CMS 3D CMS Logo

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

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::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
 

Private Attributes

CaloTowersCreationAlgo algo_
 
bool allowMissingInputs_
 
edm::EDGetTokenT< CaloTowerCollectiontok_calo_
 
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecordtok_ctmap_
 
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecordtok_cttopo_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordtok_geom_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtok_topo_
 

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

Definition at line 19 of file CaloTowersReCreator.cc.

Constructor & Destructor Documentation

◆ CaloTowersReCreator()

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

Definition at line 41 of file CaloTowersReCreator.cc.

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

42  : algo_(0.,
43  0.,
44  false,
45  false,
46  false,
47  false,
48  0.,
49  0.,
50  0.,
51  0.,
52  0.,
53  0.,
54  0.,
55  0.,
56  0.,
57  0.,
58  0.,
59  0.,
60  0.,
61  0.,
62  0., // thresholds cannot be reapplied
63  conf.getParameter<std::vector<double> >("EBGrid"),
64  conf.getParameter<std::vector<double> >("EBWeights"),
65  conf.getParameter<std::vector<double> >("EEGrid"),
66  conf.getParameter<std::vector<double> >("EEWeights"),
67  conf.getParameter<std::vector<double> >("HBGrid"),
68  conf.getParameter<std::vector<double> >("HBWeights"),
69  conf.getParameter<std::vector<double> >("HESGrid"),
70  conf.getParameter<std::vector<double> >("HESWeights"),
71  conf.getParameter<std::vector<double> >("HEDGrid"),
72  conf.getParameter<std::vector<double> >("HEDWeights"),
73  conf.getParameter<std::vector<double> >("HOGrid"),
74  conf.getParameter<std::vector<double> >("HOWeights"),
75  conf.getParameter<std::vector<double> >("HF1Grid"),
76  conf.getParameter<std::vector<double> >("HF1Weights"),
77  conf.getParameter<std::vector<double> >("HF2Grid"),
78  conf.getParameter<std::vector<double> >("HF2Weights"),
79  conf.getParameter<double>("EBWeight"),
80  conf.getParameter<double>("EEWeight"),
81  conf.getParameter<double>("HBWeight"),
82  conf.getParameter<double>("HESWeight"),
83  conf.getParameter<double>("HEDWeight"),
84  conf.getParameter<double>("HOWeight"),
85  conf.getParameter<double>("HF1Weight"),
86  conf.getParameter<double>("HF2Weight"),
87  0.,
88  0.,
89  0.,
90  conf.getParameter<bool>("UseHO"),
91  // (these have no effect on recreation: here for compatibility)
92  conf.getParameter<int>("MomConstrMethod"),
93  conf.getParameter<double>("MomHBDepth"),
94  conf.getParameter<double>("MomHEDepth"),
95  conf.getParameter<double>("MomEBDepth"),
96  conf.getParameter<double>("MomEEDepth"),
97  conf.getParameter<int>("HcalPhase")),
98  allowMissingInputs_(false) {
99  tok_calo_ = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("caloLabel"));
100  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
101  tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
102  tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
103  tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
104 
105  EBEScale = conf.getParameter<double>("EBEScale");
106  EEEScale = conf.getParameter<double>("EEEScale");
107  HBEScale = conf.getParameter<double>("HBEScale");
108  HESEScale = conf.getParameter<double>("HESEScale");
109  HEDEScale = conf.getParameter<double>("HEDEScale");
110  HOEScale = conf.getParameter<double>("HOEScale");
111  HF1EScale = conf.getParameter<double>("HF1EScale");
112  HF2EScale = conf.getParameter<double>("HF2EScale");
113  // two notes:
114  // 1) all this could go in a pset
115  // 2) not clear the instanceLabel thing
116 
117  produces<CaloTowerCollection>();
118 }
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > tok_ctmap_
CaloTowersCreationAlgo algo_
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_

◆ ~CaloTowersReCreator()

CaloTowersReCreator::~CaloTowersReCreator ( )
inlineoverride

Definition at line 22 of file CaloTowersReCreator.cc.

22 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 165 of file CaloTowersReCreator.cc.

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

