CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | Private Attributes
CaloTowersCreator Class Reference
Inheritance diagram for CaloTowersCreator:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 CaloTowersCreator (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~CaloTowersCreator () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Public Attributes

double EBEScale
 
double EEEScale
 
double HBEScale
 
double HEDEScale
 
double HESEScale
 
double HF1EScale
 
double HF2EScale
 
double HOEScale
 

Static Private Member Functions

static const std::vector< double > & getGridValues ()
 

Private Attributes

CaloTowersCreationAlgo algo_
 
bool allowMissingInputs_
 
edm::ESWatcher< IdealGeometryRecordcaloTowerConstituentsWatcher_
 
bool cutsFromDB
 
std::vector< edm::InputTagecalLabels_
 
edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcdecalPFRechitThresholdsToken_
 
bool ecalRecHitThresh_
 
edm::ESWatcher< EcalSeverityLevelAlgoRcdecalSevLevelWatcher_
 
EcalPFRecHitThresholds const * ecalThresholds = nullptr
 
EScales eScales_
 
edm::ESWatcher< HcalChannelQualityRcdhcalChStatusWatcher_
 
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcdhcalCutsToken_
 
edm::ESWatcher< HcalSeverityLevelComputerRcdhcalSevLevelWatcher_
 
HcalPFCuts const * paramPF = nullptr
 
std::vector< int > theEcalSeveritiesToBeExcluded_
 
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers_
 
unsigned int theHcalAcceptSeverityLevel_
 
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
 
bool theRecoveredEcalHitsAreUsed_
 
bool theRecoveredHcalHitsAreUsed_
 
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecordtok_ctmap_
 
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecordtok_cttopo_
 
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcdtok_ecalChStatus_
 
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcdtok_ecalSevAlgo_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordtok_geom_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbhe_
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdtok_hcalChStatus_
 
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdtok_hcalSevComputer_
 
edm::EDGetTokenT< HFRecHitCollectiontok_hf_
 
edm::EDGetTokenT< HORecHitCollectiontok_ho_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtok_topo_
 
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
 
bool useRejectedHitsOnly_
 
bool useRejectedRecoveredEcalHits_
 
bool useRejectedRecoveredHcalHits_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Original author: J. Mans - Minnesota

Definition at line 32 of file CaloTowersCreator.cc.

Constructor & Destructor Documentation

◆ CaloTowersCreator()

CaloTowersCreator::CaloTowersCreator ( const edm::ParameterSet ps)
explicit

Definition at line 105 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, gather_cfg::cout, cutsFromDB, EBEScale, EScales::EBScale, ecalLabels_, ecalPFRechitThresholdsToken_, ecalRecHitThresh_, EEEScale, EScales::EEScale, eScales_, edm::ParameterSet::getParameter(), HBEScale, EScales::HBScale, hcalCutsToken_, HEDEScale, EScales::HEDScale, HESEScale, EScales::HESScale, HF1EScale, EScales::HF1Scale, HF2EScale, EScales::HF2Scale, HOEScale, EScales::HOScale, mps_fire::i, EScales::instanceLabel, CaloTowersCreationAlgo::setMissingHcalRescaleFactorForEcal(), theEcalSeveritiesToBeExcluded_, theEcalSeveritiesToBeUsedInBadTowers_, tok_ctmap_, tok_cttopo_, tok_ecalChStatus_, tok_ecalSevAlgo_, tok_geom_, tok_hbhe_, tok_hcalChStatus_, tok_hcalSevComputer_, tok_hf_, tok_ho_, tok_topo_, toks_ecal_, and useRejectedHitsOnly_.

106  : algo_(conf.getParameter<double>("EBThreshold"),
107  conf.getParameter<double>("EEThreshold"),
108 
109  conf.getParameter<bool>("UseEtEBTreshold"),
110  conf.getParameter<bool>("UseEtEETreshold"),
111  conf.getParameter<bool>("UseSymEBTreshold"),
112  conf.getParameter<bool>("UseSymEETreshold"),
113 
114  conf.getParameter<double>("HcalThreshold"),
115  conf.getParameter<double>("HBThreshold"),
116  conf.getParameter<double>("HBThreshold1"),
117  conf.getParameter<double>("HBThreshold2"),
118  conf.getParameter<double>("HESThreshold"),
119  conf.getParameter<double>("HESThreshold1"),
120  conf.getParameter<double>("HEDThreshold"),
121  conf.getParameter<double>("HEDThreshold1"),
122  conf.getParameter<double>("HOThreshold0"),
123  conf.getParameter<double>("HOThresholdPlus1"),
124  conf.getParameter<double>("HOThresholdMinus1"),
125  conf.getParameter<double>("HOThresholdPlus2"),
126  conf.getParameter<double>("HOThresholdMinus2"),
127  conf.getParameter<double>("HF1Threshold"),
128  conf.getParameter<double>("HF2Threshold"),
129  conf.getParameter<std::vector<double> >("EBGrid"),
130  conf.getParameter<std::vector<double> >("EBWeights"),
131  conf.getParameter<std::vector<double> >("EEGrid"),
132  conf.getParameter<std::vector<double> >("EEWeights"),
133  conf.getParameter<std::vector<double> >("HBGrid"),
134  conf.getParameter<std::vector<double> >("HBWeights"),
135  conf.getParameter<std::vector<double> >("HESGrid"),
136  conf.getParameter<std::vector<double> >("HESWeights"),
137  conf.getParameter<std::vector<double> >("HEDGrid"),
138  conf.getParameter<std::vector<double> >("HEDWeights"),
139  conf.getParameter<std::vector<double> >("HOGrid"),
140  conf.getParameter<std::vector<double> >("HOWeights"),
141  conf.getParameter<std::vector<double> >("HF1Grid"),
142  conf.getParameter<std::vector<double> >("HF1Weights"),
143  conf.getParameter<std::vector<double> >("HF2Grid"),
144  conf.getParameter<std::vector<double> >("HF2Weights"),
145  conf.getParameter<double>("EBWeight"),
146  conf.getParameter<double>("EEWeight"),
147  conf.getParameter<double>("HBWeight"),
148  conf.getParameter<double>("HESWeight"),
149  conf.getParameter<double>("HEDWeight"),
150  conf.getParameter<double>("HOWeight"),
151  conf.getParameter<double>("HF1Weight"),
152  conf.getParameter<double>("HF2Weight"),
153  conf.getParameter<double>("EcutTower"),
154  conf.getParameter<double>("EBSumThreshold"),
155  conf.getParameter<double>("EESumThreshold"),
156  conf.getParameter<bool>("UseHO"),
157  // (for momentum reconstruction algorithm)
158  conf.getParameter<int>("MomConstrMethod"),
159  conf.getParameter<double>("MomHBDepth"),
160  conf.getParameter<double>("MomHEDepth"),
161  conf.getParameter<double>("MomEBDepth"),
162  conf.getParameter<double>("MomEEDepth"),
163  conf.getParameter<int>("HcalPhase")),
164 
165  ecalLabels_(conf.getParameter<std::vector<edm::InputTag> >("ecalInputs")),
166  allowMissingInputs_(conf.getParameter<bool>("AllowMissingInputs")),
167 
168  theHcalAcceptSeverityLevel_(conf.getParameter<unsigned int>("HcalAcceptSeverityLevel")),
169 
170  theRecoveredHcalHitsAreUsed_(conf.getParameter<bool>("UseHcalRecoveredHits")),
171  theRecoveredEcalHitsAreUsed_(conf.getParameter<bool>("UseEcalRecoveredHits")),
172 
173  // paramaters controlling the use of rejected hits
174 
175  useRejectedHitsOnly_(conf.getParameter<bool>("UseRejectedHitsOnly")),
176 
178  conf.getParameter<unsigned int>("HcalAcceptSeverityLevelForRejectedHit")),
179 
180  useRejectedRecoveredHcalHits_(conf.getParameter<bool>("UseRejectedRecoveredHcalHits")),
181  useRejectedRecoveredEcalHits_(conf.getParameter<bool>("UseRejectedRecoveredEcalHits")),
182  cutsFromDB(conf.getParameter<bool>("usePFThresholdsFromDB")),
183  ecalRecHitThresh_(conf.getParameter<bool>("EcalRecHitThresh")) {
184  algo_.setMissingHcalRescaleFactorForEcal(conf.getParameter<double>("missingHcalRescaleFactorForEcal"));
185 
186  // register for data access
187  tok_hbhe_ = consumes<HBHERecHitCollection>(conf.getParameter<edm::InputTag>("hbheInput"));
188  tok_ho_ = consumes<HORecHitCollection>(conf.getParameter<edm::InputTag>("hoInput"));
189  tok_hf_ = consumes<HFRecHitCollection>(conf.getParameter<edm::InputTag>("hfInput"));
190  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
191  tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
192  tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
193  tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
194  tok_ecalChStatus_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>();
195  tok_hcalChStatus_ = esConsumes<HcalChannelQuality, HcalChannelQualityRcd>(edm::ESInputTag("", "withTopo"));
196  tok_hcalSevComputer_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
197  tok_ecalSevAlgo_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
198 
199  if (cutsFromDB) {
200  hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginRun>(edm::ESInputTag("", "withTopo"));
201  }
202 
203  if (ecalRecHitThresh_) {
205  esConsumes<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd, edm::Transition::BeginRun>();
206  }
207 
208  const unsigned nLabels = ecalLabels_.size();
209  for (unsigned i = 0; i != nLabels; i++)
210  toks_ecal_.push_back(consumes<EcalRecHitCollection>(ecalLabels_[i]));
211 
220 
221  // get the Ecal severities to be excluded
222  const std::vector<std::string> severitynames =
223  conf.getParameter<std::vector<std::string> >("EcalRecHitSeveritiesToBeExcluded");
224 
225  theEcalSeveritiesToBeExcluded_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynames);
226 
227  // get the Ecal severities to be used for bad towers
228  theEcalSeveritiesToBeUsedInBadTowers_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(
229  conf.getParameter<std::vector<std::string> >("EcalSeveritiesToBeUsedInBadTowers"));
230 
231  if (eScales_.instanceLabel.empty())
232  produces<CaloTowerCollection>();
233  else
234  produces<CaloTowerCollection>(eScales_.instanceLabel);
235 
236 #ifdef EDM_ML_DEBUG
237  std::cout << "VI Producer " << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
238  << (allowMissingInputs_ ? "allowMissing " : " ") << nLabels << ' ' << severitynames.size() << std::endl;
239 #endif
240 }
double HF2Scale
Definition: EScales.h:20
CaloTowersCreationAlgo algo_
double EEScale
Definition: EScales.h:14
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > tok_hcalChStatus_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_ecalSevAlgo_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > tok_ctmap_
double HOScale
Definition: EScales.h:18
std::vector< int > theEcalSeveritiesToBeExcluded_
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
double HF1Scale
Definition: EScales.h:19
edm::EDGetTokenT< HORecHitCollection > tok_ho_
double HEDScale
Definition: EScales.h:17
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_ecalChStatus_
edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
double EBScale
Definition: EScales.h:13
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
double HBScale
Definition: EScales.h:15
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > tok_hcalSevComputer_
std::string instanceLabel
Definition: EScales.h:21
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
void setMissingHcalRescaleFactorForEcal(float factor)
unsigned int theHcalAcceptSeverityLevel_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
std::vector< edm::InputTag > ecalLabels_
double HESScale
Definition: EScales.h:16
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers_
edm::EDGetTokenT< HFRecHitCollection > tok_hf_

