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

 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_
 
std::vector< edm::InputTagecalLabels_
 
edm::ESWatcher< EcalSeverityLevelAlgoRcdecalSevLevelWatcher_
 
EScales eScales_
 
edm::ESWatcher< HcalChannelQualityRcdhcalChStatusWatcher_
 
edm::ESWatcher< HcalSeverityLevelComputerRcdhcalSevLevelWatcher_
 
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 29 of file CaloTowersCreator.cc.

Constructor & Destructor Documentation

◆ CaloTowersCreator()

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

Definition at line 92 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, gather_cfg::cout, EBEScale, EScales::EBScale, ecalLabels_, EEEScale, EScales::EEScale, eScales_, edm::ParameterSet::getParameter(), HBEScale, EScales::HBScale, 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_.

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

32 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 382 of file CaloTowersCreator.cc.

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

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

220  {
221  // get the necessary event setup objects...
222  edm::ESHandle<CaloGeometry> pG = c.getHandle(tok_geom_);
223  edm::ESHandle<HcalTopology> htopo = c.getHandle(tok_topo_);
224  edm::ESHandle<CaloTowerTopology> cttopo = c.getHandle(tok_cttopo_);
226 
227  // ECAL channel status map ****************************************
228  edm::ESHandle<EcalChannelStatus> ecalChStatus = c.getHandle(tok_ecalChStatus_);
229  const EcalChannelStatus* dbEcalChStatus = ecalChStatus.product();
230 
231  // HCAL channel status map ****************************************
232  edm::ESHandle<HcalChannelQuality> hcalChStatus = c.getHandle(tok_hcalChStatus_);
233 
234  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
235 
236  // Assignment of severity levels **********************************
237  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl = c.getHandle(tok_hcalSevComputer_);
238  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
239 
240  edm::ESHandle<EcalSeverityLevelAlgo> ecalSevLvlAlgoHndl = c.getHandle(tok_ecalSevAlgo_);
241  const EcalSeverityLevelAlgo* ecalSevLvlAlgo = ecalSevLvlAlgoHndl.product();
242 
251  algo_.setGeometry(cttopo.product(), ctmap.product(), htopo.product(), pG.product());
252 
253  // for treatment of problematic and anomalous cells
254 
255  algo_.setHcalChStatusFromDB(dbHcalChStatus);
256  algo_.setEcalChStatusFromDB(dbEcalChStatus);
257 
260 
263 
264  algo_.setHcalSevLvlComputer(hcalSevLvlComputer);
265  algo_.setEcalSevLvlAlgo(ecalSevLvlAlgo);
266 
268 
271 
274 
275 #ifdef EDM_ML_DEBUG
276  std::cout << "VI Produce: " << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
277  << (allowMissingInputs_ ? "allowMissing " : " ")
278  << (theRecoveredEcalHitsAreUsed_ ? "use RecoveredEcal " : " ") << toks_ecal_.size() << ' '
280  << std::endl;
281 #endif
282 
283  algo_.begin(); // clear the internal buffer
284 
285  // can't chain these in a big OR statement, or else it'll
286  // get triggered for each of the first three events
287  bool check1 = hcalSevLevelWatcher_.check(c);
288  bool check2 = hcalChStatusWatcher_.check(c);
289  bool check3 = caloTowerConstituentsWatcher_.check(c);
290  if (check1 || check2 || check3) {
292  }
293 
294  // check ecal SevLev
297 
298  // ----------------------------------------------------------
299  // For ecal error handling need to
300  // have access to the EB and EE collections at the end of
301  // tower reconstruction.
302 
305 
306  for (std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i = toks_ecal_.begin();
307  i != toks_ecal_.end();
308  i++) {
310 
311  if (!e.getByToken(*i, ec_tmp))
312  continue;
313  if (ec_tmp->empty())
314  continue;
315 
316  // check if this is EB or EE
317  if ((ec_tmp->begin()->detid()).subdetId() == EcalBarrel) {
318  ebHandle = ec_tmp;
319  } else if ((ec_tmp->begin()->detid()).subdetId() == EcalEndcap) {
320  eeHandle = ec_tmp;
321  }
322  }
323 
324  algo_.setEbHandle(ebHandle);
325  algo_.setEeHandle(eeHandle);
326 
327  //-----------------------------------------------------------
328 
329  bool present;
330 
331  // Step A/C: Get Inputs and process (repeatedly)
333  present = e.getByToken(tok_hbhe_, hbhe);
334  if (present || !allowMissingInputs_)
335  algo_.process(*hbhe);
336 
338  present = e.getByToken(tok_ho_, ho);
339  if (present || !allowMissingInputs_)
340  algo_.process(*ho);
341 
343  present = e.getByToken(tok_hf_, hf);
344  if (present || !allowMissingInputs_)
345  algo_.process(*hf);
346 
347  std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i;
348  for (i = toks_ecal_.begin(); i != toks_ecal_.end(); i++) {
350  present = e.getByToken(*i, ec);
351  if (present || !allowMissingInputs_)
352  algo_.process(*ec);
353  }
354 
355  // Step B: Create empty output
356  auto prod = std::make_unique<CaloTowerCollection>();
357 
358  // Step C: Process
359  algo_.finish(*prod);
360 
361 #ifdef EDM_ML_DEBUG
362  int totc = 0;
363  float totE = 0;
365  for (auto const& tw : (*prod)) {
366  totc += tw.constituents().size();
367  totE += tw.energy();
368  totP4 += tw.p4();
369  std::cout << "CaloTowerCreator: " << tw.id() << " with E " << tw.energy() << " and " << tw.constituents().size()
370  << " constituents\n";
371  }
372  std::cout << "VI " << (*prod).size() << " " << totc << " " << totE << " " << totP4 << std::endl;
373 #endif
374 
375  // Step D: Put into the event
376  if (eScales_.instanceLabel.empty())
377  e.put(std::move(prod));
378  else
380 }
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 41 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ allowMissingInputs_

