diff --git a/NPLib/Detectors/Epic/TEpicData.h b/NPLib/Detectors/Epic/TEpicData.h index fb8561b3801bc692ef9a65e2d7a87cc1e5df16cc..1f4997855e22dfbaab5be5384053418ff181aa6d 100644 --- a/NPLib/Detectors/Epic/TEpicData.h +++ b/NPLib/Detectors/Epic/TEpicData.h @@ -29,30 +29,41 @@ using namespace std; // ROOT #include "TObject.h" +class ElectronsStep{ + + private: + int num_electrons; + double t_creation; + + public: + ElectronsStep(int n, double t) : num_electrons(n), t_creation(t){ } + + ClassDef(ElectronsStep, 1) // ROOT macro for dictionary +}; + class TEpicData : public TObject { public: // per TrackID + struct EpicAnodeData { - int TrackID; - string ParticleName; - UShort_t AnodeNbr; - Double_t Q1; - Double_t Time; - // vector of {DEstep, DTstep} : - // attention steps are modified to have a fix width along the z axis - std::vector<Double_t> DE; - std::vector<Double_t> DT; // DT=Ti-T0, with T0=Tfission or Tfirst_alpha - - // Getters - int GetTrackID() const { return TrackID; } - string GetParticleName() const { return ParticleName; } - UShort_t GetAnodeNbr() const { return AnodeNbr; } - Double_t GetQ1() const { return Q1; } - Double_t GetTime() const { return Time; } - const std::vector<Double_t>& GetDE() const { return DE; } - const std::vector<Double_t>& GetDT() const { return DT; } + int TrackID; + string ParticleName; + UShort_t AnodeNbr; + Double_t Q1; + Double_t Time; + vector<int> n_electrons_step; + vector<double> t_creation_step; + + // Getters + int GetTrackID() const { return TrackID; } + string GetParticleName() const { return ParticleName; } + UShort_t GetAnodeNbr() const { return AnodeNbr; } + Double_t GetQ1() const { return Q1; } + Double_t GetTime() const { return Time; } + const vector<int>& GetNumElectronsPerStep() const { return n_electrons_step; } + const vector<double>& GetTimeCreationElectronsPerStep() const { return t_creation_step; } }; ////////////////////////////////////////////////////////////// @@ -84,8 +95,8 @@ class TEpicData : public TObject { public: ////////////////////// SETTERS //////////////////////// void Set(const int& tid, const string& name, const UShort_t& n, const Double_t& q1, const Double_t& t, - const std::vector<double>& de, const std::vector<double>& dt) { - fEpic_Data.push_back({tid, name, n, q1, t, de, dt}); + const vector<int> num, const vector<double> t_creation) { + fEpic_Data.push_back({tid, name, n, q1, t, num, t_creation}); } const EpicAnodeData& operator[](const unsigned int& i) const {return fEpic_Data[i];} @@ -96,10 +107,9 @@ class TEpicData : public TObject { UShort_t GetAnodeNbr(const unsigned short& i) const { return fEpic_Data[i].AnodeNbr; } Double_t GetQ1(const unsigned int& i) const { return fEpic_Data[i].Q1; } Double_t GetTime(const unsigned int& i) const { return fEpic_Data[i].Time; } - const std::vector<Double_t>& GetDE(const unsigned int& i) const { return fEpic_Data[i].DE; } - const std::vector<Double_t>& GetDT(const unsigned int& i) const { return fEpic_Data[i].DT; } - int GetStepNumbers(const unsigned int& i) const { return fEpic_Data[i].DT.size();} - ////////////////////////////////////////////////////////////// + const vector<int>& GetNumElectronsPerStep(const unsigned int& i)const { return fEpic_Data[i].n_electrons_step; } + const vector<double>& GetTimeCreationElectronsPerStep(const unsigned int& i)const { return fEpic_Data[i].t_creation_step; } + ////////////////////////////////////////////////////////////// // Required for ROOT dictionnary ClassDef(TEpicData,1) // EpicData structure }; diff --git a/NPLib/Detectors/Epic/TEpicPhysics.cxx b/NPLib/Detectors/Epic/TEpicPhysics.cxx index 58bfd2de37c38ccea14049c89054dc77a6130643..db0806165c3cb239ab891d772f3347ba4ed52828 100644 --- a/NPLib/Detectors/Epic/TEpicPhysics.cxx +++ b/NPLib/Detectors/Epic/TEpicPhysics.cxx @@ -116,8 +116,8 @@ void TEpicPhysics::PreTreat() { m_PreTreatedData->Set(m_EventData->GetTrackID(i), m_EventData->GetParticleName(i), AnodeNumber, Q1, Time, - m_EventData->GetDE(i), - m_EventData->GetDT(i)); + m_EventData->GetNumElectronsPerStep(i), + m_EventData->GetTimeCreationElectronsPerStep(i)); } } diff --git a/NPSimulation/Detectors/Epic/Epic.cc b/NPSimulation/Detectors/Epic/Epic.cc index 75896713dd4f85ab291eb7414b10cacfcc311e8a..3a8460312b88482b407fb1af354aad3eb99570b9 100644 --- a/NPSimulation/Detectors/Epic/Epic.cc +++ b/NPSimulation/Detectors/Epic/Epic.cc @@ -583,6 +583,7 @@ void Epic::ReadSensitive(const G4Event* ){ vector<double> rebinned_de(num_bins, 0.0); vector<double> rebinned_dt(num_bins, 0.0); vector<double> rebinned_mult(num_bins, 0.0); + vector<int> mult_electrons_per_step(num_bins, 0.0); double bin_Limits[num_bins+1]; for(int bin=0; bin<=num_bins; bin++) bin_Limits[bin] = m_Distance_AK*mm - bin * (25.*um); @@ -604,7 +605,7 @@ void Epic::ReadSensitive(const G4Event* ){ double weight = (dzmax-bin_Limits[bin+1])/(dzmax-dzmin); rebinned_de[bin] += weight * de[step]; rebinned_de[bin+1] += (1.-weight) * de[step]; rebinned_dt[bin] += weight * dt[step]; rebinned_dt[bin+1] += (1.-weight) * dt[step]; - rebinned_mult[bin] += weight ; rebinned_mult[bin+1] += 1. - weight ; + rebinned_mult[bin] += weight ; rebinned_mult[bin+1] += 1. - weight ; break; } } @@ -614,6 +615,8 @@ void Epic::ReadSensitive(const G4Event* ){ rebinned_mult[num_bins-1] += 1.; for(int i=0; i<num_bins-1; i++){ if(rebinned_mult[i]>0) rebinned_dt[i] = rebinned_dt[i] / rebinned_mult[i] ; + //// FIXME : replace 45. by the ionisation energy read in the configuration file + mult_electrons_per_step[i] = ceil(rebinned_de[i]/45.); } m_Event->Set(trackID, @@ -621,9 +624,12 @@ void Epic::ReadSensitive(const G4Event* ){ m_mapping_A[Anode], // set anode number influence_pertrackID, // set Q1 FF or alpha only time_pertrackID, // set Time - rebinned_de, rebinned_dt); + mult_electrons_per_step, + rebinned_dt); rebinned_de.clear(); rebinned_dt.clear(); + rebinned_mult.clear(); + mult_electrons_per_step.clear(); } trackID = step_trackID.at(j); name_pertrackID = step_name.at(j);