◆ ~CaloTowersCreator()

CaloTowersCreator::~CaloTowersCreator ( )
inlineoverride

Definition at line 35 of file CaloTowersCreator.cc.

35 {}

Member Function Documentation

◆ beginRun()

void CaloTowersCreator::beginRun ( edm::Run const &  run,
edm::EventSetup const &  es 
)
override

Definition at line 242 of file CaloTowersCreator.cc.

References algo_, cutsFromDB, ecalPFRechitThresholdsToken_, ecalRecHitThresh_, ecalThresholds, edm::EventSetup::getData(), hcalCutsToken_, paramPF, and CaloTowersCreationAlgo::setThresFromDB().

242  {
243  if (cutsFromDB) {
244  paramPF = &es.getData(hcalCutsToken_);
245  }
246 
247  if (ecalRecHitThresh_) {
249  }
250 
252 }
CaloTowersCreationAlgo algo_
EcalPFRecHitThresholds const * ecalThresholds
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
void setThresFromDB(const EcalPFRecHitThresholds *EcalCuts, const HcalPFCuts *HcalCuts)
HcalPFCuts const * paramPF

◆ fillDescriptions()

void CaloTowersCreator::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 416 of file CaloTowersCreator.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

416  {
418  desc.add<double>("EBSumThreshold", 0.2);
419  desc.add<double>("HF2Weight", 1.0);
420  desc.add<double>("EBWeight", 1.0);
421  desc.add<double>("EESumThreshold", 0.45);
422  desc.add<double>("HOThreshold0", 1.1);
423  desc.add<double>("HOThresholdPlus1", 3.5);
424  desc.add<double>("HOThresholdMinus1", 3.5);
425  desc.add<double>("HOThresholdPlus2", 3.5);
426  desc.add<double>("HOThresholdMinus2", 3.5);
427  desc.add<double>("HBThreshold", 0.7);
428  desc.add<double>("HBThreshold1", 0.7);
429  desc.add<double>("HBThreshold2", 0.7);
430  desc.add<double>("HF1Threshold", 0.5);
431  desc.add<double>("HEDWeight", 1.0);
432  desc.add<double>("EEWeight", 1.0);
433  desc.add<double>("HESWeight", 1.0);
434  desc.add<double>("HF1Weight", 1.0);
435  desc.add<double>("HOWeight", 1.0);
436  desc.add<double>("EBThreshold", 0.07);
437  desc.add<double>("EEThreshold", 0.3);
438  desc.add<double>("HcalThreshold", -1000.0);
439  desc.add<double>("HF2Threshold", 0.85);
440  desc.add<double>("HESThreshold", 0.8);
441  desc.add<double>("HESThreshold1", 0.8);
442  desc.add<double>("HEDThreshold", 0.8);
443  desc.add<double>("HEDThreshold1", 0.8);
444  desc.add<double>("EcutTower", -1000.0);
445  desc.add<double>("HBWeight", 1.0);
446  desc.add<double>("MomHBDepth", 0.2);
447  desc.add<double>("MomHEDepth", 0.4);
448  desc.add<double>("MomEBDepth", 0.3);
449  desc.add<double>("MomEEDepth", 0.0);
450  desc.add<bool>("UseHO", true);
451  desc.add<bool>("UseEtEBTreshold", false);
452  desc.add<bool>("UseSymEBTreshold", true);
453  desc.add<bool>("UseEtEETreshold", false);
454  desc.add<bool>("UseSymEETreshold", true);
455  desc.add<bool>("UseHcalRecoveredHits", true);
456  desc.add<bool>("UseEcalRecoveredHits", false);
457  desc.add<bool>("UseRejectedHitsOnly", false);
458  desc.add<bool>("UseRejectedRecoveredHcalHits", true);
459  desc.add<bool>("UseRejectedRecoveredEcalHits", false);
460  desc.add<double>("missingHcalRescaleFactorForEcal", 0.0);
461  desc.add<bool>("AllowMissingInputs", false);
462  desc.add<std::vector<double> >("HBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
463  desc.add<std::vector<double> >("EEWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
464  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
465  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
466  desc.add<std::vector<double> >("EEGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
467  desc.add<std::vector<double> >("HBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
468  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
469  desc.add<std::vector<double> >("HEDWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
470  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
471  desc.add<std::vector<double> >("EBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
472  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
473  desc.add<std::vector<double> >("HESGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
474  desc.add<std::vector<double> >("HESWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
475  desc.add<std::vector<double> >("HEDGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
476  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
477  desc.add<std::vector<double> >("EBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
478  desc.add<edm::InputTag>("hfInput", edm::InputTag("hfreco"));
479  desc.add<edm::InputTag>("hbheInput", edm::InputTag("hbhereco"));
480  desc.add<edm::InputTag>("hoInput", edm::InputTag("horeco"));
481  desc.add<std::vector<edm::InputTag> >(
482  "ecalInputs", {edm::InputTag("ecalRecHit", "EcalRecHitsEB"), edm::InputTag("ecalRecHit", "EcalRecHitsEE")});
483  desc.add<int>("MomConstrMethod", 1);
484  desc.add<unsigned int>("HcalAcceptSeverityLevel", 9);
485  desc.add<std::vector<std::string> >("EcalRecHitSeveritiesToBeExcluded", {"kTime", "kWeird", "kBad"});
486  desc.add<unsigned int>("HcalAcceptSeverityLevelForRejectedHit", 9999);
487  desc.add<std::vector<std::string> >("EcalSeveritiesToBeUsedInBadTowers", {});
488  desc.add<int>("HcalPhase", 0);
489  desc.add<bool>("usePFThresholdsFromDB", true);
490  desc.add<bool>("EcalRecHitThresh", false);
491  descriptions.addDefault(desc);
492 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ getGridValues()

static const std::vector<double>& CaloTowersCreator::getGridValues ( )
staticprivate

◆ produce()

void CaloTowersCreator::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 254 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, edm::SortedCollection< T, SORT >::begin(), CaloTowersCreationAlgo::begin(), DummyCfis::c, caloTowerConstituentsWatcher_, edm::ESWatcher< T >::check(), gather_cfg::cout, MillePedeFileConverter_cfg::e, EBEScale, EcalBarrel, EcalEndcap, ecalSevLevelWatcher_, EEEScale, edm::SortedCollection< T, SORT >::empty(), eScales_, CaloTowersCreationAlgo::finish(), HBEScale, photonIsolationHIProducer_cfi::hbhe, hcalChStatusWatcher_, hcalSevLevelWatcher_, HEDEScale, HESEScale, photonIsolationHIProducer_cfi::hf, HF1EScale, HF2EScale, photonIsolationHIProducer_cfi::ho, HOEScale, mps_fire::i, EScales::instanceLabel, CaloTowersCreationAlgo::makeEcalBadChs(), CaloTowersCreationAlgo::makeHcalDropChMap(), eostools::move(), CaloTowersCreationAlgo::process(), dumpMFGeometry_cfg::prod, edm::ESHandle< T >::product(), CaloTowersCreationAlgo::setEBEScale(), CaloTowersCreationAlgo::setEbHandle(), CaloTowersCreationAlgo::setEcalChStatusFromDB(), CaloTowersCreationAlgo::setEcalSeveritiesToBeExcluded(), CaloTowersCreationAlgo::SetEcalSeveritiesToBeUsedInBadTowers(), CaloTowersCreationAlgo::setEcalSevLvlAlgo(), CaloTowersCreationAlgo::setEEEScale(), CaloTowersCreationAlgo::setEeHandle(), CaloTowersCreationAlgo::setGeometry(), CaloTowersCreationAlgo::setHBEScale(), CaloTowersCreationAlgo::setHcalAcceptSeverityLevel(), CaloTowersCreationAlgo::setHcalAcceptSeverityLevelForRejectedHit(), CaloTowersCreationAlgo::setHcalChStatusFromDB(), CaloTowersCreationAlgo::setHcalSevLvlComputer(), CaloTowersCreationAlgo::setHEDEScale(), CaloTowersCreationAlgo::setHESEScale(), CaloTowersCreationAlgo::setHF1EScale(), CaloTowersCreationAlgo::setHF2EScale(), CaloTowersCreationAlgo::setHOEScale(), CaloTowersCreationAlgo::setRecoveredEcalHitsAreUsed(), CaloTowersCreationAlgo::setRecoveredHcalHitsAreUsed(), CaloTowersCreationAlgo::setUseRejectedHitsOnly(), CaloTowersCreationAlgo::setUseRejectedRecoveredEcalHits(), CaloTowersCreationAlgo::setUseRejectedRecoveredHcalHits(), theEcalSeveritiesToBeExcluded_, theEcalSeveritiesToBeUsedInBadTowers_, theHcalAcceptSeverityLevel_, theHcalAcceptSeverityLevelForRejectedHit_, theRecoveredEcalHitsAreUsed_, theRecoveredHcalHitsAreUsed_, tok_ctmap_, tok_cttopo_, tok_ecalChStatus_, tok_ecalSevAlgo_, tok_geom_, tok_hbhe_, tok_hcalChStatus_, tok_hcalSevComputer_, tok_hf_, tok_ho_, tok_topo_, toks_ecal_, useRejectedHitsOnly_, useRejectedRecoveredEcalHits_, useRejectedRecoveredHcalHits_, and trackerHitRTTI::vector.

254  {
255  // get the necessary event setup objects...
256  edm::ESHandle<CaloGeometry> pG = c.getHandle(tok_geom_);
257  edm::ESHandle<HcalTopology> htopo = c.getHandle(tok_topo_);
258  edm::ESHandle<CaloTowerTopology> cttopo = c.getHandle(tok_cttopo_);
260 
261  // ECAL channel status map ****************************************
262  edm::ESHandle<EcalChannelStatus> ecalChStatus = c.getHandle(tok_ecalChStatus_);
263  const EcalChannelStatus* dbEcalChStatus = ecalChStatus.product();
264 
265  // HCAL channel status map ****************************************
266  edm::ESHandle<HcalChannelQuality> hcalChStatus = c.getHandle(tok_hcalChStatus_);
267 
268  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
269 
270  // Assignment of severity levels **********************************
271  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl = c.getHandle(tok_hcalSevComputer_);
272  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
273 
274  edm::ESHandle<EcalSeverityLevelAlgo> ecalSevLvlAlgoHndl = c.getHandle(tok_ecalSevAlgo_);
275  const EcalSeverityLevelAlgo* ecalSevLvlAlgo = ecalSevLvlAlgoHndl.product();
276 
285  algo_.setGeometry(cttopo.product(), ctmap.product(), htopo.product(), pG.product());
286 
287  // for treatment of problematic and anomalous cells
288 
289  algo_.setHcalChStatusFromDB(dbHcalChStatus);
290  algo_.setEcalChStatusFromDB(dbEcalChStatus);
291 
294 
297 
298  algo_.setHcalSevLvlComputer(hcalSevLvlComputer);
299  algo_.setEcalSevLvlAlgo(ecalSevLvlAlgo);
300 
302 
305 
308 
309 #ifdef EDM_ML_DEBUG
310  std::cout << "VI Produce: " << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
311  << (allowMissingInputs_ ? "allowMissing " : " ")
312  << (theRecoveredEcalHitsAreUsed_ ? "use RecoveredEcal " : " ") << toks_ecal_.size() << ' '
314  << std::endl;
315 #endif
316 
317  algo_.begin(); // clear the internal buffer
318 
319  // can't chain these in a big OR statement, or else it'll
320  // get triggered for each of the first three events
321  bool check1 = hcalSevLevelWatcher_.check(c);
322  bool check2 = hcalChStatusWatcher_.check(c);
323  bool check3 = caloTowerConstituentsWatcher_.check(c);
324  if (check1 || check2 || check3) {
326  }
327 
328  // check ecal SevLev
331 
332  // ----------------------------------------------------------
333  // For ecal error handling need to
334  // have access to the EB and EE collections at the end of
335  // tower reconstruction.
336 
339 
340  for (std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i = toks_ecal_.begin();
341  i != toks_ecal_.end();
342  i++) {
344 
345  if (!e.getByToken(*i, ec_tmp))
346  continue;
347  if (ec_tmp->empty())
348  continue;
349 
350  // check if this is EB or EE
351  if ((ec_tmp->begin()->detid()).subdetId() == EcalBarrel) {
352  ebHandle = ec_tmp;
353  } else if ((ec_tmp->begin()->detid()).subdetId() == EcalEndcap) {
354  eeHandle = ec_tmp;
355  }
356  }
357 
358  algo_.setEbHandle(ebHandle);
359  algo_.setEeHandle(eeHandle);
360 
361  //-----------------------------------------------------------
362 
363  bool present;
364 
365  // Step A/C: Get Inputs and process (repeatedly)
367  present = e.getByToken(tok_hbhe_, hbhe);
368  if (present || !allowMissingInputs_)
369  algo_.process(*hbhe);
370 
372  present = e.getByToken(tok_ho_, ho);
373  if (present || !allowMissingInputs_)
374  algo_.process(*ho);
375 
377  present = e.getByToken(tok_hf_, hf);
378  if (present || !allowMissingInputs_)
379  algo_.process(*hf);
380 
381  std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i;
382  for (i = toks_ecal_.begin(); i != toks_ecal_.end(); i++) {
384  present = e.getByToken(*i, ec);
385  if (present || !allowMissingInputs_)
386  algo_.process(*ec);
387  }
388 
389  // Step B: Create empty output
390  auto prod = std::make_unique<CaloTowerCollection>();
391 
392  // Step C: Process
393  algo_.finish(*prod);
394 
395 #ifdef EDM_ML_DEBUG
396  int totc = 0;
397  float totE = 0;
399  for (auto const& tw : (*prod)) {
400  totc += tw.constituents().size();
401  totE += tw.energy();
402  totP4 += tw.p4();
403  std::cout << "CaloTowerCreator: " << tw.id() << " with E " << tw.energy() << " and " << tw.constituents().size()
404  << " constituents\n";
405  }
406  std::cout << "VI " << (*prod).size() << " " << totc << " " << totE << " " << totP4 << std::endl;
407 #endif
408 
409  // Step D: Put into the event
410  if (eScales_.instanceLabel.empty())
411  e.put(std::move(prod));
412  else
414 }
void setEcalChStatusFromDB(const EcalChannelStatus *s)
CaloTowersCreationAlgo algo_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > tok_hcalChStatus_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_ecalSevAlgo_
void setHcalChStatusFromDB(const HcalChannelQuality *s)
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > tok_ctmap_
void finish(CaloTowerCollection &destCollection)
void setEeHandle(const edm::Handle< EcalRecHitCollection > ee)
std::vector< int > theEcalSeveritiesToBeExcluded_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
void setGeometry(const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
void setEbHandle(const edm::Handle< EcalRecHitCollection > eb)
void setUseRejectedRecoveredEcalHits(bool flag)
T const * product() const
Definition: ESHandle.h:86
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_ecalChStatus_
void setEcalSeveritiesToBeExcluded(const std::vector< int > &ecalSev)
void setHcalAcceptSeverityLevelForRejectedHit(unsigned int level)
void setHcalSevLvlComputer(const HcalSeverityLevelComputer *c)
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
void SetEcalSeveritiesToBeUsedInBadTowers(const std::vector< int > &ecalSev)
const_iterator begin() const
void setRecoveredEcalHitsAreUsed(bool flag)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
edm::ESWatcher< HcalChannelQualityRcd > hcalChStatusWatcher_
void process(const HBHERecHitCollection &hbhe)
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > tok_hcalSevComputer_
std::string instanceLabel
Definition: EScales.h:21
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
void setRecoveredHcalHitsAreUsed(bool flag)
void setUseRejectedHitsOnly(bool flag)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
unsigned int theHcalAcceptSeverityLevel_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
void setHcalAcceptSeverityLevel(unsigned int level)
edm::ESWatcher< HcalSeverityLevelComputerRcd > hcalSevLevelWatcher_
void setEcalSevLvlAlgo(const EcalSeverityLevelAlgo *a)
void setUseRejectedRecoveredHcalHits(bool flag)
edm::ESWatcher< IdealGeometryRecord > caloTowerConstituentsWatcher_
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: LeafCandidate.h:23
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
edm::ESWatcher< EcalSeverityLevelAlgoRcd > ecalSevLevelWatcher_

Member Data Documentation

◆ algo_

CaloTowersCreationAlgo CaloTowersCreator::algo_
private

Definition at line 45 of file CaloTowersCreator.cc.

Referenced by beginRun(), CaloTowersCreator(), and produce().

◆ allowMissingInputs_

bool CaloTowersCreator::allowMissingInputs_
private

Definition at line 51 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ caloTowerConstituentsWatcher_

edm::ESWatcher<IdealGeometryRecord> CaloTowersCreator::caloTowerConstituentsWatcher_
private

Definition at line 88 of file CaloTowersCreator.cc.

Referenced by produce().

◆ cutsFromDB

bool CaloTowersCreator::cutsFromDB
private

Definition at line 93 of file CaloTowersCreator.cc.

Referenced by beginRun(), and CaloTowersCreator().

◆ EBEScale

double CaloTowersCreator::EBEScale

Definition at line 39 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ ecalLabels_

std::vector<edm::InputTag> CaloTowersCreator::ecalLabels_
private

Definition at line 49 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator().

◆ ecalPFRechitThresholdsToken_

edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> CaloTowersCreator::ecalPFRechitThresholdsToken_
private

Definition at line 97 of file CaloTowersCreator.cc.

Referenced by beginRun(), and CaloTowersCreator().

◆ ecalRecHitThresh_

bool CaloTowersCreator::ecalRecHitThresh_
private

Definition at line 98 of file CaloTowersCreator.cc.

Referenced by beginRun(), and CaloTowersCreator().

◆ ecalSevLevelWatcher_

edm::ESWatcher<EcalSeverityLevelAlgoRcd> CaloTowersCreator::ecalSevLevelWatcher_
private

Definition at line 89 of file CaloTowersCreator.cc.

Referenced by produce().

◆ ecalThresholds

EcalPFRecHitThresholds const* CaloTowersCreator::ecalThresholds = nullptr
private

Definition at line 99 of file CaloTowersCreator.cc.

Referenced by beginRun().

◆ EEEScale

double CaloTowersCreator::EEEScale

Definition at line 39 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ eScales_

EScales CaloTowersCreator::eScales_
private

Definition at line 90 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HBEScale

double CaloTowersCreator::HBEScale

Definition at line 39 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ hcalChStatusWatcher_

edm::ESWatcher<HcalChannelQualityRcd> CaloTowersCreator::hcalChStatusWatcher_
private

Definition at line 87 of file CaloTowersCreator.cc.

Referenced by produce().

◆ hcalCutsToken_

edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> CaloTowersCreator::hcalCutsToken_
private

Definition at line 92 of file CaloTowersCreator.cc.

Referenced by beginRun(), and CaloTowersCreator().

◆ hcalSevLevelWatcher_

edm::ESWatcher<HcalSeverityLevelComputerRcd> CaloTowersCreator::hcalSevLevelWatcher_
private

Definition at line 86 of file CaloTowersCreator.cc.

Referenced by produce().

◆ HEDEScale

double CaloTowersCreator::HEDEScale

Definition at line 40 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HESEScale

double CaloTowersCreator::HESEScale

Definition at line 39 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HF1EScale

double CaloTowersCreator::HF1EScale

Definition at line 40 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HF2EScale

double CaloTowersCreator::HF2EScale

Definition at line 40 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HOEScale

double CaloTowersCreator::HOEScale

Definition at line 40 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ paramPF

HcalPFCuts const* CaloTowersCreator::paramPF = nullptr
private

Definition at line 94 of file CaloTowersCreator.cc.

Referenced by beginRun().

◆ theEcalSeveritiesToBeExcluded_

std::vector<int> CaloTowersCreator::theEcalSeveritiesToBeExcluded_
private

Definition at line 65 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theEcalSeveritiesToBeUsedInBadTowers_

std::vector<int> CaloTowersCreator::theEcalSeveritiesToBeUsedInBadTowers_
private

Definition at line 76 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theHcalAcceptSeverityLevel_

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevel_
private

Definition at line 64 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theHcalAcceptSeverityLevelForRejectedHit_

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevelForRejectedHit_
private

Definition at line 74 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theRecoveredEcalHitsAreUsed_

bool CaloTowersCreator::theRecoveredEcalHitsAreUsed_
private

Definition at line 69 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theRecoveredHcalHitsAreUsed_

bool CaloTowersCreator::theRecoveredHcalHitsAreUsed_
private

Definition at line 68 of file CaloTowersCreator.cc.

Referenced by produce().

◆ tok_ctmap_

edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> CaloTowersCreator::tok_ctmap_
private

Definition at line 56 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_cttopo_

edm::ESGetToken<CaloTowerTopology, HcalRecNumberingRecord> CaloTowersCreator::tok_cttopo_
private

Definition at line 55 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ecalChStatus_

edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> CaloTowersCreator::tok_ecalChStatus_
private

Definition at line 57 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ecalSevAlgo_

edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> CaloTowersCreator::tok_ecalSevAlgo_
private

Definition at line 60 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_geom_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> CaloTowersCreator::tok_geom_
private

Definition at line 53 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hbhe_

edm::EDGetTokenT<HBHERecHitCollection> CaloTowersCreator::tok_hbhe_
private

Definition at line 46 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hcalChStatus_

edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> CaloTowersCreator::tok_hcalChStatus_
private

Definition at line 58 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hcalSevComputer_

edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> CaloTowersCreator::tok_hcalSevComputer_
private

Definition at line 59 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hf_

edm::EDGetTokenT<HFRecHitCollection> CaloTowersCreator::tok_hf_
private

Definition at line 48 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ho_

edm::EDGetTokenT<HORecHitCollection> CaloTowersCreator::tok_ho_
private

Definition at line 47 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_topo_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> CaloTowersCreator::tok_topo_
private

Definition at line 54 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ toks_ecal_

std::vector<edm::EDGetTokenT<EcalRecHitCollection> > CaloTowersCreator::toks_ecal_
private

Definition at line 50 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ useRejectedHitsOnly_

bool CaloTowersCreator::useRejectedHitsOnly_
private

Definition at line 73 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ useRejectedRecoveredEcalHits_

bool CaloTowersCreator::useRejectedRecoveredEcalHits_
private

Definition at line 84 of file CaloTowersCreator.cc.

Referenced by produce().

◆ useRejectedRecoveredHcalHits_

bool CaloTowersCreator::useRejectedRecoveredHcalHits_
private

Definition at line 83 of file CaloTowersCreator.cc.

Referenced by produce().