diff --git a/inc/TRestDetectorHitsEvent.h b/inc/TRestDetectorHitsEvent.h index 15f171d7..0d6d9b8f 100644 --- a/inc/TRestDetectorHitsEvent.h +++ b/inc/TRestDetectorHitsEvent.h @@ -55,7 +55,7 @@ class TRestDetectorHitsEvent : public TRestEvent { public: void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t = 0, REST_HitType type = XYZ); - void AddHit(TVector3 pos, Double_t en, Double_t t = 0, REST_HitType type = XYZ); + void AddHit(const TVector3& pos, Double_t en, Double_t t = 0, REST_HitType type = XYZ); void Sort(bool(compareCondition)(const TRestHits::iterator& hit1, const TRestHits::iterator& hit2) = nullptr); @@ -122,9 +122,7 @@ class TRestDetectorHitsEvent : public TRestEvent { inline Double_t GetEnergyX() const { return fHits->GetEnergyX(); } inline Double_t GetEnergyY() const { return fHits->GetEnergyY(); } - inline Double_t GetTotalDepositedEnergy() const { return fHits->GetTotalDepositedEnergy(); } inline Double_t GetTotalEnergy() const { return fHits->GetTotalEnergy(); } - inline Double_t GetEnergy() const { return fHits->GetEnergy(); } inline Double_t GetEnergy(int n) const { return fHits->GetEnergy(n); } inline Double_t GetTime(int n) const { return GetHits()->GetTime(n); } // return value in us diff --git a/src/TRestDetectorElectronDiffusionProcess.cxx b/src/TRestDetectorElectronDiffusionProcess.cxx index 98d6b6f1..9567303b 100644 --- a/src/TRestDetectorElectronDiffusionProcess.cxx +++ b/src/TRestDetectorElectronDiffusionProcess.cxx @@ -123,12 +123,12 @@ TRestEvent* TRestDetectorElectronDiffusionProcess::ProcessEvent(TRestEvent* inpu Int_t isAttached; - Int_t totalElectrons = fInputHitsEvent->GetEnergy() * REST_Units::eV / fWvalue; + Int_t totalElectrons = fInputHitsEvent->GetTotalEnergy() * REST_Units::eV / fWvalue; Double_t wValue = fWvalue; if (fMaxHits > 0 && totalElectrons > fMaxHits) { // set a fake w-value if max hits are limited. this fake w-value will be larger - wValue = fInputHitsEvent->GetEnergy() * REST_Units::eV / fMaxHits; + wValue = fInputHitsEvent->GetTotalEnergy() * REST_Units::eV / fMaxHits; } for (int n = 0; n < nHits; n++) { @@ -209,12 +209,12 @@ TRestEvent* TRestDetectorElectronDiffusionProcess::ProcessEvent(TRestEvent* inpu } if (this->GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) { - cout << "TRestDetectorElectronDiffusionProcess. Input hits energy : " << fInputHitsEvent->GetEnergy() - << endl; + cout << "TRestDetectorElectronDiffusionProcess. Input hits energy : " + << fInputHitsEvent->GetTotalEnergy() << endl; cout << "TRestDetectorElectronDiffusionProcess. Hits added : " << fOutputHitsEvent->GetNumberOfHits() << endl; - cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : " << fOutputHitsEvent->GetEnergy() - << endl; + cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : " + << fOutputHitsEvent->GetTotalEnergy() << endl; if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Extreme) GetChar(); } diff --git a/src/TRestDetectorFiducializationProcess.cxx b/src/TRestDetectorFiducializationProcess.cxx index 868068a1..f8cd2e40 100644 --- a/src/TRestDetectorFiducializationProcess.cxx +++ b/src/TRestDetectorFiducializationProcess.cxx @@ -79,13 +79,15 @@ TRestEvent* TRestDetectorFiducializationProcess::ProcessEvent(TRestEvent* inputE } } - if (fOutputHitsEvent->GetNumberOfHits() == 0) return nullptr; + if (fOutputHitsEvent->GetNumberOfHits() == 0) { + return nullptr; + } if (this->GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) { cout << "TRestDetectorFiducializationProcess. Hits added : " << fOutputHitsEvent->GetNumberOfHits() << endl; - cout << "TRestDetectorFiducializationProcess. Hits total energy : " << fOutputHitsEvent->GetEnergy() - << endl; + cout << "TRestDetectorFiducializationProcess. Hits total energy : " + << fOutputHitsEvent->GetTotalEnergy() << endl; } return fOutputHitsEvent; diff --git a/src/TRestDetectorGarfieldDriftProcess.cxx b/src/TRestDetectorGarfieldDriftProcess.cxx index 4307e027..3d7a82a0 100644 --- a/src/TRestDetectorGarfieldDriftProcess.cxx +++ b/src/TRestDetectorGarfieldDriftProcess.cxx @@ -419,8 +419,8 @@ TRestEvent* TRestDetectorGarfieldDriftProcess::ProcessEvent(TRestEvent* inputEve if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) { cout << "TRestDetectorElectronDiffusionProcess. Hits added : " << fOutputHitsEvent->GetNumberOfHits() << endl; - cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : " << fOutputHitsEvent->GetEnergy() - << endl; + cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : " + << fOutputHitsEvent->GetTotalEnergy() << endl; cout << " fTimedHitsEvent " << fOutputHitsEvent << " class " << fOutputHitsEvent->ClassName() << endl; fOutputHitsEvent->PrintEvent(20); } diff --git a/src/TRestDetectorHits3DReconstructionProcess.cxx b/src/TRestDetectorHits3DReconstructionProcess.cxx index 3358cbc6..32667cc6 100644 --- a/src/TRestDetectorHits3DReconstructionProcess.cxx +++ b/src/TRestDetectorHits3DReconstructionProcess.cxx @@ -523,8 +523,8 @@ TRestEvent* TRestDetectorHits3DReconstructionProcess::ProcessEvent(TRestEvent* i // scale the total energy if (fDoEnergyScaling) { - double e1 = fInputHitsEvent->GetEnergy(); - double e2 = fOutputHitsEvent->GetEnergy(); + double e1 = fInputHitsEvent->GetTotalEnergy(); + double e2 = fOutputHitsEvent->GetTotalEnergy(); for (auto h : *fOutputHitsEvent->GetHits()) { h.e() = h.e() / e2 * e1; } diff --git a/src/TRestDetectorHitsAnalysisProcess.cxx b/src/TRestDetectorHitsAnalysisProcess.cxx index fd2b4937..6fc32cf8 100644 --- a/src/TRestDetectorHitsAnalysisProcess.cxx +++ b/src/TRestDetectorHitsAnalysisProcess.cxx @@ -175,7 +175,7 @@ TRestEvent* TRestDetectorHitsAnalysisProcess::ProcessEvent(TRestEvent* inputEven fOutputHitsEvent->AddHit(x, y, z, eDep, time, type); } - Double_t energy = fOutputHitsEvent->GetEnergy(); + Double_t energy = fOutputHitsEvent->GetTotalEnergy(); TVector3 meanPosition = fOutputHitsEvent->GetMeanPosition(); Double_t sigmaX = fOutputHitsEvent->GetSigmaX(); Double_t sigmaY = fOutputHitsEvent->GetSigmaY(); diff --git a/src/TRestDetectorHitsEvent.cxx b/src/TRestDetectorHitsEvent.cxx index 08f1340a..54faf45d 100644 --- a/src/TRestDetectorHitsEvent.cxx +++ b/src/TRestDetectorHitsEvent.cxx @@ -97,7 +97,7 @@ TRestDetectorHitsEvent::~TRestDetectorHitsEvent() { delete fHits; } /// structure. Additionaly a time delay value in `us` may be added to the hits. void TRestDetectorHitsEvent::AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t, REST_HitType type) { - fHits->AddHit(x, y, z, en, t, type); + fHits->AddHit({x, y, z}, en, t, type); } /////////////////////////////////////////////// @@ -105,7 +105,7 @@ void TRestDetectorHitsEvent::AddHit(Double_t x, Double_t y, Double_t z, Double_t /// /// It adds a new hit with position `pos` in mm, and energy `en` in keV, to this TRestDetectorHitsEvent /// structure. Additionaly a time delay value in `us` may be added to the hits. -void TRestDetectorHitsEvent::AddHit(TVector3 pos, Double_t en, Double_t t, REST_HitType type) { +void TRestDetectorHitsEvent::AddHit(const TVector3& pos, Double_t en, Double_t t, REST_HitType type) { fHits->AddHit(pos, en, t, type); } @@ -172,8 +172,8 @@ TRestHits* TRestDetectorHitsEvent::GetXZHits() { for (unsigned int i = 0; i < this->GetNumberOfHits(); i++) if (GetType(i) == XZ) - fXZHits->AddHit(this->GetX(i), this->GetY(i), this->GetZ(i), this->GetEnergy(i), this->GetTime(i), - XZ); + fXZHits->AddHit({this->GetX(i), this->GetY(i), this->GetZ(i)}, this->GetEnergy(i), + this->GetTime(i), XZ); return fXZHits; } @@ -190,8 +190,8 @@ TRestHits* TRestDetectorHitsEvent::GetYZHits() { for (unsigned int i = 0; i < this->GetNumberOfHits(); i++) if (GetType(i) == YZ) - fYZHits->AddHit(this->GetX(i), this->GetY(i), this->GetZ(i), this->GetEnergy(i), this->GetTime(i), - YZ); + fYZHits->AddHit({this->GetX(i), this->GetY(i), this->GetZ(i)}, this->GetEnergy(i), + this->GetTime(i), YZ); return fYZHits; } @@ -208,7 +208,7 @@ TRestHits* TRestDetectorHitsEvent::GetXYZHits() { for (unsigned int i = 0; i < this->GetNumberOfHits(); i++) if (GetType(i) == XYZ) - fXYZHits->AddHit(this->GetX(i), this->GetY(i), this->GetZ(i), this->GetEnergy(i), + fXYZHits->AddHit({this->GetX(i), this->GetY(i), this->GetZ(i)}, this->GetEnergy(i), this->GetTime(i), XYZ); return fXYZHits; @@ -948,7 +948,7 @@ void TRestDetectorHitsEvent::DrawHistograms(Int_t& column, const TString& histOp void TRestDetectorHitsEvent::PrintEvent(Int_t nHits) const { TRestEvent::PrintEvent(); - cout << "Total energy : " << GetEnergy() << endl; + cout << "Total energy : " << GetTotalEnergy() << endl; cout << "Mean position : ( " << GetMeanPositionX() << " , " << GetMeanPositionY() << " , " << GetMeanPositionZ() << " ) " << endl; cout << "Number of hits : " << fHits->GetNumberOfHits() << endl; diff --git a/src/TRestDetectorHitsNormalizationProcess.cxx b/src/TRestDetectorHitsNormalizationProcess.cxx index 8c4c6ddb..932e4526 100644 --- a/src/TRestDetectorHitsNormalizationProcess.cxx +++ b/src/TRestDetectorHitsNormalizationProcess.cxx @@ -85,8 +85,8 @@ TRestEvent* TRestDetectorHitsNormalizationProcess::ProcessEvent(TRestEvent* inpu if (this->GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) { cout << "TRestDetectorHitsNormalizationProcess. Hits added : " << fHitsOutputEvent->GetNumberOfHits() << endl; - cout << "TRestDetectorHitsNormalizationProcess. Hits total energy : " << fHitsOutputEvent->GetEnergy() - << endl; + cout << "TRestDetectorHitsNormalizationProcess. Hits total energy : " + << fHitsOutputEvent->GetTotalEnergy() << endl; } return fHitsOutputEvent; diff --git a/src/TRestDetectorPositionMappingProcess.cxx b/src/TRestDetectorPositionMappingProcess.cxx index f1aa3df7..a49e369d 100644 --- a/src/TRestDetectorPositionMappingProcess.cxx +++ b/src/TRestDetectorPositionMappingProcess.cxx @@ -76,7 +76,7 @@ TRestEvent* TRestDetectorPositionMappingProcess::ProcessEvent(TRestEvent* inputE double y = fHitsEvent->GetMeanPositionY(); double z = fHitsEvent->GetMeanPositionZ(); - double e = fHitsEvent->GetEnergy(); + double e = fHitsEvent->GetTotalEnergy(); double n = fHitsEvent->GetNumberOfHits(); // cout << x << " " << y << " " << e << " " << n << endl; diff --git a/src/TRestDetectorSignalToHitsProcess.cxx b/src/TRestDetectorSignalToHitsProcess.cxx index 30bfaca4..98149350 100644 --- a/src/TRestDetectorSignalToHitsProcess.cxx +++ b/src/TRestDetectorSignalToHitsProcess.cxx @@ -517,7 +517,7 @@ TRestEvent* TRestDetectorSignalToHitsProcess::ProcessEvent(TRestEvent* inputEven RESTDebug << "TRestDetectorSignalToHitsProcess. Hits added : " << fHitsEvent->GetNumberOfHits() << RESTendl; - RESTDebug << "TRestDetectorSignalToHitsProcess. Hits total energy : " << fHitsEvent->GetEnergy() + RESTDebug << "TRestDetectorSignalToHitsProcess. Hits total energy : " << fHitsEvent->GetTotalEnergy() << RESTendl; if (this->GetVerboseLevel() == TRestStringOutput::REST_Verbose_Level::REST_Debug) {