165  {
167  desc.add<double>("EBWeight", 1.0);
168  desc.add<double>("HBEScale", 50.0);
169  desc.add<double>("HEDWeight", 1.0);
170  desc.add<double>("EEWeight", 1.0);
171  desc.add<double>("HF1Weight", 1.0);
172  desc.add<double>("HOWeight", 1.0);
173  desc.add<double>("HESWeight", 1.0);
174  desc.add<double>("HF2Weight", 1.0);
175  desc.add<double>("HESEScale", 50.0);
176  desc.add<double>("HEDEScale", 50.0);
177  desc.add<double>("EBEScale", 50.0);
178  desc.add<double>("HBWeight", 1.0);
179  desc.add<double>("EEEScale", 50.0);
180  desc.add<double>("MomHBDepth", 0.2);
181  desc.add<double>("MomHEDepth", 0.4);
182  desc.add<double>("MomEBDepth", 0.3);
183  desc.add<double>("MomEEDepth", 0.0);
184  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});
185  desc.add<std::vector<double> >("EEWeights", {0.51, 1.39, 1.71, 2.37, 2.32, 2.2, 2.1, 1.98, 1.8});
186  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
187  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
188  desc.add<std::vector<double> >("EEGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
189  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});
190  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
191  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});
192  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
193  desc.add<std::vector<double> >("EBWeights", {0.86, 1.47, 1.66, 2.01, 1.98, 1.86, 1.83, 1.74, 1.65});
194  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
195  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});
196  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});
197  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});
198  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
199  desc.add<std::vector<double> >("EBGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
200  desc.add<edm::InputTag>("caloLabel", edm::InputTag("calotowermaker"));
201  desc.add<int>("MomConstrMethod", 1);
202  desc.add<int>("HcalPhase", 0);
203 
204  descriptions.addDefault(desc);
205 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 120 of file CaloTowersReCreator.cc.

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), HltBtagPostValidation_cff::c, MillePedeFileConverter_cfg::e, EBEScale, EEEScale, HBEScale, HEDEScale, HESEScale, HF1EScale, HF2EScale, HOEScale, edm::HandleBase::isValid(), eostools::move(), dumpMFGeometry_cfg::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(), tok_calo_, tok_ctmap_, tok_cttopo_, tok_geom_, and tok_topo_.

120  {
121  // get the necessary event setup objects...
122  edm::ESHandle<CaloGeometry> pG = c.getHandle(tok_geom_);
123  edm::ESHandle<HcalTopology> htopo = c.getHandle(tok_topo_);
124  edm::ESHandle<CaloTowerTopology> cttopo = c.getHandle(tok_cttopo_);
126 
135  algo_.setGeometry(cttopo.product(), ctmap.product(), htopo.product(), pG.product());
136 
137  algo_.begin(); // clear the internal buffer
138 
139  // Step A/C: Get Inputs and process (repeatedly)
141  e.getByToken(tok_calo_, calt);
142 
143  // modified to rescale the CaloTowers directly
144  // without going through metatowers
145  // required for the algorithms that make use of individual
146  // crystal information
147 
148  if (!calt.isValid()) {
149  // can't find it!
150  if (!allowMissingInputs_) {
151  *calt; // will throw the proper exception
152  }
153  } else {
154  // Step B: Create empty output
155  auto prod = std::make_unique<CaloTowerCollection>();
156 
157  // step C: rescale (without going threough metataowers)
158  algo_.rescaleTowers(*calt, *prod);
159 
160  // Step D: Put into the event
161  e.put(std::move(prod));
162  }
163 }
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > tok_ctmap_
CaloTowersCreationAlgo algo_
void setGeometry(const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
T const * product() const
Definition: ESHandle.h:86
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
bool isValid() const
Definition: HandleBase.h:70
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

CaloTowersCreationAlgo CaloTowersReCreator::algo_
private

Definition at line 29 of file CaloTowersReCreator.cc.

Referenced by produce().

◆ allowMissingInputs_

bool CaloTowersReCreator::allowMissingInputs_
private

Definition at line 35 of file CaloTowersReCreator.cc.

Referenced by produce().

◆ EBEScale

double CaloTowersReCreator::EBEScale

Definition at line 25 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ EEEScale

double CaloTowersReCreator::EEEScale

Definition at line 25 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ HBEScale

double CaloTowersReCreator::HBEScale

Definition at line 25 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ HEDEScale

double CaloTowersReCreator::HEDEScale

Definition at line 26 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ HESEScale

double CaloTowersReCreator::HESEScale

Definition at line 25 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ HF1EScale

double CaloTowersReCreator::HF1EScale

Definition at line 26 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ HF2EScale

double CaloTowersReCreator::HF2EScale

Definition at line 26 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ HOEScale

double CaloTowersReCreator::HOEScale

Definition at line 26 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_calo_

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

Definition at line 30 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_ctmap_

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

Definition at line 34 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_cttopo_

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

Definition at line 33 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_geom_

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

Definition at line 31 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_topo_

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

Definition at line 32 of file CaloTowersReCreator.cc.

Referenced by CaloTowersReCreator(), and produce().