@@ -170,7 +170,8 @@ void DigitQcTask::initialize(o2::framework::InitContext& /*ctx*/)
170170 mTrgChargeLevelHigh = getNumericalParameter (" trgChargeLevelHigh" , 4095 );
171171 mTrgThresholdCharge = getNumericalParameter (" trgThresholdCharge" , 1 );
172172 mTrgThresholdNChannels = getNumericalParameter (" trgThresholdNChannels" , 1 );
173- mTimeGate = getNumericalParameter (" gateTimeForRatioHistogram" , 192 );
173+ mMinTimeGate = getNumericalParameter (" minGateTimeForRatioHistogram" , -192 );
174+ mMaxTimeGate = getNumericalParameter (" maxGateTimeForRatioHistogram" , 192 );
174175
175176 if (mTrgModeInnerOuterThresholdVar == TrgModeThresholdVar::kAmpl ) {
176177 mTrgThresholdChargeInner = getNumericalParameter (" trgThresholdChargeInner" , 1 );
@@ -280,7 +281,7 @@ void DigitQcTask::initialize(o2::framework::InitContext& /*ctx*/)
280281 mHistCycleDurationNTF = std::make_unique<TH1D >(" CycleDurationNTF" , " Cycle Duration;;time [TimeFrames]" , 1 , 0 , 2 );
281282 mHistCycleDurationRange = std::make_unique<TH1D >(" CycleDurationRange" , " Cycle Duration (total cycle range);;time [ns]" , 1 , 0 , 2 );
282283
283- std::string gateTimeRatioTitle = " Ratio of events between time - " + std::to_string (mTimeGate ) + " and " + std::to_string (mTimeGate );
284+ std::string gateTimeRatioTitle = " Ratio of events between time " + std::to_string (mMinTimeGate ) + " and " + std::to_string (mMaxTimeGate );
284285 mHistGateTimeRatio2Ch = std::make_unique<TH1F >(" EventsInGateTime" , gateTimeRatioTitle.c_str (), sNCHANNELS_FV0_PLUSREF , 0 , sNCHANNELS_FV0_PLUSREF );
285286
286287 std::vector<unsigned int > vecChannelIDs;
@@ -649,15 +650,19 @@ void DigitQcTask::endOfCycle()
649650 getObjectsManager ()->getMonitorObject (mHistBCvsTrg ->GetName ())->addOrUpdateMetadata (" TFcreationTime" , std::to_string (mTFcreationTime ));
650651
651652 for (int channel = 1 ; channel <= sNCHANNELS_FV0_PLUSREF - 1 ; channel++) {
652- int events_in_range = 0 ;
653- int events_per_channel = 0 ;
653+ float events_in_range = 0 ;
654+ float events_per_channel = 0 ;
654655 for (int bin_on_y_axis = 1 ; bin_on_y_axis <= mHistTime2Ch ->GetNbinsY (); bin_on_y_axis++) {
655- if (std::abs ( mHistTime2Ch ->GetYaxis ()->GetBinLowEdge (bin_on_y_axis)) < mTimeGate ) {
656+ if (mHistTime2Ch ->GetYaxis ()->GetBinLowEdge (bin_on_y_axis) > mMinTimeGate && mHistTime2Ch -> GetYaxis ()-> GetBinLowEdge (bin_on_y_axis) < mMaxTimeGate ) {
656657 events_in_range += mHistTime2Ch ->GetBinContent (channel, bin_on_y_axis);
657658 }
658659 events_per_channel += mHistTime2Ch ->GetBinContent (channel, bin_on_y_axis);
659660 }
660- mHistGateTimeRatio2Ch ->SetBinContent (channel, (float )events_in_range / (float )events_per_channel);
661+ if (events_per_channel) {
662+ mHistGateTimeRatio2Ch ->SetBinContent (channel, events_in_range / events_per_channel);
663+ } else {
664+ mHistGateTimeRatio2Ch ->SetBinContent (channel, 0 );
665+ }
661666 }
662667
663668 // one has to set num. of entries manually because
0 commit comments