2323#include " DataFormatsCTP/Configuration.h"
2424#include " DataFormatsFT0/Digit.h"
2525#include " DataFormatsFV0/Digit.h"
26+ #include " CommonConstants/LHCConstants.h"
2627
2728#include < TStopwatch.h>
2829#include < gsl/span>
@@ -37,7 +38,7 @@ class CTPDPLDigitizerTask : public o2::base::BaseDPLDigitizer
3738 using GRP = o2::parameters::GRPObject;
3839
3940 public:
40- CTPDPLDigitizerTask (const std::vector<o2::detectors::DetID>& detList) : o2::base::BaseDPLDigitizer(), mDigitizer (), mDetList (detList) {}
41+ CTPDPLDigitizerTask (const std::vector<o2::detectors::DetID>& detList, int ctpLumiScaler ) : o2::base::BaseDPLDigitizer(), mDigitizer (), mDetList (detList), mLumiScaler (ctpLumiScaler ) {}
4142 ~CTPDPLDigitizerTask () override = default ;
4243 void initDigitizerTask (framework::InitContext& ic) override
4344 {
@@ -85,6 +86,11 @@ class CTPDPLDigitizerTask : public o2::base::BaseDPLDigitizer
8586 pc.outputs ().snapshot (Output{" CTP" , " DIGITS" , 0 }, digits);
8687 LOG (info) << " CTP PRESENT being sent." ;
8788 pc.outputs ().snapshot (Output{" CTP" , " ROMode" , 0 }, mROMode );
89+ if (mLumiScaler >= 0 ) {
90+ o2::ctp::LumiInfo lminfo{pc.services ().get <o2::framework::TimingInfo>().firstTForbit , int (o2::constants::lhc::LHCRevFreq), 0 , mLumiScaler , 0 };
91+ LOG (info) << " CTP Lumi scaler " << lminfo.counts << " for integration time of " << lminfo.nHBFCounted << " being sent" ;
92+ pc.outputs ().snapshot (Output{" CTP" , " LUMI" , 0 }, lminfo);
93+ }
8894 timer.Stop ();
8995 LOG (info) << " CTP Digitization took " << timer.CpuTime () << " s" ;
9096 }
@@ -102,8 +108,10 @@ class CTPDPLDigitizerTask : public o2::base::BaseDPLDigitizer
102108 o2::parameters::GRPObject::ROMode mROMode = o2::parameters::GRPObject::PRESENT;
103109 o2::ctp::Digitizer mDigitizer ; // /< Digitizer
104110 std::vector<o2::detectors::DetID> mDetList ;
111+ int mLumiScaler = -1 ;
105112};
106- o2::framework::DataProcessorSpec getCTPDigitizerSpec (int channel, std::vector<o2::detectors::DetID>& detList, bool mctruth)
113+
114+ o2::framework::DataProcessorSpec getCTPDigitizerSpec (int channel, std::vector<o2::detectors::DetID>& detList, int ctpLumiScaler, bool mctruth)
107115{
108116 std::vector<InputSpec> inputs;
109117 std::vector<OutputSpec> output;
@@ -119,12 +127,15 @@ o2::framework::DataProcessorSpec getCTPDigitizerSpec(int channel, std::vector<o2
119127 }
120128 inputs.emplace_back (" ctpconfig" , " CTP" , " CTPCONFIG" , 0 , Lifetime::Condition, ccdbParamSpec (" CTP/Config/Config" , true ));
121129 output.emplace_back (" CTP" , " DIGITS" , 0 , Lifetime::Timeframe);
130+ if (ctpLumiScaler >= 0 ) {
131+ output.emplace_back (" CTP" , " LUMI" , 0 , Lifetime::Timeframe);
132+ }
122133 output.emplace_back (" CTP" , " ROMode" , 0 , Lifetime::Timeframe);
123134 return DataProcessorSpec{
124135 " CTPDigitizer" ,
125136 inputs,
126137 output,
127- AlgorithmSpec{adaptFromTask<CTPDPLDigitizerTask>(detList)},
138+ AlgorithmSpec{adaptFromTask<CTPDPLDigitizerTask>(detList, ctpLumiScaler )},
128139 Options{{" pileup" , VariantType::Int, 1 , {" whether to run in continuous time mode" }},
129140 {" disable-qed" , o2::framework::VariantType::Bool, false , {" disable QED handling" }}}};
130141}
0 commit comments