diff --git a/NPLib/Detectors/Exogam/TExogamData.cxx b/NPLib/Detectors/Exogam/TExogamData.cxx index 448d049ce88ad70235f60a432e82bb4dd7db1e22..514a5059f828a26b88b709b0123f45d379b8671b 100644 --- a/NPLib/Detectors/Exogam/TExogamData.cxx +++ b/NPLib/Detectors/Exogam/TExogamData.cxx @@ -43,21 +43,21 @@ TExogamData::~TExogamData() void TExogamData::Clear() { - fEXO_E.clear(); - fEXO_E_CrystalNbr.clear(); - fEXO_E_TS.clear(); - fEXO_HG.clear(); - fEXO_HG_CrystalNbr.clear(); - fEXO_HG_TS.clear(); - fEXO_TDC.clear(); - fEXO_TDC_CrystalNbr.clear(); - fEXO_TDC_TS.clear(); - fEXO_Outer.clear(); - fEXO_Outer_SubCrystalNbr.clear(); - fEXO_BGO.clear(); - fEXO_BGO_CrystalNbr.clear(); - fEXO_CSI.clear(); - fEXO_CSI_CrystalNbr.clear(); + fExoE.clear(); + fExoE_CrystalNbr.clear(); + fExoE_TS.clear(); + fExoHG.clear(); + fExoHG_CrystalNbr.clear(); + fExoHG_TS.clear(); + fExoTDC.clear(); + fExoTDC_CrystalNbr.clear(); + fExoTDC_TS.clear(); + fExoOuter.clear(); + fExoOuter_SubCrystalNbr.clear(); + fExoBGO.clear(); + fExoBGO_CrystalNbr.clear(); + fExoCsI.clear(); + fExoCsI_CrystalNbr.clear(); } @@ -66,28 +66,28 @@ void TExogamData::Dump() const { cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event XXXXXXXXXXXXXXXXX" << endl; - cout << "Inner6MV Mult = " << fEXO_E.size() << endl; - for (UShort_t i = 0; i < fEXO_E.size(); i++) { - cout << "Energy: " << fEXO_E[i] << " Cristal Numb: " << fEXO_E_CrystalNbr[i] << " TimeStamp: " << fEXO_E_TS[i] << endl; + cout << "Inner6MV Mult = " << fExoE.size() << endl; + for (UShort_t i = 0; i < fExoE.size(); i++) { + cout << "Energy: " << fExoE[i] << " Cristal Numb: " << fExoE_CrystalNbr[i] << " TimeStamp: " << fExoE_TS[i] << endl; } - cout << "Inner20MV Mult = " << fEXO_HG.size() << endl; - for (UShort_t i = 0; i < fEXO_HG.size(); i++) { - cout << "Energy: " << fEXO_HG[i] << " Cristal Numb: " << fEXO_HG_CrystalNbr[i] << " TimeStamp: " << fEXO_HG_TS[i] << endl; + cout << "Inner20MV Mult = " << fExoHG.size() << endl; + for (UShort_t i = 0; i < fExoHG.size(); i++) { + cout << "Energy: " << fExoHG[i] << " Cristal Numb: " << fExoHG_CrystalNbr[i] << " TimeStamp: " << fExoHG_TS[i] << endl; } - cout << "OutersV Mult = " << fEXO_Outer.size() << endl; - for (UShort_t i = 0; i < fEXO_Outer.size(); i++) { - cout << "Energy: " << fEXO_Outer[i] << " Cristal Numb: " << fEXO_Outer_SubCrystalNbr[i] << endl; + cout << "OutersV Mult = " << fExoOuter.size() << endl; + for (UShort_t i = 0; i < fExoOuter.size(); i++) { + cout << "Energy: " << fExoOuter[i] << " Cristal Numb: " << fExoOuter_SubCrystalNbr[i] << endl; } - cout << "DeltaTV Mult = " << fEXO_TDC.size() << endl; - for (UShort_t i = 0; i < fEXO_TDC.size(); i++) { - cout << "Energy: " << fEXO_TDC[i] << " Cristal Numb: " << fEXO_TDC_CrystalNbr[i] << " TimeStamp: " << fEXO_TDC_TS[i] << endl; + cout << "DeltaTV Mult = " << fExoTDC.size() << endl; + for (UShort_t i = 0; i < fExoTDC.size(); i++) { + cout << "Energy: " << fExoTDC[i] << " Cristal Numb: " << fExoTDC_CrystalNbr[i] << " TimeStamp: " << fExoTDC_TS[i] << endl; } - cout << "BGOV Mult = " << fEXO_BGO.size() << endl; - for (UShort_t i = 0; i < fEXO_BGO.size(); i++) { - cout << "Energy: " << fEXO_BGO[i] << " Cristal Numb: " << fEXO_BGO_CrystalNbr[i] << endl; + cout << "BGOV Mult = " << fExoBGO.size() << endl; + for (UShort_t i = 0; i < fExoBGO.size(); i++) { + cout << "Energy: " << fExoBGO[i] << " Cristal Numb: " << fExoBGO_CrystalNbr[i] << endl; } - cout << "CSIV Mult = " << fEXO_CSI.size() << endl; - for (UShort_t i = 0; i < fEXO_CSI.size(); i++) { - cout << "Energy: " << fEXO_CSI[i] << " Cristal Numb: " << fEXO_CSI_CrystalNbr[i] << endl; + cout << "CsIV Mult = " << fExoCsI.size() << endl; + for (UShort_t i = 0; i < fExoCsI.size(); i++) { + cout << "Energy: " << fExoCsI[i] << " Cristal Numb: " << fExoCsI_CrystalNbr[i] << endl; } } diff --git a/NPLib/Detectors/Exogam/TExogamData.h b/NPLib/Detectors/Exogam/TExogamData.h index 38d242b64523eea117d4dbff42fa73d5d64e52e1..10e3ba2c513baa0002f69c3d41c44d682024f480 100644 --- a/NPLib/Detectors/Exogam/TExogamData.h +++ b/NPLib/Detectors/Exogam/TExogamData.h @@ -28,26 +28,26 @@ class TExogamData : public TObject { private: - std::vector<UShort_t> fEXO_E; - std::vector<UShort_t> fEXO_E_CrystalNbr; - std::vector<ULong64_t> fEXO_E_TS; + std::vector<UShort_t> fExoE; + std::vector<UShort_t> fExoE_CrystalNbr; + std::vector<ULong64_t> fExoE_TS; - std::vector<UShort_t> fEXO_HG; // Same as Energy but with High Gain (for Low Energy events) - std::vector<UShort_t> fEXO_HG_CrystalNbr; - std::vector<ULong64_t> fEXO_HG_TS; + std::vector<UShort_t> fExoHG; // Same as Energy but with High Gain (for Low Energy events) + std::vector<UShort_t> fExoHG_CrystalNbr; + std::vector<ULong64_t> fExoHG_TS; - std::vector<UShort_t> fEXO_TDC; // Internal TDC of EXOGAM - std::vector<UShort_t> fEXO_TDC_CrystalNbr; - std::vector<ULong64_t> fEXO_TDC_TS; + std::vector<UShort_t> fExoTDC; // Internal TDC of EXOGAM + std::vector<UShort_t> fExoTDC_CrystalNbr; + std::vector<ULong64_t> fExoTDC_TS; - std::vector<UShort_t> fEXO_Outer; - std::vector<UShort_t> fEXO_Outer_SubCrystalNbr; + std::vector<UShort_t> fExoOuter; + std::vector<UShort_t> fExoOuter_SubCrystalNbr; - std::vector<UShort_t> fEXO_BGO; - std::vector<UShort_t> fEXO_BGO_CrystalNbr; + std::vector<UShort_t> fExoBGO; + std::vector<UShort_t> fExoBGO_CrystalNbr; - std::vector<UShort_t> fEXO_CSI; - std::vector<UShort_t> fEXO_CSI_CrystalNbr; + std::vector<UShort_t> fExoCsI; + std::vector<UShort_t> fExoCsI_CrystalNbr; public: TExogamData(); @@ -58,49 +58,49 @@ class TExogamData : public TObject { void Dump() const; ///////////////////// SETTERS //////////////////////// - inline void SetInner6MV(const UShort_t& Energy, const UShort_t& DetNumb, const ULong64_t& TimeStamp) { - fEXO_E.push_back(Energy); - fEXO_E_CrystalNbr.push_back(DetNumb); - fEXO_E_TS.push_back(TimeStamp); + inline void SetExo(const UShort_t& Energy, const UShort_t& DetNumb, const ULong64_t& TimeStamp) { + fExoE.push_back(Energy); + fExoE_CrystalNbr.push_back(DetNumb); + fExoE_TS.push_back(TimeStamp); } - inline void SetInner20MV(const UShort_t& Energy, const UShort_t& DetNumb, const ULong64_t& TimeStamp) { - fEXO_HG.push_back(Energy); - fEXO_HG_CrystalNbr.push_back(DetNumb); - fEXO_HG_TS.push_back(TimeStamp); + inline void SetExoHG(const UShort_t& Energy, const UShort_t& DetNumb, const ULong64_t& TimeStamp) { + fExoHG.push_back(Energy); + fExoHG_CrystalNbr.push_back(DetNumb); + fExoHG_TS.push_back(TimeStamp); } - inline void SetDeltaTV(const UShort_t& Time, const UShort_t& DetNumb, const ULong64_t& TimeStamp) { - fEXO_TDC.push_back(Time); - fEXO_TDC_CrystalNbr.push_back(DetNumb); - fEXO_TDC_TS.push_back(TimeStamp); + inline void SetExoDelta(const UShort_t& Time, const UShort_t& DetNumb, const ULong64_t& TimeStamp) { + fExoTDC.push_back(Time); + fExoTDC_CrystalNbr.push_back(DetNumb); + fExoTDC_TS.push_back(TimeStamp); } - inline void SetOutersV(const UShort_t& Energy, const UShort_t& OutersNumb) { - fEXO_Outer.push_back(Energy); - fEXO_Outer_SubCrystalNbr.push_back(OutersNumb); + inline void SetExoOuter(const UShort_t& Energy, const UShort_t& OutersNumb) { + fExoOuter.push_back(Energy); + fExoOuter_SubCrystalNbr.push_back(OutersNumb); } - inline void SetBGOV(const UShort_t& Energy, const UShort_t& BGONumb) { - fEXO_BGO.push_back(Energy); - fEXO_BGO_CrystalNbr.push_back(BGONumb); + inline void SetExoBGO(const UShort_t& Energy, const UShort_t& BGONumb) { + fExoBGO.push_back(Energy); + fExoBGO_CrystalNbr.push_back(BGONumb); } - inline void SetCSIV(const UShort_t& Energy, const UShort_t& CSINumb) { - fEXO_CSI.push_back(Energy); - fEXO_CSI_CrystalNbr.push_back(CSINumb); + inline void SetExoCsI(const UShort_t& Energy, const UShort_t& CsINumb) { + fExoCsI.push_back(Energy); + fExoCsI_CrystalNbr.push_back(CsINumb); } ///////////////////// GETTERS //////////////////////// - inline UShort_t GetEXO_E(const UShort_t& i)const { return fEXO_E[i]; } - inline UShort_t GetEXO_E_CrystalNbr(const UShort_t& i)const { return fEXO_E_CrystalNbr[i]; } - inline ULong64_t GetEXO_E_TS(const UShort_t& i)const { return fEXO_E_TS[i]; } - inline UShort_t GetEXO_HG(const UShort_t& i)const { return fEXO_HG[i]; } - inline UShort_t GetEXO_HG_CrystalNbr(const UShort_t& i)const { return fEXO_HG_CrystalNbr[i]; } - inline ULong64_t GetEXO_HG_TS(const UShort_t& i)const { return fEXO_HG_TS[i]; } - inline UShort_t GetEXO_TDC(const UShort_t& i)const { return fEXO_TDC[i]; } - inline UShort_t GetEXO_TDC_CrystalNbr(const UShort_t& i)const { return fEXO_TDC_CrystalNbr[i]; } - inline ULong64_t GetEXO_TDC_TS(const UShort_t& i)const { return fEXO_TDC_TS[i]; } - inline UShort_t GetEXO_Outer(const UShort_t& i)const { return fEXO_Outer[i]; } - inline UShort_t GetEXO_Outer_SubCrystalNbr(const UShort_t& i)const { return fEXO_Outer_SubCrystalNbr[i]; } - inline UShort_t GetEXO_BGO(const UShort_t& i)const { return fEXO_BGO[i]; } - inline UShort_t GetEXO_BGO_CrystalNbr(const UShort_t& i)const { return fEXO_BGO_CrystalNbr[i]; } - inline UShort_t GetEXO_CSI(const UShort_t& i)const { return fEXO_CSI[i]; } - inline UShort_t GetEXO_CSI_CrystalNbr(const UShort_t& i)const { return fEXO_CSI_CrystalNbr[i]; } + inline UShort_t GetExoE(UShort_t& i) { return fExoE[i]; } + inline UShort_t GetExoE_CrystalNbr(UShort_t& i) { return fExoE_CrystalNbr[i]; } + inline ULong64_t GetExoE_TS(UShort_t& i) { return fExoE_TS[i]; } + inline UShort_t GetExoHG(UShort_t& i) { return fExoHG[i]; } + inline UShort_t GetExoHG_CrystalNbr(UShort_t& i) { return fExoHG_CrystalNbr[i]; } + inline ULong64_t GetExoHG_TS(UShort_t& i) { return fExoHG_TS[i]; } + inline UShort_t GetExoTDC(UShort_t& i) { return fExoTDC[i]; } + inline UShort_t GetExoTDC_CrystalNbr(UShort_t& i) { return fExoTDC_CrystalNbr[i]; } + inline ULong64_t GetExoTDC_TS(UShort_t& i) { return fExoTDC_TS[i]; } + inline UShort_t GetExoOuter(UShort_t& i) { return fExoOuter[i]; } + inline UShort_t GetExoOuter_SubCrystalNbr(UShort_t& i) { return fExoOuter_SubCrystalNbr[i]; } + inline UShort_t GetExoBGO(UShort_t& i) { return fExoBGO[i]; } + inline UShort_t GetExoBGO_CrystalNbr(UShort_t& i) { return fExoBGO_CrystalNbr[i]; } + inline UShort_t GetExoCsI(UShort_t& i) { return fExoCsI[i]; } + inline UShort_t GetExoCsI_CrystalNbr(UShort_t& i) { return fExoCsI_CrystalNbr[i]; } ClassDef(TExogamData, 1) // ExogamData structure }; diff --git a/NPLib/Detectors/Exogam/TExogamPhysics.cxx b/NPLib/Detectors/Exogam/TExogamPhysics.cxx index 58ea53a90b9a04c7c64b08164514dbe759c27777..c9d907539d557cc63d4b3cb14cc47ebfffe18ced 100644 --- a/NPLib/Detectors/Exogam/TExogamPhysics.cxx +++ b/NPLib/Detectors/Exogam/TExogamPhysics.cxx @@ -20,56 +20,48 @@ *****************************************************************************/ #include "TExogamPhysics.h" using namespace EXOGAM_LOCAL; - + // STL -#include <sstream> -#include <iostream> #include <cmath> +#include <iostream> +#include <sstream> #include <stdlib.h> // NPL -#include "RootInput.h" #include "NPDetectorFactory.h" -#include "RootOutput.h" -#include "NPVDetector.h" #include "NPOptionManager.h" +#include "NPVDetector.h" +#include "RootInput.h" +#include "RootOutput.h" // ROOT #include "TChain.h" - /////////////////////////////////////////////////////////////////////////// ClassImp(TExogamPhysics) -/////////////////////////////////////////////////////////////////////////// -TExogamPhysics::TExogamPhysics() -{ - EventMultiplicity = 0 ; - ECC_Multiplicity = 0 ; - GOCCE_Multiplicity = 0 ; - NumberOfHitClover = 0 ; - NumberOfHitCristal = 0 ; - m_Spectra = NULL; - NumberOfClover=0; - - PreTreatedData = new TExogamData ; - EventData = new TExogamData ; - EventPhysics = this ; - NumberOfClover = 0 ; - CloverMult = 0 ; - + /////////////////////////////////////////////////////////////////////////// + TExogamPhysics::TExogamPhysics() { + EventMultiplicity = 0; + ECC_Multiplicity = 0; + GOCCE_Multiplicity = 0; + NumberOfHitClover = 0; + NumberOfHitCristal = 0; + m_Spectra = NULL; + NumberOfClover = 0; + + PreTreatedData = new TExogamData; + EventData = new TExogamData; + EventPhysics = this; + NumberOfClover = 0; + CloverMult = 0; } - + /////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::BuildSimplePhysicalEvent() -{ - - BuildPhysicalEvent(); -} +void TExogamPhysics::BuildSimplePhysicalEvent() { BuildPhysicalEvent(); } /////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::PreTreat() -{ +void TExogamPhysics::PreTreat() { /*ClearPreTreatedData(); - //E + //E for(unsigned int i = 0 ; i < EventData -> GetECCEMult(); i++) { UShort_t cristal_E = 10000 ; UShort_t cristal_T = 2000; @@ -77,83 +69,88 @@ void TExogamPhysics::PreTreat() { int clover = EventData -> GetECCEClover(i); int cristal = EventData -> GetECCECristal(i); - - if(EventData -> GetECCEEnergy(i) < 3000) cristal_E = CalibrationManager::getInstance()-> ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_Elow", EventData -> GetECCEEnergy(i)); - else cristal_E = CalibrationManager::getInstance()-> ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_Ehigh", EventData -> GetECCEEnergy(i)); - + if(EventData -> GetECCEEnergy(i) < 3000) cristal_E = CalibrationManager::getInstance()-> + ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_Elow", EventData -> GetECCEEnergy(i)); + else cristal_E = CalibrationManager::getInstance()-> + ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_Ehigh", EventData -> GetECCEEnergy(i)); + + if(cristal_E > Threshold_ECC) - { - - PreTreatedData->SetECCEClover ( clover ) ; - PreTreatedData->SetECCECristal( cristal ) ; - PreTreatedData->SetECCEEnergy ( cristal_E ) ; - - bool checkT = false; - for(unsigned int k = 0; k < EventData -> GetECCTMult(); k++){ - if(clover == EventData -> GetECCTClover(k) && cristal == EventData -> GetECCTCristal(k)){ - // cout << EventData -> GetECCTTime(k) << endl; - - if(EventData -> GetECCTTime(k) < 16383) cristal_T = CalibrationManager::getInstance()-> ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_T", EventData -> GetECCTTime(k)); - else cristal_T = 2500; - - //if(cristal_T >5000 && cristal_T !=25000 ) cout << "PreTreat " << cristal_T << " " << EventData -> GetECCTTime(k) << " " << clover << " " << cristal << " " << EventData->GetECCTMult() << endl; - - checkT=true; - PreTreatedData->SetECCTClover (clover ) ; - PreTreatedData->SetECCTCristal( cristal ) ; - PreTreatedData->SetECCTTime ( cristal_T ) ; - - ECC_Multiplicity ++; - GOCCE_Multiplicity++; - } - - } - - if(!checkT) { - PreTreatedData->SetECCTClover (clover ) ; - PreTreatedData->SetECCTCristal( cristal ) ; - PreTreatedData->SetECCTTime ( -1000 ) ; - } - - - } + { + + PreTreatedData->SetECCEClover ( clover ) ; + PreTreatedData->SetECCECristal( cristal ) ; + PreTreatedData->SetECCEEnergy ( cristal_E ) ; + + bool checkT = false; + for(unsigned int k = 0; k < EventData -> GetECCTMult(); k++){ + if(clover == EventData -> GetECCTClover(k) && cristal == EventData -> GetECCTCristal(k)){ + // cout << EventData -> GetECCTTime(k) << endl; + + if(EventData -> GetECCTTime(k) < 16383) cristal_T = CalibrationManager::getInstance()-> + ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_T", EventData -> GetECCTTime(k)); else + cristal_T = 2500; + + //if(cristal_T >5000 && cristal_T !=25000 ) cout << "PreTreat " << cristal_T << " " << EventData -> + GetECCTTime(k) << " " << clover << " " << cristal << " " << EventData->GetECCTMult() << endl; + + checkT=true; + PreTreatedData->SetECCTClover (clover ) ; + PreTreatedData->SetECCTCristal( cristal ) ; + PreTreatedData->SetECCTTime ( cristal_T ) ; + + ECC_Multiplicity ++; + GOCCE_Multiplicity++; + } + + } + + if(!checkT) { + PreTreatedData->SetECCTClover (clover ) ; + PreTreatedData->SetECCTCristal( cristal ) ; + PreTreatedData->SetECCTTime ( -1000 ) ; + } + + + } } } //cout << PreTreatedData-> GetECCTMult() << " " << PreTreatedData-> GetECCEMult() << endl; - + //GOCCE - //E - + //E + for(unsigned int i = 0 ; i < EventData -> GetGOCCEEMult(); i++) { - UShort_t segment_E = 25000; + UShort_t segment_E = 25000; //if(IsValidChannel) { int clover = EventData -> GetGOCCEEClover(i); int cristal = EventData -> GetGOCCEECristal(i); int segment = EventData -> GetGOCCEESegment(i); - + if(EventData -> GetGOCCEEEnergy(i) > RawThreshold_GOCCE) - { - segment_E = CalibrationManager::getInstance()->ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ NPL::itoa(cristal)+"_Seg"+ NPL::itoa(segment)+"_E", EventData -> GetGOCCEEEnergy(i)); - - if(segment_E > Threshold_GOCCE) - { - PreTreatedData->SetGOCCEEClover ( clover ) ; - PreTreatedData->SetGOCCEECristal( cristal ) ; - PreTreatedData->SetGOCCEESegment( segment ) ; - PreTreatedData->SetGOCCEEEnergy ( segment_E ) ; - - } - } + { + segment_E = CalibrationManager::getInstance()->ApplyCalibration("EXOGAM/Cl"+ NPL::itoa(clover)+"_Cr"+ + NPL::itoa(cristal)+"_Seg"+ NPL::itoa(segment)+"_E", EventData -> GetGOCCEEEnergy(i)); + + if(segment_E > Threshold_GOCCE) + { + PreTreatedData->SetGOCCEEClover ( clover ) ; + PreTreatedData->SetGOCCEECristal( cristal ) ; + PreTreatedData->SetGOCCEESegment( segment ) ; + PreTreatedData->SetGOCCEEEnergy ( segment_E ) ; + + } + } else - { - - } + { + + } } } @@ -162,110 +159,111 @@ void TExogamPhysics::PreTreat() */ } /////////////////////////////////////////////////////////////////////////// - -void TExogamPhysics::BuildPhysicalEvent() -{ + +void TExogamPhysics::BuildPhysicalEvent() { /*PreTreat(); - - if(PreTreatedData -> GetECCEMult() != PreTreatedData -> GetECCTMult()) cout << PreTreatedData -> GetECCEMult() << " " << PreTreatedData -> GetECCTMult() << endl; - + if(PreTreatedData -> GetECCEMult() != PreTreatedData -> GetECCTMult()) cout << PreTreatedData -> GetECCEMult() << " " + << PreTreatedData -> GetECCTMult() << endl; + + for(unsigned int i = 0 ; i < PreTreatedData -> GetECCEMult(); i++) { - + // cout << i << " " << cristal_E << endl; - // if(PreTreatedData->GetECCTTime(i) > 0) + // if(PreTreatedData->GetECCTTime(i) > 0) { ECC_E.push_back(PreTreatedData->GetECCEEnergy(i)); ECC_T.push_back(PreTreatedData->GetECCTTime(i)); ECC_CloverNumber.push_back(PreTreatedData->GetECCEClover(i)); ECC_CristalNumber.push_back(PreTreatedData->GetECCECristal(i)); - // cout << "BuildPhys " << PreTreatedData->GetECCEClover(i) << " " << PreTreatedData->GetECCECristal(i)<< " " << PreTreatedData->GetECCTTime(i) << " " << endl; + // cout << "BuildPhys " << PreTreatedData->GetECCEClover(i) << " " << PreTreatedData->GetECCECristal(i)<< " " << + PreTreatedData->GetECCTTime(i) << " " << endl; } } - + for(unsigned int j = 0 ; j < PreTreatedData -> GetGOCCEEMult(); j++) { GOCCE_E.push_back(PreTreatedData->GetGOCCEEEnergy(j)); GOCCE_CloverNumber.push_back(PreTreatedData->GetGOCCEEClover(j)); GOCCE_CristalNumber.push_back(PreTreatedData->GetGOCCEECristal(j)); GOCCE_SegmentNumber.push_back(PreTreatedData->GetGOCCEESegment(j)); } - + //int NumberOfHitClover = 0; - + int DetectorID = -1; - + for( unsigned short i = 0 ; i < PreTreatedData->GetECCEMult() ; i++ ) - { + { // cout << PreTreatedData->GetECCEClover(i) << endl; if( PreTreatedData->GetECCEClover(i) != DetectorID) - { - if(i==0) - { - NumberOfHitClover++; - } - else if(PreTreatedData->GetECCEClover(i)!= PreTreatedData->GetECCEClover(i-1) ) - { - NumberOfHitClover++; - } - } - if(NumberOfHitClover == 4) break; + { + if(i==0) + { + NumberOfHitClover++; + } + else if(PreTreatedData->GetECCEClover(i)!= PreTreatedData->GetECCEClover(i-1) ) + { + NumberOfHitClover++; + } + } + if(NumberOfHitClover == 4) break; //clover_mult -> Fill(NumberOfHitClover); - + } - + //cout << "NumberOfHitClover " << NumberOfHitClover << endl; - + map<int, vector<int> > MapCristal; - map<int, vector<int> > MapSegment; - + map<int, vector<int> > MapSegment; + map<int, vector<int> > :: iterator it; // iterator used with MapCristal map<int, vector<int> > :: iterator at; // iterator used with MapSegment vector<int> PositionOfCristal_Buffer_ECC; vector<int> PositionOfSegment_Buffer_GOCCE; - + //Fill map Cristal for(int clo = 0; clo < NumberOfClover; clo++) { for(unsigned int k = 0; k < ECC_CloverNumber.size(); k++) - { - if(ECC_CloverNumber.at(k) == clo) // && ECC_CristalNumber.at(k)== cri ) - PositionOfCristal_Buffer_ECC.push_back(k); - } + { + if(ECC_CloverNumber.at(k) == clo) // && ECC_CristalNumber.at(k)== cri ) + PositionOfCristal_Buffer_ECC.push_back(k); + } if(PositionOfCristal_Buffer_ECC.size() != 0) MapCristal[clo] = PositionOfCristal_Buffer_ECC; - + PositionOfCristal_Buffer_ECC.clear(); - + } - + //Fill map Segment for(int clo = 0; clo < NumberOfClover; clo++) { for(int cri = 0; cri < 4 ; cri++) - { - // for(int seg = 0; seg < 4 ; seg++) - { - for(unsigned int m = 0; m < GOCCE_CloverNumber.size(); m++) - { - if(GOCCE_CloverNumber.at(m) == clo && GOCCE_CristalNumber.at(m) == cri)// && GOCCE_SegmentNumber.at(m) == seg) - { - // PositionOfSegment_Buffer_GOCCE.push_back(4*clo+cri); - PositionOfSegment_Buffer_GOCCE.push_back(m); - } - } - } - if(PositionOfSegment_Buffer_GOCCE.size() != 0) MapSegment[4*clo+cri] = PositionOfSegment_Buffer_GOCCE; - - PositionOfSegment_Buffer_GOCCE.clear(); - } + { + // for(int seg = 0; seg < 4 ; seg++) + { + for(unsigned int m = 0; m < GOCCE_CloverNumber.size(); m++) + { + if(GOCCE_CloverNumber.at(m) == clo && GOCCE_CristalNumber.at(m) == cri)// && GOCCE_SegmentNumber.at(m) == seg) + { + // PositionOfSegment_Buffer_GOCCE.push_back(4*clo+cri); + PositionOfSegment_Buffer_GOCCE.push_back(m); + } } + } + if(PositionOfSegment_Buffer_GOCCE.size() != 0) MapSegment[4*clo+cri] = PositionOfSegment_Buffer_GOCCE; - // Treatment + PositionOfSegment_Buffer_GOCCE.clear(); + } + } + + // Treatment for(int clo = 0; clo < NumberOfClover ; clo++) { double E = 0; double T = 0; @@ -276,202 +274,195 @@ void TExogamPhysics::BuildPhysicalEvent() int Emax = 0, Emin = 1000000; int Tmin = 0, Tmax = 0; - //ADD-BACK - it = MapCristal.find(clo); - + //ADD-BACK + it = MapCristal.find(clo); + int cristal_cond = 0; - - if(it != MapCristal.end()) - { - vector<int> PositionOfCristal = it -> second; - - mult_cristal = PositionOfCristal.size(); - //if(mult_cristal!=0) cristal_mult -> Fill(mult_cristal); - - // ADD-BACK - //cout << "boucle" << endl; - - for(unsigned int k = 0; k < PositionOfCristal.size(); k++) - { - int indice = PositionOfCristal.at(k); - - cristal_cond += ECC_CristalNumber.at(indice); - // cout << ECC_CristalNumber.at(k) << " " ECC_E.at(k) << endl; - - if(mult_cristal < 3) - { - E+= ECC_E.at(indice); - - if(ECC_E.at(indice) < Emin) { - cristal_Emin = ECC_CristalNumber.at(indice); - Emin = ECC_E.at(indice); - Tmin = ECC_T.at(indice); - } - - if(ECC_E.at(indice) > Emax) { - cristal_Emax = ECC_CristalNumber.at(indice); - Emax = ECC_E.at(indice); - Tmax = ECC_T.at(indice); - } - } - - else // case of multiplicity = 3 or 4 - { - E = -1; cristal_Emax = -1; cristal_Emin = -1; Tmax = -1; Tmin = -1; - } - - // cout << ECC_E.at(indice) << " " << Emax << " " << cristal_Emax << " " << Emin << " " << cristal_Emin << endl; - - } - - if( (mult_cristal==1) || (mult_cristal ==2 && cristal_cond %2 == 1) ) - { - // cout << cristal_cond << endl; - - //cristal = cristal_Emax; T = Tmax; - //cout << Emax << " " << cristal_Emax << " " << Emin << " " << cristal_Emin << endl; - - if(E > 500) { cristal = cristal_Emax; T = Tmax; } - else { cristal = cristal_Emin; T = Tmin; } - - - // DOPPLER CORRECTION - - at = MapSegment.find(4*clo+cristal); - segment = -1; - - if(at != MapSegment.end()) - { - vector<int> PositionOfSegment = at -> second; // position of segment k in the vector - - int segment_max = -1, E_temp = -1; - - for(unsigned int m = 0; m < PositionOfSegment.size(); m++) // loop on hit segments of cristal cri of clover clo - { - int indice = PositionOfSegment.at(m); - - if(GOCCE_E.at(indice) > 0 && GOCCE_CristalNumber.at(indice) == cristal) - { - if( GOCCE_E.at(indice) > E_temp ) - { - segment_max = GOCCE_SegmentNumber.at(indice) ; - E_temp = GOCCE_E.at(indice); - } - } - } - segment = segment_max; - } - - } - - - if(E > 0 && cristal != -1 && segment != -1) - { - TotalEnergy_lab.push_back(E); - Time.push_back(T); - CloverNumber.push_back(clo); - CristalNumber.push_back(cristal); - SegmentNumber.push_back(segment); - - double theta = GetSegmentAngleTheta(clo, cristal, segment); - - Theta.push_back(theta); - - double doppler_E = DopplerCorrection(E, theta); - DopplerCorrectedEnergy.push_back(doppler_E); - - // cout << E << " " << clo << " " << cristal << " " << segment << " " << theta << " " << doppler_E << endl; - - } - - } // end of condition over CristalMap + + if(it != MapCristal.end()) + { + vector<int> PositionOfCristal = it -> second; + + mult_cristal = PositionOfCristal.size(); + //if(mult_cristal!=0) cristal_mult -> Fill(mult_cristal); + + // ADD-BACK + //cout << "boucle" << endl; + + for(unsigned int k = 0; k < PositionOfCristal.size(); k++) + { + int indice = PositionOfCristal.at(k); + + cristal_cond += ECC_CristalNumber.at(indice); + // cout << ECC_CristalNumber.at(k) << " " ECC_E.at(k) << endl; + + if(mult_cristal < 3) + { + E+= ECC_E.at(indice); + + if(ECC_E.at(indice) < Emin) { + cristal_Emin = ECC_CristalNumber.at(indice); + Emin = ECC_E.at(indice); + Tmin = ECC_T.at(indice); + } + + if(ECC_E.at(indice) > Emax) { + cristal_Emax = ECC_CristalNumber.at(indice); + Emax = ECC_E.at(indice); + Tmax = ECC_T.at(indice); + } + } + + else // case of multiplicity = 3 or 4 + { + E = -1; cristal_Emax = -1; cristal_Emin = -1; Tmax = -1; Tmin = -1; + } + + // cout << ECC_E.at(indice) << " " << Emax << " " << cristal_Emax << " " << Emin << " " << cristal_Emin << endl; + + } + + if( (mult_cristal==1) || (mult_cristal ==2 && cristal_cond %2 == 1) ) + { + // cout << cristal_cond << endl; + + //cristal = cristal_Emax; T = Tmax; + //cout << Emax << " " << cristal_Emax << " " << Emin << " " << cristal_Emin << endl; + + if(E > 500) { cristal = cristal_Emax; T = Tmax; } + else { cristal = cristal_Emin; T = Tmin; } + + + // DOPPLER CORRECTION + + at = MapSegment.find(4*clo+cristal); + segment = -1; + + if(at != MapSegment.end()) + { + vector<int> PositionOfSegment = at -> second; // position of segment k in the vector + + int segment_max = -1, E_temp = -1; + + for(unsigned int m = 0; m < PositionOfSegment.size(); m++) // loop on hit segments of cristal cri of + clover clo + { + int indice = PositionOfSegment.at(m); + + if(GOCCE_E.at(indice) > 0 && GOCCE_CristalNumber.at(indice) == cristal) + { + if( GOCCE_E.at(indice) > E_temp ) + { + segment_max = GOCCE_SegmentNumber.at(indice) ; + E_temp = GOCCE_E.at(indice); + } + } + } + segment = segment_max; + } + + } + + + if(E > 0 && cristal != -1 && segment != -1) + { + TotalEnergy_lab.push_back(E); + Time.push_back(T); + CloverNumber.push_back(clo); + CristalNumber.push_back(cristal); + SegmentNumber.push_back(segment); + + double theta = GetSegmentAngleTheta(clo, cristal, segment); + + Theta.push_back(theta); + + double doppler_E = DopplerCorrection(E, theta); + DopplerCorrectedEnergy.push_back(doppler_E); + + // cout << E << " " << clo << " " << cristal << " " << segment << " " << theta << " " << doppler_E << endl; + + } + + } // end of condition over CristalMap } // loop over NumberOfClover CloverMult = GetClover_Mult(); - //cout << "Exogam fine" << endl; + //cout << "Exogam fine" << endl; */ -} - +} -double TExogamPhysics::DopplerCorrection(double E, double Theta) -{ - double Pi = 3.141592654 ; +double TExogamPhysics::DopplerCorrection(double E, double Theta) { + double Pi = 3.141592654; TString filename = "configs/beta.txt"; ifstream file; - //cout << filename << endl; + // cout << filename << endl; file.open(filename); - if(!file) cout << filename << " was not opened" << endl; + if (!file) + cout << filename << " was not opened" << endl; double E_corr = 0; - double beta = 0.; - file>>beta; - double gamma = 1./ sqrt(1-beta*beta); + double beta = 0.; + file >> beta; + double gamma = 1. / sqrt(1 - beta * beta); - E_corr = gamma * E * ( 1. - beta * cos(Theta*Pi/180.)); - - return(E_corr); + E_corr = gamma * E * (1. - beta * cos(Theta * Pi / 180.)); + return (E_corr); } - /////////////////////////////////////////////////////////////////////////// - -void TExogamPhysics::Clear() -{ - EventMultiplicity = 0; - ECC_Multiplicity = 0; +void TExogamPhysics::Clear() { + EventMultiplicity = 0; + ECC_Multiplicity = 0; GOCCE_Multiplicity = 0; - NumberOfHitClover = 0; - NumberOfHitCristal = 0; + NumberOfHitClover = 0; + NumberOfHitCristal = 0; - ECC_CloverNumber .clear() ; - ECC_CristalNumber .clear() ; - GOCCE_CloverNumber .clear() ; - GOCCE_CristalNumber .clear() ; - GOCCE_SegmentNumber .clear() ; + ECC_CloverNumber.clear(); + ECC_CristalNumber.clear(); + GOCCE_CloverNumber.clear(); + GOCCE_CristalNumber.clear(); + GOCCE_SegmentNumber.clear(); // ECC - ECC_E.clear() ; + ECC_E.clear(); ECC_T.clear(); // GOCCE - GOCCE_E.clear() ; - - CristalNumber.clear() ; - SegmentNumber.clear() ; - CloverNumber .clear() ; - - TotalEnergy_lab .clear() ; - Time .clear() ; - DopplerCorrectedEnergy.clear() ; - Position .clear() ; - Theta .clear() ; - + GOCCE_E.clear(); + CristalNumber.clear(); + SegmentNumber.clear(); + CloverNumber.clear(); + TotalEnergy_lab.clear(); + Time.clear(); + DopplerCorrectedEnergy.clear(); + Position.clear(); + Theta.clear(); } /////////////////////////////////////////////////////////////////////////// -//// Innherited from VDetector Class //// - +//// Innherited from VDetector Class //// + // Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token -void TExogamPhysics::ReadConfiguration(NPL::InputParser parser){ +void TExogamPhysics::ReadConfiguration(NPL::InputParser parser) { vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("Exogam"); - if(NPOptionManager::getInstance()->GetVerboseLevel()) - cout << "//// " << blocks.size() << " detectors found " << endl; + if (NPOptionManager::getInstance()->GetVerboseLevel()) + cout << "//// " << blocks.size() << " detectors found " << endl; vector<string> token = {"ANGLE_FILE"}; - for(unsigned int i = 0 ; i < blocks.size() ; i++){ - if(blocks[i]->HasTokenList(token)){ + for (unsigned int i = 0; i < blocks.size(); i++) { + if (blocks[i]->HasTokenList(token)) { string AngleFile = blocks[i]->GetString("ANGLE_FILE"); AddClover(AngleFile); } - else{ + else { cout << "ERROR: check your input file formatting " << endl; exit(1); } @@ -479,122 +470,111 @@ void TExogamPhysics::ReadConfiguration(NPL::InputParser parser){ } /////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::InitSpectra(){ - m_Spectra = new TExogamSpectra(NumberOfClover); -} +void TExogamPhysics::InitSpectra() { m_Spectra = new TExogamSpectra(NumberOfClover); } /////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::FillSpectra(){ - m_Spectra -> FillRawSpectra(EventData); - m_Spectra -> FillPreTreatedSpectra(PreTreatedData); - m_Spectra -> FillPhysicsSpectra(EventPhysics); +void TExogamPhysics::FillSpectra() { + m_Spectra->FillRawSpectra(EventData); + m_Spectra->FillPreTreatedSpectra(PreTreatedData); + m_Spectra->FillPhysicsSpectra(EventPhysics); } /////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::CheckSpectra(){ - m_Spectra->CheckSpectra(); -} +void TExogamPhysics::CheckSpectra() { m_Spectra->CheckSpectra(); } /////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::ClearSpectra(){ +void TExogamPhysics::ClearSpectra() { // To be done } /////////////////////////////////////////////////////////////////////////// -map< string , TH1*> TExogamPhysics::GetSpectra() { - if(m_Spectra) +map<string, TH1*> TExogamPhysics::GetSpectra() { + if (m_Spectra) return m_Spectra->GetMapHisto(); - else{ - map< string , TH1*> empty; + else { + map<string, TH1*> empty; return empty; } -} +} ////////////////////////////////////////////////////////////////////////// -void TExogamPhysics::AddClover(string AngleFile) -{ +void TExogamPhysics::AddClover(string AngleFile) { ifstream file; // TString filename = Form("posBaptiste/angles_exogam_clover%d.txt",NumberOfClover); // TString filename = Form("posz42_simu50mm/angles_exogam_clover%d.txt",NumberOfClover); // TString filename = Form("posz42_exp_stat_demiring/angles_exogam_clover%d.txt",NumberOfClover); - + string path = "configs/"; TString filename = path + AngleFile; - + cout << filename << endl; file.open(filename); - if(!file) cout << filename << " was not opened" << endl; + if (!file) + cout << filename << " was not opened" << endl; + + vector<double> Angles; + vector<vector<double>> Segment_angles; + vector<vector<vector<double>>> Cristal_angles; - vector <double> Angles; - vector < vector <double> > Segment_angles; - vector < vector < vector <double> > > Cristal_angles; - Cristal_angles.clear(); - double angle; string buffer; + double angle; + string buffer; - for(int i = 0; i < 4; i++) - { - Segment_angles.clear(); - - for(int j = 0; j < 4; j++) - { - Angles.clear(); - - for(int k = 0; k < 2; k++) - { - file >> buffer >> angle; - - Angles.push_back(angle); // Theta (k = 0) Phi (k = 1) - - //cout << angle << endl; - if(Angles.size()==2) - cout << "Clover " << NumberOfClover << ": Theta=" << Angles[0] << " Phi=" << Angles[1]<< endl; - - } - - Segment_angles.push_back(Angles); - } - - Cristal_angles.push_back(Segment_angles); + for (int i = 0; i < 4; i++) { + Segment_angles.clear(); + + for (int j = 0; j < 4; j++) { + Angles.clear(); + + for (int k = 0; k < 2; k++) { + file >> buffer >> angle; + + Angles.push_back(angle); // Theta (k = 0) Phi (k = 1) + + // cout << angle << endl; + if (Angles.size() == 2) + cout << "Clover " << NumberOfClover << ": Theta=" << Angles[0] << " Phi=" << Angles[1] << endl; + } + + Segment_angles.push_back(Angles); } + Cristal_angles.push_back(Segment_angles); + } + Clover_Angles_Theta_Phi.push_back(Cristal_angles); file.close(); NumberOfClover++; - -} - +} // Add Parameter to the CalibrationManger -void TExogamPhysics::AddParameterToCalibrationManager() -{ - +void TExogamPhysics::AddParameterToCalibrationManager() { + CalibrationManager* Cal = CalibrationManager::getInstance(); - - for(int i = 0 ; i < NumberOfClover ; i++) - { - for( int j = 0 ; j < 4 ; j++) - { - Cal->AddParameter("EXOGAM", "Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_Elow" ,"EXOGAM_Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_Elow"); - Cal->AddParameter("EXOGAM", "Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_Ehigh","EXOGAM_Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_Ehigh"); - Cal->AddParameter("EXOGAM", "Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_T","EXOGAM_Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_T") ; - - for( int k = 0 ; k < 4 ; k++) - { - Cal->AddParameter("EXOGAM", "Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_Seg"+ NPL::itoa(k)+"_E","EXOGAM_Cl"+ NPL::itoa(i)+"_Cr"+ NPL::itoa(j)+"_Seg"+ NPL::itoa(k)+"_E") ; - } - } + + for (int i = 0; i < NumberOfClover; i++) { + for (int j = 0; j < 4; j++) { + Cal->AddParameter("EXOGAM", "Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_Elow", + "EXOGAM_Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_Elow"); + Cal->AddParameter("EXOGAM", "Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_Ehigh", + "EXOGAM_Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_Ehigh"); + Cal->AddParameter("EXOGAM", "Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_T", + "EXOGAM_Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_T"); + + for (int k = 0; k < 4; k++) { + Cal->AddParameter("EXOGAM", "Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_Seg" + NPL::itoa(k) + "_E", + "EXOGAM_Cl" + NPL::itoa(i) + "_Cr" + NPL::itoa(j) + "_Seg" + NPL::itoa(k) + "_E"); + } } + } } - // Activated associated Branches and link it to the private member DetectorData address // In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated -void TExogamPhysics::InitializeRootInputRaw() -{ - TChain* inputChain = RootInput::getInstance()->GetChain() ; - inputChain->SetBranchStatus( "EXOGAM" , true ) ; - inputChain->SetBranchStatus( "fEXO_*" , true ) ; - inputChain->SetBranchAddress( "EXOGAM" , &EventData ) ; +void TExogamPhysics::InitializeRootInputRaw() { + TChain* inputChain = RootInput::getInstance()->GetChain(); + inputChain->SetBranchStatus("EXOGAM", true); + inputChain->SetBranchStatus("fEXO_*", true); + inputChain->SetBranchAddress("EXOGAM", &EventData); /* TList* outputList = RootOutput::getInstance()->GetList(); @@ -610,82 +590,74 @@ void TExogamPhysics::InitializeRootInputRaw() // In this method mother Branches (Detector) AND daughter leaf (parameter) have to be activated void TExogamPhysics::InitializeRootInputPhysics() { TChain* inputChain = RootInput::getInstance()->GetChain(); - inputChain->SetBranchStatus( "EventMultiplicty" , true ); - inputChain->SetBranchStatus( "ECC_Multiplicity" , true ); - inputChain->SetBranchStatus( "GOCCE_Multiplicity" , true ); - inputChain->SetBranchStatus( "ECC_CloverNumber" , true ); - inputChain->SetBranchStatus( "ECC_CristalNumber" , true ); - inputChain->SetBranchStatus( "GOCCE_CloverNumber" , true ); - inputChain->SetBranchStatus( "GOCCE_CristalNumber" , true ); - inputChain->SetBranchStatus( "GOCCE_SegmentNumber" , true ); - inputChain->SetBranchStatus( "ECC_E" , true ); - inputChain->SetBranchStatus( "ECC_T" , true ); - inputChain->SetBranchStatus( "GOCCE_E" , true ); - inputChain->SetBranchStatus( "CristalNumber" , true ); - inputChain->SetBranchStatus( "SegmentNumber" , true ); - inputChain->SetBranchStatus( "CloverNumber" , true ); - inputChain->SetBranchStatus( "CloverMult" , true ); - inputChain->SetBranchStatus( "TotalEnergy_lab" , true ); - inputChain->SetBranchStatus( "Time" , true ); - inputChain->SetBranchStatus( "DopplerCorrectedEnergy" , true ); - inputChain->SetBranchStatus( "Position" , true ); - inputChain->SetBranchStatus( "Theta" , true ); - inputChain->SetBranchAddress( "EXOGAM" , &EventPhysics ); - + inputChain->SetBranchStatus("EventMultiplicty", true); + inputChain->SetBranchStatus("ECC_Multiplicity", true); + inputChain->SetBranchStatus("GOCCE_Multiplicity", true); + inputChain->SetBranchStatus("ECC_CloverNumber", true); + inputChain->SetBranchStatus("ECC_CristalNumber", true); + inputChain->SetBranchStatus("GOCCE_CloverNumber", true); + inputChain->SetBranchStatus("GOCCE_CristalNumber", true); + inputChain->SetBranchStatus("GOCCE_SegmentNumber", true); + inputChain->SetBranchStatus("ECC_E", true); + inputChain->SetBranchStatus("ECC_T", true); + inputChain->SetBranchStatus("GOCCE_E", true); + inputChain->SetBranchStatus("CristalNumber", true); + inputChain->SetBranchStatus("SegmentNumber", true); + inputChain->SetBranchStatus("CloverNumber", true); + inputChain->SetBranchStatus("CloverMult", true); + inputChain->SetBranchStatus("TotalEnergy_lab", true); + inputChain->SetBranchStatus("Time", true); + inputChain->SetBranchStatus("DopplerCorrectedEnergy", true); + inputChain->SetBranchStatus("Position", true); + inputChain->SetBranchStatus("Theta", true); + inputChain->SetBranchAddress("EXOGAM", &EventPhysics); } ///////////////////////////////////////////////////////////////////// // Create associated branches and associated private member DetectorPhysics address -void TExogamPhysics::InitializeRootOutput() -{ - TTree* outputTree = RootOutput::getInstance()->GetTree() ; - outputTree->Branch( "EXOGAM" , "TExogamPhysics" , &EventPhysics ) ; +void TExogamPhysics::InitializeRootOutput() { + TTree* outputTree = RootOutput::getInstance()->GetTree(); + outputTree->Branch("EXOGAM", "TExogamPhysics", &EventPhysics); // control histograms if needed - /* + /* TList* outputList = RootOutput::getInstance()->GetList(); controle = new TH1F("controle","histo de controle",20,0,20); outputList->Add(controle); */ - } - /////////////////////////////////////////////////////////////////////////// -namespace EXOGAM_LOCAL -{ +namespace EXOGAM_LOCAL { // tranform an integer to a string - string itoa(int value) - { + string itoa(int value) { std::ostringstream o; - + if (!(o << value)) - return "" ; - + return ""; + return o.str(); } -} - - ///////////////////////////// +} // namespace EXOGAM_LOCAL + +///////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Construct Method to be pass to the DetectorFactory // //////////////////////////////////////////////////////////////////////////////// -NPL::VDetector* TExogamPhysics::Construct(){ - return (NPL::VDetector*) new TExogamPhysics(); -} +NPL::VDetector* TExogamPhysics::Construct() { return (NPL::VDetector*)new TExogamPhysics(); } //////////////////////////////////////////////////////////////////////////////// // Registering the construct method to the factory // //////////////////////////////////////////////////////////////////////////////// -extern "C"{ -class proxy_exogam{ - public: - proxy_exogam(){ - NPL::DetectorFactory::getInstance()->AddToken("Exogam","Exogam"); - NPL::DetectorFactory::getInstance()->AddDetector("Exogam",TExogamPhysics::Construct); - } +extern "C" { +class proxy_exogam { + public: + proxy_exogam() { + NPL::DetectorFactory::getInstance()->AddToken("Exogam", "Exogam"); + NPL::DetectorFactory::getInstance()->AddDetector("Exogam", TExogamPhysics::Construct); + } }; proxy_exogam p; -} \ No newline at end of file +}