--- DarthVader/RunInfo/src/RunInfo.cpp 2006/06/30 09:21:59 1.3 +++ DarthVader/RunInfo/src/RunInfo.cpp 2006/07/21 11:00:13 1.6 @@ -30,6 +30,21 @@ S4_ver = ""; } +/** + * Fills a struct cSoftInfo with values from a SoftInfo object (to put data into a F77 common). + */ +void SoftInfo::GetLevel2Struct(cSoftInfo *l2) const{ + l2->FillTrigWith(TRIG_ver); + l2->FillTofWith(TOF_ver); + l2->FillAcWith(AC_ver); + l2->FillTrkWith(TRK_ver); + l2->FillOrbWith(ORB_ver); + l2->FillCalWith(CAL_ver); + l2->FillNdWith(ND_ver); + l2->FillS4With(S4_ver); +} +/***********************/ + ItoRunInfo::ItoRunInfo() { reprocessing = false; updating = false; @@ -77,6 +92,7 @@ version->S4_ver = ""; norun = 0; totnorun = 0; + // runlist = new TArrayL(0,NULL); // } @@ -102,6 +118,7 @@ version->S4_ver = ""; norun = 0; totnorun = 0; + runlist = new TArrayL(0,NULL); // } @@ -150,6 +167,7 @@ // norun = 0; runlist = new TArrayL(0,NULL); + //runlist->Reset(); // Bool_t found = false; Int_t error = 0; @@ -612,18 +630,36 @@ UInt_t ItoRunInfo::GetRunForEntry(UInt_t entry){ // - ItoRunInfo *run = new ItoRunInfo(); + UInt_t startfrom = 0; + // + if ( entry >= (UInt_t)first_file_entry && entry <= (UInt_t)last_file_entry ) return(ID); // - for ( UInt_t nrun = 0; nrun < norun; nrun++){ - run->GetRunInfo((ULong64_t)nrun); - if ( entry >= (UInt_t)run->first_file_entry && entry <= (UInt_t)run->last_file_entry ){ - run->newtree->Delete(); - delete run; - return(nrun); + if ( entry > (UInt_t)last_file_entry ){ + for ( UInt_t nrun = 0; nrun < norun; nrun++){ + if ( ID == (ULong64_t)runlist->At(nrun) ) { + startfrom = nrun+1; + break; + }; }; + } else { + startfrom = 0; }; - run->newtree->Delete(); - delete run; + // + if ( startfrom >= norun ) startfrom = 0; + // + retry: + // + for ( UInt_t nrun = startfrom; nrun < norun; nrun++){ + GetRunInfo((ULong64_t)runlist->At(nrun)); + if ( entry >= (UInt_t)first_file_entry && entry <= (UInt_t)last_file_entry ){ + return((UInt_t)runlist->At(nrun)); + }; + }; + if ( startfrom ){ + startfrom = 0; + goto retry; + }; + printf(" ERROR! run not found \n"); return(0); } @@ -672,8 +708,9 @@ }; if ( !found ) first_file_entry += (nwrun->EV_REG_PHYS_TO - nwrun->EV_REG_PHYS_FROM + 1); }; - if ( found ) return(0); delete nwver; delete nwrun; + if ( found ) return(0); return(-800); } +