--- DarthVader/RunInfo/src/RunInfo.cpp 2010/01/29 05:49:27 1.19 +++ DarthVader/RunInfo/src/RunInfo.cpp 2014/08/27 14:44:35 1.22 @@ -15,12 +15,27 @@ // #include #include +ClassImp(ProcInfo); ClassImp(SoftInfo); ClassImp(ItoRunInfo); // using namespace std; // +ProcInfo::ProcInfo() { + Clear(); +} + +void ProcInfo::Clear(Option_t *t){ + runID = 0; + date = ""; + commandLine = ""; + outputFilename = ""; + localDir = ""; + uname = ""; + DB = ""; +} + SoftInfo::SoftInfo() { Clear(); } @@ -88,6 +103,10 @@ } /***********************/ +ItoRunInfo::~ItoRunInfo() { + this->GL_RUN::Clear(); +} + ItoRunInfo::ItoRunInfo() { reprocessing = false; updating = false; @@ -101,7 +120,7 @@ norun = 0; runlist = new TArrayI(500); file = NULL; - newtree = new TTree(); + newtree = NULL;//new TTree(); } ItoRunInfo::ItoRunInfo(TFile *processFl){ @@ -122,6 +141,7 @@ norun = 0; totnorun = 0; runlist = new TArrayI(500); + newtree = NULL; // } @@ -169,7 +189,7 @@ // if ( glrun && newrun ){ // - // printf("copy \n"); +// printf("copy \n"); // newrun->ID = glrun->ID ; newrun->ID_RUN_FRAG = glrun-> ID_RUN_FRAG ; @@ -229,11 +249,11 @@ // Bool_t debug = false; // - Bool_t ismydir = false; + // Bool_t ismydir = false; // if ( !strcmp(processFolder.Data(),"") ){ processFolder = "runinfoFolder"; - ismydir = true; + // ismydir = true; }; // GL_RUN *oldrun = new GL_RUN(); @@ -372,7 +392,7 @@ // if ( idRun == 0 || idRun == newrun->ID ) { // - if ( debug ) printf(" Updating run number %u \n",idRun); + if ( debug ) printf(" Updating run number %u newrun->ID %i \n",idRun,(int)newrun->ID); // found = true; // @@ -511,6 +531,7 @@ }; // file->cd(); + if ( debug ) printf("filling: totnorun %i idRun %i newrun->ID %i \n",(int)totnorun,(int)idRun,(int)newrun->ID); newtree->Fill(); // }; @@ -529,11 +550,22 @@ return(-5); }; // + this->Write(); // newtree->Write(); }; +// if ( oldtree ) oldtree->Delete(); // crasha qua in queste righe e se non le metti... +// if ( newver ) delete newver; +// if ( newrun ) delete newrun; +// if ( oldver ) delete oldver; +// if ( oldrun ) delete oldrun; return(0); } +void ItoRunInfo::Write(){ + file->cd(); + newtree->Write("Run",TObject::kOverwrite); +} + Int_t ItoRunInfo::Read(UInt_t idRun){ // isreadonly = true; @@ -603,7 +635,7 @@ delete runlist; // file = new TFile(); file = 0; - if ( isreadonly ) newtree->Delete(); + // if ( isreadonly ) newtree->Delete(); } void ItoRunInfo::Clear(Option_t *t){