1919#ifndef ALICEO2_IOTOF_DIGIT_H
2020#define ALICEO2_IOTOF_DIGIT_H
2121
22+ #include " CommonConstants/LHCConstants.h"
2223#include " SimulationDataFormat/MCCompLabel.h"
2324#include " DataFormatsITSMFT/Digit.h"
2425
@@ -28,22 +29,28 @@ class Digit : public o2::itsmft::Digit
2829{
2930 public:
3031 ~Digit () = default ;
31- Digit (UShort_t chipindex = 0 , UShort_t row = 0 , UShort_t col = 0 , Int_t charge = 0 , double time = 0 .)
32- : o2::itsmft::Digit(chipindex, row, col, charge), mTime (time) {};
32+ Digit (UShort_t chipindex = 0 , UShort_t row = 0 , UShort_t col = 0 , Int_t charge = 0 , double time = 0 ., ULong64_t bc = 0 , Int_t tdc = 0 )
33+ : o2::itsmft::Digit(chipindex, row, col, charge), mTime (time), mBc (bc), mTdc (tdc) {};
3334
3435 // Setters
3536 void setTime (double time) { mTime = time; }
3637
3738 // Getters
3839 double getTime () const { return mTime ; }
40+ ULong64_t getBc () const { return mBc ; }
41+ Int_t getTdc () const { return mTdc ; }
3942
40- static UInt_t getOrderingKey (UShort_t chipindex , UShort_t row, UShort_t col)
43+ static ULong64_t getOrderingKey (ULong64_t bc , UShort_t row, UShort_t col)
4144 {
42- return (static_cast <UInt_t>(chipindex) << 16 ) | (static_cast <UInt_t>(row) << 8 ) | static_cast <UInt_t>(col);
45+ uint32_t orbit = bc / o2::constants::lhc::LHCMaxBunches;
46+ uint16_t bunch = bc % o2::constants::lhc::LHCMaxBunches;
47+ return (static_cast <ULong64_t>(orbit) << 32 ) | (static_cast <UInt_t>(bunch) << 16 ) | (static_cast <UInt_t>(row) << 8 ) | static_cast <UInt_t>(col);
4348 }
4449
4550 private:
4651 double mTime = 0 .; // /< Measured time (ns)
52+ ULong64_t mBc = 0 ; // /< BC
53+ Int_t mTdc = 0 ; // /< tdc time
4754 ClassDefNV (Digit, 1 );
4855};
4956
@@ -59,9 +66,9 @@ struct McLabelRef {
5966class LabeledDigit : public Digit
6067{
6168 public:
62- LabeledDigit (UShort_t chipindex = 0 , UShort_t row = 0 , UShort_t col = 0 , Int_t charge = 0 , double time = 0 .,
69+ LabeledDigit (UShort_t chipindex = 0 , UShort_t row = 0 , UShort_t col = 0 , Int_t charge = 0 , double time = 0 ., ULong64_t bc = 0 , Int_t tdc = 0 ,
6370 o2::MCCompLabel label = 0 )
64- : Digit(chipindex, row, col, charge, time), mLabel (label) {}
71+ : Digit(chipindex, row, col, charge, time, bc, tdc ), mLabel (label) {}
6572
6673 void setLabel (McLabelRef label) { mLabel = label; }
6774 McLabelRef getLabel () const { return mLabel ; }
0 commit comments