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

#include <CaloTowersCreator.h>

Inheritance diagram for CaloTowersCreator:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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::EDGetTokenT< HBHERecHitCollectiontok_hbhe_
 
edm::EDGetTokenT< HFRecHitCollectiontok_hf_
 
edm::EDGetTokenT< HORecHitCollectiontok_ho_
 
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
 
bool useRejectedHitsOnly_
 
bool useRejectedRecoveredEcalHits_
 
bool useRejectedRecoveredHcalHits_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Original author: J. Mans - Minnesota

Definition at line 25 of file CaloTowersCreator.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file CaloTowersCreator.cc.

References 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, theEcalSeveritiesToBeExcluded_, theEcalSeveritiesToBeUsedInBadTowers_, tok_hbhe_, tok_hf_, tok_ho_, and toks_ecal_.

12  :
13  algo_(conf.getParameter<double>("EBThreshold"),
14  conf.getParameter<double>("EEThreshold"),
15 
16  conf.getParameter<bool>("UseEtEBTreshold"),
17  conf.getParameter<bool>("UseEtEETreshold"),
18  conf.getParameter<bool>("UseSymEBTreshold"),
19  conf.getParameter<bool>("UseSymEETreshold"),
20 
21 
22  conf.getParameter<double>("HcalThreshold"),
23  conf.getParameter<double>("HBThreshold"),
24  conf.getParameter<double>("HESThreshold"),
25  conf.getParameter<double>("HESThreshold1"),
26  conf.getParameter<double>("HEDThreshold"),
27  conf.getParameter<double>("HEDThreshold1"),
28  conf.getParameter<double>("HOThreshold0"),
29  conf.getParameter<double>("HOThresholdPlus1"),
30  conf.getParameter<double>("HOThresholdMinus1"),
31  conf.getParameter<double>("HOThresholdPlus2"),
32  conf.getParameter<double>("HOThresholdMinus2"),
33  conf.getParameter<double>("HF1Threshold"),
34  conf.getParameter<double>("HF2Threshold"),
35  conf.getParameter<std::vector<double> >("EBGrid"),
36  conf.getParameter<std::vector<double> >("EBWeights"),
37  conf.getParameter<std::vector<double> >("EEGrid"),
38  conf.getParameter<std::vector<double> >("EEWeights"),
39  conf.getParameter<std::vector<double> >("HBGrid"),
40  conf.getParameter<std::vector<double> >("HBWeights"),
41  conf.getParameter<std::vector<double> >("HESGrid"),
42  conf.getParameter<std::vector<double> >("HESWeights"),
43  conf.getParameter<std::vector<double> >("HEDGrid"),
44  conf.getParameter<std::vector<double> >("HEDWeights"),
45  conf.getParameter<std::vector<double> >("HOGrid"),
46  conf.getParameter<std::vector<double> >("HOWeights"),
47  conf.getParameter<std::vector<double> >("HF1Grid"),
48  conf.getParameter<std::vector<double> >("HF1Weights"),
49  conf.getParameter<std::vector<double> >("HF2Grid"),
50  conf.getParameter<std::vector<double> >("HF2Weights"),
51  conf.getParameter<double>("EBWeight"),
52  conf.getParameter<double>("EEWeight"),
53  conf.getParameter<double>("HBWeight"),
54  conf.getParameter<double>("HESWeight"),
55  conf.getParameter<double>("HEDWeight"),
56  conf.getParameter<double>("HOWeight"),
57  conf.getParameter<double>("HF1Weight"),
58  conf.getParameter<double>("HF2Weight"),
59  conf.getParameter<double>("EcutTower"),
60  conf.getParameter<double>("EBSumThreshold"),
61  conf.getParameter<double>("EESumThreshold"),
62  conf.getParameter<bool>("UseHO"),
63  // (for momentum reconstruction algorithm)
64  conf.getParameter<int>("MomConstrMethod"),
65  conf.getParameter<double>("MomHBDepth"),
66  conf.getParameter<double>("MomHEDepth"),
67  conf.getParameter<double>("MomEBDepth"),
68  conf.getParameter<double>("MomEEDepth"),
69  conf.getParameter<int>("HcalPhase")
70  ),
71 
72  ecalLabels_(conf.getParameter<std::vector<edm::InputTag> >("ecalInputs")),
73  allowMissingInputs_(conf.getParameter<bool>("AllowMissingInputs")),
74 
75  theHcalAcceptSeverityLevel_(conf.getParameter<unsigned int>("HcalAcceptSeverityLevel")),
76 
77  theRecoveredHcalHitsAreUsed_(conf.getParameter<bool>("UseHcalRecoveredHits")),
78  theRecoveredEcalHitsAreUsed_(conf.getParameter<bool>("UseEcalRecoveredHits")),
79 
80  // paramaters controlling the use of rejected hits
81 
82  useRejectedHitsOnly_(conf.getParameter<bool>("UseRejectedHitsOnly")),
83 
84  theHcalAcceptSeverityLevelForRejectedHit_(conf.getParameter<unsigned int>("HcalAcceptSeverityLevelForRejectedHit")),
85 
86 
87  useRejectedRecoveredHcalHits_(conf.getParameter<bool>("UseRejectedRecoveredHcalHits")),
88  useRejectedRecoveredEcalHits_(conf.getParameter<bool>("UseRejectedRecoveredEcalHits"))
89 
90 
91 
92 {
93 
94  // register for data access
95  tok_hbhe_ = consumes<HBHERecHitCollection>(conf.getParameter<edm::InputTag>("hbheInput"));
96  tok_ho_ = consumes<HORecHitCollection>(conf.getParameter<edm::InputTag>("hoInput"));
97  tok_hf_ = consumes<HFRecHitCollection>(conf.getParameter<edm::InputTag>("hfInput"));
98 
99  const unsigned nLabels = ecalLabels_.size();
100  for ( unsigned i=0; i != nLabels; i++ )
101  toks_ecal_.push_back(consumes<EcalRecHitCollection>(ecalLabels_[i]));
102 
103 
112 
113  // get the Ecal severities to be excluded
114  const std::vector<std::string> severitynames =
115  conf.getParameter<std::vector<std::string> >("EcalRecHitSeveritiesToBeExcluded");
116 
117  theEcalSeveritiesToBeExcluded_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynames);
118 
119  // get the Ecal severities to be used for bad towers
121  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(conf.getParameter<std::vector<std::string> >("EcalSeveritiesToBeUsedInBadTowers") );
122 
123  if (eScales_.instanceLabel=="") produces<CaloTowerCollection>();
124  else produces<CaloTowerCollection>(eScales_.instanceLabel);
125 
126  /*
127  std::cout << "VI Producer "
128  << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
129  << (allowMissingInputs_ ? "allowMissing " : " " )
130  << nLabels << ' ' << severitynames.size()
131  << std::endl;
132  */
133 }
double HF2Scale
Definition: EScales.h:20
CaloTowersCreationAlgo algo_
double EEScale
Definition: EScales.h:14
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
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
double EBScale
Definition: EScales.h:13
double HBScale
Definition: EScales.h:15
std::string instanceLabel
Definition: EScales.h:21
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
unsigned int theHcalAcceptSeverityLevel_
std::vector< edm::InputTag > ecalLabels_
double HESScale
Definition: EScales.h:16
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers_
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
CaloTowersCreator::~CaloTowersCreator ( )
inlineoverride

