@@ -27,7 +27,7 @@ namespace raw
2727{
2828/*
2929 In the MC->Raw conversion we have to make sure that
30- 1) The HB and TF starts are in sync for all detectors regardless on time (bc/orbir )
30+ 1) The HB and TF starts are in sync for all detectors regardless on time (0/orbit )
3131 distribution of its signal.
3232 2) All HBF and TF (RAWDataHeaders with corresponding HB and TF trigger flags) are present
3333 in the emulated raw data, even if some of them had no data in particular detector.
@@ -42,8 +42,7 @@ namespace raw
4242struct HBFUtils : public o2 ::conf::ConfigurableParamHelper<HBFUtils> {
4343 using IR = o2::InteractionRecord;
4444
45-
46- IR getFirstIR () const { return {bcFirst, orbitFirst}; }
45+ IR getFirstIR () const { return {0 , orbitFirst}; }
4746
4847 int getNOrbitsPerTF () const { return nHBFPerTF; }
4948
@@ -69,6 +68,9 @@ struct HBFUtils : public o2::conf::ConfigurableParamHelper<HBFUtils> {
6968 // /< get 1st IR of the TF corresponding to provided interaction record
7069 IR getFirstIRofTF (const IR& rec) const { return getIRTF (getTF (rec)); }
7170
71+ // /< get 1st IR of TF corresponding to the 1st sampled orbit (in MC)
72+ IR getFirstSampledTFIR () const { return getFirstIRofTF ({0 , orbitFirstSampled}); }
73+
7274 // /< get TF and HB (abs) for this IR
7375 std::pair<int , int > getTFandHB (const IR& rec) const
7476 {
@@ -123,10 +125,12 @@ struct HBFUtils : public o2::conf::ConfigurableParamHelper<HBFUtils> {
123125
124126 void print () const { printKeyValues (true ); }
125127
126- int nHBFPerTF = 1 + 0xff ; // number of orbits per BC
127- uint16_t bcFirst = 0 ; // /< BC of 1st TF
128- uint32_t orbitFirst = 0 ; // /< orbit of 1st TF
129- uint32_t maxNOrbits = 0xffffffff ; // max number of orbits to accept, used in digit->raw conversion
128+ int nHBFPerTF = 128 ; // /< number of orbits per BC
129+ uint32_t orbitFirst = 0 ; // /< orbit of 1st TF of the run
130+
131+ // used for MC
132+ uint32_t orbitFirstSampled = 0 ; // /< 1st orbit sampled in the MC
133+ uint32_t maxNOrbits = 0xffffffff ; // /< max number of orbits to accept, used in digit->raw conversion
130134
131135 O2ParamDef (HBFUtils, " HBFUtils" );
132136};
@@ -140,10 +144,10 @@ void HBFUtils::updateRDH(H& rdh, const IR& rec, bool setHBTF) const
140144
141145 if (setHBTF) { // need to set the HBF IR and HB / TF trigger flags
142146 auto tfhb = getTFandHBinTF (rec);
143- RDHUtils::setHeartBeatBC (rdh, bcFirst );
147+ RDHUtils::setHeartBeatBC (rdh, 0 );
144148 RDHUtils::setHeartBeatOrbit (rdh, rec.orbit );
145149
146- if (rec.bc == bcFirst ) { // if we are starting new HB, set the HB trigger flag
150+ if (rec.bc == 0 ) { // if we are starting new HB, set the HB trigger flag
147151 auto trg = RDHUtils::getTriggerType (rdh) | (o2::trigger::ORBIT | o2::trigger::HB);
148152 if (tfhb.second == 0 ) { // if we are starting new TF, set the TF trigger flag
149153 trg |= o2::trigger::TF;
0 commit comments