@@ -45,6 +45,7 @@ namespace steer
4545{
4646
4747std::vector<o2::ctp::CTPDigit>* ctptrigger = nullptr ;
48+ float gIntRate = -1 .;
4849
4950DataProcessorSpec getSimReaderSpec (SubspecRange range, const std::vector<std::string>& simprefixes, const std::vector<int >& tpcsectors, bool withTrigger)
5051{
@@ -55,7 +56,7 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
5556
5657 auto doit = [range, tpcsectors, activeSectors, withTrigger](ProcessingContext& pc) {
5758 auto & mgr = steer::HitProcessingManager::instance ();
58- const auto & context = mgr.getDigitizationContext ();
59+ auto & context = mgr.getDigitizationContext ();
5960 auto eventrecords = context.getEventRecords ();
6061
6162 if (withTrigger) {
@@ -64,6 +65,9 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
6465 context.setCTPDigits (ctptrigger);
6566 }
6667
68+ // inject the global interaction rate information
69+ context.setDigitizerInteractionRate (gIntRate );
70+
6771 for (auto const & sector : tpcsectors) {
6872 // Note: the TPC sector header was serving the sector to lane mapping before
6973 // now the only remaining purpose is to propagate the mask of valid sectors
@@ -128,6 +132,10 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
128132 }
129133 }
130134
135+ gIntRate = ctx.options ().get <float >(" interactionRate" ); // is interaction rate requested?
136+ if (gIntRate < 1 .f ) {
137+ gIntRate = 1 .f ;
138+ }
131139 // do we start from an existing context
132140 auto incontextstring = ctx.options ().get <std::string>(" incontext" );
133141 LOG (info) << " INCONTEXTSTRING " << incontextstring;
@@ -137,13 +145,8 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
137145 LOG (fatal) << " Could not read collision context from " << incontextstring;
138146 }
139147 } else {
140-
141- auto intRate = ctx.options ().get <float >(" interactionRate" ); // is interaction rate requested?
142- if (intRate < 1 .f ) {
143- intRate = 1 .f ;
144- }
145- LOG (info) << " Imposing hadronic interaction rate " << intRate << " Hz" ;
146- mgr.getInteractionSampler ().setInteractionRate (intRate);
148+ LOG (info) << " Imposing hadronic interaction rate " << gIntRate << " Hz" ;
149+ mgr.getInteractionSampler ().setInteractionRate (gIntRate );
147150 o2::raw::HBFUtils::Instance ().print ();
148151 o2::raw::HBFUtils::Instance ().checkConsistency ();
149152 mgr.getInteractionSampler ().setFirstIR ({0 , o2::raw::HBFUtils::Instance ().orbitFirstSampled });
0 commit comments