diff --git a/Reco/plugins/HGCalTBRecHitProducer.cc b/Reco/plugins/HGCalTBRecHitProducer.cc index 9204105..6d1c75b 100644 --- a/Reco/plugins/HGCalTBRecHitProducer.cc +++ b/Reco/plugins/HGCalTBRecHitProducer.cc @@ -17,6 +17,7 @@ HGCalTBRecHitProducer::HGCalTBRecHitProducer(const edm::ParameterSet& cfg) : m_expectedMaxTimeSample(cfg.getUntrackedParameter("ExpectedMaxTimeSample", 3)), m_maxADCCut(cfg.getUntrackedParameter("MaxADCCut", 15)), m_subtractCommonMode(cfg.getUntrackedParameter("subtractCommonMode", true)), + m_TSForCommonModeNoiseSubtraction(cfg.getUntrackedParameter("TSForCommonModeNoiseSubtraction", -1)), //-1: use all TS m_preselectionMethod(cfg.getUntrackedParameter("preselectionMethod", "TB2018")) { m_HGCalTBRawHitCollection = consumes(cfg.getParameter("InputCollection")); @@ -124,30 +125,30 @@ void HGCalTBRecHitProducer::produce(edm::Event& event, const edm::EventSetup& iS } case 0 : for ( int it = 0; it < NUMBER_OF_TIME_SAMPLES; it++ ) { - subHG[it] = m_subtractCommonMode ? cmMap[iski].fullHG[it] : 0.; - subLG[it] = m_subtractCommonMode ? cmMap[iski].fullLG[it] : 0.; + subHG[it] = m_subtractCommonMode ? cmMap[iski].fullHG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; + subLG[it] = m_subtractCommonMode ? cmMap[iski].fullLG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; } break; case 2 : for ( int it = 0; it < NUMBER_OF_TIME_SAMPLES; it++ ) { - subHG[it] = m_subtractCommonMode ? cmMap[iski].halfHG[it] : 0.; - subLG[it] = m_subtractCommonMode ? cmMap[iski].halfLG[it] : 0.; + subHG[it] = m_subtractCommonMode ? cmMap[iski].halfHG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; + subLG[it] = m_subtractCommonMode ? cmMap[iski].halfLG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; } break; case 3 : for ( int it = 0; it < NUMBER_OF_TIME_SAMPLES; it++ ) { - subHG[it] = m_subtractCommonMode ? cmMap[iski].mouseBiteHG[it] : 0.; - subLG[it] = m_subtractCommonMode ? cmMap[iski].mouseBiteLG[it] : 0.; + subHG[it] = m_subtractCommonMode ? cmMap[iski].mouseBiteHG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; + subLG[it] = m_subtractCommonMode ? cmMap[iski].mouseBiteLG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; } break; case 4 : for ( int it = 0; it < NUMBER_OF_TIME_SAMPLES; it++ ) { - subHG[it] = m_subtractCommonMode ? cmMap[iski].outerHG[it] : 0.; - subLG[it] = m_subtractCommonMode ? cmMap[iski].outerLG[it] : 0.; + subHG[it] = m_subtractCommonMode ? cmMap[iski].outerHG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; + subLG[it] = m_subtractCommonMode ? cmMap[iski].outerLG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; } break; case 5 : for ( int it = 0; it < NUMBER_OF_TIME_SAMPLES; it++ ) { - subHG[it] = m_subtractCommonMode ? cmMap[iski].mergedHG[it] : 0.; - subLG[it] = m_subtractCommonMode ? cmMap[iski].mergedLG[it] : 0.; + subHG[it] = m_subtractCommonMode ? cmMap[iski].mergedHG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; + subLG[it] = m_subtractCommonMode ? cmMap[iski].mergedLG[(m_TSForCommonModeNoiseSubtraction==-1) ? it : m_TSForCommonModeNoiseSubtraction] : 0.; } break; } diff --git a/Reco/plugins/HGCalTBRecHitProducer.h b/Reco/plugins/HGCalTBRecHitProducer.h index bfaaff2..934fd68 100644 --- a/Reco/plugins/HGCalTBRecHitProducer.h +++ b/Reco/plugins/HGCalTBRecHitProducer.h @@ -47,6 +47,7 @@ class HGCalTBRecHitProducer : public edm::EDProducer double m_maxADCCut; bool m_useCalibration; bool m_subtractCommonMode; + int m_TSForCommonModeNoiseSubtraction; std::map shapesLG; std::map shapesHG; diff --git a/runConfigurationsCERNOctober2018/hgcalRechits.py b/runConfigurationsCERNOctober2018/hgcalRechits.py index 818d5e6..ae6657b 100644 --- a/runConfigurationsCERNOctober2018/hgcalRechits.py +++ b/runConfigurationsCERNOctober2018/hgcalRechits.py @@ -101,7 +101,8 @@ calibrationPerChannel=cms.untracked.bool(True), ExpectedMaxTimeSample=cms.untracked.int32(options.ExpectedMaxTimesample), MaxADCCut=cms.untracked.double(15), - subtractCommonMode=cms.untracked.bool(False) + subtractCommonMode=cms.untracked.bool(True), + TSForCommonModeNoiseSubtraction=cms.untracked.int32(0) )