Skip to content

Commit

Permalink
Merge pull request #192 from DUNE/kyjung_add_bartype
Browse files Browse the repository at this point in the history
Kyjung add bartype
  • Loading branch information
kyjung123 authored Jan 27, 2025
2 parents 0de691c + 5436fc6 commit 0f934d9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/TMS_ReadoutTreeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void TMS_ReadoutTreeWriter::MakeBranches() {
TMS_Readout->Branch("RecoHitPE", &RecoHitPE, "RecoHitPE[NRecoHits]/F");
TMS_Readout->Branch("RecoHitIsPedSupped", &RecoHitIsPedSupped, "RecoHitIsPedSupped[NRecoHits]/O");
TMS_Readout->Branch("RecoHitBar", &RecoHitBar, "RecoHitBar[NRecoHits]/I");
TMS_Readout->Branch("RecoHitBarType", &RecoHitBarType, "RecoHitBarType[NRecoHits]/I"); //enum BarType { kXBar, kYBar, kUBar, kVBar, kError }; from TMS_Bar.h
TMS_Readout->Branch("RecoHitPlane", &RecoHitPlane, "RecoHitPlane[NRecoHits]/I");
#ifdef RECORD_HIT_DEADTIME
TMS_Readout->Branch("RecoHitDeadtimeStart", &RecoHitDeadtimeStart, "RecoHitDeadtimeStart[NRecoHits]/F");
Expand Down Expand Up @@ -111,6 +112,7 @@ void TMS_ReadoutTreeWriter::Fill(TMS_Event &event) {
RecoHitPE[index] = hit.GetPE();
RecoHitIsPedSupped[index] = hit.GetPedSup();
RecoHitBar[index] = hit.GetBarNumber();
RecoHitBarType[index] = hit.GetBar().GetBarType();
RecoHitPlane[index] = hit.GetPlaneNumber();
#ifdef RECORD_HIT_DEADTIME
RecoHitDeadtimeStart[index] = hit.GetDeadtimeStart();
Expand Down
1 change: 1 addition & 0 deletions src/TMS_ReadoutTreeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class TMS_ReadoutTreeWriter {
bool RecoHitIsPedSupped[__MAX_READOUT_TREE_ARRAY_LENGTH__];
INTVAR(RecoHitBar);
INTVAR(RecoHitPlane);
INTVAR(RecoHitBarType);
#ifdef RECORD_HIT_DEADTIME
VAR(RecoHitDeadtimeStart);
VAR(RecoHitDeadtimeStop);
Expand Down
5 changes: 5 additions & 0 deletions src/TMS_TreeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ void TMS_TreeWriter::MakeBranches() {
Branch_Lines->Branch("RecoHitEnergy", RecoHitEnergy, "RecoHitEnergy[nHits]/F");
Branch_Lines->Branch("RecoHitPE", RecoHitPE, "RecoHitPE[nHits]/F");
Branch_Lines->Branch("RecoHitBar", RecoHitBar, "RecoHitBar[nHits]/I");
Branch_Lines->Branch("RecoHitBarType", RecoHitBarType, "RecoHitBarType[nHits]/I");
Branch_Lines->Branch("RecoHitPlane", RecoHitPlane, "RecoHitPlane[nHits]/I");
Branch_Lines->Branch("RecoHitSlice", RecoHitSlice, "RecoHitSlice[nHits]/I");

Expand Down Expand Up @@ -257,6 +258,7 @@ void TMS_TreeWriter::MakeBranches() {
Reco_Tree->Branch("Chi2", RecoTrackChi2, "Chi2[nTracks]/F");

Reco_Tree->Branch("TrackHitEnergies", RecoTrackHitEnergies, "TrackHitEnergies[nTracks][200]/F");
Reco_Tree->Branch("TrackHitBarType", RecoTrackHitBarType, "RecoTrackHitBarType[nTracks][200]/I");

Reco_Tree->Branch("TimeSliceStartTime", &TimeSliceStartTime, "TimeSliceStartTime/F");
Reco_Tree->Branch("TimeSliceEndTime", &TimeSliceEndTime, "TimeSliceEndTime/F");
Expand Down Expand Up @@ -1183,6 +1185,7 @@ void TMS_TreeWriter::Fill(TMS_Event &event) {
RecoHitPos[stdit][2] = (*it).GetZ();
RecoHitPos[stdit][3] = (*it).GetT();
RecoHitEnergy[stdit] = (*it).GetE();
RecoHitBarType[stdit] = (*it).GetBar().GetBarType();
RecoHitPE[stdit] = (*it).GetPE();
RecoHitBar[stdit] = (*it).GetBarNumber();
RecoHitPlane[stdit] = (*it).GetPlaneNumber();
Expand Down Expand Up @@ -1279,6 +1282,7 @@ void TMS_TreeWriter::Fill(TMS_Event &event) {

for (unsigned int j = 0; j < RecoTrack->Hits.size(); ++j) {
RecoTrackHitEnergies[itTrack][j] = RecoTrack->Hits[j].GetE(); // Add the energy deposit from each hit
RecoTrackHitBarType[itTrack][j] = RecoTrack->Hits[j].GetBar().GetBarType();

// Here we check for bar orientation
if (RecoTrack->Hits[j].GetBar().GetBarType() != TMS_Bar::kXBar) {
Expand Down Expand Up @@ -1845,6 +1849,7 @@ void TMS_TreeWriter::Clear() {
for (int i = 0; i < __TMS_MAX_HITS__; ++i) {
for (int j = 0; j < 4; ++j) RecoHitPos[i][j] = DEFAULT_CLEARING_FLOAT;
RecoHitEnergy[i] = DEFAULT_CLEARING_FLOAT;
RecoHitBarType[i] = DEFAULT_CLEARING_FLOAT;
RecoHitPE[i] = DEFAULT_CLEARING_FLOAT;
RecoHitBar[i] = DEFAULT_CLEARING_FLOAT;
RecoHitPlane[i] = DEFAULT_CLEARING_FLOAT;
Expand Down
2 changes: 2 additions & 0 deletions src/TMS_TreeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TMS_TreeWriter {
int RecoTrackKalmanPlaneBarViewTrue[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__][3];
float RecoTrackHitPos[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__][3]; // Due to a lack of variables, but as this is taken from line hits, it would make sense (maybe times 2?)
float RecoTrackHitEnergies[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__]; // Due to a lack of variables, but as this is taken from line hits, it would make sense (maybe times 2?)
int RecoTrackHitBarType[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__];
float RecoTrackStartPos[__TMS_MAX_TRACKS__][3];
float RecoTrackStartDirection[__TMS_MAX_TRACKS__][3];
float RecoTrackEndPos[__TMS_MAX_TRACKS__][3];
Expand Down Expand Up @@ -265,6 +266,7 @@ class TMS_TreeWriter {
float RecoHitPos[__TMS_MAX_HITS__][4]; // Position of hit; [0] is x, [1] is y, [2] is z, [3] is time
float RecoHitEnergy[__TMS_MAX_HITS__]; // Energy in hit
float RecoHitPE[__TMS_MAX_HITS__];
int RecoHitBarType[__TMS_MAX_HITS__];
int RecoHitBar[__TMS_MAX_HITS__];
int RecoHitPlane[__TMS_MAX_HITS__];
int RecoHitSlice[__TMS_MAX_HITS__];
Expand Down

0 comments on commit 0f934d9

Please sign in to comment.