From 915a8aee682a2969f15da655451f37dee9808308 Mon Sep 17 00:00:00 2001 From: Hugo Jacob <hugojacob57@gmail.com> Date: Fri, 19 Jan 2024 16:44:39 +0100 Subject: [PATCH] Added IsPhysiscal Opt to npreader + fixed exogam memory issue --- .../Detectors/Exogam/Geometry_Clover_Exogam.h | 4 ++- NPLib/Utility/npreader.cxx | 30 ++----------------- Projects/E805/Analysis.cxx | 6 ++-- Projects/E805/Analysis.h | 2 +- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/NPLib/Detectors/Exogam/Geometry_Clover_Exogam.h b/NPLib/Detectors/Exogam/Geometry_Clover_Exogam.h index 9dced423b..a8feb2694 100644 --- a/NPLib/Detectors/Exogam/Geometry_Clover_Exogam.h +++ b/NPLib/Detectors/Exogam/Geometry_Clover_Exogam.h @@ -558,7 +558,9 @@ float EXOGAM_Segment_Pos1,EXOGAM_Segment_Pos2 ; else {printf("Bad flange number, flange %d doesn't exist in EXOGAM !!!!!! \n",flange);} - + delete ShapeC; + delete ShapeS1; + delete ShapeS2; return Result; diff --git a/NPLib/Utility/npreader.cxx b/NPLib/Utility/npreader.cxx index bb17fc88b..5f2642ea9 100644 --- a/NPLib/Utility/npreader.cxx +++ b/NPLib/Utility/npreader.cxx @@ -204,43 +204,19 @@ int main(int argc , char** argv){ } } - /*else{ - std::cout << "test npa branch 3" << std::endl; - while(inputTreeReader->Next()){ - //for (unsigned long i = first_entry ; i < nentries + first_entry; i++) { + else{ + for (unsigned long i = first_entry ; i < nentries + first_entry; i++) { // Get the Physics Data - //Chain -> GetEntry(i); + Chain -> GetEntry(i); // User Analysis UserAnalysis->TreatEvent(); // Fill the tree myDetector->FillOutputTree(); current_tree = Chain->GetTreeNumber()+1; - ProgressDisplay(begin,end,treated,inter,nentries,mean_rate,displayed,current_tree,total_tree); ProgressDisplay(tv_begin,tv_end,treated,inter,nentries,mean_rate,displayed,current_tree,total_tree); - //if(myOptionManager->GetOnline() && i%10000==0){ - // myDetector->CheckSpectraServer(); - - // bool first = true; - // while(!Chain || first){ - // first = false; - // RootInput::getInstance()->GetFile()->ReadKeys(kTRUE); - - // Chain = (TChain*) RootInput::getInstance()->GetFile()->FindKeyAny(ChainName)->ReadObj(); - // new_nentries = Chain->GetEntries(); - // if(new_nentries!=nentries){ - // RootInput::getInstance()->SetChain(Chain); - // myDetector->InitializeRootInput(); - // nentries = Chain->GetEntries(); - // } - // else{ - // first = true; - // } - // } - //} } } -*/ UserAnalysis->End(); } diff --git a/Projects/E805/Analysis.cxx b/Projects/E805/Analysis.cxx index ec0431e65..99509e6ab 100755 --- a/Projects/E805/Analysis.cxx +++ b/Projects/E805/Analysis.cxx @@ -18,7 +18,6 @@ * Comment: * * * *****************************************************************************/ - #include<iostream> using namespace std; #include"Analysis.h" @@ -70,7 +69,8 @@ void Analysis::Init(){ Reaction_pd->SetBeamEnergy(BeamTarget["48Cr"].Slow(Reaction_pd->GetBeamEnergy(),TargetThickness*0.5,0)); Reaction_pt->SetBeamEnergy(BeamTarget["48Cr"].Slow(Reaction_pt->GetBeamEnergy(),TargetThickness*0.5,0)); Reaction_p3He->SetBeamEnergy(BeamTarget["48Cr"].Slow(Reaction_p3He->GetBeamEnergy(),TargetThickness*0.5,0)); - Cal = CalibrationManager::getInstance(); + Cal = CalibrationManager::getInstance(); + IsPhysics = NPOptionManager::getInstance()->GetInputPhysicalTreeOption(); } ///////////////////////////// Initialize some important parameters ////////////////////////////////// @@ -105,7 +105,7 @@ void Analysis::TreatEvent(){ //if(bCATS){ // TreatZDD(); // TreatTAC(); - // TreatMUST2(); + TreatMUST2(); // TreatEXO(); //} /*//for(unsigned int countMust2 = 0 ; countMust2 < M2->Si_E.size() ; countMust2++){ diff --git a/Projects/E805/Analysis.h b/Projects/E805/Analysis.h index e891c2489..c08cf7c7f 100755 --- a/Projects/E805/Analysis.h +++ b/Projects/E805/Analysis.h @@ -82,7 +82,7 @@ class Analysis: public NPL::VAnalysis{ private: bool bCATS; - + bool IsPhysics; private: /// Currently only treating multiplicity 1 events -- GitLab