| 85 |
// |
// |
| 86 |
//-------------------------------------- |
//-------------------------------------- |
| 87 |
/** |
/** |
| 88 |
* Constructor |
* Default Constructor |
| 89 |
*/ |
*/ |
| 90 |
PamLevel2::PamLevel2(){ |
PamLevel2::PamLevel2(){ |
| 91 |
|
Initialize(); |
| 92 |
|
}; |
| 93 |
|
|
| 94 |
|
/** |
| 95 |
|
* Constructor with given dir, list and detectors |
| 96 |
|
*/ |
| 97 |
|
PamLevel2::PamLevel2(TString ddir,TString list,TString detlist){ |
| 98 |
|
Initialize(); |
| 99 |
|
GetPamTree(GetListOfLevel2Files(ddir,list),detlist); |
| 100 |
|
GetRunTree(GetListOfLevel2Files(ddir,list)); |
| 101 |
|
}; |
| 102 |
|
|
| 103 |
|
/** |
| 104 |
|
* Constructor with given dir and list |
| 105 |
|
*/ |
| 106 |
|
PamLevel2::PamLevel2(TString ddir,TString list){ |
| 107 |
|
Initialize(); |
| 108 |
|
GetPamTree(GetListOfLevel2Files(ddir,list),""); |
| 109 |
|
GetRunTree(GetListOfLevel2Files(ddir,list)); |
| 110 |
|
}; |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
void PamLevel2::Initialize(){ |
| 114 |
|
|
| 115 |
// trk2_obj = TrkLevel2::GetTrkLevel2(); |
// trk2_obj = TrkLevel2::GetTrkLevel2(); |
| 116 |
// trk1_obj = TrkLevel1::GetTrkLevel1(); |
// trk1_obj = TrkLevel1::GetTrkLevel1(); |
| 241 |
} |
} |
| 242 |
|
|
| 243 |
if(l0_file)l0_file->Close(); |
if(l0_file)l0_file->Close(); |
| 244 |
if(pam_tree)pam_tree->Delete();; |
// if(pam_tree)pam_tree->Delete();; |
| 245 |
|
|
| 246 |
|
if ( pam_tree ){ |
| 247 |
|
// |
| 248 |
|
// we have first to find which chains we have to delete, then delete the main chain and only after delete the friend chains. Any other order causes a segfault... |
| 249 |
|
// |
| 250 |
|
TList *temp = pam_tree->GetListOfFriends(); |
| 251 |
|
TList *contents = new TList; // create chain friend list |
| 252 |
|
contents->SetOwner(); |
| 253 |
|
TIter next(temp); |
| 254 |
|
TChain *questo = 0; |
| 255 |
|
while ( (questo = (TChain*) next()) ){ |
| 256 |
|
TString name = questo->GetName(); |
| 257 |
|
contents->Add((TChain*)gROOT->FindObject(name.Data()));// add object to the list |
| 258 |
|
}; |
| 259 |
|
// |
| 260 |
|
// deleting the main chain |
| 261 |
|
// |
| 262 |
|
pam_tree->Delete(); |
| 263 |
|
// |
| 264 |
|
// deleting the friends... |
| 265 |
|
// |
| 266 |
|
TIter next2(contents); |
| 267 |
|
TChain *questa = 0; |
| 268 |
|
while ( questa = (TChain*)next2() ){ |
| 269 |
|
TString name = questa->GetName(); |
| 270 |
|
questa->Delete(); |
| 271 |
|
questa=NULL; |
| 272 |
|
}; |
| 273 |
|
// |
| 274 |
|
}; |
| 275 |
|
pam_tree = NULL; |
| 276 |
|
|
| 277 |
if(run_tree)run_tree->Delete();; |
if(run_tree)run_tree->Delete();; |
| 278 |
if(sel_tree)sel_tree->Delete();; |
if(sel_tree)sel_tree->Delete();; |
| 279 |
for(Int_t i=0; i<NCLONES; i++ )if(pam_tree_clone[i])pam_tree_clone[i]->Delete();; |
for(Int_t i=0; i<NCLONES; i++ )if(pam_tree_clone[i])pam_tree_clone[i]->Delete();; |
| 302 |
// if(trk0_obj) trk0_obj->Clear(); |
// if(trk0_obj) trk0_obj->Clear(); |
| 303 |
if(calo0_obj) calo0_obj->Clear(); |
if(calo0_obj) calo0_obj->Clear(); |
| 304 |
if(trk1_obj) trk1_obj->Clear(); |
if(trk1_obj) trk1_obj->Clear(); |
| 305 |
if(trk2_obj) trk2_obj->Clear(); |
if(trk2_obj) trk2_obj->Clear(); |
| 306 |
if(trkh_obj) trkh_obj->Clear(); |
if(trkh_obj) trkh_obj->Clear(); |
| 307 |
if(calo1_obj)calo1_obj->Clear(); |
if(calo1_obj)calo1_obj->Clear(); |
| 308 |
if(calo2_obj)calo2_obj->Clear(); |
if(calo2_obj)calo2_obj->Clear(); |
| 322 |
if(timage){ |
if(timage){ |
| 323 |
timage->Delete(); |
timage->Delete(); |
| 324 |
} |
} |
| 325 |
|
}; |
| 326 |
|
|
| 327 |
|
void PamLevel2::Reset(){ |
| 328 |
|
// |
| 329 |
|
// First of all clear everything |
| 330 |
|
// |
| 331 |
|
Clear(); |
| 332 |
|
// |
| 333 |
|
// close and reset chains and pointers |
| 334 |
|
// |
| 335 |
|
if ( pam_tree ){ |
| 336 |
|
// |
| 337 |
|
// we have first to find which chains we have to delete, then delete the main chain and only after delete the friend chains. Any other order causes a segfault... |
| 338 |
|
// |
| 339 |
|
TList *temp = pam_tree->GetListOfFriends(); |
| 340 |
|
TList *contents = new TList; // create chain friend list |
| 341 |
|
contents->SetOwner(); |
| 342 |
|
TIter next(temp); |
| 343 |
|
TChain *questo = 0; |
| 344 |
|
while ( (questo = (TChain*) next()) ){ |
| 345 |
|
TString name = questo->GetName(); |
| 346 |
|
contents->Add((TChain*)gROOT->FindObject(name.Data()));// add object to the list |
| 347 |
|
}; |
| 348 |
|
// |
| 349 |
|
// deleting the main chain |
| 350 |
|
// |
| 351 |
|
pam_tree->Delete(); |
| 352 |
|
// |
| 353 |
|
// deleting the friends... |
| 354 |
|
// |
| 355 |
|
TIter next2(contents); |
| 356 |
|
TChain *questa = 0; |
| 357 |
|
while ( questa = (TChain*)next2() ){ |
| 358 |
|
TString name = questa->GetName(); |
| 359 |
|
questa->Delete(); |
| 360 |
|
questa=NULL; |
| 361 |
|
}; |
| 362 |
|
// |
| 363 |
|
}; |
| 364 |
|
pam_tree = NULL; |
| 365 |
|
// |
| 366 |
|
if(run_tree)run_tree->Delete();; |
| 367 |
|
run_tree = NULL; |
| 368 |
|
if(sel_tree)sel_tree->Delete();; |
| 369 |
|
sel_tree = NULL; |
| 370 |
|
// |
| 371 |
|
// Close file |
| 372 |
|
// |
| 373 |
|
if(l0_file)l0_file->Close("R"); |
| 374 |
|
l0_file = NULL; |
| 375 |
|
// |
| 376 |
|
h0_obj = 0; |
| 377 |
|
trk0_obj = 0; |
| 378 |
|
calo0_obj = 0; |
| 379 |
|
// |
| 380 |
|
trk2_obj = 0; |
| 381 |
|
trk1_obj = 0; |
| 382 |
|
trkh_obj = 0; |
| 383 |
|
calo1_obj = 0; |
| 384 |
|
calo2_obj = 0; |
| 385 |
|
tof_obj = 0; |
| 386 |
|
trig_obj = 0; |
| 387 |
|
s4_obj = 0; |
| 388 |
|
nd_obj = 0; |
| 389 |
|
ac_obj = 0; |
| 390 |
|
orb_obj = 0; |
| 391 |
|
// |
| 392 |
|
// Reset run pointers |
| 393 |
|
// |
| 394 |
|
run_obj = 0;//new GL_RUN(); |
| 395 |
|
soft_obj = 0;// Emiliano |
| 396 |
|
irun = -1; |
| 397 |
|
runfirstentry = 0ULL; |
| 398 |
|
runlastentry = 0ULL; |
| 399 |
|
// |
| 400 |
}; |
}; |
| 401 |
|
|
| 402 |
|
|
| 965 |
|
|
| 966 |
// if( !detlist.IsNull() ) SetWhichTrees(detlist); |
// if( !detlist.IsNull() ) SetWhichTrees(detlist); |
| 967 |
// else GetWhichTrees(f); |
// else GetWhichTrees(f); |
| 968 |
|
if ( pam_tree ){ |
| 969 |
|
printf("WARNING: TTree *PamLevel2::GetPamTree(TFile *fl, TString detlist) -- pam_tree already exists!\n "); |
| 970 |
|
return pam_tree; |
| 971 |
|
}; |
| 972 |
|
// |
| 973 |
|
|
| 974 |
cout << "TTree *PamLevel2::GetPamTree(TFile *f, TString detlist ) -- obsolte "<<endl; |
cout << "TTree *PamLevel2::GetPamTree(TFile *f, TString detlist ) -- obsolte "<<endl; |
| 975 |
|
|
| 976 |
SetWhichTrees(detlist); |
SetWhichTrees(detlist); |
| 1046 |
if(R && TRG) { |
if(R && TRG) { |
| 1047 |
R->SetBranchAddress("TrigLevel2", GetPointerTo("TrigLevel2")); |
R->SetBranchAddress("TrigLevel2", GetPointerTo("TrigLevel2")); |
| 1048 |
cout << "Trigger : set branch address TrigLevel2"<<endl; |
cout << "Trigger : set branch address TrigLevel2"<<endl; |
| 1049 |
if(!Trout)Trout=O; |
if(!Trout)Trout=R; |
| 1050 |
else Trout->AddFriend(R); |
else Trout->AddFriend(R); |
| 1051 |
}else{ |
}else{ |
| 1052 |
cout << "Trigger : missing tree"<<endl; |
cout << "Trigger : missing tree"<<endl; |
| 1056 |
if(S && S4) { |
if(S && S4) { |
| 1057 |
S->SetBranchAddress("S4Level2", GetPointerTo("S4Level2")); |
S->SetBranchAddress("S4Level2", GetPointerTo("S4Level2")); |
| 1058 |
cout << "S4 : set branch address S4Level2"<<endl; |
cout << "S4 : set branch address S4Level2"<<endl; |
| 1059 |
if(!Trout)Trout=O; |
if(!Trout)Trout=S; |
| 1060 |
else Trout->AddFriend(S); |
else Trout->AddFriend(S); |
| 1061 |
}else{ |
}else{ |
| 1062 |
cout << "S4 : missing tree"<<endl; |
cout << "S4 : missing tree"<<endl; |
| 1066 |
if(N && ND) { |
if(N && ND) { |
| 1067 |
N->SetBranchAddress("NDLevel2", GetPointerTo("NDLevel2")); |
N->SetBranchAddress("NDLevel2", GetPointerTo("NDLevel2")); |
| 1068 |
cout << "NeutronD : set branch address NDLevel2"<<endl; |
cout << "NeutronD : set branch address NDLevel2"<<endl; |
| 1069 |
if(!Trout)Trout=O; |
if(!Trout)Trout=N; |
| 1070 |
else Trout->AddFriend(N); |
else Trout->AddFriend(N); |
| 1071 |
}else{ |
}else{ |
| 1072 |
cout << "NeutronD : missing tree"<<endl; |
cout << "NeutronD : missing tree"<<endl; |
| 1076 |
if(A && AC) { |
if(A && AC) { |
| 1077 |
A->SetBranchAddress("AcLevel2", GetPointerTo("AcLevel2")); |
A->SetBranchAddress("AcLevel2", GetPointerTo("AcLevel2")); |
| 1078 |
cout << "Anticounter : set branch address AcLevel2"<<endl; |
cout << "Anticounter : set branch address AcLevel2"<<endl; |
| 1079 |
if(!Trout)Trout=O; |
if(!Trout)Trout=A; |
| 1080 |
else Trout->AddFriend(A); |
else Trout->AddFriend(A); |
| 1081 |
}else{ |
}else{ |
| 1082 |
cout << "Anticounter : missing tree"<<endl; |
cout << "Anticounter : missing tree"<<endl; |
| 1086 |
if(B && ORB) { |
if(B && ORB) { |
| 1087 |
B->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
B->SetBranchAddress("OrbitalInfo", GetPointerTo("OrbitalInfo")); |
| 1088 |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
cout << "OrbitalInfo : set branch address OrbitalInfo"<<endl; |
| 1089 |
if(!Trout)Trout=O; |
if(!Trout)Trout=B; |
| 1090 |
else Trout->AddFriend(B); |
else Trout->AddFriend(B); |
| 1091 |
}else{ |
}else{ |
| 1092 |
cout << "OrbitalInfo : missing tree"<<endl; |
cout << "OrbitalInfo : missing tree"<<endl; |
| 1128 |
|
|
| 1129 |
TString wdir = gSystem->WorkingDirectory(); |
TString wdir = gSystem->WorkingDirectory(); |
| 1130 |
|
|
| 1131 |
if(ddir=="")ddir = wdir; |
// if(ddir=="")ddir = wdir; |
| 1132 |
// TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
// TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
| 1133 |
cout << "Level2 data directory : "<< ddir << endl; |
if ( ddir != ""){ |
| 1134 |
|
cout << "Level2 data directory : "<< ddir << endl; |
| 1135 |
|
} else { |
| 1136 |
|
cout << "Level2 data directory not given as input: trying to evaluate from list or taking working directory " << endl; |
| 1137 |
|
}; |
| 1138 |
TList *contents = new TList; // create output list |
TList *contents = new TList; // create output list |
| 1139 |
contents->SetOwner(); |
contents->SetOwner(); |
| 1140 |
|
|
| 1183 |
// if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
// if( gSystem->IsFileInIncludePath(file,&fullpath) ){ |
| 1184 |
// if( (fullpath = gSystem->FindFile(ddir,file)) ){ |
// if( (fullpath = gSystem->FindFile(ddir,file)) ){ |
| 1185 |
if( file.EndsWith(".root") ){ |
if( file.EndsWith(".root") ){ |
| 1186 |
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(ddir),gSystem->BaseName(file)); |
TString filedir; |
| 1187 |
|
if (ddir != ""){ |
| 1188 |
|
filedir = ddir; // take the input dir |
| 1189 |
|
} else { |
| 1190 |
|
gSystem->ChangeDirectory(wdir); // back to the working directory |
| 1191 |
|
filedir = gSystem->DirName(file); // this will take the path if exist in the list otherwise it will return automatically the working dir |
| 1192 |
|
}; |
| 1193 |
|
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(filedir),gSystem->BaseName(file)); |
| 1194 |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
| 1195 |
delete fullpath; |
delete fullpath; |
| 1196 |
} |
} |
| 1200 |
}; |
}; |
| 1201 |
in.close(); |
in.close(); |
| 1202 |
} else { |
} else { |
| 1203 |
|
if(flisttxt.Contains("#"))flisttxt = flisttxt(0,flisttxt.First("#")); |
| 1204 |
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(flisttxt),gSystem->BaseName(flisttxt)); |
| 1205 |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
contents->Add(new TSystemFile(fullpath,gSystem->DirName(fullpath)));// add file to the list |
| 1206 |
delete fullpath; |
delete fullpath; |
| 1210 |
cout << "No input file list given."<<endl; |
cout << "No input file list given."<<endl; |
| 1211 |
cout << "Check for existing root files."<<endl; |
cout << "Check for existing root files."<<endl; |
| 1212 |
// cout << "Warking directory: "<< gSystem->WorkingDirectory()<< endl; |
// cout << "Warking directory: "<< gSystem->WorkingDirectory()<< endl; |
| 1213 |
|
if ( ddir == "" ){ |
| 1214 |
|
ddir = wdir; |
| 1215 |
|
cout << "Level2 data directory : "<< ddir << endl; |
| 1216 |
|
}; |
| 1217 |
|
|
| 1218 |
TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
TSystemDirectory *datadir = new TSystemDirectory(gSystem->BaseName(ddir),ddir); |
| 1219 |
TList *temp = datadir->GetListOfFiles(); |
TList *temp = datadir->GetListOfFiles(); |
| 1220 |
// temp->Print(); |
// temp->Print(); |
| 1258 |
* @return Pointer to a TChain |
* @return Pointer to a TChain |
| 1259 |
*/ |
*/ |
| 1260 |
TChain *PamLevel2::GetPamTree(TList *fl, TString detlist ){ |
TChain *PamLevel2::GetPamTree(TList *fl, TString detlist ){ |
| 1261 |
|
// |
| 1262 |
|
// |
| 1263 |
|
// |
| 1264 |
|
if ( pam_tree ){ |
| 1265 |
|
printf("WARNING: TChain *PamLevel2::GetPamTree(TList *fl, TString detlist) -- pam_tree already exists!\n "); |
| 1266 |
|
return pam_tree; |
| 1267 |
|
}; |
| 1268 |
|
// |
| 1269 |
|
|
| 1270 |
TChain *Trout =0; |
TChain *Trout =0; |
| 1271 |
|
|
| 1286 |
if(ORB)cout<<"ORB "; |
if(ORB)cout<<"ORB "; |
| 1287 |
cout << endl; |
cout << endl; |
| 1288 |
|
|
| 1289 |
TChain *T = 0; |
TChain *T = 0; |
| 1290 |
TChain *C = 0; |
TChain *C = 0; |
| 1291 |
TChain *O = 0; |
TChain *O = 0; |
| 1292 |
TChain *R = 0; |
TChain *R = 0; |
| 1293 |
TChain *S = 0; |
TChain *S = 0; |
| 1294 |
TChain *N = 0; |
TChain *N = 0; |
| 1295 |
TChain *A = 0; |
TChain *A = 0; |
| 1296 |
TChain *B = 0; |
TChain *B = 0; |
| 1297 |
|
|
| 1298 |
TChain *L = 0; |
TChain *L = 0; |
| 1299 |
|
|
| 1300 |
if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); |
if(TRK2||TRK1||TRKh) T = new TChain("Tracker"); |
| 1301 |
if(CAL2||CAL1) C = new TChain("Calorimeter"); |
if(CAL2||CAL1) C = new TChain("Calorimeter"); |
| 1305 |
if(ND) N = new TChain("NeutronD"); |
if(ND) N = new TChain("NeutronD"); |
| 1306 |
if(AC) A = new TChain("Anticounter"); |
if(AC) A = new TChain("Anticounter"); |
| 1307 |
if(ORB) B = new TChain("OrbitalInfo"); |
if(ORB) B = new TChain("OrbitalInfo"); |
|
|
|
| 1308 |
L = new TChain("SelectionList"); |
L = new TChain("SelectionList"); |
| 1309 |
|
|
| 1310 |
// loop over files and create chains |
// loop over files and create chains |
| 1324 |
if(ORB) B->Add(name); |
if(ORB) B->Add(name); |
| 1325 |
if(SELLI==1) L->Add(name); |
if(SELLI==1) L->Add(name); |
| 1326 |
}; |
}; |
| 1327 |
} |
}; |
| 1328 |
|
|
| 1329 |
cout << "done chain \n"; |
cout << "done chain \n"; |
| 1330 |
|
|
| 1341 |
// else T->SetBranchStatus("TrkHough",0,found); |
// else T->SetBranchStatus("TrkHough",0,found); |
| 1342 |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
if(TRKh)cout << "Tracker : set branch address TrkHough"<<endl; |
| 1343 |
if(!Trout)Trout=T; |
if(!Trout)Trout=T; |
| 1344 |
else Trout->AddFriend("Tracker"); |
else Trout->AddFriend("Tracker"); |
| 1345 |
}else{ |
}else{ |
| 1346 |
cout << "Tracker : missing tree"<<endl; |
cout << "Tracker : missing tree"<<endl; |
| 1347 |
}; |
}; |
| 1614 |
* @return Pointer to a TChain |
* @return Pointer to a TChain |
| 1615 |
*/ |
*/ |
| 1616 |
TChain *PamLevel2::GetRunTree(TList *fl){ |
TChain *PamLevel2::GetRunTree(TList *fl){ |
| 1617 |
|
// |
| 1618 |
TChain *R = new TChain("Run"); |
// |
| 1619 |
|
// |
| 1620 |
|
if ( run_tree ){ |
| 1621 |
|
printf("WARNING: TChain *PamLevel2::GetRunTree(TList *fl) -- run_tree already exists!\n "); |
| 1622 |
|
return run_tree; |
| 1623 |
|
}; |
| 1624 |
|
// |
| 1625 |
|
TChain *R = new TChain("Run"); |
| 1626 |
|
|
| 1627 |
// loop over files and create chains |
// loop over files and create chains |
| 1628 |
TIter next(fl); |
TIter next(fl); |
| 1661 |
* @return Pointer to a TTree |
* @return Pointer to a TTree |
| 1662 |
*/ |
*/ |
| 1663 |
TTree *PamLevel2::GetRunTree(TFile *f){ |
TTree *PamLevel2::GetRunTree(TFile *f){ |
| 1664 |
|
if ( run_tree ){ |
| 1665 |
|
printf("WARNING: TTree *PamLevel2::GetRunTree(TFile *f) -- run_tree already exists!\n "); |
| 1666 |
|
return run_tree; |
| 1667 |
|
}; |
| 1668 |
|
|
| 1669 |
|
|
| 1670 |
cout << "TTree *PamLevel2::GetRunTree(TFile *f) -- obsolte "<<endl; |
cout << "TTree *PamLevel2::GetRunTree(TFile *f) -- obsolte "<<endl; |
| 1671 |
|
|
| 1672 |
TTree *R = (TTree*)f->Get("Run"); |
TTree *T = (TTree*)f->Get("Run"); |
| 1673 |
|
|
| 1674 |
if(R){ |
if(T){ |
| 1675 |
R->SetBranchAddress("RunInfo", GetPointerTo("RunInfo")); |
T->SetBranchAddress("RunInfo", GetPointerTo("RunInfo")); |
| 1676 |
cout << "Run : set branch address RunInfo"<<endl; |
cout << "Run : set branch address RunInfo"<<endl; |
| 1677 |
R->SetBranchAddress("SoftInfo", GetPointerTo("SoftInfo")); // Emiliano |
T->SetBranchAddress("SoftInfo", GetPointerTo("SoftInfo")); // Emiliano |
| 1678 |
cout << "Software : set branch address SoftInfo"<<endl; // Emiliano |
cout << "Software : set branch address SoftInfo"<<endl; // Emiliano |
| 1679 |
} |
} |
| 1680 |
|
|
| 1681 |
run_tree = (TChain*)R; |
run_tree = (TChain*)T; |
| 1682 |
|
|
| 1683 |
return R; |
return T; |
| 1684 |
|
|
| 1685 |
} |
} |
| 1686 |
/** |
/** |
| 1699 |
if ( run->GetEntries() <= 0 ) return(false); |
if ( run->GetEntries() <= 0 ) return(false); |
| 1700 |
// |
// |
| 1701 |
|
|
| 1702 |
// Int_t oldrun = irun; |
// Int_t oldrun = irun; |
| 1703 |
Long64_t oldrun = irun; |
Long64_t oldrun = irun; |
| 1704 |
|
|
| 1705 |
// -------------------------------------- |
// -------------------------------------- |
| 1706 |
// if it is a full file (not preselected) |
// if it is a full file (not preselected) |
| 1707 |
// -------------------------------------- |
// -------------------------------------- |
| 1712 |
return(false); |
return(false); |
| 1713 |
} |
} |
| 1714 |
|
|
| 1715 |
if ( irun < 0 ){ |
if ( irun < 0LL ){ |
| 1716 |
irun = 0; |
irun = 0LL; |
| 1717 |
run->GetEntry(irun); |
run->GetEntry(irun); |
| 1718 |
runfirstentry = 0LL; |
runfirstentry = 0LL; |
| 1719 |
runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); |
runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); |
| 1722 |
// cout << "runfirstentry "<<runfirstentry<<endl; |
// cout << "runfirstentry "<<runfirstentry<<endl; |
| 1723 |
// return(true); |
// return(true); |
| 1724 |
}; |
}; |
| 1725 |
|
// |
| 1726 |
|
if ( irun == run->GetEntries()-1LL && |
| 1727 |
|
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
| 1728 |
|
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
| 1729 |
|
){ |
| 1730 |
|
irun = -1LL; |
| 1731 |
|
runfirstentry = 0LL; |
| 1732 |
|
runlastentry = -1LL; |
| 1733 |
|
}; |
| 1734 |
// modificato il controllo sull'aggiornamento del run, per evitare problemi |
// modificato il controllo sull'aggiornamento del run, per evitare problemi |
| 1735 |
// dovuti agli eventi annidati (NB! NEVENTS conta anche questi!!) |
// dovuti agli eventi annidati (NB! NEVENTS conta anche questi!!) |
| 1736 |
// |
// |
| 1737 |
bool fromfirst = true; |
bool fromfirst = true; |
| 1738 |
// |
// |
| 1739 |
while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries()-1 ){ |
while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries()-1LL ){ |
| 1740 |
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
| 1741 |
irun++; |
irun++; |
| 1742 |
run->GetEntry(irun); |
run->GetEntry(irun); |
| 1751 |
// |
// |
| 1752 |
// prevshift = 0; |
// prevshift = 0; |
| 1753 |
// |
// |
| 1754 |
if ( irun == run->GetEntries()-1 && fromfirst && !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME)){ |
if ( irun == (Long64_t)(run->GetEntries()-1LL) && fromfirst && !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME)){ |
| 1755 |
printf(" resetting irun (it should NOT happen!!!)\n"); |
printf(" resetting irun (it should NOT happen!!!)\n"); |
| 1756 |
fromfirst = false; |
fromfirst = false; |
| 1757 |
irun = 0; |
irun = 0; |
| 1763 |
// |
// |
| 1764 |
}; |
}; |
| 1765 |
// |
// |
| 1766 |
if ( !fromfirst && |
if ( |
| 1767 |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
| 1768 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
| 1769 |
) { |
) { |