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::ESWatcher< EcalSeverityLevelAlgoRcdecalSevLevelWatcher_
 
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 30 of file CaloTowersCreator.cc.

Constructor & Destructor Documentation

◆ CaloTowersCreator()

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

Definition at line 98 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, gather_cfg::cout, cutsFromDB, EBEScale, EScales::EBScale, ecalLabels_, 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_.

99  : algo_(conf.getParameter<double>("EBThreshold"),
100  conf.getParameter<double>("EEThreshold"),
101 
102  conf.getParameter<bool>("UseEtEBTreshold"),
103  conf.getParameter<bool>("UseEtEETreshold"),
104  conf.getParameter<bool>("UseSymEBTreshold"),
105  conf.getParameter<bool>("UseSymEETreshold"),
106 
107  conf.getParameter<double>("HcalThreshold"),
108  conf.getParameter<double>("HBThreshold"),
109  conf.getParameter<double>("HBThreshold1"),
110  conf.getParameter<double>("HBThreshold2"),
111  conf.getParameter<double>("HESThreshold"),
112  conf.getParameter<double>("HESThreshold1"),
113  conf.getParameter<double>("HEDThreshold"),
114  conf.getParameter<double>("HEDThreshold1"),
115  conf.getParameter<double>("HOThreshold0"),
116  conf.getParameter<double>("HOThresholdPlus1"),
117  conf.getParameter<double>("HOThresholdMinus1"),
118  conf.getParameter<double>("HOThresholdPlus2"),
119  conf.getParameter<double>("HOThresholdMinus2"),
120  conf.getParameter<double>("HF1Threshold"),
121  conf.getParameter<double>("HF2Threshold"),
122  conf.getParameter<std::vector<double> >("EBGrid"),
123  conf.getParameter<std::vector<double> >("EBWeights"),
124  conf.getParameter<std::vector<double> >("EEGrid"),
125  conf.getParameter<std::vector<double> >("EEWeights"),
126  conf.getParameter<std::vector<double> >("HBGrid"),
127  conf.getParameter<std::vector<double> >("HBWeights"),
128  conf.getParameter<std::vector<double> >("HESGrid"),
129  conf.getParameter<std::vector<double> >("HESWeights"),
130  conf.getParameter<std::vector<double> >("HEDGrid"),
131  conf.getParameter<std::vector<double> >("HEDWeights"),
132  conf.getParameter<std::vector<double> >("HOGrid"),
133  conf.getParameter<std::vector<double> >("HOWeights"),
134  conf.getParameter<std::vector<double> >("HF1Grid"),
135  conf.getParameter<std::vector<double> >("HF1Weights"),
136  conf.getParameter<std::vector<double> >("HF2Grid"),
137  conf.getParameter<std::vector<double> >("HF2Weights"),
138  conf.getParameter<double>("EBWeight"),
139  conf.getParameter<double>("EEWeight"),
140  conf.getParameter<double>("HBWeight"),
141  conf.getParameter<double>("HESWeight"),
142  conf.getParameter<double>("HEDWeight"),
143  conf.getParameter<double>("HOWeight"),
144  conf.getParameter<double>("HF1Weight"),
145  conf.getParameter<double>("HF2Weight"),
146  conf.getParameter<double>("EcutTower"),
147  conf.getParameter<double>("EBSumThreshold"),
148  conf.getParameter<double>("EESumThreshold"),
149  conf.getParameter<bool>("UseHO"),
150  // (for momentum reconstruction algorithm)
151  conf.getParameter<int>("MomConstrMethod"),
152  conf.getParameter<double>("MomHBDepth"),
153  conf.getParameter<double>("MomHEDepth"),
154  conf.getParameter<double>("MomEBDepth"),
155  conf.getParameter<double>("MomEEDepth"),
156  conf.getParameter<int>("HcalPhase")),
157 
158  ecalLabels_(conf.getParameter<std::vector<edm::InputTag> >("ecalInputs")),
159  allowMissingInputs_(conf.getParameter<bool>("AllowMissingInputs")),
160 
161  theHcalAcceptSeverityLevel_(conf.getParameter<unsigned int>("HcalAcceptSeverityLevel")),
162 
163  theRecoveredHcalHitsAreUsed_(conf.getParameter<bool>("UseHcalRecoveredHits")),
164  theRecoveredEcalHitsAreUsed_(conf.getParameter<bool>("UseEcalRecoveredHits")),
165 
166  // paramaters controlling the use of rejected hits
167 
168  useRejectedHitsOnly_(conf.getParameter<bool>("UseRejectedHitsOnly")),
169 
171  conf.getParameter<unsigned int>("HcalAcceptSeverityLevelForRejectedHit")),
172 
173  useRejectedRecoveredHcalHits_(conf.getParameter<bool>("UseRejectedRecoveredHcalHits")),
174  useRejectedRecoveredEcalHits_(conf.getParameter<bool>("UseRejectedRecoveredEcalHits")),
175  cutsFromDB(conf.getParameter<bool>("usePFThresholdsFromDB"))
176 
177 {
178  algo_.setMissingHcalRescaleFactorForEcal(conf.getParameter<double>("missingHcalRescaleFactorForEcal"));
179 
180  // register for data access
181  tok_hbhe_ = consumes<HBHERecHitCollection>(conf.getParameter<edm::InputTag>("hbheInput"));
182  tok_ho_ = consumes<HORecHitCollection>(conf.getParameter<edm::InputTag>("hoInput"));
183  tok_hf_ = consumes<HFRecHitCollection>(conf.getParameter<edm::InputTag>("hfInput"));
184  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
185  tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
186  tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
187  tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
188  tok_ecalChStatus_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>();
189  tok_hcalChStatus_ = esConsumes<HcalChannelQuality, HcalChannelQualityRcd>(edm::ESInputTag("", "withTopo"));
190  tok_hcalSevComputer_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
191  tok_ecalSevAlgo_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
192 
193  if (cutsFromDB) {
194  hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginRun>(edm::ESInputTag("", "withTopo"));
195  }
196  const unsigned nLabels = ecalLabels_.size();
197  for (unsigned i = 0; i != nLabels; i++)
198  toks_ecal_.push_back(consumes<EcalRecHitCollection>(ecalLabels_[i]));
199 
208 
209  // get the Ecal severities to be excluded
210  const std::vector<std::string> severitynames =
211  conf.getParameter<std::vector<std::string> >("EcalRecHitSeveritiesToBeExcluded");
212 
213  theEcalSeveritiesToBeExcluded_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynames);
214 
215  // get the Ecal severities to be used for bad towers
216  theEcalSeveritiesToBeUsedInBadTowers_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(
217  conf.getParameter<std::vector<std::string> >("EcalSeveritiesToBeUsedInBadTowers"));
218 
219  if (eScales_.instanceLabel.empty())
220  produces<CaloTowerCollection>();
221  else
222  produces<CaloTowerCollection>(eScales_.instanceLabel);
223 
224 #ifdef EDM_ML_DEBUG
225  std::cout << "VI Producer " << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
226  << (allowMissingInputs_ ? "allowMissing " : " ") << nLabels << ' ' << severitynames.size() << std::endl;
227 #endif
228 }
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_
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 33 of file CaloTowersCreator.cc.

