11 |
calo_track = 0; |
calo_track = 0; |
12 |
tof_track = 0; |
tof_track = 0; |
13 |
candeleteobj = 0; |
candeleteobj = 0; |
14 |
|
pscore = 0; |
15 |
|
iscore = 0; |
16 |
}; |
}; |
17 |
//-------------------------------------- |
//-------------------------------------- |
18 |
// |
// |
62 |
calo_track = 0; |
calo_track = 0; |
63 |
tof_track = 0; |
tof_track = 0; |
64 |
} |
} |
65 |
|
pscore = 0; |
66 |
|
iscore = 0; |
67 |
|
|
68 |
} |
} |
69 |
void PamTrack::Delete(){ |
void PamTrack::Delete(){ |
70 |
// cout << "PamTrack::Delete() "<<candeleteobj<<endl; |
// cout << "PamTrack::Delete() "<<candeleteobj<<endl; |
117 |
|
|
118 |
void PamLevel2::Initialize(){ |
void PamLevel2::Initialize(){ |
119 |
|
|
|
// trk2_obj = TrkLevel2::GetTrkLevel2(); |
|
|
// trk1_obj = TrkLevel1::GetTrkLevel1(); |
|
|
// trkh_obj = TrkHough::GetTrkHough(); |
|
|
// calo1_obj = CaloLevel1::GetCaloLevel1(); |
|
|
// calo2_obj = CaloLevel2::GetCaloLevel2(); |
|
|
// tof_obj = ToFLevel2::GetToFLevel2(); |
|
|
// trig_obj = TrigLevel2::GetTrigLevel2(); |
|
|
// s4_obj = S4Level2::GetS4Level2(); |
|
|
// nd_obj = NDLevel2::GetNDLevel2(); |
|
|
// ac_obj = AcLevel2::GetAcLevel2(); |
|
|
// orb_obj = OrbitalInfo::GetOrbitalInfo(); |
|
|
|
|
120 |
h0_obj = 0; |
h0_obj = 0; |
121 |
trk0_obj = 0; |
trk0_obj = 0; |
122 |
calo0_obj = 0; |
calo0_obj = 0; |
145 |
dbc = 0; |
dbc = 0; |
146 |
|
|
147 |
prevshift = 0; |
prevshift = 0; |
148 |
|
maxshift = 10; //EMILIANO |
149 |
|
|
150 |
run_tree = NULL; |
run_tree = NULL; |
151 |
run_tree_clone = NULL; |
run_tree_clone = NULL; |
156 |
pam_tree = NULL; |
pam_tree = NULL; |
157 |
for(Int_t i=0; i<NCLONES; i++ )pam_tree_clone[i]=NULL; |
for(Int_t i=0; i<NCLONES; i++ )pam_tree_clone[i]=NULL; |
158 |
|
|
159 |
|
totdltime[0] = 0LL; |
160 |
|
totdltime[1] = 0LL; |
161 |
|
|
162 |
host = "mysql://localhost/pamelaprod"; |
host = "mysql://localhost/pamelaprod"; |
163 |
user = "anonymous"; |
user = "anonymous"; |
164 |
psw = ""; |
psw = ""; |
195 |
|
|
196 |
SELLI = -1; |
SELLI = -1; |
197 |
|
|
198 |
|
ISGP = false; |
199 |
|
|
200 |
tsorted=0; |
tsorted=0; |
201 |
timage=0; |
timage=0; |
202 |
|
|
400 |
runfirstentry = 0ULL; |
runfirstentry = 0ULL; |
401 |
runlastentry = 0ULL; |
runlastentry = 0ULL; |
402 |
// |
// |
403 |
|
totdltime[0] = 0LL; |
404 |
|
totdltime[1] = 0LL; |
405 |
|
// |
406 |
}; |
}; |
407 |
|
|
408 |
Bool_t PamLevel2::IsGood(){ |
Bool_t PamLevel2::IsGood(){ |
637 |
void PamLevel2::SortTracks(){ |
void PamLevel2::SortTracks(){ |
638 |
TString how = howtosort; |
TString how = howtosort; |
639 |
|
|
640 |
// cout <<" PamLevel2::SortTracks(TString how) "<<endl; |
// cout <<" PamLevel2::SortTracks(TString how) "<<endl; |
641 |
if( !trk2_obj ){ |
if( !trk2_obj ){ |
642 |
cout << "void PamLevel2::SortTracks(): TrkLevel2 not loaded !!!"; |
cout << "void PamLevel2::SortTracks(): TrkLevel2 not loaded !!!"; |
643 |
return; |
return; |
667 |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
668 |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
669 |
Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); |
Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); |
670 |
|
Bool_t use_S1 = how.Contains("S1", TString::kIgnoreCase); |
671 |
|
Bool_t use_S2 = how.Contains("S2", TString::kIgnoreCase); |
672 |
|
Bool_t use_S3 = how.Contains("S3", TString::kIgnoreCase); |
673 |
|
|
674 |
|
if ( use_TOF ){ |
675 |
|
use_S1 = true; |
676 |
|
use_S2 = true; |
677 |
|
use_S3 = true; |
678 |
|
}; |
679 |
if( !CAL2 && use_CAL) use_CAL = false; |
if( !CAL2 && use_CAL) use_CAL = false; |
680 |
if( !TOF && use_TOF) use_TOF = false; |
if( !TOF ){ |
681 |
|
use_TOF = false; |
682 |
|
use_S1 = false; |
683 |
|
use_S2 = false; |
684 |
|
use_S3 = false; |
685 |
|
} |
686 |
|
|
687 |
if( !TRK2 ){ |
if( !TRK2 ){ |
688 |
// cout << "SortTracks() : without tracker does not work!!! (not yet)" << endl; |
// cout << "SortTracks() : without tracker does not work!!! (not yet)" << endl; |
689 |
return; |
return; |
711 |
ToFTrkVar *oi = 0; |
ToFTrkVar *oi = 0; |
712 |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
713 |
// if track has an image, check image selection |
// if track has an image, check image selection |
714 |
|
|
715 |
|
Int_t tp_score = 0; //main track sorted by the tracker |
716 |
|
Int_t ti_score = 0; //image track |
717 |
|
Int_t totp_score = 0; //main track sorted by the tracker |
718 |
|
Int_t toti_score = 0; //image track |
719 |
|
|
720 |
if(tp->HasImage()){ |
if(tp->HasImage()){ |
721 |
|
|
722 |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
726 |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
727 |
|
|
728 |
//assign starting scores |
//assign starting scores |
729 |
Int_t tp_score = 0; //main track sorted by the tracker |
tp_score = 0; //main track sorted by the tracker |
730 |
Int_t ti_score = 0; //image track |
ti_score = 0; //image track |
731 |
|
|
732 |
// ----------------------------------------------------------------------------------------- |
// ----------------------------------------------------------------------------------------- |
733 |
// calorimeter check |
// calorimeter check |
738 |
cout << "void PamLevel2::SortTracks(): howtosort= "<<how<<" but CaloLevel2 not loaded !!!"; |
cout << "void PamLevel2::SortTracks(): howtosort= "<<how<<" but CaloLevel2 not loaded !!!"; |
739 |
return; |
return; |
740 |
}; |
}; |
741 |
|
if( use_CAL && !cp && ci ){ |
742 |
|
ti_score++; |
743 |
|
toti_score++; |
744 |
|
}; |
745 |
|
if( use_CAL && cp && !ci ){ |
746 |
|
tp_score++; |
747 |
|
totp_score++; |
748 |
|
}; |
749 |
if( |
if( |
750 |
use_CAL && |
use_CAL && |
751 |
// calo2_obj->npcfit[1] > 5 && //no. of fit planes on Y view |
// calo2_obj->npcfit[1] > 5 && //no. of fit planes on Y view |
761 |
// else ti_score++; |
// else ti_score++; |
762 |
|
|
763 |
|
|
764 |
if( cp->npresh > ci->npresh) tp_score++; |
if( cp->npresh > ci->npresh){ |
765 |
if( cp->npresh < ci->npresh) ti_score++; |
tp_score++; |
766 |
else ;//niente |
totp_score++; |
767 |
|
}; |
768 |
|
if( cp->npresh < ci->npresh){ |
769 |
|
ti_score++; |
770 |
|
toti_score++; |
771 |
|
}; |
772 |
|
|
773 |
// cout << "CALO "<<tp_score<<ti_score<<endl; |
// cout << "CALO "<<tp_score<<ti_score<<endl; |
774 |
|
|
778 |
// ----------------------------------------------------------------------------------------- |
// ----------------------------------------------------------------------------------------- |
779 |
// check the number of hit pmts along the track |
// check the number of hit pmts along the track |
780 |
// on S12 S21 and S32, where paddles are parallel to Y axis |
// on S12 S21 and S32, where paddles are parallel to Y axis |
781 |
if( use_TOF && !tof_obj ){ |
if( (use_TOF || use_S1 || use_S2 || use_S3 ) && !tof_obj ){ |
782 |
cout << "void PamLevel2::SortTracks(): howtosort= "<<how<<" but ToFLevel2 not loaded !!!"; |
cout << "void PamLevel2::SortTracks(): howtosort= "<<how<<" but ToFLevel2 not loaded !!!"; |
783 |
return; |
return; |
784 |
}; |
}; |
785 |
if( use_TOF && op && oi ){ |
// |
786 |
|
if( (use_TOF || use_S1 || use_S2 || use_S3 ) && !op && oi ){ |
787 |
|
ti_score++; |
788 |
|
toti_score++; |
789 |
|
}; |
790 |
|
if( (use_TOF || use_S1 || use_S2 || use_S3 ) && op && !oi ){ |
791 |
|
tp_score++; |
792 |
|
totp_score++; |
793 |
|
}; |
794 |
|
if( (use_TOF || use_S1 || use_S2 || use_S3 ) && op && oi ){ |
795 |
// |
// |
796 |
Float_t sen = 0.; |
Float_t sen = 0.; |
797 |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
803 |
if ( pl == 2 || pl == 3 || pl == 4 || pl == 5 ) sen += (oi->dedx).At(ih); |
if ( pl == 2 || pl == 3 || pl == 4 || pl == 5 ) sen += (oi->dedx).At(ih); |
804 |
}; |
}; |
805 |
// |
// |
806 |
if ( sen >= sortthr ){ |
if ( sen >= sortthr && false){ // temporary disabled NUCLEI special algorithm since the new one should work for every particle (to be checked!) |
807 |
//printf(" IS A NUCLEUS! en = %f \n",sen); |
//printf(" IS A NUCLEUS! en = %f \n",sen); |
808 |
// |
// |
809 |
// is a nucleus use a different algorithm |
// is a nucleus use a different algorithm |
896 |
|
|
897 |
|
|
898 |
if( |
if( |
899 |
use_TOF && |
(use_TOF || use_S1 || use_S2 || use_S3) && |
900 |
(nphit_p+nphit_i) !=0 && |
(nphit_p+nphit_i) !=0 && |
901 |
true){ |
true){ |
902 |
|
|
943 |
for (Int_t ih=0; ih < op->npmttdc; ih++){ |
for (Int_t ih=0; ih < op->npmttdc; ih++){ |
944 |
Int_t pl = tof_obj->GetPlaneIndex( (op->pmttdc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (op->pmttdc).At(ih) ); |
945 |
// if( (op->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_p++; |
// if( (op->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_p++; |
946 |
if( (op->tdcflag).At(ih)==0 )nphit_p++; |
if ( (use_S1 && ( pl == 0 || pl == 1 )) || (use_S2 && ( pl == 2 || pl == 3 )) || (use_S3 && ( pl == 4 || pl == 5 )) ){ |
947 |
|
if( (op->tdcflag).At(ih)==0 )nphit_p++; |
948 |
|
}; |
949 |
}; |
}; |
950 |
|
|
951 |
for (Int_t ih=0; ih < oi->npmttdc; ih++){ |
for (Int_t ih=0; ih < oi->npmttdc; ih++){ |
952 |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmttdc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmttdc).At(ih) ); |
953 |
// if( (oi->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_i++; |
// if( (oi->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_i++; |
954 |
if( (oi->tdcflag).At(ih)==0 )nphit_i++; |
if ( (use_S1 && ( pl == 0 || pl == 1 )) || (use_S2 && ( pl == 2 || pl == 3 )) || (use_S3 && ( pl == 4 || pl == 5 )) ){ |
955 |
|
if( (oi->tdcflag).At(ih)==0 )nphit_i++; |
956 |
|
}; |
957 |
}; |
}; |
958 |
|
|
959 |
if( |
if( |
960 |
(nphit_p+nphit_i) !=0 && |
(nphit_p+nphit_i) !=0 && |
961 |
true){ |
true){ |
962 |
|
|
963 |
if ( nphit_p > nphit_i) tp_score++; |
if ( nphit_p != nphit_i ){ |
964 |
else if( nphit_p < nphit_i) ti_score++; |
totp_score += nphit_p; |
965 |
else ;//niente |
toti_score += nphit_i; |
966 |
|
tp_score+=nphit_p; |
967 |
|
ti_score+=nphit_i; |
968 |
|
}; |
969 |
|
// if ( nphit_p > nphit_i) tp_score+=nphit_p; |
970 |
|
// else if( nphit_p < nphit_i) ti_score+=nphit_i; |
971 |
|
// else ;//niente |
972 |
}; |
}; |
973 |
}; |
}; |
974 |
// cout << "TOF "<<tp_score<<ti_score<<endl; |
// cout << "TOF "<<tp_score<<ti_score<<endl; |
990 |
// else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; |
// else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; |
991 |
|
|
992 |
// CHECK 1 : number of points along X |
// CHECK 1 : number of points along X |
993 |
if ( tp->GetNX() >= ti->GetNX() )tp_score++ ; |
if ( tp->GetNX() >= ti->GetNX() ){ |
994 |
if ( tp->GetNX() <= ti->GetNX() )ti_score++ ; |
tp_score++ ; |
995 |
|
totp_score++ ; |
996 |
|
}; |
997 |
|
if ( tp->GetNX() <= ti->GetNX() ){ |
998 |
|
ti_score++ ; |
999 |
|
toti_score++ ; |
1000 |
|
}; |
1001 |
// CHECK 2 : number of points along Y |
// CHECK 2 : number of points along Y |
1002 |
if ( tp->GetNY() >= ti->GetNY() )tp_score++ ; |
if ( tp->GetNY() >= ti->GetNY() ){ |
1003 |
if ( tp->GetNY() <= ti->GetNY() )ti_score++ ; |
tp_score++ ; |
1004 |
|
totp_score++ ; |
1005 |
|
}; |
1006 |
|
if ( tp->GetNY() <= ti->GetNY() ){ |
1007 |
|
ti_score++ ; |
1008 |
|
toti_score++ ; |
1009 |
|
}; |
1010 |
// CHECK 3 : chi**2 along X |
// CHECK 3 : chi**2 along X |
1011 |
// if( tp->GetChi2X() > 0 && (tp->GetChi2X() < ti->GetChi2X() || ti->GetChi2X() <=0) ) tp_score++ ; |
// if( tp->GetChi2X() > 0 && (tp->GetChi2X() < ti->GetChi2X() || ti->GetChi2X() <=0) ) tp_score++ ; |
1012 |
// if( ti->GetChi2X() > 0 && (ti->GetChi2X() < tp->GetChi2X() || tp->GetChi2X() <=0) ) ti_score++ ; |
// if( ti->GetChi2X() > 0 && (ti->GetChi2X() < tp->GetChi2X() || tp->GetChi2X() <=0) ) ti_score++ ; |
1034 |
ts = ti;//its image!! |
ts = ti;//its image!! |
1035 |
cs = ci; |
cs = ci; |
1036 |
os = oi; |
os = oi; |
1037 |
|
Int_t totis = toti_score; |
1038 |
|
|
1039 |
ti = tp;//its image!! |
ti = tp;//its image!! |
1040 |
ci = cp; |
ci = cp; |
1044 |
cp = cs; |
cp = cs; |
1045 |
op = os; |
op = os; |
1046 |
|
|
1047 |
|
toti_score = totp_score; |
1048 |
|
totp_score = totis; |
1049 |
|
|
1050 |
|
|
1051 |
}else { |
}else { |
1052 |
|
|
1055 |
}; |
}; |
1056 |
|
|
1057 |
}else{ |
}else{ |
1058 |
|
totp_score = 1; |
1059 |
|
toti_score = 0; |
1060 |
|
|
1061 |
// ts = tp; |
// ts = tp; |
1062 |
// cs = cp; |
// cs = cp; |
1063 |
// os = op; |
// os = op; |
1071 |
// cout<<"o "<<tp<<endl; |
// cout<<"o "<<tp<<endl; |
1072 |
// cout<<"o "<<cp<<endl; |
// cout<<"o "<<cp<<endl; |
1073 |
// cout<<"o "<<op<<endl; |
// cout<<"o "<<op<<endl; |
1074 |
|
|
1075 |
new(ttsorted[i]) PamTrack(tp,cp,op); |
new(ttsorted[i]) PamTrack(tp,cp,op); |
1076 |
new(ttimage[i]) PamTrack(ti,ci,oi); |
new(ttimage[i]) PamTrack(ti,ci,oi); |
1077 |
|
|
1078 |
|
((PamTrack*)(ttsorted[i]))->SetPScore(totp_score); |
1079 |
|
((PamTrack*)(ttsorted[i]))->SetIScore(toti_score); |
1080 |
|
((PamTrack*)(ttimage[i]))->SetPScore(totp_score); |
1081 |
|
((PamTrack*)(ttimage[i]))->SetIScore(toti_score); |
1082 |
}; |
}; |
1083 |
|
|
1084 |
if( tsorted->GetEntries() != trk2_obj->GetNTracks() ){ |
if( tsorted->GetEntries() != trk2_obj->GetNTracks() ){ |
1976 |
// |
// |
1977 |
// check if we have already called once GetEntry, if not call it |
// check if we have already called once GetEntry, if not call it |
1978 |
// |
// |
1979 |
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, Long64_t iev) --- NON FUNZIONA BENISSIMO.... "<<endl; |
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, Long64_t iev) --- ATTENZIONE --- NON E` MANTENUTA!!!!!!!.... "<<endl; |
1980 |
if(!run){ |
if(!run){ |
1981 |
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, ULong64_t iev) -- ERROR -- missing RunInfo tree "<<endl; |
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, ULong64_t iev) -- ERROR -- missing RunInfo tree "<<endl; |
1982 |
return(false); |
return(false); |
1995 |
// |
// |
1996 |
// the absolute time is necessary to relate the event with the run |
// the absolute time is necessary to relate the event with the run |
1997 |
// |
// |
1998 |
if( !GetOrbitalInfo() ){ |
if( !GetOrbitalInfo() && !ISGP){ |
1999 |
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, ULong64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
cout << "Bool_t PamLevel2::UpdateRunInfo(TChain *run, ULong64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
2000 |
return(false); |
return(false); |
2001 |
} |
} |
2002 |
|
|
2003 |
|
ULong64_t abstime = 0; |
2004 |
|
if( GetOrbitalInfo() )abstime=GetOrbitalInfo()->absTime; |
2005 |
|
|
2006 |
|
|
2007 |
// |
// |
2008 |
// the first time the routine is called, set run search from the beginning |
// the first time the routine is called, set run search from the beginning |
2009 |
// |
// |
2013 |
runfirstentry = 0LL; |
runfirstentry = 0LL; |
2014 |
runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); |
runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); |
2015 |
if ( (Long64_t)(this->GetRunInfo()->NEVENTS) > 0LL ) runlastentry -= 1LL; |
if ( (Long64_t)(this->GetRunInfo()->NEVENTS) > 0LL ) runlastentry -= 1LL; |
2016 |
|
|
2017 |
|
if( ISGP && run->GetEntries()!=1 ){ |
2018 |
|
cout << "** WARNING ** simulated files are assumed to have 1 single run, not "<< run->GetEntries() << endl; |
2019 |
|
cout << "** WARNING ** run will not be updated"<<endl; |
2020 |
|
} |
2021 |
|
|
2022 |
}; |
}; |
2023 |
// |
// |
2024 |
if ( irun == run->GetEntries()-1LL && |
if(ISGP)abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO |
2025 |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
// |
2026 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
if ( irun == run->GetEntries()-1LL && |
2027 |
|
!(abstime >= GetRunInfo()->RUNHEADER_TIME && |
2028 |
|
abstime <= GetRunInfo()->RUNTRAILER_TIME) |
2029 |
){ |
){ |
2030 |
irun = -1LL; |
irun = -1LL; |
2031 |
runfirstentry = 0LL; |
runfirstentry = 0LL; |
2036 |
// |
// |
2037 |
bool fromfirst = true; |
bool fromfirst = true; |
2038 |
// |
// |
2039 |
while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries()-1LL ){ |
while ( !(abstime >= GetRunInfo()->RUNHEADER_TIME && abstime <= GetRunInfo()->RUNTRAILER_TIME) && irun < run->GetEntries()-1LL ){ |
2040 |
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
2041 |
irun++; |
irun++; |
2042 |
run->GetEntry(irun); |
run->GetEntry(irun); |
2046 |
// cout << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
// cout << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
2047 |
// cout << "runfirstentry "<<runfirstentry<<endl; |
// cout << "runfirstentry "<<runfirstentry<<endl; |
2048 |
// printf(" iev %llu %u %llu \n",iev,this->GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS))); |
// printf(" iev %llu %u %llu \n",iev,this->GetRunInfo()->NEVENTS,(ULong64_t)(runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS))); |
2049 |
// printf(" abstime %u trailertime %u \n",GetOrbitalInfo()->absTime,GetRunInfo()->RUNTRAILER_TIME); |
// printf(" abstime %u trailertime %u \n",abstime,GetRunInfo()->RUNTRAILER_TIME); |
2050 |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
2051 |
// |
// |
2052 |
// prevshift = 0; |
// prevshift = 0; |
2053 |
// |
// |
2054 |
if ( irun == (Long64_t)(run->GetEntries()-1LL) && fromfirst && !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME)){ |
if ( irun == (Long64_t)(run->GetEntries()-1LL) && fromfirst && !(abstime >= GetRunInfo()->RUNHEADER_TIME && abstime <= GetRunInfo()->RUNTRAILER_TIME)){ |
2055 |
printf(" resetting irun (it should NOT happen!!!)\n"); |
printf(" resetting irun (it should NOT happen!!!)\n"); |
2056 |
fromfirst = false; |
fromfirst = false; |
2057 |
irun = 0; |
irun = 0; |
2064 |
}; |
}; |
2065 |
// |
// |
2066 |
if ( |
if ( |
2067 |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
!(abstime >= GetRunInfo()->RUNHEADER_TIME && |
2068 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
abstime <= GetRunInfo()->RUNTRAILER_TIME) |
2069 |
) { |
) { |
2070 |
printf(" Something very wrong here: cannot find RUN containing absolute time %u \n",GetOrbitalInfo()->absTime); |
printf(" Something very wrong here: cannot find RUN containing absolute time %llu \n",abstime); |
2071 |
return false; |
return false; |
2072 |
} |
} |
2073 |
// |
// |
2119 |
if(SELLI==0){ |
if(SELLI==0){ |
2120 |
|
|
2121 |
// --------------------------------------------------------------- |
// --------------------------------------------------------------- |
2122 |
|
// increment dead and live-time counters |
2123 |
|
// --------------------------------------------------------------- |
2124 |
|
if( GetTrigLevel2() ){ |
2125 |
|
totdltime[0]+=GetTrigLevel2()->dltime[0]; |
2126 |
|
totdltime[1]+=GetTrigLevel2()->dltime[1]; |
2127 |
|
} |
2128 |
|
totdltime[2]++; |
2129 |
|
|
2130 |
|
// cout << setw(10)<<totdltime[0]<<setw(10)<<totdltime[1]<<setw(10)<<totdltime[2]<<endl; |
2131 |
|
|
2132 |
|
// --------------------------------------------------------------- |
2133 |
|
// retrieve OBT and absolute time of the event |
2134 |
|
// --------------------------------------------------------------- |
2135 |
|
ULong64_t abstime = 0; |
2136 |
|
ULong64_t obt = 0; |
2137 |
|
if( GetOrbitalInfo() ){ |
2138 |
|
abstime = GetOrbitalInfo()->absTime; |
2139 |
|
obt = GetOrbitalInfo()->OBT; |
2140 |
|
} |
2141 |
|
// --------------------------------------------------------------- |
2142 |
// the absolute time is necessary to relate the event with the run |
// the absolute time is necessary to relate the event with the run |
2143 |
// --------------------------------------------------------------- |
// --------------------------------------------------------------- |
2144 |
if( !GetOrbitalInfo() ){ |
if( !GetOrbitalInfo() && !ISGP ){ |
2145 |
cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
2146 |
return(false); |
return(false); |
2147 |
} |
} |
2154 |
irunentry = 0; |
irunentry = 0; |
2155 |
prevshift = 0; |
prevshift = 0; |
2156 |
run_tree->GetEntry(irun); |
run_tree->GetEntry(irun); |
2157 |
|
|
2158 |
|
if( ISGP && run_tree->GetEntries()!=1 ){ |
2159 |
|
cout << "** WARNING ** simulated files are assumed to have 1 single run, not "<< run_tree->GetEntries() << endl; |
2160 |
|
cout << "** WARNING ** run will not be updated"<<endl; |
2161 |
|
} |
2162 |
}; |
}; |
2163 |
|
|
2164 |
|
// ----------------------------------------------------------------------- |
2165 |
|
// if it is simulation, assign abstime by hand (temporaneo!!!) |
2166 |
|
// ----------------------------------------------------------------------- |
2167 |
|
if(ISGP){ |
2168 |
|
abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO |
2169 |
|
obt = GetRunInfo()->RUNHEADER_OBT; // BARBATRUCCO |
2170 |
|
} |
2171 |
// |
// |
2172 |
bool fromfirst = true; // first loop over runs |
bool fromfirst = true; // first loop over runs |
2173 |
|
|
2181 |
while ( |
while ( |
2182 |
( |
( |
2183 |
( |
( |
2184 |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && // check on absolute time (s) |
!(abstime >= GetRunInfo()->RUNHEADER_TIME && // check on absolute time (s) |
2185 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && |
abstime <= GetRunInfo()->RUNTRAILER_TIME) && |
2186 |
!(GetOrbitalInfo()->OBT >= GetRunInfo()->RUNHEADER_OBT && // additional check on OBT (ms) |
!(obt >= GetRunInfo()->RUNHEADER_OBT && // additional check on OBT (ms) |
2187 |
GetOrbitalInfo()->OBT <= GetRunInfo()->RUNTRAILER_OBT) |
obt <= GetRunInfo()->RUNTRAILER_OBT) |
2188 |
) |
) |
2189 |
|| GetRunInfo()->NEVENTS==0 |
|| GetRunInfo()->NEVENTS==0 |
2190 |
|| !(irunentry < GetRunInfo()->NEVENTS-1-prevshift) |
// || !(irunentry < GetRunInfo()->NEVENTS-1-prevshift) // ERRORE!!! fa saltare i run con 1 evento |
2191 |
|
|| !(irunentry <= GetRunInfo()->NEVENTS-1-prevshift) |
2192 |
) |
) |
2193 |
&& irun < run_tree->GetEntries() ){ |
&& irun < run_tree->GetEntries() ){ |
2194 |
|
|
2195 |
|
// - - - - - - - - - - - - - |
2196 |
|
// irunentry = position of current entry, relative to the run |
2197 |
|
// prevshift = shift needed to synchronize l0 and l2 data (nested events) |
2198 |
|
// - - - - - - - - - - - - - |
2199 |
|
|
2200 |
|
// ----------------------------------------- |
2201 |
|
// store dead and live-time of previous run |
2202 |
|
// ----------------------------------------- |
2203 |
|
if(fromfirst){ |
2204 |
|
if(oldrun==irun){ |
2205 |
|
/// decrement counters |
2206 |
|
if( GetTrigLevel2()){ |
2207 |
|
totdltime[0]-=GetTrigLevel2()->dltime[0];//live-time |
2208 |
|
totdltime[1]-=GetTrigLevel2()->dltime[1];//dead-time |
2209 |
|
} |
2210 |
|
totdltime[2]--; //event counter |
2211 |
|
cout << endl; |
2212 |
|
cout << "n.events : "<<totdltime[2]<<endl; |
2213 |
|
cout << "RUN LIVE-TIME: "<<totdltime[0]*0.16<<" ms"<<endl; |
2214 |
|
cout << "RUN DEAD-TIME: "<<totdltime[1]*0.01<<" ms"<<endl; |
2215 |
|
}else{ |
2216 |
|
totdltime[0]=0;//live-time |
2217 |
|
totdltime[1]=0;//dead-time |
2218 |
|
totdltime[2]=0; //event counter |
2219 |
|
cout << " *** JUMP RUN *** irun "<<irun<<endl; |
2220 |
|
} |
2221 |
|
/// add an entry |
2222 |
|
if(run_tree_clone) |
2223 |
|
if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) |
2224 |
|
run_tree_clone->GetBranch("DeadLiveTime")->Fill(); |
2225 |
|
/// reset counters |
2226 |
|
if( GetTrigLevel2() ){ |
2227 |
|
totdltime[0]=GetTrigLevel2()->dltime[0];//live-time |
2228 |
|
totdltime[1]=0; //dead-time |
2229 |
|
} |
2230 |
|
totdltime[2]=1; //event counter |
2231 |
|
} |
2232 |
|
|
2233 |
|
|
2234 |
irun++; |
irun++; |
2235 |
// ------------------------------------ |
// ------------------------------------ |
2236 |
// if the end of run tree is reached... |
// if the end of run tree is reached... |
2258 |
// ------------------------------------------------------------------- |
// ------------------------------------------------------------------- |
2259 |
if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS)-prevshift; |
if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS)-prevshift; |
2260 |
irunentry = 0; |
irunentry = 0; |
2261 |
prevshift = 0; |
prevshift = 0; |
2262 |
run_tree->GetEntry(irun); |
run_tree->GetEntry(irun); |
2263 |
if(GetRunInfo()->RUNHEADER_OBT>GetRunInfo()->RUNTRAILER_OBT ){ |
if(GetRunInfo()->RUNHEADER_OBT>GetRunInfo()->RUNTRAILER_OBT ){ |
2264 |
cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- WARNING -- irun "<<irun<<" has RUNHEADER_OBT>=RUNTRAILER_OBT " <<endl; |
cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- WARNING -- irun "<<irun<<" has RUNHEADER_OBT>=RUNTRAILER_OBT " <<endl; |
2278 |
|
|
2279 |
// -------------------------------------- |
// -------------------------------------- |
2280 |
// ... otherwise |
// ... otherwise |
2281 |
|
// -------------------------------------- |
2282 |
|
|
2283 |
|
|
2284 |
|
|
2285 |
|
// // ----------------------------------------- |
2286 |
|
// // store dead and live-time of previous run |
2287 |
|
// // ----------------------------------------- |
2288 |
|
// // -------------------------------------------------------------- |
2289 |
|
// // if the run is empty, fill the dead-live time branch with zeros |
2290 |
|
// // -------------------------------------------------------------- |
2291 |
|
// /// if some runs have been jumped, fill with zeros |
2292 |
|
// if(irun-oldrun>1){ |
2293 |
|
// ULong64_t temp[3]; |
2294 |
|
// temp[0]=totdltime[0]; |
2295 |
|
// temp[1]=totdltime[1]; |
2296 |
|
// temp[2]=totdltime[2]; |
2297 |
|
// for(int i=oldrun+1; i<irun; irun++){ |
2298 |
|
// totdltime[0]=0; |
2299 |
|
// totdltime[1]=0; |
2300 |
|
// totdltime[2]=0; |
2301 |
|
// cout << " ** JUMPED RUN **"<<endl; |
2302 |
|
// if(run_tree_clone) |
2303 |
|
// if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) |
2304 |
|
// run_tree_clone->GetBranch("DeadLiveTime")->Fill(); |
2305 |
|
// } |
2306 |
|
// totdltime[0]=temp[0]; |
2307 |
|
// totdltime[1]=temp[1]; |
2308 |
|
// totdltime[2]=temp[2]; |
2309 |
|
// } |
2310 |
|
// /// decrement counters |
2311 |
|
// if( GetTrigLevel2() ){ |
2312 |
|
// totdltime[0]-=GetTrigLevel2()->dltime[0];//live-time |
2313 |
|
// totdltime[1]-=GetTrigLevel2()->dltime[1];//dead-time |
2314 |
|
// } |
2315 |
|
// totdltime[2]--; //event counter |
2316 |
|
// /// add an entry |
2317 |
|
// if(irun>0 ){ |
2318 |
|
// cout << endl; |
2319 |
|
// cout << "n.events : "<<totdltime[2]<<endl; |
2320 |
|
// cout << "RUN LIVE-TIME: "<<totdltime[0]*0.16<<" ms"<<endl; |
2321 |
|
// cout << "RUN DEAD-TIME: "<<totdltime[1]*0.01<<" ms"<<endl; |
2322 |
|
// if(run_tree_clone) |
2323 |
|
// if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) |
2324 |
|
// run_tree_clone->GetBranch("DeadLiveTime")->Fill(); |
2325 |
|
// } |
2326 |
|
// /// reset counters |
2327 |
|
// if( GetTrigLevel2() ){ |
2328 |
|
// totdltime[0]=GetTrigLevel2()->dltime[0];//live-time |
2329 |
|
// totdltime[1]=0; //dead-time |
2330 |
|
// } |
2331 |
|
// totdltime[2]=1; //event counter |
2332 |
|
|
2333 |
|
|
2334 |
|
// -------------------------------------- |
2335 |
// ---> exit with TRUE |
// ---> exit with TRUE |
2336 |
// -------------------------------------- |
// -------------------------------------- |
2337 |
cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
2346 |
true ){ |
true ){ |
2347 |
cout << "* fragment *"<<endl; |
cout << "* fragment *"<<endl; |
2348 |
} |
} |
2349 |
|
|
2350 |
return(true); |
return(true); |
2351 |
}; |
}; |
2352 |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- |
3026 |
} |
} |
3027 |
cout << "----------------------------------------------------"<<endl; |
cout << "----------------------------------------------------"<<endl; |
3028 |
|
|
3029 |
|
// ------------------------------------ |
3030 |
|
// add branch with dead and live times |
3031 |
|
// ------------------------------------ |
3032 |
|
run_tree_clone->Branch("DeadLiveTime",totdltime,"dltime[3]/l"); |
3033 |
|
cout << "Run : branch DeadLiveTime"<<endl; |
3034 |
|
|
3035 |
|
|
3036 |
sel_tree_clone = new TTree("SelectionList","List of selected events "); |
sel_tree_clone = new TTree("SelectionList","List of selected events "); |
3037 |
sel_tree_clone->Branch("RunEntry",&irun,"runentry/L"); |
sel_tree_clone->Branch("RunEntry",&irun,"runentry/L"); |
3158 |
void PamLevel2::WriteCloneTrees(){ |
void PamLevel2::WriteCloneTrees(){ |
3159 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
3160 |
cout << "Write clones of PAMELA trees "<<endl; |
cout << "Write clones of PAMELA trees "<<endl; |
3161 |
cout << run_tree_clone->GetName()<<endl; |
cout << run_tree_clone->GetName()<<endl; |
3162 |
|
if(run_tree_clone->GetBranch("DeadLiveTime")->GetEntries() < run_tree->GetEntries()) |
3163 |
|
run_tree_clone->GetBranch("DeadLiveTime")->Fill(); |
3164 |
run_tree_clone->Write(); |
run_tree_clone->Write(); |
3165 |
cout << sel_tree_clone->GetName()<<endl; |
cout << sel_tree_clone->GetName()<<endl; |
3166 |
sel_tree_clone->Write(); |
sel_tree_clone->Write(); |
3402 |
|
|
3403 |
// cout << " irun "<< irun << " irunentry "<< irunentry<<" run_obj->EV_FROM "<<run_obj->EV_FROM <<" quella giusta "<<quellagiusta << endl; |
// cout << " irun "<< irun << " irunentry "<< irunentry<<" run_obj->EV_FROM "<<run_obj->EV_FROM <<" quella giusta "<<quellagiusta << endl; |
3404 |
// cout << " iroot "<<iroot<<" run_obj->ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<endl; |
// cout << " iroot "<<iroot<<" run_obj->ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<endl; |
3405 |
// cout << " time "<< GetOrbitalInfo()->absTime << endl; |
// cout << " time "<< abstime << endl; |
3406 |
// cout << " trk_calib_used "<<run_obj->TRK_CALIB_USED<< endl; |
// cout << " trk_calib_used "<<run_obj->TRK_CALIB_USED<< endl; |
3407 |
|
|
3408 |
if( !GetOrbitalInfo() ){ |
ULong64_t obt = 0; |
3409 |
|
ULong64_t pktn = 0; |
3410 |
|
if( GetOrbitalInfo() ){ |
3411 |
|
obt = GetOrbitalInfo()->OBT; |
3412 |
|
pktn = GetOrbitalInfo()->pkt_num; |
3413 |
|
} |
3414 |
|
|
3415 |
|
if( !GetOrbitalInfo() && !ISGP){ |
3416 |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing OrbitalInfo "<<endl; |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing OrbitalInfo "<<endl; |
3417 |
return 0; |
return 0; |
3418 |
} |
} |
3419 |
if( GetOrbitalInfo()->OBT==0 && GetOrbitalInfo()->pkt_num==0 ){ |
if( obt==0 && pktn==0 && !ISGP ){ |
3420 |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- level2 event corrupted ?? "<<endl; |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- level2 event corrupted ?? "<<endl; |
3421 |
return 0; |
return 0; |
3422 |
} |
} |
3435 |
Int_t answer = 0; |
Int_t answer = 0; |
3436 |
Int_t shift =0; |
Int_t shift =0; |
3437 |
// printf(" siamo qui %i %i \n",shift,prevshift); |
// printf(" siamo qui %i %i \n",shift,prevshift); |
3438 |
Int_t maxshift = 10; |
// Int_t maxshift = 50; // EMILIANO |
3439 |
do{ |
do{ |
3440 |
if(shift>0){ |
if(shift>0){ |
3441 |
cout << " PKTNUM L2 --- "<< GetOrbitalInfo()->pkt_num << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
cout << " PKTNUM L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
3442 |
cout << " RUN: ID "<< GetRunInfo()->ID << " ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<" ID_RUN_FRAG "<<GetRunInfo()->ID_RUN_FRAG << " EV_FROM "<<GetRunInfo()->EV_FROM <<endl; |
cout << " RUN: ID "<< GetRunInfo()->ID << " ID_ROOT_L0 "<<run_obj->ID_ROOT_L0<<" ID_RUN_FRAG "<<GetRunInfo()->ID_RUN_FRAG << " EV_FROM "<<GetRunInfo()->EV_FROM <<endl; |
3443 |
cout << " L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl; |
cout << " L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl; |
3444 |
} |
} |
3448 |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing EventHeader "<<endl; |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing EventHeader "<<endl; |
3449 |
return 0; |
return 0; |
3450 |
} |
} |
3451 |
// cout << "PKTNUM "<<shift<<" == L2 --- "<< GetOrbitalInfo()->pkt_num << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
|
3452 |
// cout << " L2 --- "<< GetOrbitalInfo()->OBT << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime()<<endl; |
if(ISGP){ |
3453 |
|
obt = (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()); //BARBATRUCCO |
3454 |
|
pktn = (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter()); //BARBATRUCCO |
3455 |
|
} |
3456 |
|
|
3457 |
|
// cout << "PKTNUM "<<shift<<" == L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
3458 |
|
// cout << " L2 --- "<< obt << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime()<<endl; |
3459 |
// if( (quellagiusta+shift) == l0_tree->GetEntries()+1 )cout << ">>> end of level0 tree <<<"<<endl; |
// if( (quellagiusta+shift) == l0_tree->GetEntries()+1 )cout << ">>> end of level0 tree <<<"<<endl; |
3460 |
// cout << " GetOrbitalInfo()->OBT "<< GetOrbitalInfo()->OBT << endl; |
// cout << " obt "<< obt << endl; |
3461 |
// cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl; |
// cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl; |
3462 |
// cout << " GetOrbitalInfo()->pkt_num "<< GetOrbitalInfo()->pkt_num << endl; |
// cout << " pktn "<< pktn << endl; |
3463 |
// cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl; |
// cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl; |
3464 |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
3465 |
// |
// |
3468 |
shift = -1; |
shift = -1; |
3469 |
}; |
}; |
3470 |
|
|
3471 |
}while( ( GetOrbitalInfo()->OBT != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()) || GetOrbitalInfo()->pkt_num != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter())) && (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
}while( ( obt != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()) || |
3472 |
|
pktn != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter()) ) |
3473 |
|
&& (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
3474 |
|
|
3475 |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
3476 |
cout << " Big trouble here, no such event in Level0 data! " <<endl; |
cout << " Big trouble here, no such event in Level0 data! " <<endl; |
3500 |
return true; |
return true; |
3501 |
|
|
3502 |
} |
} |
3503 |
|
|
3504 |
|
/** |
3505 |
|
* \Brief Add a friend to the pamela chain. |
3506 |
|
* @param cname name of the chain to be added |
3507 |
|
*/ |
3508 |
|
|
3509 |
|
TChain* PamLevel2::AddFriend(TString cname){ |
3510 |
|
|
3511 |
|
if(!GetPamTree()){ |
3512 |
|
cout << " TChain* PamLevel2::AddFriend(TString cname) --- a pamela tree must be created first"<<endl; |
3513 |
|
return NULL; |
3514 |
|
} |
3515 |
|
|
3516 |
|
|
3517 |
|
TChain *c = new TChain( cname.Data() ); |
3518 |
|
|
3519 |
|
TIter next( GetPamTree()->GetListOfFiles() ); |
3520 |
|
Int_t nf = 0; |
3521 |
|
TChainElement* element = 0; |
3522 |
|
while ((element = (TChainElement*) next())) { |
3523 |
|
c->Add(element->GetTitle()); |
3524 |
|
nf++; |
3525 |
|
} |
3526 |
|
|
3527 |
|
GetPamTree()->AddFriend(cname.Data()); |
3528 |
|
|
3529 |
|
cout << "external chain created and added to pamela friends :"<<cname<<endl; |
3530 |
|
cout << "n.files "<<nf<<endl; |
3531 |
|
|
3532 |
|
|
3533 |
|
return c; |
3534 |
|
|
3535 |
|
} |