CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
CaloTowersReCreator Class Reference

#include <CaloTowersReCreator.h>

Inheritance diagram for CaloTowersReCreator:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CaloTowersReCreator (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~CaloTowersReCreator () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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)
 
 ~ProducerBase () noexcept(false) override
 
- 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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Public Attributes

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

Private Attributes

CaloTowersCreationAlgo algo_
 
bool allowMissingInputs_
 
edm::EDGetTokenT< CaloTowerCollectiontok_calo_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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

Definition at line 19 of file CaloTowersReCreator.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file CaloTowersReCreator.cc.

References EBEScale, EEEScale, edm::ParameterSet::getParameter(), HBEScale, HEDEScale, HESEScale, HF1EScale, HF2EScale, HOEScale, and tok_calo_.

6  :
7  algo_(0.,0., false, false, false, false, 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,// thresholds cannot be reapplied
8  conf.getParameter<std::vector<double> >("EBGrid"),
9  conf.getParameter<std::vector<double> >("EBWeights"),
10  conf.getParameter<std::vector<double> >("EEGrid"),
11  conf.getParameter<std::vector<double> >("EEWeights"),
12  conf.getParameter<std::vector<double> >("HBGrid"),
13  conf.getParameter<std::vector<double> >("HBWeights"),
14  conf.getParameter<std::vector<double> >("HESGrid"),
15  conf.getParameter<std::vector<double> >("HESWeights"),
16  conf.getParameter<std::vector<double> >("HEDGrid"),
17  conf.getParameter<std::vector<double> >("HEDWeights"),
18  conf.getParameter<std::vector<double> >("HOGrid"),
19  conf.getParameter<std::vector<double> >("HOWeights"),
20  conf.getParameter<std::vector<double> >("HF1Grid"),
21  conf.getParameter<std::vector<double> >("HF1Weights"),
22  conf.getParameter<std::vector<double> >("HF2Grid"),
23  conf.getParameter<std::vector<double> >("HF2Weights"),
24  conf.getParameter<double>("EBWeight"),
25  conf.getParameter<double>("EEWeight"),
26  conf.getParameter<double>("HBWeight"),
27  conf.getParameter<double>("HESWeight"),
28  conf.getParameter<double>("HEDWeight"),
29  conf.getParameter<double>("HOWeight"),
30  conf.getParameter<double>("HF1Weight"),
31  conf.getParameter<double>("HF2Weight"),
32  0.,0.,0.,
33  conf.getParameter<bool>("UseHO"),
34  // (these have no effect on recreation: here for compatibility)
35  conf.getParameter<int>("MomConstrMethod"),
36  conf.getParameter<double>("MomHBDepth"),
37  conf.getParameter<double>("MomHEDepth"),
38  conf.getParameter<double>("MomEBDepth"),
39  conf.getParameter<double>("MomEEDepth"),
40  conf.getParameter<int>("HcalPhase")
41  ),
42  allowMissingInputs_(false)
43 {
44  tok_calo_ = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("caloLabel"));
45 
46  EBEScale=conf.getParameter<double>("EBEScale");
47  EEEScale=conf.getParameter<double>("EEEScale");
48  HBEScale=conf.getParameter<double>("HBEScale");
49  HESEScale=conf.getParameter<double>("HESEScale");
50  HEDEScale=conf.getParameter<double>("HEDEScale");
51  HOEScale=conf.getParameter<double>("HOEScale");
52  HF1EScale=conf.getParameter<double>("HF1EScale");
53  HF2EScale=conf.getParameter<double>("HF2EScale");
54  // two notes:
55  // 1) all this could go in a pset
56  // 2) not clear the instanceLabel thing
57 }
CaloTowersCreationAlgo algo_
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
CaloTowersReCreator::~CaloTowersReCreator ( )
inlineoverride

Member Function Documentation

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

Definition at line 107 of file CaloTowersReCreator.cc.

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

Referenced by ~CaloTowersReCreator().

