@@ -42,6 +42,20 @@ void RawToDigitConverterSpec::init(framework::InitContext& ctx)
4242 return ; // skip CCDB initialization for pedestal runs
4343 }
4444
45+ // is no-gain-calibration flag setted?
46+ mIsUsingGainCalibration = true ;
47+ if (ctx.options ().isSet (" no-gain-calibration" )) {
48+ mIsUsingGainCalibration = !ctx.options ().get <bool >(" no-gain-calibration" );
49+ LOG (INFO) << " no-gain-calibration is swithed ON" ;
50+ }
51+
52+ // is no-bad-channel-map flag setted?
53+ mIsUsingBadMap = true ;
54+ if (ctx.options ().isSet (" no-bad-channel-map" )) {
55+ mIsUsingBadMap = !ctx.options ().get <bool >(" no-bad-channel-map" );
56+ LOG (INFO) << " no-bad-channel-map is swithed ON" ;
57+ }
58+
4559 // CCDB Url
4660 std::string ccdbUrl = " localtest" ;
4761 if (ctx.options ().isSet (" ccdb-url" )) {
@@ -81,16 +95,28 @@ void RawToDigitConverterSpec::init(framework::InitContext& ctx)
8195 mCurrentTimeStamp = o2::ccdb::getCurrentTimestamp ();
8296 ccdbMgr.setTimestamp (mCurrentTimeStamp );
8397
84- mCalibParams = ccdbMgr.get <o2::cpv::CalibParams>(" CPV/Calib/Gains" );
85- if (!mCalibParams ) {
86- LOG (ERROR) << " Cannot get o2::cpv::CalibParams from CCDB. Using dummy calibration!" ;
98+ if (mIsUsingGainCalibration ) {
99+ mCalibParams = ccdbMgr.get <o2::cpv::CalibParams>(" CPV/Calib/Gains" );
100+ if (!mCalibParams ) {
101+ LOG (ERROR) << " Cannot get o2::cpv::CalibParams from CCDB. Using dummy calibration!" ;
102+ mCalibParams = new o2::cpv::CalibParams (1 );
103+ }
104+ } else {
105+ LOG (INFO) << " Using dummy gain calibration (all coeffs = 1.)" ;
87106 mCalibParams = new o2::cpv::CalibParams (1 );
88107 }
89- mBadMap = ccdbMgr.get <o2::cpv::BadChannelMap>(" CPV/Calib/BadChannelMap" );
90- if (!mBadMap ) {
91- LOG (ERROR) << " Cannot get o2::cpv::BadChannelMap from CCDB. Using dummy calibration!" ;
108+
109+ if (mIsUsingBadMap ) {
110+ mBadMap = ccdbMgr.get <o2::cpv::BadChannelMap>(" CPV/Calib/BadChannelMap" );
111+ if (!mBadMap ) {
112+ LOG (ERROR) << " Cannot get o2::cpv::BadChannelMap from CCDB. Using dummy calibration!" ;
113+ mBadMap = new o2::cpv::BadChannelMap (1 );
114+ }
115+ } else {
92116 mBadMap = new o2::cpv::BadChannelMap (1 );
117+ LOG (INFO) << " Using dummy bad map (all channels are good)" ;
93118 }
119+
94120 mPedestals = ccdbMgr.get <o2::cpv::Pedestals>(" CPV/Calib/Pedestals" );
95121 if (!mPedestals ) {
96122 LOG (ERROR) << " Cannot get o2::cpv::Pedestals from CCDB. Using dummy calibration!" ;
@@ -232,7 +258,7 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx)
232258 }
233259 digitBuffer.clear ();
234260
235- LOG (DEBUG ) << " [CPVRawToDigitConverter - run] Writing " << mOutputDigits .size () << " digits .. ." ;
261+ LOG (INFO ) << " [CPVRawToDigitConverter - run] Sending " << mOutputDigits .size () << " digits in " << mOutputTriggerRecords . size () << " trigger records ." ;
236262 ctx.outputs ().snapshot (o2::framework::Output{" CPV" , " DIGITS" , 0 , o2::framework::Lifetime::Timeframe}, mOutputDigits );
237263 ctx.outputs ().snapshot (o2::framework::Output{" CPV" , " DIGITTRIGREC" , 0 , o2::framework::Lifetime::Timeframe}, mOutputTriggerRecords );
238264 ctx.outputs ().snapshot (o2::framework::Output{" CPV" , " RAWHWERRORS" , 0 , o2::framework::Lifetime::Timeframe}, mOutputHWErrors );
@@ -259,5 +285,7 @@ o2::framework::DataProcessorSpec o2::cpv::reco_workflow::getRawToDigitConverterS
259285 o2::framework::Options{
260286 {" pedestal" , o2::framework::VariantType::Bool, false , {" do not subtract pedestals from digits" }},
261287 {" ccdb-url" , o2::framework::VariantType::String, " http://ccdb-test.cern.ch:8080" , {" CCDB Url" }},
288+ {" no-gain-calibration" , o2::framework::VariantType::Bool, false , {" do not apply gain calibration" }},
289+ {" no-bad-channel-map" , o2::framework::VariantType::Bool, false , {" do not mask bad channels" }},
262290 }};
263291}
0 commit comments