Skip to content

Commit 401ac76

Browse files
authored
Merge pull request #103 from rest-for-physics/lobis-fix-pipeline
Fix pipeline
2 parents 96bb57b + c824397 commit 401ac76

10 files changed

+29
-29
lines changed

inc/TRestDetectorHitsEvent.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TRestDetectorHitsEvent : public TRestEvent {
5555

5656
public:
5757
void AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
58-
void AddHit(TVector3 pos, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
58+
void AddHit(const TVector3& pos, Double_t en, Double_t t = 0, REST_HitType type = XYZ);
5959

6060
void Sort(bool(compareCondition)(const TRestHits::iterator& hit1,
6161
const TRestHits::iterator& hit2) = nullptr);
@@ -122,9 +122,7 @@ class TRestDetectorHitsEvent : public TRestEvent {
122122

123123
inline Double_t GetEnergyX() const { return fHits->GetEnergyX(); }
124124
inline Double_t GetEnergyY() const { return fHits->GetEnergyY(); }
125-
inline Double_t GetTotalDepositedEnergy() const { return fHits->GetTotalDepositedEnergy(); }
126125
inline Double_t GetTotalEnergy() const { return fHits->GetTotalEnergy(); }
127-
inline Double_t GetEnergy() const { return fHits->GetEnergy(); }
128126
inline Double_t GetEnergy(int n) const { return fHits->GetEnergy(n); }
129127
inline Double_t GetTime(int n) const { return GetHits()->GetTime(n); } // return value in us
130128

src/TRestDetectorElectronDiffusionProcess.cxx

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ TRestEvent* TRestDetectorElectronDiffusionProcess::ProcessEvent(TRestEvent* inpu
123123

124124
Int_t isAttached;
125125

126-
Int_t totalElectrons = fInputHitsEvent->GetEnergy() * REST_Units::eV / fWvalue;
126+
Int_t totalElectrons = fInputHitsEvent->GetTotalEnergy() * REST_Units::eV / fWvalue;
127127

128128
Double_t wValue = fWvalue;
129129
if (fMaxHits > 0 && totalElectrons > fMaxHits) {
130130
// set a fake w-value if max hits are limited. this fake w-value will be larger
131-
wValue = fInputHitsEvent->GetEnergy() * REST_Units::eV / fMaxHits;
131+
wValue = fInputHitsEvent->GetTotalEnergy() * REST_Units::eV / fMaxHits;
132132
}
133133

134134
for (int n = 0; n < nHits; n++) {
@@ -209,12 +209,12 @@ TRestEvent* TRestDetectorElectronDiffusionProcess::ProcessEvent(TRestEvent* inpu
209209
}
210210

211211
if (this->GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) {
212-
cout << "TRestDetectorElectronDiffusionProcess. Input hits energy : " << fInputHitsEvent->GetEnergy()
213-
<< endl;
212+
cout << "TRestDetectorElectronDiffusionProcess. Input hits energy : "
213+
<< fInputHitsEvent->GetTotalEnergy() << endl;
214214
cout << "TRestDetectorElectronDiffusionProcess. Hits added : " << fOutputHitsEvent->GetNumberOfHits()
215215
<< endl;
216-
cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : " << fOutputHitsEvent->GetEnergy()
217-
<< endl;
216+
cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : "
217+
<< fOutputHitsEvent->GetTotalEnergy() << endl;
218218
if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Extreme) GetChar();
219219
}
220220

src/TRestDetectorFiducializationProcess.cxx

+5-3
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ TRestEvent* TRestDetectorFiducializationProcess::ProcessEvent(TRestEvent* inputE
7979
}
8080
}
8181

82-
if (fOutputHitsEvent->GetNumberOfHits() == 0) return nullptr;
82+
if (fOutputHitsEvent->GetNumberOfHits() == 0) {
83+
return nullptr;
84+
}
8385

8486
if (this->GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) {
8587
cout << "TRestDetectorFiducializationProcess. Hits added : " << fOutputHitsEvent->GetNumberOfHits()
8688
<< endl;
87-
cout << "TRestDetectorFiducializationProcess. Hits total energy : " << fOutputHitsEvent->GetEnergy()
88-
<< endl;
89+
cout << "TRestDetectorFiducializationProcess. Hits total energy : "
90+
<< fOutputHitsEvent->GetTotalEnergy() << endl;
8991
}
9092

9193
return fOutputHitsEvent;

src/TRestDetectorGarfieldDriftProcess.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ TRestEvent* TRestDetectorGarfieldDriftProcess::ProcessEvent(TRestEvent* inputEve
419419
if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) {
420420
cout << "TRestDetectorElectronDiffusionProcess. Hits added : " << fOutputHitsEvent->GetNumberOfHits()
421421
<< endl;
422-
cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : " << fOutputHitsEvent->GetEnergy()
423-
<< endl;
422+
cout << "TRestDetectorElectronDiffusionProcess. Hits total energy : "
423+
<< fOutputHitsEvent->GetTotalEnergy() << endl;
424424
cout << " fTimedHitsEvent " << fOutputHitsEvent << " class " << fOutputHitsEvent->ClassName() << endl;
425425
fOutputHitsEvent->PrintEvent(20);
426426
}

src/TRestDetectorHits3DReconstructionProcess.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ TRestEvent* TRestDetectorHits3DReconstructionProcess::ProcessEvent(TRestEvent* i
523523

524524
// scale the total energy
525525
if (fDoEnergyScaling) {
526-
double e1 = fInputHitsEvent->GetEnergy();
527-
double e2 = fOutputHitsEvent->GetEnergy();
526+
double e1 = fInputHitsEvent->GetTotalEnergy();
527+
double e2 = fOutputHitsEvent->GetTotalEnergy();
528528
for (auto h : *fOutputHitsEvent->GetHits()) {
529529
h.e() = h.e() / e2 * e1;
530530
}

src/TRestDetectorHitsAnalysisProcess.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ TRestEvent* TRestDetectorHitsAnalysisProcess::ProcessEvent(TRestEvent* inputEven
175175
fOutputHitsEvent->AddHit(x, y, z, eDep, time, type);
176176
}
177177

178-
Double_t energy = fOutputHitsEvent->GetEnergy();
178+
Double_t energy = fOutputHitsEvent->GetTotalEnergy();
179179
TVector3 meanPosition = fOutputHitsEvent->GetMeanPosition();
180180
Double_t sigmaX = fOutputHitsEvent->GetSigmaX();
181181
Double_t sigmaY = fOutputHitsEvent->GetSigmaY();

src/TRestDetectorHitsEvent.cxx

+8-8
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ TRestDetectorHitsEvent::~TRestDetectorHitsEvent() { delete fHits; }
9797
/// structure. Additionaly a time delay value in `us` may be added to the hits.
9898
void TRestDetectorHitsEvent::AddHit(Double_t x, Double_t y, Double_t z, Double_t en, Double_t t,
9999
REST_HitType type) {
100-
fHits->AddHit(x, y, z, en, t, type);
100+
fHits->AddHit({x, y, z}, en, t, type);
101101
}
102102

103103
///////////////////////////////////////////////
104104
/// \brief Adds a new hit to this event
105105
///
106106
/// It adds a new hit with position `pos` in mm, and energy `en` in keV, to this TRestDetectorHitsEvent
107107
/// structure. Additionaly a time delay value in `us` may be added to the hits.
108-
void TRestDetectorHitsEvent::AddHit(TVector3 pos, Double_t en, Double_t t, REST_HitType type) {
108+
void TRestDetectorHitsEvent::AddHit(const TVector3& pos, Double_t en, Double_t t, REST_HitType type) {
109109
fHits->AddHit(pos, en, t, type);
110110
}
111111

@@ -172,8 +172,8 @@ TRestHits* TRestDetectorHitsEvent::GetXZHits() {
172172

173173
for (unsigned int i = 0; i < this->GetNumberOfHits(); i++)
174174
if (GetType(i) == XZ)
175-
fXZHits->AddHit(this->GetX(i), this->GetY(i), this->GetZ(i), this->GetEnergy(i), this->GetTime(i),
176-
XZ);
175+
fXZHits->AddHit({this->GetX(i), this->GetY(i), this->GetZ(i)}, this->GetEnergy(i),
176+
this->GetTime(i), XZ);
177177

178178
return fXZHits;
179179
}
@@ -190,8 +190,8 @@ TRestHits* TRestDetectorHitsEvent::GetYZHits() {
190190

191191
for (unsigned int i = 0; i < this->GetNumberOfHits(); i++)
192192
if (GetType(i) == YZ)
193-
fYZHits->AddHit(this->GetX(i), this->GetY(i), this->GetZ(i), this->GetEnergy(i), this->GetTime(i),
194-
YZ);
193+
fYZHits->AddHit({this->GetX(i), this->GetY(i), this->GetZ(i)}, this->GetEnergy(i),
194+
this->GetTime(i), YZ);
195195

196196
return fYZHits;
197197
}
@@ -208,7 +208,7 @@ TRestHits* TRestDetectorHitsEvent::GetXYZHits() {
208208

209209
for (unsigned int i = 0; i < this->GetNumberOfHits(); i++)
210210
if (GetType(i) == XYZ)
211-
fXYZHits->AddHit(this->GetX(i), this->GetY(i), this->GetZ(i), this->GetEnergy(i),
211+
fXYZHits->AddHit({this->GetX(i), this->GetY(i), this->GetZ(i)}, this->GetEnergy(i),
212212
this->GetTime(i), XYZ);
213213

214214
return fXYZHits;
@@ -948,7 +948,7 @@ void TRestDetectorHitsEvent::DrawHistograms(Int_t& column, const TString& histOp
948948
void TRestDetectorHitsEvent::PrintEvent(Int_t nHits) const {
949949
TRestEvent::PrintEvent();
950950

951-
cout << "Total energy : " << GetEnergy() << endl;
951+
cout << "Total energy : " << GetTotalEnergy() << endl;
952952
cout << "Mean position : ( " << GetMeanPositionX() << " , " << GetMeanPositionY() << " , "
953953
<< GetMeanPositionZ() << " ) " << endl;
954954
cout << "Number of hits : " << fHits->GetNumberOfHits() << endl;

src/TRestDetectorHitsNormalizationProcess.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ TRestEvent* TRestDetectorHitsNormalizationProcess::ProcessEvent(TRestEvent* inpu
8585
if (this->GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) {
8686
cout << "TRestDetectorHitsNormalizationProcess. Hits added : " << fHitsOutputEvent->GetNumberOfHits()
8787
<< endl;
88-
cout << "TRestDetectorHitsNormalizationProcess. Hits total energy : " << fHitsOutputEvent->GetEnergy()
89-
<< endl;
88+
cout << "TRestDetectorHitsNormalizationProcess. Hits total energy : "
89+
<< fHitsOutputEvent->GetTotalEnergy() << endl;
9090
}
9191

9292
return fHitsOutputEvent;

src/TRestDetectorPositionMappingProcess.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ TRestEvent* TRestDetectorPositionMappingProcess::ProcessEvent(TRestEvent* inputE
7676
double y = fHitsEvent->GetMeanPositionY();
7777
double z = fHitsEvent->GetMeanPositionZ();
7878

79-
double e = fHitsEvent->GetEnergy();
79+
double e = fHitsEvent->GetTotalEnergy();
8080
double n = fHitsEvent->GetNumberOfHits();
8181

8282
// cout << x << " " << y << " " << e << " " << n << endl;

src/TRestDetectorSignalToHitsProcess.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ TRestEvent* TRestDetectorSignalToHitsProcess::ProcessEvent(TRestEvent* inputEven
517517

518518
RESTDebug << "TRestDetectorSignalToHitsProcess. Hits added : " << fHitsEvent->GetNumberOfHits()
519519
<< RESTendl;
520-
RESTDebug << "TRestDetectorSignalToHitsProcess. Hits total energy : " << fHitsEvent->GetEnergy()
520+
RESTDebug << "TRestDetectorSignalToHitsProcess. Hits total energy : " << fHitsEvent->GetTotalEnergy()
521521
<< RESTendl;
522522

523523
if (this->GetVerboseLevel() == TRestStringOutput::REST_Verbose_Level::REST_Debug) {

0 commit comments

Comments
 (0)