Skip to content

Commit 1a357ad

Browse files
BugFix: If CRTData are not present, hitTreeun number and subRun number were left uninitialized.
1 parent 92b12cf commit 1a357ad

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

icaruscode/CRT/CRTDataAnalysis_module.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ namespace crt {
209209
vector<vector<int>> fDetPDG; /// signal inducing particle(s)' PDG code
210210

211211
//CRT hit product vars
212+
int fHitRun;
213+
int fHitSubRun;
212214
int fHitEvent;
213215
float fXHit; ///< reconstructed X position of CRT hit (cm)
214216
float fYHit; ///< reconstructed Y position of CRT hit (cm)
@@ -373,8 +375,8 @@ namespace crt {
373375
fDAQNtuple->Branch("gate_start_timestamp", &m_gate_start_timestamp, "gate_start_timestamp/l");
374376

375377
// Define the branches of our SimHit n-tuple
376-
fHitNtuple->Branch("run", &fDetRun, "run/I");
377-
fHitNtuple->Branch("subrun", &fDetSubRun, "subrun/I");
378+
fHitNtuple->Branch("run", &fHitRun, "run/I");
379+
fHitNtuple->Branch("subrun", &fHitSubRun, "subrun/I");
378380
fHitNtuple->Branch("event", &fHitEvent, "event/I");
379381
fHitNtuple->Branch("nHit", &fNHit, "nHit/I");
380382
fHitNtuple->Branch("x", &fXHit, "x/F");
@@ -578,6 +580,8 @@ namespace crt {
578580
for ( auto const& hit : *crtHitHandle )
579581
{
580582
fNHit++;
583+
fHitRun = fRun;
584+
fHitSubRun = fSubRun;
581585
fHitEvent = fEvent;
582586
fXHit = hit.x_pos;
583587
fYHit = hit.y_pos;

0 commit comments

Comments
 (0)