| 22 |
// |
// |
| 23 |
|
|
| 24 |
SoftInfo::SoftInfo() { |
SoftInfo::SoftInfo() { |
| 25 |
TRIG_ver = ""; |
Clear(); |
|
TOF_ver = ""; |
|
|
AC_ver = ""; |
|
|
TRK_ver = ""; |
|
|
ORB_ver = ""; |
|
|
CAL_ver = ""; |
|
|
ND_ver = ""; |
|
|
S4_ver = ""; |
|
|
DV_ver = ""; |
|
| 26 |
} |
} |
| 27 |
|
|
| 28 |
void SoftInfo::Clear(){ |
void SoftInfo::Clear(Option_t *t){ |
| 29 |
TRIG_ver = ""; |
TRIG_ver = ""; |
| 30 |
TOF_ver = ""; |
TOF_ver = ""; |
| 31 |
AC_ver = ""; |
AC_ver = ""; |
| 88 |
} |
} |
| 89 |
/***********************/ |
/***********************/ |
| 90 |
|
|
| 91 |
|
ItoRunInfo::~ItoRunInfo() { |
| 92 |
|
this->GL_RUN::Clear(); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
ItoRunInfo::ItoRunInfo() { |
ItoRunInfo::ItoRunInfo() { |
| 96 |
reprocessing = false; |
reprocessing = false; |
| 97 |
updating = false; |
updating = false; |
| 105 |
norun = 0; |
norun = 0; |
| 106 |
runlist = new TArrayI(500); |
runlist = new TArrayI(500); |
| 107 |
file = NULL; |
file = NULL; |
| 108 |
newtree = new TTree(); |
newtree = NULL;//new TTree(); |
| 109 |
} |
} |
| 110 |
|
|
| 111 |
ItoRunInfo::ItoRunInfo(TFile *processFl){ |
ItoRunInfo::ItoRunInfo(TFile *processFl){ |
| 126 |
norun = 0; |
norun = 0; |
| 127 |
totnorun = 0; |
totnorun = 0; |
| 128 |
runlist = new TArrayI(500); |
runlist = new TArrayI(500); |
| 129 |
|
newtree = NULL; |
| 130 |
// |
// |
| 131 |
} |
} |
| 132 |
|
|
| 174 |
// |
// |
| 175 |
if ( glrun && newrun ){ |
if ( glrun && newrun ){ |
| 176 |
// |
// |
| 177 |
// printf("copy \n"); |
printf("copy \n"); |
| 178 |
// |
// |
| 179 |
newrun->ID = glrun->ID ; |
newrun->ID = glrun->ID ; |
| 180 |
newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG ; |
newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG ; |
| 206 |
newrun->TRK_CALIB_USED = glrun->TRK_CALIB_USED ; |
newrun->TRK_CALIB_USED = glrun->TRK_CALIB_USED ; |
| 207 |
newrun->CAL_DSP_MASK = glrun->CAL_DSP_MASK ; |
newrun->CAL_DSP_MASK = glrun->CAL_DSP_MASK ; |
| 208 |
newrun->BOOT_NUMBER = glrun->BOOT_NUMBER ; |
newrun->BOOT_NUMBER = glrun->BOOT_NUMBER ; |
| 209 |
|
newrun->PHYSENDRUN_MASK_S3S2S12 = glrun->PHYSENDRUN_MASK_S3S2S12 ; |
| 210 |
|
newrun->PHYSENDRUN_MASK_S11CRC = glrun->PHYSENDRUN_MASK_S11CRC ; |
| 211 |
newrun->VALIDATION = glrun->VALIDATION ; |
newrun->VALIDATION = glrun->VALIDATION ; |
| 212 |
// |
// |
| 213 |
}; |
}; |
| 232 |
isreadonly = false; |
isreadonly = false; |
| 233 |
idRun = run; |
idRun = run; |
| 234 |
// |
// |
| 235 |
Bool_t debug = false; |
Bool_t debug = true; |
| 236 |
// |
// |
| 237 |
Bool_t ismydir = false; |
// Bool_t ismydir = false; |
| 238 |
// |
// |
| 239 |
if ( !strcmp(processFolder.Data(),"") ){ |
if ( !strcmp(processFolder.Data(),"") ){ |
| 240 |
processFolder = "runinfoFolder"; |
processFolder = "runinfoFolder"; |
| 241 |
ismydir = true; |
// ismydir = true; |
| 242 |
}; |
}; |
| 243 |
// |
// |
| 244 |
GL_RUN *oldrun = new GL_RUN(); |
GL_RUN *oldrun = new GL_RUN(); |
| 335 |
totnorun = 1; |
totnorun = 1; |
| 336 |
reprocessing = false; |
reprocessing = false; |
| 337 |
first_file_entry = 0; |
first_file_entry = 0; |
| 338 |
last_file_entry = (UInt_t)(EV_TO - EV_FROM); |
if ( EV_TO >= EV_FROM ) last_file_entry = (UInt_t)(EV_TO - EV_FROM); |
| 339 |
norun = 1; |
norun = 1; |
| 340 |
runlist->AddAt((Int_t)ID,0); |
runlist->AddAt((Int_t)ID,0); |
| 341 |
// |
// |
| 367 |
// |
// |
| 368 |
for ( UInt_t run = 0; run < totnorun; run++){ |
for ( UInt_t run = 0; run < totnorun; run++){ |
| 369 |
// |
// |
| 370 |
oldtree->GetEntry(run); |
if ( oldtree->GetEntry(run) <= 0 ) throw -36; |
| 371 |
// |
// |
| 372 |
CopyFromTo(oldrun,newrun,oldver,newver); |
CopyFromTo(oldrun,newrun,oldver,newver); |
| 373 |
// |
// |
| 377 |
// |
// |
| 378 |
if ( idRun == 0 || idRun == newrun->ID ) { |
if ( idRun == 0 || idRun == newrun->ID ) { |
| 379 |
// |
// |
| 380 |
if ( debug ) printf(" Updating run number %u \n",idRun); |
if ( debug ) printf(" Updating run number %u newrun->ID %i \n",idRun,(int)newrun->ID); |
| 381 |
// |
// |
| 382 |
found = true; |
found = true; |
| 383 |
// |
// |
| 509 |
}; |
}; |
| 510 |
}; |
}; |
| 511 |
// |
// |
| 512 |
last_file_entry = first_file_entry + (oldrun->EV_TO - oldrun->EV_FROM + 1); |
if ( oldrun->EV_TO >= oldrun->EV_FROM ) last_file_entry = first_file_entry + (oldrun->EV_TO - oldrun->EV_FROM + 1); |
| 513 |
// |
// |
| 514 |
} else { |
} else { |
| 515 |
if ( !found ) first_file_entry += (oldrun->EV_TO - oldrun->EV_FROM + 1); |
if ( !found ) first_file_entry += (oldrun->EV_TO - oldrun->EV_FROM + 1); |
| 516 |
}; |
}; |
| 517 |
// |
// |
| 518 |
file->cd(); |
file->cd(); |
| 519 |
|
if ( debug ) printf("filling: totnorun %i idRun %i newrun->ID %i \n",(int)totnorun,(int)idRun,(int)newrun->ID); |
| 520 |
newtree->Fill(); |
newtree->Fill(); |
| 521 |
// |
// |
| 522 |
}; |
}; |
| 535 |
return(-5); |
return(-5); |
| 536 |
}; |
}; |
| 537 |
// |
// |
| 538 |
|
this->Write(); |
| 539 |
// newtree->Write(); |
// newtree->Write(); |
| 540 |
}; |
}; |
| 541 |
|
// if ( oldtree ) oldtree->Delete(); // crasha qua in queste righe e se non le metti... |
| 542 |
|
// if ( newver ) delete newver; |
| 543 |
|
// if ( newrun ) delete newrun; |
| 544 |
|
// if ( oldver ) delete oldver; |
| 545 |
|
// if ( oldrun ) delete oldrun; |
| 546 |
return(0); |
return(0); |
| 547 |
} |
} |
| 548 |
|
|
| 549 |
|
void ItoRunInfo::Write(){ |
| 550 |
|
file->cd(); |
| 551 |
|
newtree->Write("Run",TObject::kOverwrite); |
| 552 |
|
} |
| 553 |
|
|
| 554 |
Int_t ItoRunInfo::Read(UInt_t idRun){ |
Int_t ItoRunInfo::Read(UInt_t idRun){ |
| 555 |
// |
// |
| 556 |
isreadonly = true; |
isreadonly = true; |
| 587 |
// |
// |
| 588 |
for ( UInt_t run = 0; run < totnorun; run++){ |
for ( UInt_t run = 0; run < totnorun; run++){ |
| 589 |
// |
// |
| 590 |
newtree->GetEntry(run); |
if ( newtree->GetEntry(run) <= 0 ) throw -36; |
| 591 |
// |
// |
| 592 |
file_entries += (newrun->EV_TO - newrun->EV_FROM + 1); |
file_entries += (newrun->EV_TO - newrun->EV_FROM + 1); |
| 593 |
// |
// |
| 598 |
runlist->AddAt(newrun->ID,norun); |
runlist->AddAt(newrun->ID,norun); |
| 599 |
norun++; |
norun++; |
| 600 |
}; |
}; |
| 601 |
last_file_entry = first_file_entry + (newrun->EV_TO - newrun->EV_FROM + 1); |
if ( newrun->EV_TO >= newrun->EV_FROM ) last_file_entry = first_file_entry + (newrun->EV_TO - newrun->EV_FROM + 1); |
| 602 |
}; |
}; |
| 603 |
}; |
}; |
| 604 |
if ( debug ) printf("norun %i \n",(int)norun); |
if ( debug ) printf("norun %i \n",(int)norun); |
| 620 |
delete runlist; |
delete runlist; |
| 621 |
// file = new TFile(); |
// file = new TFile(); |
| 622 |
file = 0; |
file = 0; |
| 623 |
if ( isreadonly ) newtree->Delete(); |
// if ( isreadonly ) newtree->Delete(); |
| 624 |
} |
} |
| 625 |
|
|
| 626 |
void ItoRunInfo::Clear(){ |
void ItoRunInfo::Clear(Option_t *t){ |
| 627 |
if ( newtree ) newtree->Delete(); |
if ( newtree ) newtree->Delete(); |
| 628 |
} |
} |
| 629 |
|
|
| 676 |
totnorun = newtree->GetEntries(); |
totnorun = newtree->GetEntries(); |
| 677 |
// |
// |
| 678 |
for ( UInt_t nrun = 0; nrun < totnorun; nrun++){ |
for ( UInt_t nrun = 0; nrun < totnorun; nrun++){ |
| 679 |
newtree->GetEntry(nrun); |
if ( newtree->GetEntry(nrun) <= 0 ) throw -36; |
| 680 |
// |
// |
| 681 |
if ( nwrun->ID == run || run == 0 ){ |
if ( nwrun->ID == run || run == 0 ){ |
| 682 |
CopyFromTo(nwrun,(GL_RUN*)this,nwver,version); |
CopyFromTo(nwrun,(GL_RUN*)this,nwver,version); |
| 683 |
found = true; |
found = true; |
| 684 |
last_file_entry = first_file_entry + (nwrun->EV_TO - nwrun->EV_FROM + 1); |
if ( nwrun->EV_TO >= nwrun->EV_FROM ) last_file_entry = first_file_entry + (nwrun->EV_TO - nwrun->EV_FROM + 1); |
| 685 |
}; |
}; |
| 686 |
if ( !found ) first_file_entry += (nwrun->EV_TO - nwrun->EV_FROM + 1); |
if ( !found ) first_file_entry += (nwrun->EV_TO - nwrun->EV_FROM + 1); |
| 687 |
}; |
}; |