Skip to content

Commit 031c785

Browse files
noferinishahor02
authored andcommitted
change TOF digit structure: longBC to InteractionRecord
1 parent 6d49274 commit 031c785

4 files changed

Lines changed: 25 additions & 11 deletions

File tree

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Digit
3232
Digit() = default;
3333

3434
Digit(Int_t channel, Int_t tdc, Int_t tot, uint64_t bc, Int_t label = -1, uint32_t triggerorbit = 0, uint16_t triggerbunch = 0);
35+
Digit(Int_t channel, Int_t tdc, Int_t tot, uint32_t orbit, uint16_t bc, Int_t label = -1, uint32_t triggerorbit = 0, uint16_t triggerbunch = 0);
3536
~Digit() = default;
3637

3738
/// Get global ordering key made of
@@ -41,7 +42,7 @@ class Digit
4142
}
4243
ULong64_t getOrderingKey()
4344
{
44-
return getOrderingKey(mChannel, mBC, mTDC);
45+
return getOrderingKey(mChannel, mIR.toLong(), mTDC);
4546
}
4647

4748
Int_t getChannel() const { return mChannel; }
@@ -53,8 +54,8 @@ class Digit
5354
uint16_t getTOT() const { return mTOT; }
5455
void setTOT(uint16_t tot) { mTOT = tot; }
5556

56-
uint64_t getBC() const { return mBC; }
57-
void setBC(uint64_t bc) { mBC = bc; }
57+
uint64_t getBC() const { return mIR.toLong(); }
58+
void setBC(uint64_t bc) { mIR.setFromLong(bc); }
5859

5960
Int_t getLabel() const { return mLabel; }
6061
void setLabel(Int_t label) { mLabel = label; }
@@ -91,19 +92,19 @@ class Digit
9192
private:
9293
friend class boost::serialization::access;
9394

94-
Double_t mCalibratedTime; //!< time of the digits after calibration (not persistent; it will be filled during clusterization)
9595
Int_t mChannel; ///< TOF channel index
9696
uint16_t mTDC; ///< TDC bin number
9797
uint16_t mTOT; ///< TOT bin number
98-
uint64_t mBC; ///< Bunch Crossing // RS: since it is used as absolute bunch counter from orbit 0, it has to be 64 bits
98+
InteractionRecord mIR{0, 0}; ///< InteractionRecord (orbit and bc) when digit occurs
9999
Int_t mLabel; ///< Index of the corresponding entry in the MC label array
100+
Double_t mCalibratedTime; //!< time of the digits after calibration (not persistent; it will be filled during clusterization)
100101
Int_t mElectronIndex; //!/< index in electronic format
101102
uint32_t mTriggerOrbit = 0; //!< orbit id of trigger event // RS: orbit must be 32bits long
102103
uint16_t mTriggerBunch = 0; //!< bunch id of trigger event
103104
Bool_t mIsUsedInCluster; //!/< flag to declare that the digit was used to build a cluster
104105
Bool_t mIsProblematic = false; //!< flag to tell whether the channel of the digit was problemati; not persistent; default = ok
105106

106-
ClassDefNV(Digit, 3);
107+
ClassDefNV(Digit, 4);
107108
};
108109

109110
std::ostream& operator<<(std::ostream& stream, const Digit& dig);

‎Detectors/TOF/base/src/Digit.cxx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@ using namespace o2::tof;
1717
ClassImp(o2::tof::Digit);
1818

1919
Digit::Digit(Int_t channel, Int_t tdc, Int_t tot, uint64_t bc, Int_t label, uint32_t triggerorbit, uint16_t triggerbunch)
20-
: mChannel(channel), mTDC(tdc), mTOT(tot), mBC(bc), mLabel(label), mTriggerOrbit(triggerorbit), mTriggerBunch(triggerbunch), mIsUsedInCluster(kFALSE)
20+
: mChannel(channel), mTDC(tdc), mTOT(tot), mIR(0, 0), mLabel(label), mTriggerOrbit(triggerorbit), mTriggerBunch(triggerbunch), mIsUsedInCluster(kFALSE)
21+
{
22+
mIR.setFromLong(bc);
23+
}
24+
//______________________________________________________________________
25+
Digit::Digit(Int_t channel, Int_t tdc, Int_t tot, uint32_t orbit, uint16_t bc, Int_t label, uint32_t triggerorbit, uint16_t triggerbunch)
26+
: mChannel(channel), mTDC(tdc), mTOT(tot), mIR(bc, orbit), mLabel(label), mTriggerOrbit(triggerorbit), mTriggerBunch(triggerbunch), mIsUsedInCluster(kFALSE)
2127
{
2228
}
23-
2429
//______________________________________________________________________
2530

2631
void Digit::printStream(std::ostream& stream) const
2732
{
28-
stream << "TOF Digit: Channel " << mChannel << " TDC " << mTDC << " TOT " << mTOT << "Bunch Crossing index" << mBC << " Label " << mLabel << "\n";
33+
stream << "TOF Digit: Channel " << mChannel << " TDC " << mTDC << " TOT " << mTOT << "Bunch Crossing index" << mIR.toLong() << " Label " << mLabel << "\n";
2934
}
3035

3136
//______________________________________________________________________

‎Detectors/TOF/base/src/WindowFiller.cxx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ void WindowFiller::flushOutputContainer(std::vector<Digit>& digits)
175175
for (Int_t i = 0; i < MAXWINDOWS; i++) {
176176
fillOutputContainer(digits); // fill last readout windows
177177
}
178+
179+
int nwindowperTF = o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * Geo::NWINDOW_IN_ORBIT;
180+
181+
// check that all orbits are complete in terms of number of readout windows
182+
while ((mReadoutWindowData.size() % nwindowperTF)) {
183+
fillOutputContainer(digits); // fill windows without digits to complete all orbits in the last TF
184+
}
178185
}
179186
}
180187
//______________________________________________________________________

‎Detectors/TOF/workflow/src/CompressedDecodingTask.cxx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ void CompressedDecodingTask::postData(ProcessingContext& pc)
5252
mHasToBePosted = false;
5353
mDecoder.FillWindows();
5454

55-
int nwindowperTF = o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * 3;
56-
5755
// send output message
5856
std::vector<o2::tof::Digit>* alldigits = mDecoder.getDigitPerTimeFrame();
5957
std::vector<o2::tof::ReadoutWindowData>* row = mDecoder.getReadoutWindowData();
@@ -67,6 +65,8 @@ void CompressedDecodingTask::postData(ProcessingContext& pc)
6765
lastIR = last->mFirstIR;
6866
}
6967

68+
/*
69+
int nwindowperTF = o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * 3;
7070
while (row->size() < nwindowperTF) {
7171
// complete timeframe with empty readout windows
7272
auto& dummy = row->emplace_back(lastval, 0);
@@ -76,6 +76,7 @@ void CompressedDecodingTask::postData(ProcessingContext& pc)
7676
// remove extra readout windows after a check they are empty
7777
row->pop_back();
7878
}
79+
*/
7980

8081
int n_tof_window = row->size();
8182
int n_orbits = n_tof_window / 3;

0 commit comments

Comments
 (0)