Member Function Documentation

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

Definition at line 298 of file CaloTowersCreator.cc.

References edm::ParameterSetDescription::add(), and edm::ConfigurationDescriptions::addDefault().

Referenced by ~CaloTowersCreator().

298  {
300  desc.add<double>("EBSumThreshold", 0.2);
301  desc.add<double>("HF2Weight", 1.0);
302  desc.add<double>("EBWeight", 1.0);
303  desc.add<double>("EESumThreshold", 0.45);
304  desc.add<double>("HOThreshold0", 1.1);
305  desc.add<double>("HOThresholdPlus1", 3.5);
306  desc.add<double>("HOThresholdMinus1", 3.5);
307  desc.add<double>("HOThresholdPlus2", 3.5);
308  desc.add<double>("HOThresholdMinus2", 3.5);
309  desc.add<double>("HBThreshold", 0.7);
310  desc.add<double>("HF1Threshold", 0.5);
311  desc.add<double>("HEDWeight", 1.0);
312  desc.add<double>("EEWeight", 1.0);
313  desc.add<double>("HESWeight", 1.0);
314  desc.add<double>("HF1Weight", 1.0);
315  desc.add<double>("HOWeight", 1.0);
316  desc.add<double>("EBThreshold", 0.07);
317  desc.add<double>("EEThreshold", 0.3);
318  desc.add<double>("HcalThreshold", -1000.0);
319  desc.add<double>("HF2Threshold", 0.85);
320  desc.add<double>("HESThreshold", 0.8);
321  desc.add<double>("HESThreshold1", 0.8);
322  desc.add<double>("HEDThreshold", 0.8);
323  desc.add<double>("HEDThreshold1", 0.8);
324  desc.add<double>("EcutTower", -1000.0);
325  desc.add<double>("HBWeight", 1.0);
326  desc.add<double>("MomHBDepth", 0.2);
327  desc.add<double>("MomHEDepth", 0.4);
328  desc.add<double>("MomEBDepth", 0.3);
329  desc.add<double>("MomEEDepth", 0.0);
330  desc.add<bool>("UseHO", true);
331  desc.add<bool>("UseEtEBTreshold", false);
332  desc.add<bool>("UseSymEBTreshold", true);
333  desc.add<bool>("UseEtEETreshold", false);
334  desc.add<bool>("UseSymEETreshold", true);
335  desc.add<bool>("UseHcalRecoveredHits", true);
336  desc.add<bool>("UseEcalRecoveredHits", false);
337  desc.add<bool>("UseRejectedHitsOnly", false);
338  desc.add<bool>("UseRejectedRecoveredHcalHits", true);
339  desc.add<bool>("UseRejectedRecoveredEcalHits", false);
340  desc.add<bool>("AllowMissingInputs", false);
341  desc.add<std::vector<double> >("HBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
342  desc.add<std::vector<double> >("EEWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
343  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
344  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
345  desc.add<std::vector<double> >("EEGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
346  desc.add<std::vector<double> >("HBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
347  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
348  desc.add<std::vector<double> >("HEDWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
349  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
350  desc.add<std::vector<double> >("EBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
351  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
352  desc.add<std::vector<double> >("HESGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
353  desc.add<std::vector<double> >("HESWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
354  desc.add<std::vector<double> >("HEDGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
355  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
356  desc.add<std::vector<double> >("EBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
357  desc.add<edm::InputTag>("hfInput", edm::InputTag("hfreco"));
358  desc.add<edm::InputTag>("hbheInput", edm::InputTag("hbhereco"));
359  desc.add<edm::InputTag>("hoInput", edm::InputTag("horeco"));
360  desc.add<std::vector<edm::InputTag> >("ecalInputs", {edm::InputTag("ecalRecHit","EcalRecHitsEB"), edm::InputTag("ecalRecHit","EcalRecHitsEE")});
361  desc.add<int>("MomConstrMethod", 1);
362  desc.add<unsigned int>("HcalAcceptSeverityLevel", 9);
363  desc.add<std::vector<std::string> >("EcalRecHitSeveritiesToBeExcluded", {"kTime","kWeird","kBad"});
364  desc.add<unsigned int>("HcalAcceptSeverityLevelForRejectedHit", 9999);
365  desc.add<std::vector<std::string> >("EcalSeveritiesToBeUsedInBadTowers", {});
366  desc.add<int>("HcalPhase", 0);
367 
368  descriptions.addDefault(desc);
369 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static const std::vector<double>& CaloTowersCreator::getGridValues ( )
staticprivate
void CaloTowersCreator::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 135 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), edm::SortedCollection< T, SORT >::begin(), caloTowerConstituentsWatcher_, edm::ESWatcher< T >::check(), EBEScale, RecoEcal_EventContent_cff::ec, EcalBarrel, EcalEndcap, ecalSevLevelWatcher_, EEEScale, edm::SortedCollection< T, SORT >::empty(), eScales_, CaloTowersCreationAlgo::finish(), edm::EventSetup::get(), edm::Event::getByToken(), 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(), parseEventContent::prod, edm::ESHandle< T >::product(), edm::Event::put(), 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_hbhe_, tok_hf_, tok_ho_, toks_ecal_, useRejectedHitsOnly_, useRejectedRecoveredEcalHits_, and useRejectedRecoveredHcalHits_.

Referenced by ~CaloTowersCreator().

135  {
136  // get the necessary event setup objects...
141  c.get<CaloGeometryRecord>().get(pG);
142  c.get<HcalRecNumberingRecord>().get(htopo);
143  c.get<HcalRecNumberingRecord>().get(cttopo);
144  c.get<CaloGeometryRecord>().get(ctmap);
145 
146  // ECAL channel status map ****************************************
148  c.get<EcalChannelStatusRcd>().get( ecalChStatus );
149  const EcalChannelStatus* dbEcalChStatus = ecalChStatus.product();
150 
151  // HCAL channel status map ****************************************
152  edm::ESHandle<HcalChannelQuality> hcalChStatus;
153  c.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
154 
155  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
156 
157  // Assignment of severity levels **********************************
158  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
159  c.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
160  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
161 
162  edm::ESHandle<EcalSeverityLevelAlgo> ecalSevLvlAlgoHndl;
163  c.get<EcalSeverityLevelAlgoRcd>().get(ecalSevLvlAlgoHndl);
164  const EcalSeverityLevelAlgo* ecalSevLvlAlgo = ecalSevLvlAlgoHndl.product();
165 
166 
175  algo_.setGeometry(cttopo.product(),ctmap.product(),htopo.product(),pG.product());
176 
177  // for treatment of problematic and anomalous cells
178 
179  algo_.setHcalChStatusFromDB(dbHcalChStatus);
180  algo_.setEcalChStatusFromDB(dbEcalChStatus);
181 
184 
187 
188  algo_.setHcalSevLvlComputer(hcalSevLvlComputer);
189  algo_.setEcalSevLvlAlgo(ecalSevLvlAlgo);
190 
191 
193 
196 
199 
200  /*
201  std::cout << "VI Produce: "
202  << (useRejectedHitsOnly_ ? "use rejectOnly " : " ")
203  << (allowMissingInputs_ ? "allowMissing " : " " )
204  << (theRecoveredEcalHitsAreUsed_ ? "use RecoveredEcal ": " " )
205  << toks_ecal_.size()
206  << ' ' << theEcalSeveritiesToBeExcluded_.size()
207  << ' ' << theEcalSeveritiesToBeUsedInBadTowers_.size()
208  << std::endl;
209  */
210 
211  algo_.begin(); // clear the internal buffer
212 
213  // can't chain these in a big OR statement, or else it'll
214  // get triggered for each of the first three events
215  bool check1 = hcalSevLevelWatcher_.check(c);
216  bool check2 = hcalChStatusWatcher_.check(c);
217  bool check3 = caloTowerConstituentsWatcher_.check(c);
218  if(check1 || check2 || check3)
219  {
221  }
222 
223  // check ecal SevLev
225 
226  // ----------------------------------------------------------
227  // For ecal error handling need to
228  // have access to the EB and EE collections at the end of
229  // tower reconstruction.
230 
233 
234  for (std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i=toks_ecal_.begin();
235  i!=toks_ecal_.end(); i++) {
236 
238 
239  if (! e.getByToken(*i,ec_tmp) ) continue;
240  if (ec_tmp->empty()) continue;
241 
242  // check if this is EB or EE
243  if ( (ec_tmp->begin()->detid()).subdetId() == EcalBarrel ) {
244  ebHandle = ec_tmp;
245  }
246  else if ((ec_tmp->begin()->detid()).subdetId() == EcalEndcap) {
247  eeHandle = ec_tmp;
248  }
249  }
250 
251  algo_.setEbHandle(ebHandle);
252  algo_.setEeHandle(eeHandle);
253 
254  //-----------------------------------------------------------
255 
256  bool present;
257 
258  // Step A/C: Get Inputs and process (repeatedly)
260  present=e.getByToken(tok_hbhe_,hbhe);
261  if (present || !allowMissingInputs_) algo_.process(*hbhe);
262 
264  present=e.getByToken(tok_ho_,ho);
265  if (present || !allowMissingInputs_) algo_.process(*ho);
266 
268  present=e.getByToken(tok_hf_,hf);
269  if (present || !allowMissingInputs_) algo_.process(*hf);
270 
271  std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i;
272  for (i=toks_ecal_.begin(); i!=toks_ecal_.end(); i++) {
274  present=e.getByToken(*i,ec);
275  if (present || !allowMissingInputs_) algo_.process(*ec);
276  }
277 
278  // Step B: Create empty output
279  auto prod = std::make_unique<CaloTowerCollection>();
280 
281  // Step C: Process
282  algo_.finish(*prod);
283 
284  /*
285  int totc=0; float totE=0;
286  reco::LeafCandidate::LorentzVector totP4;
287  for (auto const & tw : (*prod) ) { totc += tw.constituents().size(); totE+=tw.energy(); totP4+=tw.p4();}
288  std::cout << "VI " << (*prod).size() << " " << totc << " " << totE << " " << totP4 << std::endl;
289  */
290 
291  // Step D: Put into the event
292  if (eScales_.instanceLabel=="") e.put(std::move(prod));
294 
295 
296 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
void setEcalChStatusFromDB(const EcalChannelStatus *s)
CaloTowersCreationAlgo algo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
void setHcalChStatusFromDB(const HcalChannelQuality *s)
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)
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)
void setRecoveredEcalHitsAreUsed(bool flag)
edm::ESWatcher< HcalChannelQualityRcd > hcalChStatusWatcher_
void process(const HBHERecHitCollection &hbhe)
std::string instanceLabel
Definition: EScales.h:21
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
void setRecoveredHcalHitsAreUsed(bool flag)
const T & get() const
Definition: EventSetup.h:58
void setUseRejectedHitsOnly(bool flag)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
unsigned int theHcalAcceptSeverityLevel_
void setHcalAcceptSeverityLevel(unsigned int level)
edm::ESWatcher< HcalSeverityLevelComputerRcd > hcalSevLevelWatcher_
void setEcalSevLvlAlgo(const EcalSeverityLevelAlgo *a)
void setUseRejectedRecoveredHcalHits(bool flag)
edm::ESWatcher< IdealGeometryRecord > caloTowerConstituentsWatcher_
T const * product() const
Definition: ESHandle.h:86
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers_
def move(src, dest)
Definition: eostools.py:510
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
const_iterator begin() const
edm::ESWatcher< EcalSeverityLevelAlgoRcd > ecalSevLevelWatcher_

Member Data Documentation

CaloTowersCreationAlgo CaloTowersCreator::algo_
private

Definition at line 38 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::allowMissingInputs_
private

Definition at line 44 of file CaloTowersCreator.h.

Referenced by produce().

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

Definition at line 76 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::EBEScale

Definition at line 31 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 42 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator().

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

Definition at line 77 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::EEEScale

Definition at line 31 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

EScales CaloTowersCreator::eScales_
private

Definition at line 78 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HBEScale

Definition at line 31 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 75 of file CaloTowersCreator.h.

Referenced by produce().

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

Definition at line 74 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::HEDEScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HESEScale

Definition at line 31 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HF1EScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HF2EScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HOEScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 50 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 62 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevel_
private

Definition at line 49 of file CaloTowersCreator.h.

Referenced by produce().

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevelForRejectedHit_
private

Definition at line 60 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::theRecoveredEcalHitsAreUsed_
private

Definition at line 54 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::theRecoveredHcalHitsAreUsed_
private

Definition at line 53 of file CaloTowersCreator.h.

Referenced by produce().

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

Definition at line 39 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 41 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 40 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

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

Definition at line 43 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

bool CaloTowersCreator::useRejectedHitsOnly_
private

Definition at line 59 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::useRejectedRecoveredEcalHits_
private

Definition at line 72 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::useRejectedRecoveredHcalHits_
private

Definition at line 71 of file CaloTowersCreator.h.

Referenced by produce().