374 |
PamTrack::PamTrack(const PamTrack& track) { |
PamTrack::PamTrack(const PamTrack& track) { |
375 |
|
|
376 |
TrkTrack *t = track.trk_track; |
TrkTrack *t = track.trk_track; |
377 |
|
ExtTrack *e = track.trk_ext_track; |
378 |
CaloTrkVar *c = track.calo_track; |
CaloTrkVar *c = track.calo_track; |
379 |
ToFTrkVar *o = track.tof_track; |
ToFTrkVar *o = track.tof_track; |
380 |
OrbitalInfoTrkVar *r = track.orb_track; |
OrbitalInfoTrkVar *r = track.orb_track; |
381 |
|
|
382 |
trk_track = 0; |
trk_ext_track = 0; |
383 |
calo_track = 0; |
trk_track = 0; |
384 |
tof_track = 0; |
calo_track = 0; |
385 |
orb_track = 0; |
tof_track = 0; |
386 |
|
orb_track = 0; |
387 |
|
if(e) |
388 |
|
trk_ext_track = new ExtTrack(*e); |
389 |
if (t) |
if (t) |
390 |
trk_track = new TrkTrack(*t); |
trk_track = new TrkTrack(*t); |
391 |
if (c) |
if (c) |
394 |
tof_track = new ToFTrkVar(*o); |
tof_track = new ToFTrkVar(*o); |
395 |
if (r) |
if (r) |
396 |
orb_track = new OrbitalInfoTrkVar(*r); |
orb_track = new OrbitalInfoTrkVar(*r); |
397 |
|
|
398 |
candeleteobj = 1; |
candeleteobj = 1; |
399 |
pscore = 0; |
pscore = 0; |
400 |
iscore = 0; |
iscore = 0; |
401 |
|
|
402 |
} |
} |
403 |
void PamTrack::Clear() { |
void PamTrack::Clear(Option_t *option) { |
404 |
|
|
405 |
// cout << "PamTrack::Clear() "<<candeleteobj<<endl; |
// cout << "PamTrack::Clear( "<<option<<" ) "<<candeleteobj<<endl; |
406 |
if (candeleteobj) { |
if (candeleteobj) { |
407 |
|
|
408 |
if (trk_ext_track) |
if (trk_ext_track) |
409 |
trk_ext_track->ExtTrack::Clear(); |
trk_ext_track->ExtTrack::Clear(option); |
410 |
if (trk_track) |
if (trk_track) |
411 |
trk_track->TrkTrack::Clear(); |
trk_track->TrkTrack::Clear(); |
412 |
if (calo_track) |
if (calo_track) |
431 |
// cout << "PamTrack::Delete() "<<candeleteobj<<endl; |
// cout << "PamTrack::Delete() "<<candeleteobj<<endl; |
432 |
if (candeleteobj) { |
if (candeleteobj) { |
433 |
if (trk_ext_track) { |
if (trk_ext_track) { |
434 |
trk_ext_track->ExtTrack::Clear(); |
trk_ext_track->ExtTrack::Clear("C"); |
435 |
delete trk_ext_track; |
delete trk_ext_track; |
436 |
} |
} |
437 |
if (trk_track) { |
if (trk_track) { |
576 |
gltsync = 0; // Emiliano |
gltsync = 0; // Emiliano |
577 |
fUpdateRunInfo = true; // Emiliano |
fUpdateRunInfo = true; // Emiliano |
578 |
fUseDBinRunInfo = true; // Emiliano |
fUseDBinRunInfo = true; // Emiliano |
579 |
|
fDiscarded = false; //EM |
580 |
isSync = false; // by default assume that the level2 file(s) is(are) not sinchronized between L0/DB and L2, that is we miss some packets in L2 due to nested/DV-skipped events |
isSync = false; // by default assume that the level2 file(s) is(are) not sinchronized between L0/DB and L2, that is we miss some packets in L2 due to nested/DV-skipped events |
581 |
il0entry = 0LL; |
il0entry = 0LL; |
582 |
// hasL0EE = true; |
// hasL0EE = true; |
1454 |
// create TCloneArrays to store tracks and its images |
// create TCloneArrays to store tracks and its images |
1455 |
if (!tsorted) |
if (!tsorted) |
1456 |
tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
1457 |
tsorted->Delete(); |
tsorted->Clear("C+C");//Delete(); |
1458 |
TClonesArray &ttsorted = *tsorted; |
TClonesArray &ttsorted = *tsorted; |
1459 |
|
|
1460 |
if (!timage) |
if (!timage) |
1461 |
timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
1462 |
timage->Delete(); |
timage->Clear("C+C");//Delete(); |
1463 |
TClonesArray &ttimage = *timage; |
TClonesArray &ttimage = *timage; |
1464 |
|
|
1465 |
|
|
1995 |
//----------------------------------------------------------- |
//----------------------------------------------------------- |
1996 |
// create/reset TCloneArrays to store tracks and their images |
// create/reset TCloneArrays to store tracks and their images |
1997 |
//----------------------------------------------------------- |
//----------------------------------------------------------- |
1998 |
|
|
1999 |
|
// cout << " PamLevel2::SortTracksNew() --- Clear TClonesArray objects"<<endl; |
2000 |
|
|
2001 |
// main tracks from standard alg |
// main tracks from standard alg |
2002 |
if (!tsorted) |
// if (!tsorted) |
2003 |
tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
// tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
2004 |
tsorted->Delete(); |
// tsorted->Clear("C+C");//Delete(); |
2005 |
// track images from standard alg |
// // track images from standard alg |
2006 |
if (!timage) |
// if (!timage) |
2007 |
timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
// timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
2008 |
timage->Delete(); |
// timage->Clear("C+C");//Delete(); |
2009 |
// tracks from extended algorythm |
// // tracks from extended algorythm |
2010 |
if(EXT && !text) |
// if(EXT && !text) |
2011 |
text = new TClonesArray("PamTrack",trk_ext_obj->GetEntries()); |
// text = new TClonesArray("PamTrack",trk_ext_obj->GetEntries()); |
2012 |
if(text)text->Delete(); |
// if(text)text->Clear("C+C");//Delete(); |
2013 |
|
|
2014 |
|
if(tsorted)delete tsorted; |
2015 |
|
if(timage) delete timage; |
2016 |
|
if(text) delete text; |
2017 |
|
tsorted = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
2018 |
|
timage = new TClonesArray("PamTrack", trk2_obj->GetNTracks()); |
2019 |
|
text = new TClonesArray("PamTrack",trk_ext_obj->GetEntries()); |
2020 |
|
|
2021 |
//----------------------------------------------------------- |
//----------------------------------------------------------- |
2022 |
// create/reset TCloneArrays to store tracks and their images |
// create/reset TCloneArrays to store tracks and their images |
2023 |
//----------------------------------------------------------- |
//----------------------------------------------------------- |
2024 |
if(NUC){ |
if(NUC){ |
2025 |
|
|
2026 |
|
|
2027 |
|
if(tsorted_nuc)delete tsorted_nuc; |
2028 |
|
if(timage_nuc) delete timage_nuc; |
2029 |
|
if(text_nuc) delete text_nuc; |
2030 |
|
tsorted_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); |
2031 |
|
timage_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); |
2032 |
|
text_nuc = new TClonesArray("PamTrack",trk_ext_nuc_obj->GetEntries()); |
2033 |
|
|
2034 |
// main tracks from standard alg |
// main tracks from standard alg |
2035 |
if (!tsorted_nuc) |
// if (!tsorted_nuc) |
2036 |
tsorted_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); |
// tsorted_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); |
2037 |
tsorted_nuc->Delete(); |
// tsorted_nuc->Clear("C+C");//Delete(); |
2038 |
// track images from standard alg |
// // track images from standard alg |
2039 |
if (!timage_nuc) |
// if (!timage_nuc) |
2040 |
timage_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); |
// timage_nuc = new TClonesArray("PamTrack", trk2_nuc_obj->GetNTracks()); |
2041 |
timage_nuc->Delete(); |
// timage_nuc->Clear("C+C");//Delete(); |
2042 |
// tracks from extended algorythm |
// // tracks from extended algorythm |
2043 |
if(EXT && !text_nuc) |
// if(EXT && !text_nuc) |
2044 |
text_nuc = new TClonesArray("PamTrack",trk_ext_nuc_obj->GetEntries()); |
// text_nuc = new TClonesArray("PamTrack",trk_ext_nuc_obj->GetEntries()); |
2045 |
if(text_nuc)text_nuc->Delete(); |
// if(text_nuc)text_nuc->Clear("C+C");//Delete(); |
2046 |
|
|
2047 |
} |
} |
2048 |
//-------------------------------------------------- |
//-------------------------------------------------- |
2049 |
// retrieve sorting method |
// retrieve sorting method |
4778 |
TFile *f = new TFile(name.Data()); |
TFile *f = new TFile(name.Data()); |
4779 |
if (!f || f->IsZombie()) { |
if (!f || f->IsZombie()) { |
4780 |
cout << "File: " << f->GetName() << " discarded ---- Non valid root file" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Non valid root file" << endl; |
4781 |
|
fDiscarded = true; |
4782 |
return false; |
return false; |
4783 |
} |
} |
4784 |
// cout << "Get list of keys: "<<f<<endl; |
// cout << "Get list of keys: "<<f<<endl; |
4817 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4818 |
cout << "File: " << f->GetName() << " discarded ---- SelectionList tree has " << nevt |
cout << "File: " << f->GetName() << " discarded ---- SelectionList tree has " << nevt |
4819 |
<< " events instead of " << nev << endl; |
<< " events instead of " << nev << endl; |
4820 |
|
fDiscarded = true; |
4821 |
return false; |
return false; |
4822 |
} |
} |
4823 |
nev = nevt; |
nev = nevt; |
4832 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4833 |
cout << "File: " << f->GetName() << " discarded ---- Trigger tree has " << nevt << " events instead of " |
cout << "File: " << f->GetName() << " discarded ---- Trigger tree has " << nevt << " events instead of " |
4834 |
<< nev << endl; |
<< nev << endl; |
4835 |
|
fDiscarded = true; |
4836 |
return false; |
return false; |
4837 |
} |
} |
4838 |
nev = nevt; |
nev = nevt; |
4846 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4847 |
cout << "File: " << f->GetName() << " discarded ---- ToF tree has " << nevt << " events instead of " << nev |
cout << "File: " << f->GetName() << " discarded ---- ToF tree has " << nevt << " events instead of " << nev |
4848 |
<< endl; |
<< endl; |
4849 |
|
fDiscarded = true; |
4850 |
return false; |
return false; |
4851 |
} |
} |
4852 |
nev = nevt; |
nev = nevt; |
4860 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4861 |
cout << "File: " << f->GetName() << " discarded ---- S4 tree has " << nevt << " events instead of " << nev |
cout << "File: " << f->GetName() << " discarded ---- S4 tree has " << nevt << " events instead of " << nev |
4862 |
<< endl; |
<< endl; |
4863 |
|
fDiscarded = true; |
4864 |
return false; |
return false; |
4865 |
} |
} |
4866 |
nev = nevt; |
nev = nevt; |
4875 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4876 |
cout << "File: " << f->GetName() << " discarded ---- NeutronD tree has " << nevt << " events instead of " |
cout << "File: " << f->GetName() << " discarded ---- NeutronD tree has " << nevt << " events instead of " |
4877 |
<< nev << endl; |
<< nev << endl; |
4878 |
|
fDiscarded = true; |
4879 |
return false; |
return false; |
4880 |
} |
} |
4881 |
nev = nevt; |
nev = nevt; |
4889 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4890 |
cout << "File: " << f->GetName() << " discarded ---- Anticounter tree has " << nevt << " events instead of " |
cout << "File: " << f->GetName() << " discarded ---- Anticounter tree has " << nevt << " events instead of " |
4891 |
<< nev << endl; |
<< nev << endl; |
4892 |
|
fDiscarded = true; |
4893 |
return false; |
return false; |
4894 |
} |
} |
4895 |
nev = nevt; |
nev = nevt; |
4903 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4904 |
cout << "File: " << f->GetName() << " discarded ---- OrbitalInfo tree has " << nevt << " events instead of " |
cout << "File: " << f->GetName() << " discarded ---- OrbitalInfo tree has " << nevt << " events instead of " |
4905 |
<< nev << endl; |
<< nev << endl; |
4906 |
|
fDiscarded = true; |
4907 |
return false; |
return false; |
4908 |
} |
} |
4909 |
nev = nevt; |
nev = nevt; |
4917 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4918 |
cout << "File: " << f->GetName() << " discarded ---- Tracker tree has " << nevt << " events instead of " |
cout << "File: " << f->GetName() << " discarded ---- Tracker tree has " << nevt << " events instead of " |
4919 |
<< nev << endl; |
<< nev << endl; |
4920 |
|
fDiscarded = true; |
4921 |
return false; |
return false; |
4922 |
} |
} |
4923 |
nev = nevt; |
nev = nevt; |
4941 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4942 |
cout << "File: " << f->GetName() << " discarded ---- Calorimeter tree has " << nevt << " events instead of " |
cout << "File: " << f->GetName() << " discarded ---- Calorimeter tree has " << nevt << " events instead of " |
4943 |
<< nev << endl; |
<< nev << endl; |
4944 |
|
fDiscarded = true; |
4945 |
return false; |
return false; |
4946 |
} |
} |
4947 |
nev = nevt; |
nev = nevt; |
4964 |
if (nev && nevt != nev) { |
if (nev && nevt != nev) { |
4965 |
cout << "File: " << f->GetName() << " discarded ---- h20 tree has " << nevt << " events instead of " << nev |
cout << "File: " << f->GetName() << " discarded ---- h20 tree has " << nevt << " events instead of " << nev |
4966 |
<< endl; |
<< endl; |
4967 |
|
fDiscarded = true; |
4968 |
return false; |
return false; |
4969 |
} |
} |
4970 |
nev = nevt; |
nev = nevt; |
4977 |
SELLI = (Int_t) SELLI__ok; |
SELLI = (Int_t) SELLI__ok; |
4978 |
if (SELLI == 0 && SELLI__ok) { |
if (SELLI == 0 && SELLI__ok) { |
4979 |
cout << "File: " << f->GetName() << " discarded ---- found SelectionList (it is not a full-event file)" << endl; |
cout << "File: " << f->GetName() << " discarded ---- found SelectionList (it is not a full-event file)" << endl; |
4980 |
|
fDiscarded = true; |
4981 |
return false; |
return false; |
4982 |
} |
} |
4983 |
if (SELLI == 1 && !SELLI__ok) { |
if (SELLI == 1 && !SELLI__ok) { |
4984 |
cout << "File: " << f->GetName() << " discarded ---- SelectionList missing" << endl; |
cout << "File: " << f->GetName() << " discarded ---- SelectionList missing" << endl; |
4985 |
|
fDiscarded = true; |
4986 |
return false; |
return false; |
4987 |
} |
} |
4988 |
|
|
5021 |
|
|
5022 |
if (CAL1 && !CAL1__ok) { |
if (CAL1 && !CAL1__ok) { |
5023 |
cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel1 branch" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel1 branch" << endl; |
5024 |
|
fDiscarded = true; |
5025 |
return false; |
return false; |
5026 |
}; |
}; |
5027 |
if (CAL2 && !CAL2__ok) { |
if (CAL2 && !CAL2__ok) { |
5028 |
cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel2 branch" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing CaloLevel2 branch" << endl; |
5029 |
|
fDiscarded = true; |
5030 |
return false; |
return false; |
5031 |
}; |
}; |
5032 |
if (TRK2 && !TRK2__ok) { |
if (TRK2 && !TRK2__ok) { |
5033 |
cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel2 branch" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel2 branch" << endl; |
5034 |
|
fDiscarded = true; |
5035 |
return false; |
return false; |
5036 |
}; |
}; |
5037 |
if (TRK1 && !TRK1__ok) { |
if (TRK1 && !TRK1__ok) { |
5038 |
cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel1 branch" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing TrkLevel1 branch" << endl; |
5039 |
|
fDiscarded = true; |
5040 |
return false; |
return false; |
5041 |
}; |
}; |
5042 |
if (TRKh && !TRKh__ok) { |
if (TRKh && !TRKh__ok) { |
5043 |
cout << "File: " << f->GetName() << " discarded ---- Missing TrkHough branch" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing TrkHough branch" << endl; |
5044 |
|
fDiscarded = true; |
5045 |
return false; |
return false; |
5046 |
}; |
}; |
5047 |
if (ORB && !ORB__ok) { |
if (ORB && !ORB__ok) { |
5048 |
cout << "File: " << f->GetName() << " discarded ---- Missing ORB tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing ORB tree" << endl; |
5049 |
|
fDiscarded = true; |
5050 |
return false; |
return false; |
5051 |
}; |
}; |
5052 |
if (AC && !AC__ok) { |
if (AC && !AC__ok) { |
5053 |
cout << "File: " << f->GetName() << " discarded ---- Missing AC tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing AC tree" << endl; |
5054 |
|
fDiscarded = true; |
5055 |
return false; |
return false; |
5056 |
}; |
}; |
5057 |
if (S4 && !S4__ok) { |
if (S4 && !S4__ok) { |
5058 |
cout << "File: " << f->GetName() << " discarded ---- Missing S4 tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing S4 tree" << endl; |
5059 |
|
fDiscarded = true; |
5060 |
return false; |
return false; |
5061 |
}; |
}; |
5062 |
if (TOF && !TOF__ok) { |
if (TOF && !TOF__ok) { |
5063 |
cout << "File: " << f->GetName() << " discarded ---- Missing ToF tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing ToF tree" << endl; |
5064 |
|
fDiscarded = true; |
5065 |
return false; |
return false; |
5066 |
}; |
}; |
5067 |
|
|
5068 |
if (ND && !ND__ok) { |
if (ND && !ND__ok) { |
5069 |
cout << "File: " << f->GetName() << " discarded ---- Missing ND tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing ND tree" << endl; |
5070 |
|
fDiscarded = true; |
5071 |
return false; |
return false; |
5072 |
}; |
}; |
5073 |
if (TRG && !TRG__ok) { |
if (TRG && !TRG__ok) { |
5074 |
cout << "File: " << f->GetName() << " discarded ---- Missing Trigger tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing Trigger tree" << endl; |
5075 |
|
fDiscarded = true; |
5076 |
return false; |
return false; |
5077 |
}; |
}; |
5078 |
if (GP && !GP__ok) { |
if (GP && !GP__ok) { |
5079 |
cout << "File: " << f->GetName() << " discarded ---- Missing h20 tree" << endl; |
cout << "File: " << f->GetName() << " discarded ---- Missing h20 tree" << endl; |
5080 |
|
fDiscarded = true; |
5081 |
return false; |
return false; |
5082 |
}; |
}; |
5083 |
|
|
5388 |
for (Int_t i = 0; i < NCLONES; i++) { |
for (Int_t i = 0; i < NCLONES; i++) { |
5389 |
if (pam_tree_clone[i]) { |
if (pam_tree_clone[i]) { |
5390 |
cout << pam_tree_clone[i]->GetName() << endl; |
cout << pam_tree_clone[i]->GetName() << endl; |
5391 |
pam_tree_clone[i]->Write(); |
pam_tree_clone[i]->Write(pam_tree_clone[i]->GetName(),TObject::kOverwrite); |
5392 |
}; |
}; |
5393 |
} |
} |
5394 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; |