| 101 |
if (INSERT_RAW) SetRawName(filerawname); |
if (INSERT_RAW) SetRawName(filerawname); |
| 102 |
// |
// |
| 103 |
INSERT_ROOT = !filerootname.IsNull(); |
INSERT_ROOT = !filerootname.IsNull(); |
| 104 |
|
if ( INSERT_ROOT ) this->SetRootName(filerootname); |
| 105 |
this->SetOrbitNo(dwinput); |
this->SetOrbitNo(dwinput); |
| 106 |
// |
// |
| 107 |
this->SetID_RAW(0); |
this->SetID_RAW(0); |
| 190 |
throw -85; |
throw -85; |
| 191 |
}; |
}; |
| 192 |
filerootname = chpath + chfile;// + ".root"; |
filerootname = chpath + chfile;// + ".root"; |
|
if ( debug ) printf(" chewbacca: filename is %s \n",filerootname.Data()); |
|
| 193 |
}; |
}; |
| 194 |
this->SetRootName(filerootname); |
this->SetRootName(filerootname); |
|
file = TFile::Open(this->GetRootName().Data()); |
|
|
} else { |
|
|
this->SetRootName(""); |
|
| 195 |
}; |
}; |
| 196 |
|
if ( debug ) printf(" Filename is %s \n",filerootname.Data()); |
| 197 |
|
file = TFile::Open(this->GetRootName().Data()); |
| 198 |
|
// } else { |
| 199 |
|
// this->SetRootName(""); |
| 200 |
|
// this->SetRootName(filerootname); |
| 201 |
|
// }; |
| 202 |
} |
} |
| 203 |
|
|
| 204 |
// |
// |
| 398 |
return; |
return; |
| 399 |
}; |
}; |
| 400 |
// |
// |
| 401 |
TString name = this->GetRootFile(); |
if ( !chewbacca ){ |
| 402 |
Int_t nlength = name.Length(); |
TString name = this->GetRootFile(); |
| 403 |
if ( nlength < 5 ) return; |
Int_t nlength = name.Length(); |
| 404 |
TString dwo = 0; |
if ( nlength < 5 ){ |
| 405 |
for (Int_t i = 0; i<5; i++){ |
if ( IsDebug() ) printf(" Agh problems determining the orbit number! name = %s \n",name.Data()); |
| 406 |
dwo.Append(name[i],1); |
return; |
| 407 |
}; |
}; |
| 408 |
if ( dwo.IsDigit() ){ |
TString dwo = 0; |
| 409 |
dworbit = (UInt_t)dwo.Atoi(); |
for (Int_t i = 0; i<5; i++){ |
|
} else { |
|
|
dwo=""; |
|
|
for (Int_t i = 8; i<13; i++){ |
|
| 410 |
dwo.Append(name[i],1); |
dwo.Append(name[i],1); |
| 411 |
}; |
}; |
| 412 |
if ( dwo.IsDigit() ) dworbit = (UInt_t)dwo.Atoi(); |
if ( dwo.IsDigit() ){ |
| 413 |
|
dworbit = (UInt_t)dwo.Atoi(); |
| 414 |
|
} else { |
| 415 |
|
dwo=""; |
| 416 |
|
for (Int_t i = 8; i<13; i++){ |
| 417 |
|
dwo.Append(name[i],1); |
| 418 |
|
}; |
| 419 |
|
if ( dwo.IsDigit() ) dworbit = (UInt_t)dwo.Atoi(); |
| 420 |
|
}; |
| 421 |
|
if ( IsDebug() ) printf(" Downlink orbit is %i (dwo = %s) \n",dworbit,dwo.Data()); |
| 422 |
}; |
}; |
|
if ( IsDebug() ) printf(" Downlink orbit is %i (dwo = %s) \n",dworbit,dwo.Data()); |
|
| 423 |
return; |
return; |
| 424 |
}; |
}; |
| 425 |
|
|
| 1585 |
result = conn->Query(oss.str().c_str()); |
result = conn->Query(oss.str().c_str()); |
| 1586 |
if ( !result ) throw -10; |
if ( !result ) throw -10; |
| 1587 |
row = result->Next(); |
row = result->Next(); |
| 1588 |
|
if ( !row ) throw -92; |
| 1589 |
idresof = (UInt_t)atoll(row->GetField(0)); |
idresof = (UInt_t)atoll(row->GetField(0)); |
| 1590 |
existsts = true; |
existsts = true; |
| 1591 |
goto eout; |
goto eout; |
| 2248 |
ptht = cod->Get(pctp->RunHeader) - 1; |
ptht = cod->Get(pctp->RunHeader) - 1; |
| 2249 |
// evbeft = cod->Get(pctp->Physics); |
// evbeft = cod->Get(pctp->Physics); |
| 2250 |
tcod = (UInt_t)cod->Get(pctp->Physics); |
tcod = (UInt_t)cod->Get(pctp->Physics); |
| 2251 |
if ( !tcod ) tcod = 1; |
// if ( !tcod ) tcod = 1; // IS A BUG SINCE RUNS WITH ZERO EVENTS WILL LOOK LIKE RUNS WITH ONE EVENT |
| 2252 |
evbeft = TMath::Min(upperentry,(tcod-1)); |
evbeft = TMath::Min(upperentry,(tcod-1)); |
| 2253 |
if ( debug ) printf(" Loop in runtrailers, evbeft is %u upperentry %u cod->getetc %u \n",evbeft,upperentry,cod->Get(pctp->Physics)); |
if ( debug ) printf(" Loop in runtrailers, evbeft is %u upperentry %u cod->getetc %u \n",evbeft,upperentry,cod->Get(pctp->Physics)); |
| 2254 |
// |
// |
| 2287 |
obth = phh->GetOrbitalTime(); |
obth = phh->GetOrbitalTime(); |
| 2288 |
cod = ehh->GetCounter(); |
cod = ehh->GetCounter(); |
| 2289 |
tcod = (UInt_t)cod->Get(pctp->Physics); |
tcod = (UInt_t)cod->Get(pctp->Physics); |
| 2290 |
if ( !tcod ) tcod = 1; |
// if ( !tcod ) tcod = 1; // IS A BUG SINCE RUNS WITH ZERO EVENTS WILL LOOK LIKE RUNS WITH ONE EVENT |
| 2291 |
evbefh = TMath::Max(chminentry,(tcod-1)); |
evbefh = TMath::Max(chminentry,(tcod-1)); |
| 2292 |
// |
// |
| 2293 |
if ( PKT(pkth) >= PKT(pktfirst) && PKT(pkth) <= upperpkt ){ |
if ( PKT(pkth) >= PKT(pktfirst) && PKT(pkth) <= upperpkt ){ |
| 2349 |
cod = ehh->GetCounter(); |
cod = ehh->GetCounter(); |
| 2350 |
// evbeft = cod->Get(pctp->Physics); |
// evbeft = cod->Get(pctp->Physics); |
| 2351 |
tcod = (UInt_t)cod->Get(pctp->Physics); |
tcod = (UInt_t)cod->Get(pctp->Physics); |
| 2352 |
if ( !tcod ) tcod = 1; |
// if ( !tcod ) tcod = 1; // IS A BUG SINCE RUNS WITH ZERO EVENTS WILL LOOK LIKE RUNS WITH ONE EVENT |
| 2353 |
evbeft = TMath::Min(upperentry,(tcod-1)); |
evbeft = TMath::Min(upperentry,(tcod-1)); |
| 2354 |
rh->GetEntry(pth); |
rh->GetEntry(pth); |
| 2355 |
phh = ehh->GetPscuHeader(); |
phh = ehh->GetPscuHeader(); |
| 2391 |
// if ( conptt+1 == (nrtev+nrtbef )){ |
// if ( conptt+1 == (nrtev+nrtbef )){ |
| 2392 |
if ( IsDebug() ) printf(" >>>>>>>>>>> %i %u %i %u \n",ptht,rhev,nrtev,conptt); |
if ( IsDebug() ) printf(" >>>>>>>>>>> %i %u %i %u \n",ptht,rhev,nrtev,conptt); |
| 2393 |
ptht++; |
ptht++; |
| 2394 |
if ( ptht < rhev ){ |
if ( ptht < rhev ){ |
| 2395 |
rh->GetEntry(ptht); |
rh->GetEntry(ptht); |
| 2396 |
//pth++; |
//pth++; |
| 2397 |
//if ( pth < rhev ){ |
//if ( pth < rhev ){ |
| 2419 |
if ( (UInt_t)evbeft < upperentry-1 && upperentry>0 ){ |
if ( (UInt_t)evbeft < upperentry-1 && upperentry>0 ){ |
| 2420 |
if ( IsDebug() ) printf(" Piece of run at the end of the file with NO RUNHEADER! evbeft %u upperentry-1 %u \n",(UInt_t)evbeft,upperentry-1); |
if ( IsDebug() ) printf(" Piece of run at the end of the file with NO RUNHEADER! evbeft %u upperentry-1 %u \n",(UInt_t)evbeft,upperentry-1); |
| 2421 |
// |
// |
| 2422 |
if ( (ptt-1) < 0 ) throw -15; // should never arrive here! |
// if ( (ptt-1) < 0 ) throw -15; // should never arrive here! |
| 2423 |
|
if ( (rtev-1) < 0 || ptt < 0 ) throw -15; // should never arrive here! |
| 2424 |
// rt->GetEntry(ptt-1); |
// rt->GetEntry(ptt-1); |
| 2425 |
rt->GetEntry(rtev-1); |
rt->GetEntry(rtev-1); |
| 2426 |
cod = eht->GetCounter(); |
cod = eht->GetCounter(); |
| 2655 |
// |
// |
| 2656 |
// we have now the good first piece of a run, fill the glrun object |
// we have now the good first piece of a run, fill the glrun object |
| 2657 |
// |
// |
| 2658 |
if ( rhfirstev != firstev && !mishead ) mishead = true; |
if ( firstev != (lastev+1) ){ // could be a problem sometimes (?) |
| 2659 |
if ( rtlastev != lastev && !mistrail ) mistrail = true; |
if ( rhfirstev != firstev && !mishead ) mishead = true; |
| 2660 |
|
if ( rtlastev != lastev && !mistrail ) mistrail = true; |
| 2661 |
|
}; |
| 2662 |
// |
// |
| 2663 |
|
if ( IsDebug() ) printf(" bhere firstev is %i lastev is %i \n",firstev,lastev); |
| 2664 |
this->FillClass(mishead,mistrail,firstev,lastev); |
this->FillClass(mishead,mistrail,firstev,lastev); |
| 2665 |
|
if ( IsDebug() ) printf(" chere firstev is %i lastev is %i \n",firstev,lastev); |
| 2666 |
// |
// |
| 2667 |
if ( IsDebug() ) printf("The run is good, is it the other piece in the GL_RUN_FRAGMENTS table?\n"); |
if ( IsDebug() ) printf("The run is good, is it the other piece in the GL_RUN_FRAGMENTS table?\n"); |
| 2668 |
if ( IsDebug() ) printf(" C THIS RUN: RUNHEADER_OBT %u RUNTRAILER_OBT %u RUNHEADER_PKT %u RUNTRAILER_PKT %u \n", glrun->GetRUNHEADER_OBT(),glrun->GetRUNTRAILER_OBT(),glrun->GetRUNHEADER_PKT(),glrun->GetRUNTRAILER_PKT()); |
if ( IsDebug() ) printf(" C THIS RUN: RUNHEADER_OBT %u RUNTRAILER_OBT %u RUNHEADER_PKT %u RUNTRAILER_PKT %u \n", glrun->GetRUNHEADER_OBT(),glrun->GetRUNTRAILER_OBT(),glrun->GetRUNHEADER_PKT(),glrun->GetRUNTRAILER_PKT()); |
| 2757 |
// |
// |
| 2758 |
found = false; // default value |
found = false; // default value |
| 2759 |
// |
// |
| 2760 |
if ( IsDebug() ) printf(" Found a possible candidate, checking if it is the good one... \n"); |
if ( IsDebug() ) printf(" A Found a possible candidate, checking if it is the good one... \n"); |
| 2761 |
// |
// |
| 2762 |
// if we have both runheader and runtrailer we can check with pkt_counter: |
// if we have both runheader and runtrailer we can check with pkt_counter: |
| 2763 |
// |
// |
| 2773 |
if ( IsDebug() ) printf(" FOUND!!! check %llu pktt %llu \n",chkpkt,pktt); |
if ( IsDebug() ) printf(" FOUND!!! check %llu pktt %llu \n",chkpkt,pktt); |
| 2774 |
// |
// |
| 2775 |
found = true; |
found = true; |
| 2776 |
|
if ( IsDebug() ) printf(" where firstev is %i lastev is %i \n",firstev,lastev); |
| 2777 |
// |
// |
| 2778 |
} else { |
} else { |
| 2779 |
// |
// |
| 2839 |
oss << " ID="<<row->GetField(0)<<";"; |
oss << " ID="<<row->GetField(0)<<";"; |
| 2840 |
// |
// |
| 2841 |
glrun1->Query_GL_RUN_FRAGMENTS(oss.str().c_str(),conn); // here we have runheader infos |
glrun1->Query_GL_RUN_FRAGMENTS(oss.str().c_str(),conn); // here we have runheader infos |
| 2842 |
|
if ( IsDebug() ) printf(" there firstev is %i lastev is %i \n",firstev,lastev); |
| 2843 |
// |
// |
| 2844 |
// merge infos |
// merge infos |
| 2845 |
// |
// |
| 2870 |
glrun1->SetRUNTRAILER_OBT(glrun->GetRUNTRAILER_OBT()); |
glrun1->SetRUNTRAILER_OBT(glrun->GetRUNTRAILER_OBT()); |
| 2871 |
glrun1->SetRUNTRAILER_PKT(glrun->GetRUNTRAILER_PKT()); |
glrun1->SetRUNTRAILER_PKT(glrun->GetRUNTRAILER_PKT()); |
| 2872 |
// |
// |
| 2873 |
|
if ( IsDebug() ) printf(" here firstev is %i lastev is %i \n",firstev,lastev); |
| 2874 |
|
// |
| 2875 |
glrun->SetEV_FROM(firstev); |
glrun->SetEV_FROM(firstev); |
| 2876 |
glrun->SetNEVENTS(lastev-firstev+1); |
glrun->SetNEVENTS(lastev-firstev+1); |
| 2877 |
// |
// |
| 2964 |
// |
// |
| 2965 |
found = false; // default value |
found = false; // default value |
| 2966 |
// |
// |
| 2967 |
if ( IsDebug() ) printf(" Found a possible candidate, checking if it is the good one... \n"); |
if ( IsDebug() ) printf(" B Found a possible candidate, checking if it is the good one... \n"); |
| 2968 |
// |
// |
| 2969 |
// if we have both runheader and runtrailer we can check with pkt_counter: |
// if we have both runheader and runtrailer we can check with pkt_counter: |
| 2970 |
// |
// |
| 3193 |
glrun->SetID(this->AssignRunID()); |
glrun->SetID(this->AssignRunID()); |
| 3194 |
glrun->SetID_RUN_FRAG(0); |
glrun->SetID_RUN_FRAG(0); |
| 3195 |
glrun->Fill_GL_RUN(conn); // it'ok we arrive here only inside a file hence in the middle of the runs... |
glrun->Fill_GL_RUN(conn); // it'ok we arrive here only inside a file hence in the middle of the runs... |
| 3196 |
}; |
}; |
| 3197 |
// |
// |
| 3198 |
}; |
}; |
| 3199 |
// |
// |
| 3237 |
if ( firstev == lastev+1 || lastev == firstev ) { // no events inside the run! |
if ( firstev == lastev+1 || lastev == firstev ) { // no events inside the run! |
| 3238 |
//if ( firstev <= lastev+1 ) { // no events inside the run! |
//if ( firstev <= lastev+1 ) { // no events inside the run! |
| 3239 |
if ( IsDebug() ) printf(" Checking but no events in the run! \n"); |
if ( IsDebug() ) printf(" Checking but no events in the run! \n"); |
| 3240 |
|
firstev = lastev+1; // this is necessary for files with no Physics entries, should have no influence on other files |
| 3241 |
// return true is correct |
// return true is correct |
| 3242 |
return(true); |
return(true); |
| 3243 |
// |
// |
| 3493 |
// |
// |
| 3494 |
found = false; // default value |
found = false; // default value |
| 3495 |
// |
// |
| 3496 |
if ( IsDebug() ) printf(" Found a possible candidate, checking if it is the good one... \n"); |
if ( IsDebug() ) printf(" C Found a possible candidate, checking if it is the good one... \n"); |
| 3497 |
// |
// |
| 3498 |
// if we have both runheader and runtrailer we can check with pkt_counter: |
// if we have both runheader and runtrailer we can check with pkt_counter: |
| 3499 |
// |
// |