--- DarthVader/RunInfo/src/RunInfo.cpp 2006/07/17 12:14:30 1.4 +++ 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,22 +630,36 @@ UInt_t ItoRunInfo::GetRunForEntry(UInt_t entry){ // - // ItoRunInfo *run = new ItoRunInfo(file); + 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); - // printf("nrun = %i runlist = %llu \n",nrun,(ULong64_t)runlist->At(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; + }; + // + if ( startfrom >= norun ) startfrom = 0; + // + retry: + // + for ( UInt_t nrun = startfrom; nrun < norun; nrun++){ GetRunInfo((ULong64_t)runlist->At(nrun)); - // printf("entry %i first %i last %i \n",entry,(UInt_t)first_file_entry,(UInt_t)last_file_entry ); if ( entry >= (UInt_t)first_file_entry && entry <= (UInt_t)last_file_entry ){ - // run->newtree->Delete(); - // delete run; - //printf("nrun is %i \n",nrun); return((UInt_t)runlist->At(nrun)); }; }; - // run->newtree->Delete(); - // delete run; + if ( startfrom ){ + startfrom = 0; + goto retry; + }; + printf(" ERROR! run not found \n"); return(0); } @@ -681,3 +713,4 @@ if ( found ) return(0); return(-800); } +