107  {
109  desc.add<double>("EBWeight", 1.0);
110  desc.add<double>("HBEScale", 50.0);
111  desc.add<double>("HEDWeight", 1.0);
112  desc.add<double>("EEWeight", 1.0);
113  desc.add<double>("HF1Weight", 1.0);
114  desc.add<double>("HOWeight", 1.0);
115  desc.add<double>("HESWeight", 1.0);
116  desc.add<double>("HF2Weight", 1.0);
117  desc.add<double>("HESEScale", 50.0);
118  desc.add<double>("HEDEScale", 50.0);
119  desc.add<double>("EBEScale", 50.0);
120  desc.add<double>("HBWeight", 1.0);
121  desc.add<double>("EEEScale", 50.0);
122  desc.add<double>("MomHBDepth", 0.2);
123  desc.add<double>("MomHEDepth", 0.4);
124  desc.add<double>("MomEBDepth", 0.3);
125  desc.add<double>("MomEEDepth", 0.0);
126  desc.add<std::vector<double> >("HBGrid", {0.0, 2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 1000.0});
127  desc.add<std::vector<double> >("EEWeights", {0.51, 1.39, 1.71, 2.37, 2.32, 2.2, 2.1, 1.98, 1.8});
128  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
129  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
130  desc.add<std::vector<double> >("EEGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
131  desc.add<std::vector<double> >("HBWeights", {2.0, 1.86, 1.69, 1.55, 1.37, 1.19, 1.13, 1.11, 1.09, 1.0});
132  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
133  desc.add<std::vector<double> >("HEDWeights", {1.7, 1.57, 1.54, 1.49, 1.41, 1.26, 1.19, 1.15, 1.12, 1.0});
134  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
135  desc.add<std::vector<double> >("EBWeights", {0.86, 1.47, 1.66, 2.01, 1.98, 1.86, 1.83, 1.74, 1.65});
136  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
137  desc.add<std::vector<double> >("HESGrid", {0.0, 2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 1000.0});
138  desc.add<std::vector<double> >("HESWeights", {1.7, 1.57, 1.54, 1.49, 1.41, 1.26, 1.19, 1.15, 1.12, 1.0});
139  desc.add<std::vector<double> >("HEDGrid", {0.0, 2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 1000.0});
140  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
141  desc.add<std::vector<double> >("EBGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
142  desc.add<edm::InputTag>("caloLabel", edm::InputTag("calotowermaker"));
143  desc.add<int>("MomConstrMethod", 1);
144  desc.add<int>("HcalPhase", 0);
145 
146  descriptions.addDefault(desc);
147 }
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void CaloTowersReCreator::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 59 of file CaloTowersReCreator.cc.

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), EBEScale, EEEScale, edm::EventSetup::get(), edm::Event::getByToken(), HBEScale, HEDEScale, HESEScale, HF1EScale, HF2EScale, HOEScale, edm::HandleBase::isValid(), parseEventContent::prod, edm::ESHandle< T >::product(), CaloTowersCreationAlgo::rescaleTowers(), CaloTowersCreationAlgo::setEBEScale(), CaloTowersCreationAlgo::setEEEScale(), CaloTowersCreationAlgo::setGeometry(), CaloTowersCreationAlgo::setHBEScale(), CaloTowersCreationAlgo::setHEDEScale(), CaloTowersCreationAlgo::setHESEScale(), CaloTowersCreationAlgo::setHF1EScale(), CaloTowersCreationAlgo::setHF2EScale(), CaloTowersCreationAlgo::setHOEScale(), and tok_calo_.

Referenced by ~CaloTowersReCreator().

59  {
60  // get the necessary event setup objects...
65  c.get<CaloGeometryRecord>().get(pG);
66  c.get<HcalRecNumberingRecord>().get(htopo);
67  c.get<HcalRecNumberingRecord>().get(cttopo);
68  c.get<CaloGeometryRecord>().get(ctmap);
69 
78  algo_.setGeometry(cttopo.product(),ctmap.product(),htopo.product(),pG.product());
79 
80  algo_.begin(); // clear the internal buffer
81 
82  // Step A/C: Get Inputs and process (repeatedly)
84  e.getByToken(tok_calo_,calt);
85 
86 
87  // modified to rescale the CaloTowers directly
88  // without going through metatowers
89  // required for the algorithms that make use of individual
90  // crystal information
91 
92  if (!calt.isValid()) {
93  // can't find it!
94  if (!allowMissingInputs_) {
95  *calt; // will throw the proper exception
96  }
97  } else {
98  // Step B: Create empty output
99  auto prod = std::make_unique<CaloTowerCollection>();
100 
101  // step C: rescale (without going threough metataowers)
102  algo_.rescaleTowers(*calt, *prod);
103 
104  }
105 }
CaloTowersCreationAlgo algo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void setGeometry(const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
bool isValid() const
Definition: HandleBase.h:74
T get() const
Definition: EventSetup.h:63
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

CaloTowersCreationAlgo CaloTowersReCreator::algo_
private

Definition at line 28 of file CaloTowersReCreator.h.

Referenced by produce().

bool CaloTowersReCreator::allowMissingInputs_
private

Definition at line 30 of file CaloTowersReCreator.h.

Referenced by produce().

double CaloTowersReCreator::EBEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::EEEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HBEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HEDEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HESEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HF1EScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HF2EScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HOEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

edm::EDGetTokenT<CaloTowerCollection> CaloTowersReCreator::tok_calo_
private

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().