Skip to content

Commit 5e637b9

Browse files
committed
Add and fill extra members to CosmicInfo
1 parent d0e771d commit 5e637b9

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

DataFormats/Detectors/TOF/include/DataFormatsTOF/CosmicInfo.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class CosmicInfo
3232
float mTot1;
3333
float mTot2;
3434
float mL;
35+
float mT1;
36+
float mT2;
3537

3638
public:
3739
int getCH1() const { return mChan1; }
@@ -40,17 +42,21 @@ class CosmicInfo
4042
float getTOT1() const { return mTot1; }
4143
float getTOT2() const { return mTot2; }
4244
float getL() const { return mL; }
45+
float getT1() const { return mT1; }
46+
float getT2() const { return mT2; }
4347

4448
void setCH1(int ch) { mChan1 = ch; }
4549
void setCH2(int ch) { mChan2 = ch; }
4650
void setDeltaTime(float val) { mDtime = val; }
4751
void setTOT1(float val) { mTot1 = val; }
4852
void setTOT2(float val) { mTot2 = val; }
53+
void setT1(float val) { mT1 = val; }
54+
void setT2(float val) { mT2 = val; }
4955
void setL(float val) { mL = val; }
5056

51-
CosmicInfo(int ch1 = 0, int ch2 = 0, float dt = 0, float tot1 = 0, float tot2 = 0, float l = 0) : mChan1(ch1), mChan2(ch2), mDtime(dt), mTot1(tot1), mTot2(tot2), mL(l) {}
57+
CosmicInfo(int ch1 = 0, int ch2 = 0, float dt = 0, float tot1 = 0, float tot2 = 0, float l = 0, float tm1 = 0, float tm2 = 0) : mChan1(ch1), mChan2(ch2), mDtime(dt), mTot1(tot1), mTot2(tot2), mL(l), mT1(tm1), mT2(tm2) {}
5258

53-
ClassDefNV(CosmicInfo, 1);
59+
ClassDefNV(CosmicInfo, 2);
5460
};
5561
} // namespace tof
5662

Detectors/TOF/base/include/TOFBase/Digit.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class Digit
5656

5757
uint64_t getBC() const { return mIR.toLong(); }
5858
void setBC(uint64_t bc) { mIR.setFromLong(bc); }
59+
void setIR(const InteractionRecord& ir) { mIR = ir; }
60+
61+
auto getIR() const { return mIR; }
5962

6063
Int_t getLabel() const { return mLabel; }
6164
void setLabel(Int_t label) { mLabel = label; }

Detectors/TOF/reconstruction/src/CosmicProcessor.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "FairLogger.h" // for LOG
1515
#include "TOFReconstruction/CosmicProcessor.h"
1616
#include <TStopwatch.h>
17+
#include "DetectorsRaw/HBFUtils.h"
1718

1819
using namespace o2::tof;
1920

@@ -32,6 +33,7 @@ void CosmicProcessor::process(DigitDataReader& reader, bool fill)
3233
timerProcess.Start();
3334

3435
reader.init();
36+
const o2::raw::HBFUtils& hbfutils = o2::raw::HBFUtils::Instance();
3537

3638
auto array = reader.getDigitArray();
3739
int ndig = array->size();
@@ -50,12 +52,16 @@ void CosmicProcessor::process(DigitDataReader& reader, bool fill)
5052
if (mCounters[ch1] > 3) {
5153
continue;
5254
}
55+
auto ir0 = hbfutils.getFirstIRofTF(dig1.getIR());
56+
5357
int64_t bc1 = int64_t(dig1.getBC());
5458
int tdc1 = int(dig1.getTDC());
5559
float tot1 = dig1.getTOT() * 48.8E-3;
5660
Geo::getVolumeIndices(ch1, volID1);
5761
Geo::getPos(volID1, pos1);
5862

63+
float tm1 = (dig1.getIR().differenceInBC(ir0) * 1024 + tdc1) * Geo::TDCBIN; // in ps
64+
5965
for (int j = i + 1; j < ndig2; j++) {
6066
auto& dig2 = (*array)[j];
6167
int64_t bc2 = int64_t(dig2.getBC()) - bc1;
@@ -67,6 +73,8 @@ void CosmicProcessor::process(DigitDataReader& reader, bool fill)
6773
if (mCounters[ch2] > 3) {
6874
continue;
6975
}
76+
float tm2 = (dig2.getIR().differenceInBC(ir0) * 1024 + int(dig2.getTDC())) * Geo::TDCBIN; // in ps
77+
7078
int tdc2 = int(dig2.getTDC()) - tdc1;
7179
float tot2 = dig2.getTOT() * 48.8E-3;
7280
Geo::getVolumeIndices(ch2, volID2);
@@ -92,7 +100,7 @@ void CosmicProcessor::process(DigitDataReader& reader, bool fill)
92100
continue;
93101
}
94102

95-
mCosmicInfo.emplace_back(ch1, ch2, dtime, tot1, tot2, l);
103+
mCosmicInfo.emplace_back(ch1, ch2, dtime, tot1, tot2, l, tm1, tm2);
96104
}
97105
}
98106

0 commit comments

Comments
 (0)