| 112 |
|
|
| 113 |
void PamLevel2::Initialize(){ |
void PamLevel2::Initialize(){ |
| 114 |
|
|
|
// 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(); |
|
|
|
|
| 115 |
h0_obj = 0; |
h0_obj = 0; |
| 116 |
trk0_obj = 0; |
trk0_obj = 0; |
| 117 |
calo0_obj = 0; |
calo0_obj = 0; |
| 186 |
|
|
| 187 |
SELLI = -1; |
SELLI = -1; |
| 188 |
|
|
| 189 |
|
ISGP = false; |
| 190 |
|
|
| 191 |
tsorted=0; |
tsorted=0; |
| 192 |
timage=0; |
timage=0; |
| 193 |
|
|
| 294 |
|
|
| 295 |
if(h0_obj) h0_obj->Clear(); |
if(h0_obj) h0_obj->Clear(); |
| 296 |
// if(trk0_obj) trk0_obj->Clear(); |
// if(trk0_obj) trk0_obj->Clear(); |
|
if(calo0_obj) calo0_obj->Clear(); |
|
| 297 |
if(trk1_obj) trk1_obj->Clear(); |
if(trk1_obj) trk1_obj->Clear(); |
| 298 |
if(trk2_obj) trk2_obj->Clear(); |
if(trk2_obj) trk2_obj->Clear(); |
| 299 |
if(trkh_obj) trkh_obj->Clear(); |
if(trkh_obj) trkh_obj->Clear(); |
| 300 |
|
if(calo0_obj) calo0_obj->Clear(); |
| 301 |
if(calo1_obj)calo1_obj->Clear(); |
if(calo1_obj)calo1_obj->Clear(); |
| 302 |
if(calo2_obj)calo2_obj->Clear(); |
if(calo2_obj)calo2_obj->Clear(); |
| 303 |
if(tof_obj) tof_obj->Clear(); |
if(tof_obj) tof_obj->Clear(); |
| 393 |
// |
// |
| 394 |
}; |
}; |
| 395 |
|
|
| 396 |
|
Bool_t PamLevel2::IsGood(){ |
| 397 |
|
Bool_t goodev=true; |
| 398 |
|
// if(trk2_obj && trk2_obj->UnpackError() != 0 ) goodev = false; |
| 399 |
|
if(calo2_obj && calo2_obj->good != 1) goodev = false; |
| 400 |
|
if(tof_obj && tof_obj->unpackError != 0) goodev = false; |
| 401 |
|
if(trig_obj && trig_obj->unpackError != 0) goodev = false; |
| 402 |
|
if(s4_obj && s4_obj->unpackError != 0) goodev = false; |
| 403 |
|
if(nd_obj && nd_obj->unpackError != 0) goodev = false; |
| 404 |
|
if(ac_obj && ac_obj->unpackError != 255) goodev = false; |
| 405 |
|
// if(orb_obj) |
| 406 |
|
return goodev; |
| 407 |
|
}; |
| 408 |
|
|
| 409 |
//-------------------------------------- |
//-------------------------------------- |
| 410 |
// |
// |
| 648 |
TClonesArray &ttimage = *timage; |
TClonesArray &ttimage = *timage; |
| 649 |
|
|
| 650 |
|
|
| 651 |
// loop over the tracks sorted by the tracker |
|
| 652 |
|
//-------------------------------------------------- |
| 653 |
|
// retrieve sorting method |
| 654 |
|
//-------------------------------------------------- |
| 655 |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
| 656 |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
| 657 |
Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); |
Bool_t use_TOF = how.Contains("TOF", TString::kIgnoreCase); |
| 665 |
}; |
}; |
| 666 |
|
|
| 667 |
// cout << "use_CAL "<<use_CAL<<" use_TOF "<<use_TOF<<" use_TRK "<<use_TRK <<endl; |
// cout << "use_CAL "<<use_CAL<<" use_TOF "<<use_TOF<<" use_TRK "<<use_TRK <<endl; |
| 668 |
|
|
| 669 |
|
|
| 670 |
|
//-------------------------------------------------- |
| 671 |
|
// loop over "physical" tracks sorted by the tracker |
| 672 |
|
//-------------------------------------------------- |
| 673 |
for(Int_t i=0; i < trk2_obj->TrkLevel2::GetNTracks(); i++){ |
for(Int_t i=0; i < trk2_obj->TrkLevel2::GetNTracks(); i++){ |
| 674 |
|
|
| 675 |
TrkTrack *ts = 0; |
TrkTrack *ts = 0; |
| 677 |
ToFTrkVar *os = 0; |
ToFTrkVar *os = 0; |
| 678 |
|
|
| 679 |
// get tracker tracks |
// get tracker tracks |
| 680 |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
| 681 |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
| 682 |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
| 683 |
|
|
| 684 |
TrkTrack *ti = 0; //tracker (image) |
TrkTrack *ti = 0; //tracker (image) |
| 685 |
CaloTrkVar *ci = 0; |
CaloTrkVar *ci = 0; |
| 686 |
ToFTrkVar *oi = 0; |
ToFTrkVar *oi = 0; |
| 687 |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
| 698 |
Int_t tp_score = 0; //main track sorted by the tracker |
Int_t tp_score = 0; //main track sorted by the tracker |
| 699 |
Int_t ti_score = 0; //image track |
Int_t ti_score = 0; //image track |
| 700 |
|
|
| 701 |
// ------------------------ |
// ----------------------------------------------------------------------------------------- |
| 702 |
// calorimeter check |
// calorimeter check |
| 703 |
// ------------------------ |
// ----------------------------------------------------------------------------------------- |
| 704 |
// check the Y spatial residual on the first calorimeter plane |
// check the Y spatial residual on the first calorimeter plane |
| 705 |
// (cut on calorimeter variables from Emiliano) |
// (cut on calorimeter variables from Emiliano) |
| 706 |
if( use_CAL && !calo2_obj ){ |
if( use_CAL && !calo2_obj ){ |
| 709 |
}; |
}; |
| 710 |
if( |
if( |
| 711 |
use_CAL && |
use_CAL && |
| 712 |
calo2_obj->npcfit[1] > 5 && //no. of fit planes on Y view |
// calo2_obj->npcfit[1] > 5 && //no. of fit planes on Y view |
| 713 |
calo2_obj->varcfit[1] < 1000. && //fit variance on Y view |
// calo2_obj->varcfit[1] < 1000. && //fit variance on Y view |
| 714 |
cp && ci && |
cp && ci && |
| 715 |
true){ |
true){ |
| 716 |
|
|
| 717 |
|
|
| 718 |
Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; |
// Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; |
| 719 |
Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; |
// Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; |
| 720 |
|
|
| 721 |
if(resy_p <= resy_i) tp_score++; |
// if(resy_p <= resy_i) tp_score++; |
| 722 |
else ti_score++; |
// else ti_score++; |
| 723 |
|
|
| 724 |
|
|
| 725 |
|
if( cp->npresh > ci->npresh) tp_score++; |
| 726 |
|
if( cp->npresh < ci->npresh) ti_score++; |
| 727 |
|
else ;//niente |
| 728 |
|
|
| 729 |
// cout << "CALO "<<tp_score<<ti_score<<endl; |
// cout << "CALO "<<tp_score<<ti_score<<endl; |
| 730 |
|
|
| 731 |
}; |
}; |
| 732 |
// ------------------------ |
// ----------------------------------------------------------------------------------------- |
| 733 |
// TOF check |
// TOF check |
| 734 |
// ------------------------ |
// ----------------------------------------------------------------------------------------- |
| 735 |
// check the number of hit pmts along the track |
// check the number of hit pmts along the track |
| 736 |
// on S12 S21 and S32, where paddles are parallel to Y axis |
// on S12 S21 and S32, where paddles are parallel to Y axis |
| 737 |
if( use_TOF && !tof_obj ){ |
if( use_TOF && !tof_obj ){ |
| 877 |
cout << "image: npmtadc "<< oi->npmtadc << endl; |
cout << "image: npmtadc "<< oi->npmtadc << endl; |
| 878 |
cout << "image: npmttdc "<< oi->npmttdc << endl;*/ |
cout << "image: npmttdc "<< oi->npmttdc << endl;*/ |
| 879 |
|
|
| 880 |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
// for (Int_t ih=0; ih < op->npmtadc; ih++){ |
| 881 |
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
// Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
| 882 |
if(pl == 1 || pl == 2 || pl == 5)nphit_p++; |
// if(pl == 1 || pl == 2 || pl == 5)nphit_p++; |
| 883 |
|
// }; |
| 884 |
|
|
| 885 |
|
// for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
| 886 |
|
// Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
| 887 |
|
// if(pl == 1 || pl == 2 || pl == 5)nphit_i++; |
| 888 |
|
// }; |
| 889 |
|
// --- modified to count tdc signals (more efficient?) |
| 890 |
|
// --- and to implement check on tdcflag |
| 891 |
|
for (Int_t ih=0; ih < op->npmttdc; ih++){ |
| 892 |
|
Int_t pl = tof_obj->GetPlaneIndex( (op->pmttdc).At(ih) ); |
| 893 |
|
// if( (op->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_p++; |
| 894 |
|
if( (op->tdcflag).At(ih)==0 )nphit_p++; |
| 895 |
}; |
}; |
| 896 |
|
|
| 897 |
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
for (Int_t ih=0; ih < oi->npmttdc; ih++){ |
| 898 |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmttdc).At(ih) ); |
| 899 |
if(pl == 1 || pl == 2 || pl == 5)nphit_i++; |
// if( (oi->tdcflag).At(ih)==0 && (pl == 1 || pl == 2 || pl == 5) )nphit_i++; |
| 900 |
|
if( (oi->tdcflag).At(ih)==0 )nphit_i++; |
| 901 |
}; |
}; |
| 902 |
|
|
| 903 |
if( |
if( |
|
use_TOF && |
|
| 904 |
(nphit_p+nphit_i) !=0 && |
(nphit_p+nphit_i) !=0 && |
| 905 |
true){ |
true){ |
| 906 |
|
|
| 907 |
if( nphit_p >= nphit_i) tp_score++; |
if ( nphit_p > nphit_i) tp_score++; |
| 908 |
else ti_score++; |
else if( nphit_p < nphit_i) ti_score++; |
| 909 |
|
else ;//niente |
| 910 |
}; |
}; |
| 911 |
}; |
}; |
| 912 |
// cout << "TOF "<<tp_score<<ti_score<<endl; |
// cout << "TOF "<<tp_score<<ti_score<<endl; |
| 913 |
}; |
}; |
| 914 |
if(tp_score == ti_score) use_TRK = true; |
|
| 915 |
// ------------------------ |
|
| 916 |
|
// if(tp_score == ti_score) use_TRK = true; |
| 917 |
|
|
| 918 |
|
|
| 919 |
|
// ----------------------------------------------------------------------------------------- |
| 920 |
// tracker check |
// tracker check |
| 921 |
// ------------------------ |
// ----------------------------------------------------------------------------------------- |
| 922 |
// chi**2 difference is not always large enough to distinguish among |
// chi**2 difference is not always large enough to distinguish among |
| 923 |
// the real track and its image. |
// the real track and its image. |
| 924 |
// Tracker check will be applied always when calorimeter and tof information is ambiguous. |
// Tracker check will be applied always when calorimeter and tof information is ambiguous. |
| 925 |
|
// *** MODIFIED ON AUGUST 2007 *** |
| 926 |
if(use_TRK){ |
if(use_TRK){ |
| 927 |
if( tp->chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; |
// if( tp->chi2 > 0 && tp->chi2 < ti->chi2 ) tp_score++ ; |
| 928 |
else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; |
// else if( ti->chi2 > 0 && ti->chi2 < tp->chi2 ) ti_score++ ; |
| 929 |
|
|
| 930 |
|
// CHECK 1 : number of points along X |
| 931 |
|
if ( tp->GetNX() >= ti->GetNX() )tp_score++ ; |
| 932 |
|
if ( tp->GetNX() <= ti->GetNX() )ti_score++ ; |
| 933 |
|
// CHECK 2 : number of points along Y |
| 934 |
|
if ( tp->GetNY() >= ti->GetNY() )tp_score++ ; |
| 935 |
|
if ( tp->GetNY() <= ti->GetNY() )ti_score++ ; |
| 936 |
|
// CHECK 3 : chi**2 along X |
| 937 |
|
// if( tp->GetChi2X() > 0 && (tp->GetChi2X() < ti->GetChi2X() || ti->GetChi2X() <=0) ) tp_score++ ; |
| 938 |
|
// if( ti->GetChi2X() > 0 && (ti->GetChi2X() < tp->GetChi2X() || tp->GetChi2X() <=0) ) ti_score++ ; |
| 939 |
|
// CHECK 4 : chi**2 along Y |
| 940 |
|
// if( tp->GetChi2Y() > 0 && (tp->GetChi2Y() < ti->GetChi2Y() || ti->GetChi2Y() <=0) ) tp_score++ ; |
| 941 |
|
// if( ti->GetChi2Y() > 0 && (ti->GetChi2Y() < tp->GetChi2Y() || tp->GetChi2Y() <=0) ) ti_score++ ; |
| 942 |
|
// CHECK 5 : total chi**2 |
| 943 |
|
// if( tp->chi2 > 0 && (tp->chi2 < ti->chi2 || ti->chi2 <=0) ) tp_score++ ; |
| 944 |
|
// if( ti->chi2 > 0 && (ti->chi2 < tp->chi2 || tp->chi2 <=0) ) ti_score++ ; |
| 945 |
|
|
| 946 |
// cout << "TRK "<<tp_score<<ti_score<<endl; |
// cout << "TRK "<<tp_score<<ti_score<<endl; |
| 947 |
}; |
}; |
| 948 |
|
|
| 949 |
// ------------------------ |
|
| 950 |
|
|
| 951 |
|
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |
| 952 |
// the winner is.... |
// the winner is.... |
| 953 |
// ------------------------ |
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |
| 954 |
if (tp_score > ti_score) { |
if (tp_score > ti_score) { |
| 955 |
// ts = tp;//the track sorted by the tracker!! |
|
|
// cs = cp; |
|
|
// os = op; |
|
|
// cout << "It's primary!" << endl; |
|
| 956 |
|
|
| 957 |
}else if (tp_score < ti_score) { |
}else if (tp_score < ti_score) { |
| 958 |
|
|
|
// cout << "It's image!" << endl; |
|
| 959 |
|
|
| 960 |
ts = ti;//its image!! |
ts = ti;//its image!! |
| 961 |
cs = ci; |
cs = ci; |
| 971 |
|
|
| 972 |
|
|
| 973 |
}else { |
}else { |
| 974 |
// ts = tp; |
|
| 975 |
// cs = cp; |
// cout << "Warning - track image ambiguity not solved" << endl; |
| 976 |
// os = op; |
|
|
cout << "Warning - track image ambiguity not solved" << endl; |
|
|
// cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; |
|
| 977 |
}; |
}; |
| 978 |
|
|
| 979 |
}else{ |
}else{ |
| 1908 |
// |
// |
| 1909 |
// the absolute time is necessary to relate the event with the run |
// the absolute time is necessary to relate the event with the run |
| 1910 |
// |
// |
| 1911 |
if( !GetOrbitalInfo() ){ |
if( !GetOrbitalInfo() && !ISGP){ |
| 1912 |
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; |
| 1913 |
return(false); |
return(false); |
| 1914 |
} |
} |
| 1915 |
|
|
| 1916 |
|
ULong64_t abstime = 0; |
| 1917 |
|
if( GetOrbitalInfo() )abstime=GetOrbitalInfo()->absTime; |
| 1918 |
|
|
| 1919 |
|
|
| 1920 |
// |
// |
| 1921 |
// 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 |
| 1922 |
// |
// |
| 1926 |
runfirstentry = 0LL; |
runfirstentry = 0LL; |
| 1927 |
runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); |
runlastentry += (Long64_t)(this->GetRunInfo()->NEVENTS); |
| 1928 |
if ( (Long64_t)(this->GetRunInfo()->NEVENTS) > 0LL ) runlastentry -= 1LL; |
if ( (Long64_t)(this->GetRunInfo()->NEVENTS) > 0LL ) runlastentry -= 1LL; |
| 1929 |
|
|
| 1930 |
|
if( ISGP && run->GetEntries()!=1 ){ |
| 1931 |
|
cout << "** WARNING ** simulated files are assumed to have 1 single run, not "<< run->GetEntries() << endl; |
| 1932 |
|
cout << "** WARNING ** run will not be updated"<<endl; |
| 1933 |
|
} |
| 1934 |
|
|
| 1935 |
}; |
}; |
| 1936 |
// |
// |
| 1937 |
if ( irun == run->GetEntries()-1LL && |
if(ISGP)abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO |
| 1938 |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
// |
| 1939 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
if ( irun == run->GetEntries()-1LL && |
| 1940 |
|
!(abstime >= GetRunInfo()->RUNHEADER_TIME && |
| 1941 |
|
abstime <= GetRunInfo()->RUNTRAILER_TIME) |
| 1942 |
){ |
){ |
| 1943 |
irun = -1LL; |
irun = -1LL; |
| 1944 |
runfirstentry = 0LL; |
runfirstentry = 0LL; |
| 1949 |
// |
// |
| 1950 |
bool fromfirst = true; |
bool fromfirst = true; |
| 1951 |
// |
// |
| 1952 |
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 ){ |
| 1953 |
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
// while ( iev > (runfirstentry+(ULong64_t)(this->GetRunInfo()->NEVENTS-1)) && irun < run->GetEntries() ){ |
| 1954 |
irun++; |
irun++; |
| 1955 |
run->GetEntry(irun); |
run->GetEntry(irun); |
| 1959 |
// cout << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
// cout << " ))))) UPDATE RUN INFO ((((( @iev "<<iev<<" run "<<GetRunInfo()->ID<<" irun "<<irun<<endl; |
| 1960 |
// cout << "runfirstentry "<<runfirstentry<<endl; |
// cout << "runfirstentry "<<runfirstentry<<endl; |
| 1961 |
// 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))); |
| 1962 |
// printf(" abstime %u trailertime %u \n",GetOrbitalInfo()->absTime,GetRunInfo()->RUNTRAILER_TIME); |
// printf(" abstime %u trailertime %u \n",abstime,GetRunInfo()->RUNTRAILER_TIME); |
| 1963 |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
| 1964 |
// |
// |
| 1965 |
// prevshift = 0; |
// prevshift = 0; |
| 1966 |
// |
// |
| 1967 |
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)){ |
| 1968 |
printf(" resetting irun (it should NOT happen!!!)\n"); |
printf(" resetting irun (it should NOT happen!!!)\n"); |
| 1969 |
fromfirst = false; |
fromfirst = false; |
| 1970 |
irun = 0; |
irun = 0; |
| 1977 |
}; |
}; |
| 1978 |
// |
// |
| 1979 |
if ( |
if ( |
| 1980 |
!(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && |
!(abstime >= GetRunInfo()->RUNHEADER_TIME && |
| 1981 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) |
abstime <= GetRunInfo()->RUNTRAILER_TIME) |
| 1982 |
) { |
) { |
| 1983 |
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 %u \n",abstime); |
| 1984 |
return false; |
return false; |
| 1985 |
} |
} |
| 1986 |
// |
// |
| 2031 |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- |
| 2032 |
if(SELLI==0){ |
if(SELLI==0){ |
| 2033 |
|
|
| 2034 |
|
ULong64_t abstime = 0; |
| 2035 |
|
ULong64_t obt = 0; |
| 2036 |
|
if( GetOrbitalInfo() ){ |
| 2037 |
|
abstime = GetOrbitalInfo()->absTime; |
| 2038 |
|
obt = GetOrbitalInfo()->OBT; |
| 2039 |
|
} |
| 2040 |
// --------------------------------------------------------------- |
// --------------------------------------------------------------- |
| 2041 |
// the absolute time is necessary to relate the event with the run |
// the absolute time is necessary to relate the event with the run |
| 2042 |
// --------------------------------------------------------------- |
// --------------------------------------------------------------- |
| 2043 |
if( !GetOrbitalInfo() ){ |
if( !GetOrbitalInfo() && !ISGP ){ |
| 2044 |
cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
cout << "Bool_t PamLevel2::UpdateRunInfo(Long64_t iev) -- ERROR -- missing OrbitalInfo "<<endl; |
| 2045 |
return(false); |
return(false); |
| 2046 |
} |
} |
| 2050 |
// ----------------------------------------------------------------------- |
// ----------------------------------------------------------------------- |
| 2051 |
if ( irun < 0 ){ |
if ( irun < 0 ){ |
| 2052 |
irun = 0LL; |
irun = 0LL; |
| 2053 |
|
irunentry = 0; |
| 2054 |
|
prevshift = 0; |
| 2055 |
run_tree->GetEntry(irun); |
run_tree->GetEntry(irun); |
| 2056 |
|
|
| 2057 |
|
if( ISGP && run_tree->GetEntries()!=1 ){ |
| 2058 |
|
cout << "** WARNING ** simulated files are assumed to have 1 single run, not "<< run_tree->GetEntries() << endl; |
| 2059 |
|
cout << "** WARNING ** run will not be updated"<<endl; |
| 2060 |
|
} |
| 2061 |
}; |
}; |
| 2062 |
|
|
| 2063 |
|
// ----------------------------------------------------------------------- |
| 2064 |
|
// if it is simulation, assigh abstime by end (temporaneo!!!) |
| 2065 |
|
// ----------------------------------------------------------------------- |
| 2066 |
|
if(ISGP){ |
| 2067 |
|
abstime = GetRunInfo()->RUNHEADER_TIME; // BARBATRUCCO |
| 2068 |
|
obt = GetRunInfo()->RUNHEADER_OBT; // BARBATRUCCO |
| 2069 |
|
} |
| 2070 |
// |
// |
| 2071 |
bool fromfirst = true; // first loop over runs |
bool fromfirst = true; // first loop over runs |
| 2072 |
|
|
| 2073 |
|
// Bool_t hasfrag = false; |
| 2074 |
|
// if( GetRunInfo()->ID_RUN_FRAG!=0 && GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID)hasfrag=true; |
| 2075 |
|
// ULong64_t fragid = GetRunInfo()->ID_RUN_FRAG; |
| 2076 |
|
|
| 2077 |
// ------------------------------------------------------ |
// ------------------------------------------------------ |
| 2078 |
// loop over runs to find the one that contains the event |
// loop over runs to find the one that contains the event |
| 2079 |
// ------------------------------------------------------ |
// ------------------------------------------------------ |
| 2080 |
while ( !(GetOrbitalInfo()->absTime >= GetRunInfo()->RUNHEADER_TIME && // check on absolute time (s) |
while ( |
| 2081 |
GetOrbitalInfo()->absTime <= GetRunInfo()->RUNTRAILER_TIME) && |
( |
| 2082 |
!(GetOrbitalInfo()->OBT >= GetRunInfo()->RUNHEADER_OBT && // additional check on OBT (ms) |
( |
| 2083 |
GetOrbitalInfo()->OBT <= GetRunInfo()->RUNTRAILER_OBT) && |
!(abstime >= GetRunInfo()->RUNHEADER_TIME && // check on absolute time (s) |
| 2084 |
irun < run_tree->GetEntries() ){ |
abstime <= GetRunInfo()->RUNTRAILER_TIME) && |
| 2085 |
|
!(obt >= GetRunInfo()->RUNHEADER_OBT && // additional check on OBT (ms) |
| 2086 |
|
obt <= GetRunInfo()->RUNTRAILER_OBT) |
| 2087 |
|
) |
| 2088 |
|
|| GetRunInfo()->NEVENTS==0 |
| 2089 |
|
|| !(irunentry < GetRunInfo()->NEVENTS-1-prevshift) |
| 2090 |
|
) |
| 2091 |
|
&& irun < run_tree->GetEntries() ){ |
| 2092 |
|
|
| 2093 |
irun++; |
irun++; |
| 2094 |
// ------------------------------------ |
// ------------------------------------ |
| 2095 |
// if the end of run tree is reached... |
// if the end of run tree is reached... |
| 2115 |
// save the index of the first entry of the run, relative to pam_tree, |
// save the index of the first entry of the run, relative to pam_tree, |
| 2116 |
// and read a new run |
// and read a new run |
| 2117 |
// ------------------------------------------------------------------- |
// ------------------------------------------------------------------- |
| 2118 |
if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS); |
if(irun>0)runfirstentry += (GetRunInfo()->NEVENTS)-prevshift; |
| 2119 |
|
irunentry = 0; |
| 2120 |
|
prevshift = 0; |
| 2121 |
run_tree->GetEntry(irun); |
run_tree->GetEntry(irun); |
| 2122 |
if(GetRunInfo()->RUNHEADER_OBT>=GetRunInfo()->RUNTRAILER_OBT ){ |
if(GetRunInfo()->RUNHEADER_OBT>GetRunInfo()->RUNTRAILER_OBT ){ |
| 2123 |
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; |
| 2124 |
cout << " (NB!! in this case some events are assigned to a wrong run)"<<endl; |
cout << " (NB!! in this case some events are assigned to a wrong run)"<<endl; |
| 2125 |
} |
} |
| 2126 |
|
// if(hasfrag && fragid != GetRunInfo()->ID){ |
| 2127 |
|
// cout << "... where is the next fragment ??"<<endl; |
| 2128 |
|
// } |
| 2129 |
}; |
}; |
| 2130 |
|
|
| 2131 |
|
|
| 2132 |
// -------------------------------------- |
// -------------------------------------- |
| 2133 |
// if there was no need to update the run |
// if there was no need to update the run |
| 2134 |
// ---> exit with FALSE |
// ---> exit with FALSE |
| 2140 |
// ---> exit with TRUE |
// ---> exit with TRUE |
| 2141 |
// -------------------------------------- |
// -------------------------------------- |
| 2142 |
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; |
| 2143 |
prevshift = 0; |
// ---------------------------------------------------- |
| 2144 |
|
// then check if the run has a fragment |
| 2145 |
|
// in this case we have to switch to the next fragment |
| 2146 |
|
// when the end of the first fragment is reached |
| 2147 |
|
// ---------------------------------------------------- |
| 2148 |
|
if( |
| 2149 |
|
GetRunInfo()->ID_RUN_FRAG != 0 && |
| 2150 |
|
// GetRunInfo()->ID_RUN_FRAG != GetRunInfo()->ID && |
| 2151 |
|
true ){ |
| 2152 |
|
cout << "* fragment *"<<endl; |
| 2153 |
|
} |
| 2154 |
|
|
| 2155 |
return(true); |
return(true); |
| 2156 |
}; |
}; |
| 2157 |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- |
| 2800 |
*/ |
*/ |
| 2801 |
void PamLevel2::CreateCloneTrees(TFile *ofile){ |
void PamLevel2::CreateCloneTrees(TFile *ofile){ |
| 2802 |
|
|
| 2803 |
|
|
| 2804 |
|
// if the pointer is null, create a default file |
| 2805 |
|
|
| 2806 |
|
if(!ofile){ |
| 2807 |
|
cout << "void PamLevel2::CreateCloneTrees(TFile*) -- WARNING -- Creating file: clone-tree.root "<<endl; |
| 2808 |
|
ofile = new TFile("clone-tree.root","recreate"); |
| 2809 |
|
} |
| 2810 |
|
|
| 2811 |
ofile->cd(); |
ofile->cd(); |
| 2812 |
|
|
| 2813 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
| 2977 |
//Int_t PamLevel2::GetEntry(Int_t iee){ |
//Int_t PamLevel2::GetEntry(Int_t iee){ |
| 2978 |
Int_t PamLevel2::GetEntry(Long64_t iee){ |
Int_t PamLevel2::GetEntry(Long64_t iee){ |
| 2979 |
|
|
| 2980 |
|
// cout << "-------------------------------------"<<endl; |
| 2981 |
|
// cout << "Int_t PamLevel2::GetEntry("<<iee<<")"<<endl; |
| 2982 |
|
|
| 2983 |
if(!pam_tree){ |
if(!pam_tree){ |
| 2984 |
cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- level2 trees not loaded"<<endl; |
cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- level2 trees not loaded"<<endl; |
| 2985 |
return 0; |
return 0; |
| 3025 |
|
|
| 3026 |
// cout << "PamLevel2::GetEntry("<<iee<<") "<<irun<<" "<<runfirstentry<<" "<<irunentry<<endl; |
// cout << "PamLevel2::GetEntry("<<iee<<") "<<irun<<" "<<runfirstentry<<" "<<irunentry<<endl; |
| 3027 |
|
|
| 3028 |
// cout << " irunentry "<<irunentry << endl; |
// cout << "irunentry "<<irunentry << endl; |
| 3029 |
|
// cout << "runfirstentry "<<runfirstentry << endl; |
| 3030 |
|
// cout << "nevents "<<GetRunInfo()->NEVENTS<< endl; |
| 3031 |
|
|
| 3032 |
|
// if( TRK0 || CAL0 || TOF0 ){ |
| 3033 |
|
// if( !GetYodaEntry( ) ){ |
| 3034 |
|
// cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- error reading level0 tree"<<endl; |
| 3035 |
|
// return 0; |
| 3036 |
|
// } |
| 3037 |
|
// } |
| 3038 |
|
|
| 3039 |
|
|
|
if( TRK0 || CAL0 || TOF0 ){ |
|
|
if( !GetYodaEntry( ) ){ |
|
|
cout << " Int_t PamLevel2::GetEntry(Int_t) -- ERROR -- error reading level0 tree"<<endl; |
|
|
return 0; |
|
|
} |
|
|
} |
|
| 3040 |
return 1; |
return 1; |
| 3041 |
|
|
| 3042 |
} |
} |
| 3043 |
|
|
| 3044 |
|
TrkLevel0 *PamLevel2::GetTrkLevel0(){ |
| 3045 |
|
if( !TRK0 )return NULL; |
| 3046 |
|
if( !GetYodaEntry( ) ){ |
| 3047 |
|
cout << " Int_t PamLevel2::GetTrkLevel0() -- ERROR -- error reading level0 tree"<<endl; |
| 3048 |
|
return 0; |
| 3049 |
|
} |
| 3050 |
|
return trk0_obj; |
| 3051 |
|
}; |
| 3052 |
|
CaloLevel0 *PamLevel2::GetCaloLevel0(){ |
| 3053 |
|
if( !CAL0 )return NULL; |
| 3054 |
|
if( !GetYodaEntry( ) ){ |
| 3055 |
|
cout << " Int_t PamLevel2::GetCaloLevel0() -- ERROR -- error reading level0 tree"<<endl; |
| 3056 |
|
return 0; |
| 3057 |
|
} |
| 3058 |
|
return calo0_obj; |
| 3059 |
|
}; |
| 3060 |
|
|
| 3061 |
|
|
| 3062 |
/** |
/** |
| 3063 |
* Method to retrieve the level0 tree (YODA tree) that contains the current event. |
* Method to retrieve the level0 tree (YODA tree) that contains the current event. |
| 3064 |
* Given the run ID (...), if needed it query the DB and load the proper file. |
* Given the run ID (...), if needed it query the DB and load the proper file. |
| 3078 |
return NULL; |
return NULL; |
| 3079 |
} |
} |
| 3080 |
Int_t irootnew = run_obj->ID_ROOT_L0; |
Int_t irootnew = run_obj->ID_ROOT_L0; |
| 3081 |
// cout << "iroot "<<iroot<<endl; |
// cout << "iroot "<<iroot<<endl; |
| 3082 |
// cout << "irootnew "<<irootnew<<endl; |
// cout << "irootnew "<<irootnew<<endl; |
| 3083 |
|
|
| 3084 |
//=================================== |
//=================================== |
| 3085 |
// load the level0 file |
// load the level0 file |
| 3136 |
}; |
}; |
| 3137 |
l0_tree->SetBranchAddress("Tracker" ,trk0_obj->GetPointerToTrackerEvent()); |
l0_tree->SetBranchAddress("Tracker" ,trk0_obj->GetPointerToTrackerEvent()); |
| 3138 |
} |
} |
| 3139 |
//--------------------------------------------------- |
//-------------------------------------------------- |
| 3140 |
// CALORIMETER: |
// CALORIMETER: |
| 3141 |
if(CAL0){ |
if(CAL0){ |
| 3142 |
if(!calo0_obj){ |
if(!calo0_obj){ |
| 3199 |
|
|
| 3200 |
// 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; |
| 3201 |
// 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; |
| 3202 |
// cout << " time "<< GetOrbitalInfo()->absTime << endl; |
// cout << " time "<< abstime << endl; |
| 3203 |
// cout << " trk_calib_used "<<run_obj->TRK_CALIB_USED<< endl; |
// cout << " trk_calib_used "<<run_obj->TRK_CALIB_USED<< endl; |
| 3204 |
|
|
| 3205 |
if( !GetOrbitalInfo() ){ |
ULong64_t obt = 0; |
| 3206 |
|
ULong64_t pktn = 0; |
| 3207 |
|
if( GetOrbitalInfo() ){ |
| 3208 |
|
obt = GetOrbitalInfo()->OBT; |
| 3209 |
|
pktn = GetOrbitalInfo()->pkt_num; |
| 3210 |
|
} |
| 3211 |
|
|
| 3212 |
|
if( !GetOrbitalInfo() && !ISGP){ |
| 3213 |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing OrbitalInfo "<<endl; |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing OrbitalInfo "<<endl; |
| 3214 |
return 0; |
return 0; |
| 3215 |
} |
} |
| 3216 |
if( GetOrbitalInfo()->OBT==0 && GetOrbitalInfo()->pkt_num==0 ){ |
if( obt==0 && pktn==0 && !ISGP ){ |
| 3217 |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- level2 event corrupted ?? "<<endl; |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- level2 event corrupted ?? "<<endl; |
| 3218 |
return 0; |
return 0; |
| 3219 |
} |
} |
| 3232 |
Int_t answer = 0; |
Int_t answer = 0; |
| 3233 |
Int_t shift =0; |
Int_t shift =0; |
| 3234 |
// printf(" siamo qui %i %i \n",shift,prevshift); |
// printf(" siamo qui %i %i \n",shift,prevshift); |
| 3235 |
Int_t maxshift = 100; |
Int_t maxshift = 10; |
| 3236 |
do{ |
do{ |
| 3237 |
if(shift>0){ |
if(shift>0){ |
| 3238 |
cout << " PKTNUM L2 --- "<< GetOrbitalInfo()->pkt_num << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
cout << " PKTNUM L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
| 3239 |
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; |
| 3240 |
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; |
| 3241 |
} |
} |
| 3245 |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing EventHeader "<<endl; |
cout << "Int_t PamLevel2::GetYodaEntry() -- ERROR -- missing EventHeader "<<endl; |
| 3246 |
return 0; |
return 0; |
| 3247 |
} |
} |
| 3248 |
// cout << "PKTNUM "<<shift<<" == L2 --- "<< GetOrbitalInfo()->pkt_num << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
|
| 3249 |
// cout << " L2 --- "<< GetOrbitalInfo()->OBT << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime()<<endl; |
if(ISGP){ |
| 3250 |
|
obt = (UInt_t)(GetEventHeader()->GetPscuHeader()->GetOrbitalTime()); //BARBATRUCCO |
| 3251 |
|
pktn = (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter()); //BARBATRUCCO |
| 3252 |
|
} |
| 3253 |
|
|
| 3254 |
|
// cout << "PKTNUM "<<shift<<" == L2 --- "<< pktn << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetCounter()<<endl; |
| 3255 |
|
// cout << " L2 --- "<< obt << " --- L0 --- "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime()<<endl; |
| 3256 |
// 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; |
| 3257 |
// cout << " GetOrbitalInfo()->OBT "<< GetOrbitalInfo()->OBT << endl; |
// cout << " obt "<< obt << endl; |
| 3258 |
// cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl; |
// cout << " GetEventHeader()->GetPscuHeader()->GetOrbitalTime() "<< GetEventHeader()->GetPscuHeader()->GetOrbitalTime() << endl; |
| 3259 |
// cout << " GetOrbitalInfo()->pkt_num "<< GetOrbitalInfo()->pkt_num << endl; |
// cout << " pktn "<< pktn << endl; |
| 3260 |
// cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl; |
// cout << " GetEventHeader()->GetPscuHeader()->GetCounter() "<< GetEventHeader()->GetPscuHeader()->GetCounter() << endl; |
| 3261 |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
// printf(" IDRUN %u \n",GetRunInfo()->ID); |
| 3262 |
// |
// |
| 3265 |
shift = -1; |
shift = -1; |
| 3266 |
}; |
}; |
| 3267 |
|
|
| 3268 |
}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()) || |
| 3269 |
|
pktn != (UInt_t)(GetEventHeader()->GetPscuHeader()->GetCounter()) ) |
| 3270 |
|
&& (quellagiusta+(Long64_t)shift) < GetYodaTree()->GetEntries() && shift < maxshift); |
| 3271 |
|
|
| 3272 |
if ( (quellagiusta+(Long64_t)shift) == GetYodaTree()->GetEntries() || shift == maxshift ) { |
if ( (quellagiusta+(Long64_t)shift+(Long64_t)prevshift) > GetYodaTree()->GetEntries() || shift == maxshift ) { |
| 3273 |
cout << " Big trouble here, no such event in Level0 data! " <<endl; |
cout << " Big trouble here, no such event in Level0 data! " <<endl; |
| 3274 |
return 0; |
return 0; |
| 3275 |
} |
} |
| 3280 |
return answer; |
return answer; |
| 3281 |
|
|
| 3282 |
} |
} |
| 3283 |
|
/** |
| 3284 |
|
* \Brief Set DB connection |
| 3285 |
|
*/ |
| 3286 |
|
Bool_t PamLevel2::SetDBConnection(){ |
| 3287 |
|
|
| 3288 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
| 3289 |
|
cout<<"Connecting to DB"<<endl; |
| 3290 |
|
cout<<"HOST "<<host<<endl; |
| 3291 |
|
cout<<"USER "<<user<<endl; |
| 3292 |
|
cout<<"PSW "<<psw<<endl; |
| 3293 |
|
dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
| 3294 |
|
if( !dbc )return false; |
| 3295 |
|
if( !dbc->IsConnected() )return false; |
| 3296 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
| 3297 |
|
return true; |
| 3298 |
|
|
| 3299 |
|
} |