@@ -952,7 +952,6 @@ void TRestGeant4Metadata::ReadGenerator() {
952
952
// TODO : If not defined (and required to be) it just returns (0,0,0) we
953
953
// should make a WARNING. Inside StringToVector probably
954
954
fGenPosition = Get3DVectorParameterWithUnits (" position" , generatorDefinition);
955
-
956
955
fGenRotation = StringTo3DVector (GetParameter (" rotation" , generatorDefinition));
957
956
958
957
string dimension2[2 ]{" length" , " lenY" };
@@ -987,7 +986,6 @@ void TRestGeant4Metadata::ReadGenerator() {
987
986
fGeneratorFile = use;
988
987
info << " Reading custom sources from ROOT file : " << fGeneratorFile << endl;
989
988
ReadGeneratorTreeFile (fGeneratorFile );
990
- // exit(1);
991
989
} else {
992
990
info << " Load custom sources from " << use << endl;
993
991
TRestGeant4ParticleCollection* particleCollection =
@@ -1188,15 +1186,16 @@ void TRestGeant4Metadata::ReadGeneratorTreeFile(TString fName) {
1188
1186
debug << " TRestGeant4Metadata::ReadGeneratorTreeFile" << endl;
1189
1187
1190
1188
TFile* file;
1189
+ TTree* GeneratorTree;
1190
+ TString treeName = " GeneratorTree" ;
1191
+
1191
1192
file = TFile::Open (fName , " READ" );
1192
1193
if (!file) {
1193
1194
ferr << " Error opening file: " << fName << endl;
1194
1195
exit (1 );
1195
1196
}
1196
-
1197
- TTree* GeneratorTree;
1198
- TString treeName = " GeneratorTree" ;
1199
1197
file->GetObject (treeName, GeneratorTree);
1198
+
1200
1199
if (!GeneratorTree) {
1201
1200
ferr << " Error reading TTree named " << treeName << " from " << fName << endl;
1202
1201
file->ls ();
@@ -1214,10 +1213,10 @@ void TRestGeant4Metadata::ReadGeneratorTreeFile(TString fName) {
1214
1213
1215
1214
debug << " Setting up TTree" << endl;
1216
1215
1217
- vector<double >*x, *y, *z;
1218
- vector<double >*px, *py, *pz;
1219
- vector<double >*KE, *timeGlobal, *weight;
1220
- vector<TString>* particleName;
1216
+ vector<double >*x = 0 , *y = 0 , *z = 0 ;
1217
+ vector<double >*px = 0 , *py = 0 , *pz = 0 ;
1218
+ vector<double >*KE = 0 , *timeGlobal = 0 , *weight = 0 ;
1219
+ vector<TString>* particleName = 0 ;
1221
1220
1222
1221
GeneratorTree->SetBranchAddress (" x" , &x);
1223
1222
GeneratorTree->SetBranchAddress (" y" , &y);
@@ -1232,9 +1231,6 @@ void TRestGeant4Metadata::ReadGeneratorTreeFile(TString fName) {
1232
1231
1233
1232
debug << " Finished setting up TTree" << endl;
1234
1233
1235
- GeneratorTree->Show (0 );
1236
- GeneratorTree->GetEntry (0 );
1237
-
1238
1234
TRestGeant4Particle particle;
1239
1235
for (int k = 0 ; k < numberOfGeneratorEvents; k++) {
1240
1236
debug << " - Getting entry " << k << endl;
@@ -1244,6 +1240,7 @@ void TRestGeant4Metadata::ReadGeneratorTreeFile(TString fName) {
1244
1240
particleCollection->RemoveParticles ();
1245
1241
1246
1242
int nParticles = x->size ();
1243
+ debug << " Number of particles: " << nParticles << endl;
1247
1244
1248
1245
for (int i = 0 ; i < nParticles; i++) {
1249
1246
TString thisParticleName = (*particleName)[i];
@@ -1303,7 +1300,7 @@ void TRestGeant4Metadata::ReadEventDataFile(TString fName) {
1303
1300
// /////////////////////////////////////////////
1304
1301
// / \brief Reads particle information using the file format from newer Decay0 versions.
1305
1302
// /
1306
- // / This is an auxiliar method used in TRestGeant4Metadata::ReadEventDataFile that will read the Decay0 files
1303
+ // / This is an auxiliary method used in TRestGeant4Metadata::ReadEventDataFile that will read the Decay0 files
1307
1304
// / produced with the newer Decay0 versions.
1308
1305
// /
1309
1306
Int_t TRestGeant4Metadata::ReadNewDecay0File (TString fileName) {
@@ -1406,7 +1403,7 @@ Int_t TRestGeant4Metadata::ReadNewDecay0File(TString fileName) {
1406
1403
// /////////////////////////////////////////////
1407
1404
// / \brief Reads particle information using the file format from older Decay0 versions.
1408
1405
// /
1409
- // / This is an auxiliar method used in TRestGeant4Metadata::ReadEventDataFile that will read the Decay0 files
1406
+ // / This is an auxiliary method used in TRestGeant4Metadata::ReadEventDataFile that will read the Decay0 files
1410
1407
// / produced with the newer Decay0 versions.
1411
1408
// /
1412
1409
Int_t TRestGeant4Metadata::ReadOldDecay0File (TString fileName) {
0 commit comments