284 |
trk_track = 0; |
trk_track = 0; |
285 |
calo_track = 0; |
calo_track = 0; |
286 |
tof_track = 0; |
tof_track = 0; |
287 |
|
orb_track = 0; |
288 |
candeleteobj = 0; |
candeleteobj = 0; |
289 |
pscore = 0; |
pscore = 0; |
290 |
iscore = 0; |
iscore = 0; |
296 |
/** |
/** |
297 |
* Constructor |
* Constructor |
298 |
*/ |
*/ |
299 |
PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o){ |
PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o, OrbitalInfoTrkVar *r){ |
300 |
|
|
301 |
trk_track = 0; |
trk_track = 0; |
302 |
calo_track = 0; |
calo_track = 0; |
303 |
tof_track = 0; |
tof_track = 0; |
304 |
|
orb_track = 0; |
305 |
// if(t)trk_track = new TrkTrack(*t); |
// if(t)trk_track = new TrkTrack(*t); |
306 |
// if(c)calo_track = new CaloTrkVar(*c); |
// if(c)calo_track = new CaloTrkVar(*c); |
307 |
// if(o)tof_track = new ToFTrkVar(*o); |
// if(o)tof_track = new ToFTrkVar(*o); |
308 |
if(t)trk_track = t; |
if(t)trk_track = t; |
309 |
if(c)calo_track = c; |
if(c)calo_track = c; |
310 |
if(o)tof_track = o; |
if(o)tof_track = o; |
311 |
candeleteobj = 0; |
if(r) orb_track = r; |
312 |
|
|
313 |
|
candeleteobj = 0; |
314 |
|
|
315 |
}; |
}; |
316 |
PamTrack::PamTrack(const PamTrack& track){ |
PamTrack::PamTrack(const PamTrack& track){ |
318 |
TrkTrack *t = track.trk_track; |
TrkTrack *t = track.trk_track; |
319 |
CaloTrkVar *c = track.calo_track; |
CaloTrkVar *c = track.calo_track; |
320 |
ToFTrkVar *o = track.tof_track; |
ToFTrkVar *o = track.tof_track; |
321 |
|
OrbitalInfoTrkVar *r = track.orb_track; |
322 |
|
|
323 |
trk_track = 0; |
trk_track = 0; |
324 |
calo_track = 0; |
calo_track = 0; |
325 |
tof_track = 0; |
tof_track = 0; |
326 |
|
orb_track = 0; |
327 |
if(t)trk_track = new TrkTrack(*t); |
if(t)trk_track = new TrkTrack(*t); |
328 |
if(c)calo_track = new CaloTrkVar(*c); |
if(c)calo_track = new CaloTrkVar(*c); |
329 |
if(o)tof_track = new ToFTrkVar(*o); |
if(o)tof_track = new ToFTrkVar(*o); |
330 |
|
if(r)orb_track = new OrbitalInfoTrkVar(*r); |
331 |
candeleteobj = 1; |
candeleteobj = 1; |
332 |
|
|
333 |
} |
} |
338 |
if(trk_track) trk_track->TrkTrack::Clear(); |
if(trk_track) trk_track->TrkTrack::Clear(); |
339 |
if(calo_track) calo_track->CaloTrkVar::Clear();//??? |
if(calo_track) calo_track->CaloTrkVar::Clear();//??? |
340 |
if(tof_track) tof_track->ToFTrkVar::Clear();//??? |
if(tof_track) tof_track->ToFTrkVar::Clear();//??? |
341 |
|
if(orb_track) orb_track->OrbitalInfoTrkVar::Clear();//??? |
342 |
}else{ |
}else{ |
343 |
trk_track = 0; |
trk_track = 0; |
344 |
calo_track = 0; |
calo_track = 0; |
345 |
tof_track = 0; |
tof_track = 0; |
346 |
|
orb_track = 0; |
347 |
} |
} |
348 |
pscore = 0; |
pscore = 0; |
349 |
iscore = 0; |
iscore = 0; |
364 |
tof_track->ToFTrkVar::Clear();//??? |
tof_track->ToFTrkVar::Clear();//??? |
365 |
delete tof_track; |
delete tof_track; |
366 |
} |
} |
367 |
|
if(orb_track){ |
368 |
|
orb_track->OrbitalInfoTrkVar::Clear();//??? |
369 |
|
delete orb_track; |
370 |
|
} |
371 |
}else{ |
}else{ |
372 |
Clear(); |
Clear(); |
373 |
} |
} |
404 |
GetRunTree(listf); |
GetRunTree(listf); |
405 |
}; |
}; |
406 |
|
|
407 |
|
PamLevel2::PamLevel2(TString ddir,TList *list,TString detlist){ |
408 |
|
Initialize(); |
409 |
|
GetPamTree(list,detlist); |
410 |
|
GetRunTree(list); |
411 |
|
}; |
412 |
/** |
/** |
413 |
* Constructor |
* Constructor |
414 |
* @param ddir Name of directory where level2 files are stored. |
* @param ddir Name of directory where level2 files are stored. |
726 |
// |
// |
727 |
}; |
}; |
728 |
|
|
729 |
Bool_t PamLevel2::IsGood(){ |
Bool_t PamLevel2::IsGood(Bool_t strict){ |
730 |
Bool_t goodev=true; |
Bool_t goodev=true; |
731 |
// if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false; |
// |
732 |
if(calo2_obj && calo2_obj->good != 1) goodev = false; |
if(calo2_obj && !calo2_obj->IsGood(strict) ) goodev = false; |
733 |
|
// |
734 |
|
if ( strict ){ |
735 |
|
if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false; |
736 |
if(tof_obj && tof_obj->unpackError != 0) goodev = false; |
if(tof_obj && tof_obj->unpackError != 0) goodev = false; |
737 |
if(trig_obj && trig_obj->unpackError != 0) goodev = false; |
if(trig_obj && trig_obj->unpackError != 0) goodev = false; |
738 |
if(s4_obj && s4_obj->unpackError != 0) goodev = false; |
if(s4_obj && s4_obj->unpackError != 0) goodev = false; |
739 |
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
740 |
if(ac_obj && ac_obj->unpackError != 255) goodev = false; |
if(ac_obj && (ac_obj->unpackError != 0 || ((ac_obj->status[0]>>3)&1) || ((ac_obj->status[0]>>3)&1)) ) goodev = false; |
741 |
// if(orb_obj) |
// if(orb_obj) |
742 |
return goodev; |
} else { |
743 |
|
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
744 |
|
if(ac_obj && (ac_obj->unpackError != 0 || ((ac_obj->status[0]>>3)&1) || ((ac_obj->status[0]>>3)&1)) ) goodev = false; |
745 |
|
}; |
746 |
|
return(goodev); |
747 |
}; |
}; |
748 |
|
|
749 |
//-------------------------------------- |
//-------------------------------------- |
769 |
return &trk2_obj; |
return &trk2_obj; |
770 |
}; |
}; |
771 |
if(!objname.CompareTo("TrkHough")) { |
if(!objname.CompareTo("TrkHough")) { |
772 |
if(!trkh_obj) trkh_obj = new TrkHough(); |
if(!trkh_obj) { |
773 |
|
trkh_obj = new TrkHough(); |
774 |
|
trkh_obj->Set(); |
775 |
|
} |
776 |
return &trkh_obj; |
return &trkh_obj; |
777 |
}; |
}; |
778 |
if(!objname.CompareTo("CaloLevel1")) { |
if(!objname.CompareTo("CaloLevel1")) { |
809 |
if(!ac_obj) ac_obj = new AcLevel2(); |
if(!ac_obj) ac_obj = new AcLevel2(); |
810 |
return &ac_obj; |
return &ac_obj; |
811 |
}; |
}; |
812 |
if(!objname.CompareTo("OrbitalInfo")){ |
if(!objname.CompareTo("OrbitalInfo")) { |
813 |
if(!orb_obj) orb_obj = new OrbitalInfo(); |
if(!orb_obj){ |
814 |
|
orb_obj = new OrbitalInfo(); |
815 |
|
orb_obj->Set(); |
816 |
|
} |
817 |
return &orb_obj; |
return &orb_obj; |
818 |
}; |
}; |
819 |
|
// if(!objname.CompareTo("OrbitalInfo")){ |
820 |
|
// if(!orb_obj) orb_obj = new OrbitalInfo(); |
821 |
|
// return &orb_obj; |
822 |
|
// }; |
823 |
if(!objname.CompareTo("GPamela")){ |
if(!objname.CompareTo("GPamela")){ |
824 |
if(!gp_obj) gp_obj = new GPamela(); |
if(!gp_obj) gp_obj = new GPamela(); |
825 |
return &gp_obj; |
return &gp_obj; |
901 |
// |
// |
902 |
//-------------------------------------- |
//-------------------------------------- |
903 |
/** |
/** |
904 |
* Give the pamela track associated to a tracker track, retrieving related calorimeter and tof track information. |
* Retrieves the OrbitalInfo track matching the seqno-th tracker stored track. |
905 |
|
* (If seqno = -1 retrieves the tracker-independent tof related track) |
906 |
|
*/ |
907 |
|
OrbitalInfoTrkVar *PamLevel2::GetOrbitalInfoStoredTrack(int seqno){ |
908 |
|
|
909 |
|
if( !orb_obj )return 0; |
910 |
|
|
911 |
|
|
912 |
|
if( orb_obj->OrbitalInfo::ntrk()==0 ){ |
913 |
|
// // TRICK BEGIN |
914 |
|
// OrbitalInfoTrkVar *r = new OrbitalInfoTrkVar(); // TEMPORARY TRICK |
915 |
|
// Int_t nn = 0; |
916 |
|
// TClonesArray &tor = *orb_obj->OrbitalInfoTrk; |
917 |
|
// for(Int_t nt=0; nt < tof_obj->ToFLevel2::ntrk(); nt++){ |
918 |
|
// // |
919 |
|
// ToFTrkVar *ptt = tof_obj->ToFLevel2::GetToFTrkVar(nt); |
920 |
|
// if ( ptt->trkseqno != -1 ){ |
921 |
|
// // |
922 |
|
// r->trkseqno = ptt->trkseqno; |
923 |
|
// // |
924 |
|
// r->Eij = 0; |
925 |
|
// // |
926 |
|
// r->Sij = 0; |
927 |
|
// // |
928 |
|
// r->pitch = -1000.; |
929 |
|
// // |
930 |
|
// r->cutoff = -1000.; |
931 |
|
// // |
932 |
|
// new(tor[nn]) OrbitalInfoTrkVar(*r); |
933 |
|
// nn++; |
934 |
|
// // |
935 |
|
// r->Clear(); |
936 |
|
// // |
937 |
|
// }; |
938 |
|
// }; |
939 |
|
// delete r; |
940 |
|
// OrbitalInfoTrkVar *c = 0; |
941 |
|
// c = orb_obj->OrbitalInfo::GetOrbitalInfoTrkVar(0); |
942 |
|
// return c; |
943 |
|
// //TRICK END |
944 |
|
cout << "PamLevel2::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no OrbitalInfo tracks are stored"<<endl; |
945 |
|
return NULL; |
946 |
|
}; |
947 |
|
|
948 |
|
OrbitalInfoTrkVar *c = 0; |
949 |
|
Int_t it_tof=0; |
950 |
|
|
951 |
|
do{ |
952 |
|
c = orb_obj->OrbitalInfo::GetOrbitalInfoTrkVar(it_tof); |
953 |
|
it_tof++; |
954 |
|
} while( c && seqno != c->trkseqno && it_tof < orb_obj->OrbitalInfo::ntrk()); |
955 |
|
|
956 |
|
if(!c || seqno != c->trkseqno){ |
957 |
|
c = 0; |
958 |
|
if(seqno!=-1)cout << "PamLevel2::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo "<< seqno <<" does not match OrbitalInfo stored tracks"<<endl; |
959 |
|
}; |
960 |
|
return c; |
961 |
|
|
962 |
|
}; |
963 |
|
|
964 |
|
//-------------------------------------- |
965 |
|
// |
966 |
|
// |
967 |
|
//-------------------------------------- |
968 |
|
/** |
969 |
|
* Give the pamela track associated to a tracker track, retrieving related calorimeter, orbitalinfo and tof track information. |
970 |
*/ |
*/ |
971 |
PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t){ |
PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t){ |
972 |
|
|
975 |
|
|
976 |
CaloTrkVar *c = 0; |
CaloTrkVar *c = 0; |
977 |
ToFTrkVar *o = 0; |
ToFTrkVar *o = 0; |
978 |
|
OrbitalInfoTrkVar *r = 0; |
979 |
|
|
980 |
if(CAL2) c = GetCaloStoredTrack(t->GetSeqNo()); |
if(CAL2) c = GetCaloStoredTrack(t->GetSeqNo()); |
981 |
if(TOF) o = GetToFStoredTrack(t->GetSeqNo()); |
if(TOF) o = GetToFStoredTrack(t->GetSeqNo()); |
982 |
|
if(ORB) r = GetOrbitalInfoStoredTrack(t->GetSeqNo()); |
983 |
|
|
984 |
// if(t && c && o)track = new PamTrack(t,c,o); |
// if(t && c && o)track = new PamTrack(t,c,o); |
985 |
PamTrack *track = new PamTrack(t,c,o); |
PamTrack *track = new PamTrack(t,c,o,r); |
986 |
|
|
987 |
return track; |
return track; |
988 |
|
|
1000 |
PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){ |
PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){ |
1001 |
|
|
1002 |
cout <<"PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** "<<endl; |
cout <<"PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** "<<endl; |
1003 |
cout <<"for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack)"<<endl; |
cout <<"for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack) OrbitalInfo::GetOrbitalInfoTrkVar(Int_t notrack)"<<endl; |
1004 |
cout <<"(if you use it, remember to delete the PamTrack object)"<<endl; |
cout <<"(if you use it, remember to delete the PamTrack object)"<<endl; |
1005 |
PamTrack *track = 0; |
PamTrack *track = 0; |
1006 |
|
|
1112 |
TrkTrack *ts = 0; |
TrkTrack *ts = 0; |
1113 |
CaloTrkVar *cs = 0; |
CaloTrkVar *cs = 0; |
1114 |
ToFTrkVar *os = 0; |
ToFTrkVar *os = 0; |
1115 |
|
OrbitalInfoTrkVar *rs = 0; |
1116 |
|
|
1117 |
// get tracker tracks |
// get tracker tracks |
1118 |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
1119 |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
1120 |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
1121 |
|
OrbitalInfoTrkVar *rp = GetOrbitalInfoStoredTrack(tp->GetSeqNo()); |
1122 |
|
|
1123 |
TrkTrack *ti = 0; //tracker (image) |
TrkTrack *ti = 0; //tracker (image) |
1124 |
CaloTrkVar *ci = 0; |
CaloTrkVar *ci = 0; |
1125 |
ToFTrkVar *oi = 0; |
ToFTrkVar *oi = 0; |
1126 |
|
OrbitalInfoTrkVar *ri = 0; |
1127 |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
1128 |
// if track has an image, check image selection |
// if track has an image, check image selection |
1129 |
|
|
1137 |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
1138 |
ci = GetCaloStoredTrack(ti->GetSeqNo()); |
ci = GetCaloStoredTrack(ti->GetSeqNo()); |
1139 |
oi = GetToFStoredTrack(ti->GetSeqNo()); |
oi = GetToFStoredTrack(ti->GetSeqNo()); |
1140 |
|
ri = GetOrbitalInfoStoredTrack(ti->GetSeqNo()); |
1141 |
|
|
1142 |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
1143 |
|
|
1479 |
ts = ti;//its image!! |
ts = ti;//its image!! |
1480 |
cs = ci; |
cs = ci; |
1481 |
os = oi; |
os = oi; |
1482 |
|
rs = ri; |
1483 |
Int_t totis = toti_score; |
Int_t totis = toti_score; |
1484 |
|
|
1485 |
ti = tp;//its image!! |
ti = tp;//its image!! |
1486 |
ci = cp; |
ci = cp; |
1487 |
oi = op; |
oi = op; |
1488 |
|
ri = rp; |
1489 |
|
|
1490 |
tp = ts;//its image!! |
tp = ts;//its image!! |
1491 |
cp = cs; |
cp = cs; |
1492 |
op = os; |
op = os; |
1493 |
|
rp = rs; |
1494 |
|
|
1495 |
toti_score = totp_score; |
toti_score = totp_score; |
1496 |
totp_score = totis; |
totp_score = totis; |
1520 |
// cout<<"o "<<cp<<endl; |
// cout<<"o "<<cp<<endl; |
1521 |
// cout<<"o "<<op<<endl; |
// cout<<"o "<<op<<endl; |
1522 |
|
|
1523 |
new(ttsorted[i]) PamTrack(tp,cp,op); |
new(ttsorted[i]) PamTrack(tp,cp,op,rp); |
1524 |
new(ttimage[i]) PamTrack(ti,ci,oi); |
new(ttimage[i]) PamTrack(ti,ci,oi,ri); |
1525 |
|
|
1526 |
((PamTrack*)(ttsorted[i]))->SetPScore(totp_score); |
((PamTrack*)(ttsorted[i]))->SetPScore(totp_score); |
1527 |
((PamTrack*)(ttsorted[i]))->SetIScore(toti_score); |
((PamTrack*)(ttsorted[i]))->SetIScore(toti_score); |
2792 |
// -------------------------------------- |
// -------------------------------------- |
2793 |
// ---> exit with TRUE |
// ---> exit with TRUE |
2794 |
// -------------------------------------- |
// -------------------------------------- |
2795 |
cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
if(DBG)cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
2796 |
|
// ---------------------------------------------------- |
2797 |
|
// update the tracker parameters |
2798 |
|
// (non ho trovato nessun altro modo sicuro di farlo...) |
2799 |
|
// ---------------------------------------------------- |
2800 |
|
if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection(); |
2801 |
|
TrkParams::Set(GetRunInfo() ,dbc); |
2802 |
|
if(dbc)dbc->Close(); |
2803 |
|
|
2804 |
// ---------------------------------------------------- |
// ---------------------------------------------------- |
2805 |
// then check if the run has a fragment |
// then check if the run has a fragment |
2806 |
// in this case we have to switch to the next fragment |
// in this case we have to switch to the next fragment |
2809 |
if( |
if( |
2810 |
GetRunInfo()->ID_RUN_FRAG != 0 && |
GetRunInfo()->ID_RUN_FRAG != 0 && |
2811 |
// GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID && |
// GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID && |
2812 |
|
DBG && |
2813 |
true ){ |
true ){ |
2814 |
cout << "* fragment *"<<endl; |
cout << "* fragment *"<<endl; |
2815 |
} |
} |
2829 |
// check if the time is ok (with merged files it is not...) |
// check if the time is ok (with merged files it is not...) |
2830 |
// if not loop over run and look for the proper entry |
// if not loop over run and look for the proper entry |
2831 |
bool SECONDO_GIRO=false; |
bool SECONDO_GIRO=false; |
2832 |
Long64_t irun_start = irun; |
// Long64_t irun_start = irun; |
2833 |
int offset_start = irunoffset[sel_tree->GetTreeNumber()]; |
int offset_start = irunoffset[sel_tree->GetTreeNumber()]; |
2834 |
while ( |
while ( |
2835 |
( |
( |
2855 |
cout << " obt "<<obt; |
cout << " obt "<<obt; |
2856 |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
2857 |
cout << " *** JUMP RUN *** irun "<<irun; |
cout << " *** JUMP RUN *** irun "<<irun; |
|
// if(!SECONDO_GIRO)cout << " (don't worry)"; |
|
|
// else cout << " (start worring...)"; |
|
2858 |
cout << endl; |
cout << endl; |
2859 |
} |
} |
2860 |
// irun++; |
// irun++; |
2886 |
cout << " obt "<<obt; |
cout << " obt "<<obt; |
2887 |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
cout <<" >> "<<GetRunInfo()->RUNHEADER_OBT<<" "<<GetRunInfo()->RUNTRAILER_OBT; |
2888 |
} |
} |
2889 |
cout << endl; |
if(DBG)cout << endl; |
2890 |
cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" (run-entry "<<irun<<")"<<endl; |
if(DBG)cout << endl << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" (run-entry "<<irun<<")"<<endl; |
2891 |
|
// ---------------------------------------------------- |
2892 |
|
// update the tracker parameters |
2893 |
|
// (non ho trovato nessun altro modo sicuro di farlo...) |
2894 |
|
// ---------------------------------------------------- |
2895 |
|
if(!dbc || (dbc && !dbc->IsConnected()) )SetDBConnection(); |
2896 |
|
TrkParams::Set(GetRunInfo() ,dbc); |
2897 |
|
if(dbc)dbc->Close(); |
2898 |
// cout << endl; |
// cout << endl; |
2899 |
prevshift = 0; |
prevshift = 0; |
2900 |
return true; |
return true; |
3966 |
// } |
// } |
3967 |
|
|
3968 |
if ( TRK0 ){ |
if ( TRK0 ){ |
3969 |
TrkParams::Load(6); |
// TrkParams::Load(6); |
3970 |
if( !TrkParams::IsLoaded(6) ){ |
// if( !TrkParams::IsLoaded(6) ){ |
3971 |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl; |
// cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- VK-mask not loaded"<<endl; |
3972 |
}; |
// }; |
3973 |
if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection(); |
// if(!dbc || (dbc && !dbc->IsConnected()))SetDBConnection(); |
3974 |
TrkParams::SetCalib(run_obj,dbc); |
TrkParams::SetCalib(run_obj,dbc); |
3975 |
TrkParams::LoadCalib( ); |
TrkParams::LoadCalib( ); |
3976 |
if( !TrkParams::CalibIsLoaded() ){ |
if( !TrkParams::CalibIsLoaded() ){ |
3977 |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl; |
cout << " TTree* PamLevel2::GetYodaTree( ) -- WARNING -- Calibration not loaded"<<endl; |
3978 |
}; |
}; |
3979 |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
// if(dbc)dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
3980 |
} |
} |
3981 |
|
|
3982 |
|
|
4045 |
do{ |
do{ |
4046 |
if(shift>0){ |
if(shift>0){ |
4047 |
cout << " PKTNUM L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
cout << " PKTNUM L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
4048 |
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; |
if(DBG)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; |
4049 |
cout << " L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl; |
if(DBG)cout << " L2 <--> L0 mismatch ( irun "<<irun<<" irunentry "<<irunentry<<" shift "<<shift<<" prevshift "<<prevshift<<" )"<<endl; |
4050 |
} |
} |
4051 |
answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift); |
answer = l0_tree->GetEntry(quellagiusta+(Long64_t)shift+(Long64_t)prevshift); |
4052 |
shift++; |
shift++; |
4079 |
&& (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
&& (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
4080 |
|
|
4081 |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
4082 |
cout << " Big trouble here, no such event in Level0 data! " <<endl; |
cout << " Big trouble here, no such event in Level0 data! (NB maxshift set to "<<maxshift<<" )" <<endl; |
4083 |
return 0; |
return 0; |
4084 |
} |
} |
4085 |
// cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl; |
// cout << "LA ENTRY GIUSTA E`: "<<quellagiusta<<" (spero...)"<<endl; |
4094 |
*/ |
*/ |
4095 |
Bool_t PamLevel2::SetDBConnection(){ |
Bool_t PamLevel2::SetDBConnection(){ |
4096 |
|
|
4097 |
|
// cout << "PamLevel2::SetDBConnection()" << endl; |
4098 |
if(DBG){ |
if(DBG){ |
4099 |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
4100 |
cout<<"Connecting to DB"<<endl; |
cout<<"Connecting to DB"<<endl; |