Skip to content

Commit 2b36a7c

Browse files
MartinaFeijoojose-luis-rs
authored andcommitted
actaf online update
actafhit include maxAmpl fixing Clang-format Minor change
1 parent 7b6f306 commit 2b36a7c

7 files changed

Lines changed: 368 additions & 34 deletions

File tree

actaf/calibration/R3BActafCal2Hit.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ void R3BActafCal2Hit::Exec(Option_t*)
110110
auto ring = fActafGeo->GetRingId(pad);
111111
auto zpos = calData->GetZpos();
112112
auto energy = calData->GetEnergy();
113+
auto maxAmpl = calData->GetEMaxAmpl();
113114
TVector3 track = fActafGeo->GetPosition(pad);
114-
AddHitData(pad, (pad < 65 ? 1 : 2), ring, track.X(), track.Y(), zpos, energy, track);
115+
AddHitData(pad, (pad < 65 ? 1 : 2), ring, track.X(), track.Y(), zpos, energy, track, maxAmpl);
115116
}
116117
return;
117118
}
@@ -134,12 +135,13 @@ R3BActafHitData* R3BActafCal2Hit::AddHitData(UInt_t padId,
134135
double ypos,
135136
double zpos,
136137
double energy,
137-
TVector3 track)
138+
TVector3 track,
139+
double maxAmpl)
138140
{
139141
// It fills the R3BActafCalData
140142
TClonesArray& clref = *fActafHitData;
141143
Int_t size = clref.GetEntriesFast();
142-
return new (clref[size]) R3BActafHitData(padId, side, ring, xpos, ypos, zpos, energy, track);
144+
return new (clref[size]) R3BActafHitData(padId, side, ring, xpos, ypos, zpos, energy, track, maxAmpl);
143145
}
144146

145147
ClassImp(R3BActafCal2Hit)

actaf/calibration/R3BActafCal2Hit.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class R3BActafCal2Hit : public FairTask
7171
double ypos,
7272
double zpos,
7373
double energy,
74-
TVector3 track);
74+
TVector3 track,
75+
double maxAmpl);
7576

7677
public:
7778
// Class definition

actaf/calibration/R3BActafMapped2Cal.cxx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <TClonesArray.h>
2121
#include <TMath.h>
2222
#include <array>
23+
#include <fstream>
2324
#include <iostream>
2425
#include <numeric>
2526
#include <utility>
@@ -245,15 +246,26 @@ void R3BActafMapped2Cal::Exec(Option_t*)
245246
continue;
246247

247248
std::array<double, ACTAF_BINS> waveform = mappedData->GetTrace();
249+
int maxPos = FindMaxPosition(waveform);
248250

249251
// Calculate rms before filtering
250-
int maxPos = FindMaxPosition(waveform);
252+
251253
double rmsRaw = ComputeBaselineMean(waveform, maxPos, 0);
252254
double meanRaw = ComputeBaselineMean(waveform, maxPos, 1) + mappedData->GetBaseline();
253-
// Apply the SG filter to the waveform
255+
256+
// create baseline-subtracted copy and write it to file (temporary tool)
257+
std::array<double, ACTAF_BINS> waveform_bs = waveform;
258+
double baseline = meanRaw;
259+
for (auto& x : waveform_bs)
260+
x -= baseline;
261+
262+
// Apply the SG filter to the waveform (on baseline-subtracted data)
254263
if (fApplySGFilter)
255264
ApplySGFilter(waveform, fSgCoeffs);
256265

266+
// Use baseline-subtracted waveform for further processing
267+
// waveform = waveform_bs;
268+
257269
auto integral = IntegratePulse(waveform, mappedData->GetMaxpos());
258270
auto energy = integral * fEGain[pad - 1];
259271
auto energyMaxAmpl = mappedData->GetMaxampl() * fEGain[pad - 1];

0 commit comments

Comments
 (0)