33 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 230 of file CaloTowersCreator.cc.

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

230  {
231  if (cutsFromDB) {
232  paramPF = &es.getData(hcalCutsToken_);
233  }
235 }
CaloTowersCreationAlgo algo_
void setThresFromDB(const HcalPFCuts *cuts)
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
HcalPFCuts const * paramPF

◆ fillDescriptions()

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

Definition at line 399 of file CaloTowersCreator.cc.

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

399  {
401  desc.add<double>("EBSumThreshold", 0.2);
402  desc.add<double>("HF2Weight", 1.0);
403  desc.add<double>("EBWeight", 1.0);
404  desc.add<double>("EESumThreshold", 0.45);
405  desc.add<double>("HOThreshold0", 1.1);
406  desc.add<double>("HOThresholdPlus1", 3.5);
407  desc.add<double>("HOThresholdMinus1", 3.5);
408  desc.add<double>("HOThresholdPlus2", 3.5);
409  desc.add<double>("HOThresholdMinus2", 3.5);
410  desc.add<double>("HBThreshold", 0.7);
411  desc.add<double>("HBThreshold1", 0.7);
412  desc.add<double>("HBThreshold2", 0.7);
413  desc.add<double>("HF1Threshold", 0.5);
414  desc.add<double>("HEDWeight", 1.0);
415  desc.add<double>("EEWeight", 1.0);
416  desc.add<double>("HESWeight", 1.0);
417  desc.add<double>("HF1Weight", 1.0);
418  desc.add<double>("HOWeight", 1.0);
419  desc.add<double>("EBThreshold", 0.07);
420  desc.add<double>("EEThreshold", 0.3);
421  desc.add<double>("HcalThreshold", -1000.0);
422  desc.add<double>("HF2Threshold", 0.85);
423  desc.add<double>("HESThreshold", 0.8);
424  desc.add<double>("HESThreshold1", 0.8);
425  desc.add<double>("HEDThreshold", 0.8);
426  desc.add<double>("HEDThreshold1", 0.8);
427  desc.add<double>("EcutTower", -1000.0);
428  desc.add<double>("HBWeight", 1.0);
429  desc.add<double>("MomHBDepth", 0.2);
430  desc.add<double>("MomHEDepth", 0.4);
431  desc.add<double>("MomEBDepth", 0.3);
432  desc.add<double>("MomEEDepth", 0.0);
433  desc.add<bool>("UseHO", true);
434  desc.add<bool>("UseEtEBTreshold", false);
435  desc.add<bool>("UseSymEBTreshold", true);
436  desc.add<bool>("UseEtEETreshold", false);
437  desc.add<bool>("UseSymEETreshold", true);
438  desc.add<bool>("UseHcalRecoveredHits", true);
439  desc.add<bool>("UseEcalRecoveredHits", false);
440  desc.add<bool>("UseRejectedHitsOnly", false);
441  desc.add<bool>("UseRejectedRecoveredHcalHits", true);
442  desc.add<bool>("UseRejectedRecoveredEcalHits", false);
443  desc.add<double>("missingHcalRescaleFactorForEcal", 0.0);
444  desc.add<bool>("AllowMissingInputs", false);
445  desc.add<std::vector<double> >("HBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
446  desc.add<std::vector<double> >("EEWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
447  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
448  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
449  desc.add<std::vector<double> >("EEGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
450  desc.add<std::vector<double> >("HBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
451  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
452  desc.add<std::vector<double> >("HEDWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
453  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
454  desc.add<std::vector<double> >("EBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
455  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
456  desc.add<std::vector<double> >("HESGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
457  desc.add<std::vector<double> >("HESWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
458  desc.add<std::vector<double> >("HEDGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
459  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
460  desc.add<std::vector<double> >("EBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
461  desc.add<edm::InputTag>("hfInput", edm::InputTag("hfreco"));
462  desc.add<edm::InputTag>("hbheInput", edm::InputTag("hbhereco"));
463  desc.add<edm::InputTag>("hoInput", edm::InputTag("horeco"));
464  desc.add<std::vector<edm::InputTag> >(
465  "ecalInputs", {edm::InputTag("ecalRecHit", "EcalRecHitsEB"), edm::InputTag("ecalRecHit", "EcalRecHitsEE")});
466  desc.add<int>("MomConstrMethod", 1);
467  desc.add<unsigned int>("HcalAcceptSeverityLevel", 9);
468  desc.add<std::vector<std::string> >("EcalRecHitSeveritiesToBeExcluded", {"kTime", "kWeird", "kBad"});
469  desc.add<unsigned int>("HcalAcceptSeverityLevelForRejectedHit", 9999);
470  desc.add<std::vector<std::string> >("EcalSeveritiesToBeUsedInBadTowers", {});
471  desc.add<int>("HcalPhase", 0);
472  desc.add<bool>("usePFThresholdsFromDB", true);
473 
474  descriptions.addDefault(desc);
475 }
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 237 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, edm::SortedCollection< T, SORT >::begin(), CaloTowersCreationAlgo::begin(), HltBtagPostValidation_cff::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.

237  {
238  // get the necessary event setup objects...
239  edm::ESHandle<CaloGeometry> pG = c.getHandle(tok_geom_);
240  edm::ESHandle<HcalTopology> htopo = c.getHandle(tok_topo_);
241  edm::ESHandle<CaloTowerTopology> cttopo = c.getHandle(tok_cttopo_);
243 
244  // ECAL channel status map ****************************************
245  edm::ESHandle<EcalChannelStatus> ecalChStatus = c.getHandle(tok_ecalChStatus_);
246  const EcalChannelStatus* dbEcalChStatus = ecalChStatus.product();
247 
248  // HCAL channel status map ****************************************
249  edm::ESHandle<HcalChannelQuality> hcalChStatus = c.getHandle(tok_hcalChStatus_);
250 
251  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
252 
253  // Assignment of severity levels **********************************
254  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl = c.getHandle(tok_hcalSevComputer_);
255  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
256 
257  edm::ESHandle<EcalSeverityLevelAlgo> ecalSevLvlAlgoHndl = c.getHandle(tok_ecalSevAlgo_);
258  const EcalSeverityLevelAlgo* ecalSevLvlAlgo = ecalSevLvlAlgoHndl.product();
259 
268  algo_.setGeometry(cttopo.product(), ctmap.product(), htopo.product(), pG.product());
269 
270  // for treatment of problematic and anomalous cells
271 
272  algo_.setHcalChStatusFromDB(dbHcalChStatus);
273  algo_.setEcalChStatusFromDB(dbEcalChStatus);
274 
277 
280 
281  algo_.setHcalSevLvlComputer(hcalSevLvlComputer);
282  algo_.setEcalSevLvlAlgo(ecalSevLvlAlgo);
283 
285 
288 
291 
292 #ifdef EDM_ML_DEBUG
293  std::cout << "VI Produce: " << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
294  << (allowMissingInputs_ ? "allowMissing " : " ")
295  << (theRecoveredEcalHitsAreUsed_ ? "use RecoveredEcal " : " ") << toks_ecal_.size() << ' '
297  << std::endl;
298 #endif
299 
300  algo_.begin(); // clear the internal buffer
301 
302  // can't chain these in a big OR statement, or else it'll
303  // get triggered for each of the first three events
304  bool check1 = hcalSevLevelWatcher_.check(c);
305  bool check2 = hcalChStatusWatcher_.check(c);
306  bool check3 = caloTowerConstituentsWatcher_.check(c);
307  if (check1 || check2 || check3) {
309  }
310 
311  // check ecal SevLev
314 
315  // ----------------------------------------------------------
316  // For ecal error handling need to
317  // have access to the EB and EE collections at the end of
318  // tower reconstruction.
319 
322 
323  for (std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i = toks_ecal_.begin();
324  i != toks_ecal_.end();
325  i++) {
327 
328  if (!e.getByToken(*i, ec_tmp))
329  continue;
330  if (ec_tmp->empty())
331  continue;
332 
333  // check if this is EB or EE
334  if ((ec_tmp->begin()->detid()).subdetId() == EcalBarrel) {
335  ebHandle = ec_tmp;
336  } else if ((ec_tmp->begin()->detid()).subdetId() == EcalEndcap) {
337  eeHandle = ec_tmp;
338  }
339  }
340 
341  algo_.setEbHandle(ebHandle);
342  algo_.setEeHandle(eeHandle);
343 
344  //-----------------------------------------------------------
345 
346  bool present;
347 
348  // Step A/C: Get Inputs and process (repeatedly)
350  present = e.getByToken(tok_hbhe_, hbhe);
351  if (present || !allowMissingInputs_)
352  algo_.process(*hbhe);
353 
355  present = e.getByToken(tok_ho_, ho);
356  if (present || !allowMissingInputs_)
357  algo_.process(*ho);
358 
360  present = e.getByToken(tok_hf_, hf);
361  if (present || !allowMissingInputs_)
362  algo_.process(*hf);
363 
364  std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i;
365  for (i = toks_ecal_.begin(); i != toks_ecal_.end(); i++) {
367  present = e.getByToken(*i, ec);
368  if (present || !allowMissingInputs_)
369  algo_.process(*ec);
370  }
371 
372  // Step B: Create empty output
373  auto prod = std::make_unique<CaloTowerCollection>();
374 
375  // Step C: Process
376  algo_.finish(*prod);
377 
378 #ifdef EDM_ML_DEBUG
379  int totc = 0;
380  float totE = 0;
382  for (auto const& tw : (*prod)) {
383  totc += tw.constituents().size();
384  totE += tw.energy();
385  totP4 += tw.p4();
386  std::cout << "CaloTowerCreator: " << tw.id() << " with E " << tw.energy() << " and " << tw.constituents().size()
387  << " constituents\n";
388  }
389  std::cout << "VI " << (*prod).size() << " " << totc << " " << totE << " " << totP4 << std::endl;
390 #endif
391 
392  // Step D: Put into the event
393  if (eScales_.instanceLabel.empty())
394  e.put(std::move(prod));
395  else
397 }
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 43 of file CaloTowersCreator.cc.

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

◆ allowMissingInputs_

bool CaloTowersCreator::allowMissingInputs_
private

Definition at line 49 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ caloTowerConstituentsWatcher_

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

Definition at line 86 of file CaloTowersCreator.cc.

Referenced by produce().

◆ cutsFromDB

bool CaloTowersCreator::cutsFromDB
private

Definition at line 91 of file CaloTowersCreator.cc.

Referenced by beginRun(), and CaloTowersCreator().

◆ EBEScale

double CaloTowersCreator::EBEScale

Definition at line 37 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ ecalLabels_

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

Definition at line 47 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator().

◆ ecalSevLevelWatcher_

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

Definition at line 87 of file CaloTowersCreator.cc.

Referenced by produce().

◆ EEEScale

double CaloTowersCreator::EEEScale

Definition at line 37 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ eScales_

EScales CaloTowersCreator::eScales_
private

Definition at line 88 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HBEScale

double CaloTowersCreator::HBEScale

Definition at line 37 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ hcalChStatusWatcher_

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

Definition at line 85 of file CaloTowersCreator.cc.

Referenced by produce().

◆ hcalCutsToken_

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

Definition at line 90 of file CaloTowersCreator.cc.

Referenced by beginRun(), and CaloTowersCreator().

◆ hcalSevLevelWatcher_

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

Definition at line 84 of file CaloTowersCreator.cc.

Referenced by produce().

◆ HEDEScale

double CaloTowersCreator::HEDEScale

Definition at line 38 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HESEScale

double CaloTowersCreator::HESEScale

Definition at line 37 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HF1EScale

double CaloTowersCreator::HF1EScale

Definition at line 38 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HF2EScale

double CaloTowersCreator::HF2EScale

Definition at line 38 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HOEScale

double CaloTowersCreator::HOEScale

Definition at line 38 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ paramPF

HcalPFCuts const* CaloTowersCreator::paramPF = nullptr
private

Definition at line 92 of file CaloTowersCreator.cc.

Referenced by beginRun().

◆ theEcalSeveritiesToBeExcluded_

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

Definition at line 63 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theEcalSeveritiesToBeUsedInBadTowers_

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

Definition at line 74 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theHcalAcceptSeverityLevel_

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevel_
private

Definition at line 62 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theHcalAcceptSeverityLevelForRejectedHit_

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevelForRejectedHit_
private

Definition at line 72 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theRecoveredEcalHitsAreUsed_

bool CaloTowersCreator::theRecoveredEcalHitsAreUsed_
private

Definition at line 67 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theRecoveredHcalHitsAreUsed_

bool CaloTowersCreator::theRecoveredHcalHitsAreUsed_
private

Definition at line 66 of file CaloTowersCreator.cc.

Referenced by produce().

◆ tok_ctmap_

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

Definition at line 54 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_cttopo_

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

Definition at line 53 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ecalChStatus_

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

Definition at line 55 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ecalSevAlgo_

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

Definition at line 58 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_geom_

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

Definition at line 51 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hbhe_

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

Definition at line 44 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hcalChStatus_

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

Definition at line 56 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hcalSevComputer_

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

Definition at line 57 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hf_

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

Definition at line 46 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ho_

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

Definition at line 45 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_topo_

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

Definition at line 52 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ toks_ecal_

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

Definition at line 48 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ useRejectedHitsOnly_

bool CaloTowersCreator::useRejectedHitsOnly_
private

Definition at line 71 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ useRejectedRecoveredEcalHits_

bool CaloTowersCreator::useRejectedRecoveredEcalHits_
private

Definition at line 82 of file CaloTowersCreator.cc.

Referenced by produce().

◆ useRejectedRecoveredHcalHits_

bool CaloTowersCreator::useRejectedRecoveredHcalHits_
private

Definition at line 81 of file CaloTowersCreator.cc.

Referenced by produce().