/[PAMELA software]/PamelaLevel2/src/PamLevel2.cpp
ViewVC logotype

Diff of /PamelaLevel2/src/PamLevel2.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.85 by mocchiut, Tue May 11 03:57:52 2010 UTC revision 1.88 by pam-fi, Tue Nov 29 15:34:12 2011 UTC
# Line 647  void PamLevel2::Delete() { Line 647  void PamLevel2::Delete() {
647      run_tree->Delete();;      run_tree->Delete();;
648    if (sel_tree)    if (sel_tree)
649      sel_tree->Delete();;      sel_tree->Delete();;
650    for (Int_t i = 0; i < NCLONES; i++)  
651      // The following lines are commented out since they may generate a double delete error
652      // if the file containing the clone trees is closed. This is because the file owns the
653      // clone trees which are written into it, so it will delete them when it is closed; if
654      // also PamLevel2 will try to delete these trees, a double delete error will be generated
655      // when exiting from analysis program. (Nicola 28/11/2011)
656    
657      /*for (Int_t i = 0; i < NCLONES; i++)
658      if (pam_tree_clone[i])      if (pam_tree_clone[i])
659        pam_tree_clone[i]->Delete();;        pam_tree_clone[i]->Delete();;
660    if (run_tree_clone)    if (run_tree_clone)
661      run_tree_clone->Delete();;      run_tree_clone->Delete();;
662    if (sel_tree_clone)    if (sel_tree_clone)
663      sel_tree_clone->Delete();;      sel_tree_clone->Delete();;*/
664    
665    if (irunoffset)    if (irunoffset)
666      delete[] irunoffset;      delete[] irunoffset;
# Line 834  Bool_t PamLevel2::IsGood(Bool_t strict) Line 841  Bool_t PamLevel2::IsGood(Bool_t strict)
841  }  }
842  ;  ;
843    
844    void PamLevel2::SkipRunInfoUpdate(){
845      printf("\n\n ******** WARNING ******** \n Skip DB connections, DO NOT USE PamLevel2::GetRunInfo() method! \n\n");
846      fUpdateRunInfo = false;
847      this->SetSELLI(2);
848      printf(" ===============> W A R N I N G <================ \n");
849      printf(" in case PamLevel2::CreateCloneTrees() will be called \n");
850      printf(" it will be reverted to PadmeAmidala level2 structure , i.e. NO SELECTIONLIST WILL BE CREATED IN THE NEW LEVEL2 FILE! \n\n");
851      if ( run_tree_clone ){
852        printf(" ===============> W A R N I N G <================ \n");
853        printf(" PamLevel2::SkipRunIndoUpdate or PamLevel2::NoDBconnections() has been called together with PamLevel2::CreateCloneTrees() \n");
854        printf(" TO AVOID CRASHES call PamLevel2::CreateCloneTrees() after PamLevel2::SkipRunIndoUpdate or PamLevel2::NoDBconnections() \n");    
855      };
856    }
857    
858  //--------------------------------------  //--------------------------------------
859  //  //
860  //  //
# Line 2888  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 2909  Bool_t PamLevel2::UpdateRunInfo(Long64_t
2909      gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); //Emiliano // the "false" means not to use level0 file (not necessary here)      gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); //Emiliano // the "false" means not to use level0 file (not necessary here)
2910      if (dbc){      if (dbc){
2911        dbc->Close();// Emiliano        dbc->Close();// Emiliano
2912          delete dbc;
2913        dbc=0;        dbc=0;
2914      };      };
2915    };    };
# Line 3036  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 3058  Bool_t PamLevel2::UpdateRunInfo(Long64_t
3058        gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); // Emiliano        gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); // Emiliano
3059        if (dbc){        if (dbc){
3060          dbc->Close(); // Emiliano          dbc->Close(); // Emiliano
3061            delete dbc;
3062          dbc=0;          dbc=0;
3063        };        };
3064        if (gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT) > gltsync->DBobt(GetRunInfo()->RUNTRAILER_OBT)) { // Emiliano        if (gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT) > gltsync->DBobt(GetRunInfo()->RUNTRAILER_OBT)) { // Emiliano
# Line 3077  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 3100  Bool_t PamLevel2::UpdateRunInfo(Long64_t
3100      TrkParams::Set(GetRunInfo(), dbc);      TrkParams::Set(GetRunInfo(), dbc);
3101      if (dbc){      if (dbc){
3102        dbc->Close();        dbc->Close();
3103          delete dbc;
3104        dbc=0;        dbc=0;
3105      };      };
3106    
# Line 3172  Bool_t PamLevel2::UpdateRunInfo(Long64_t Line 3196  Bool_t PamLevel2::UpdateRunInfo(Long64_t
3196        TrkParams::Set(GetRunInfo(), dbc);        TrkParams::Set(GetRunInfo(), dbc);
3197        if (dbc){        if (dbc){
3198          dbc->Close();          dbc->Close();
3199            delete dbc;
3200          dbc=0;          dbc=0;
3201        };        };
3202        //            cout << endl;        //            cout << endl;
# Line 4106  void PamLevel2::CreateCloneTrees(TFile * Line 4131  void PamLevel2::CreateCloneTrees(TFile *
4131    if (GP) {    if (GP) {
4132      pam_tree_clone[i] = new TTree("h20", "GPAMELA info ");      pam_tree_clone[i] = new TTree("h20", "GPAMELA info ");
4133      pam_tree_clone[i]->Branch("GPamela", "GPamela", GetPointerTo("GPamela"), 32000, 1);//split      pam_tree_clone[i]->Branch("GPamela", "GPamela", GetPointerTo("GPamela"), 32000, 1);//split
4134      cout << "OrbitalInfo  : branch OrbitalInfo" << endl;      cout << "GPamela  : branch GPamela" << endl;
4135      i++;      i++;
4136    };    };
4137    cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl;    cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl;
# Line 4352  TTree* PamLevel2::GetYodaTree() { Line 4377  TTree* PamLevel2::GetYodaTree() {
4377      }      }
4378    
4379      dbc->Close(); // EMILIANO, do not leave open connections, open only when needed      dbc->Close(); // EMILIANO, do not leave open connections, open only when needed
4380        delete dbc;
4381      dbc=0;      dbc=0;
4382    
4383    };    };
# Line 4373  TTree* PamLevel2::GetYodaTree() { Line 4399  TTree* PamLevel2::GetYodaTree() {
4399      };      };
4400      if(dbc){      if(dbc){
4401        dbc->Close(); // EMILIANO, do not leave open connections, open only when needed        dbc->Close(); // EMILIANO, do not leave open connections, open only when needed
4402          delete dbc;
4403        dbc=0;        dbc=0;
4404      };      };
4405    }    }

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.88

  ViewVC Help
Powered by ViewVC 1.1.23