bool CaloTowersCreator::allowMissingInputs_
private

Definition at line 47 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ caloTowerConstituentsWatcher_

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

Definition at line 84 of file CaloTowersCreator.cc.

Referenced by produce().

◆ EBEScale

double CaloTowersCreator::EBEScale

Definition at line 35 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ ecalLabels_

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

Definition at line 45 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator().

◆ ecalSevLevelWatcher_

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

Definition at line 85 of file CaloTowersCreator.cc.

Referenced by produce().

◆ EEEScale

double CaloTowersCreator::EEEScale

Definition at line 35 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ eScales_

EScales CaloTowersCreator::eScales_
private

Definition at line 86 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HBEScale

double CaloTowersCreator::HBEScale

Definition at line 35 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ hcalChStatusWatcher_

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

Definition at line 83 of file CaloTowersCreator.cc.

Referenced by produce().

◆ hcalSevLevelWatcher_

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

Definition at line 82 of file CaloTowersCreator.cc.

Referenced by produce().

◆ HEDEScale

double CaloTowersCreator::HEDEScale

Definition at line 36 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HESEScale

double CaloTowersCreator::HESEScale

Definition at line 35 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HF1EScale

double CaloTowersCreator::HF1EScale

Definition at line 36 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HF2EScale

double CaloTowersCreator::HF2EScale

Definition at line 36 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ HOEScale

double CaloTowersCreator::HOEScale

Definition at line 36 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theEcalSeveritiesToBeExcluded_

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

Definition at line 61 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theEcalSeveritiesToBeUsedInBadTowers_

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

Definition at line 72 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ theHcalAcceptSeverityLevel_

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevel_
private

Definition at line 60 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theHcalAcceptSeverityLevelForRejectedHit_

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevelForRejectedHit_
private

Definition at line 70 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theRecoveredEcalHitsAreUsed_

bool CaloTowersCreator::theRecoveredEcalHitsAreUsed_
private

Definition at line 65 of file CaloTowersCreator.cc.

Referenced by produce().

◆ theRecoveredHcalHitsAreUsed_

bool CaloTowersCreator::theRecoveredHcalHitsAreUsed_
private

Definition at line 64 of file CaloTowersCreator.cc.

Referenced by produce().

◆ tok_ctmap_

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

Definition at line 52 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_cttopo_

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

Definition at line 51 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ecalChStatus_

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

Definition at line 53 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ecalSevAlgo_

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

Definition at line 56 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_geom_

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

Definition at line 49 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hbhe_

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

Definition at line 42 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hcalChStatus_

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

Definition at line 54 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hcalSevComputer_

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

Definition at line 55 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_hf_

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

Definition at line 44 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_ho_

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

Definition at line 43 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ tok_topo_

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

Definition at line 50 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ toks_ecal_

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

Definition at line 46 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ useRejectedHitsOnly_

bool CaloTowersCreator::useRejectedHitsOnly_
private

Definition at line 69 of file CaloTowersCreator.cc.

Referenced by CaloTowersCreator(), and produce().

◆ useRejectedRecoveredEcalHits_

bool CaloTowersCreator::useRejectedRecoveredEcalHits_
private

Definition at line 80 of file CaloTowersCreator.cc.

Referenced by produce().

◆ useRejectedRecoveredHcalHits_

bool CaloTowersCreator::useRejectedRecoveredHcalHits_
private

Definition at line 79 of file CaloTowersCreator.cc.

Referenced by produce().