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::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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

Detailed Description

Definition at line 22 of file CaloTowersReCreator.h.

Constructor & Destructor Documentation

◆ CaloTowersReCreator()

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

Definition at line 4 of file CaloTowersReCreator.cc.

5  : algo_(0.,
6  0.,
7  false,
8  false,
9  false,
10  false,
11  0.,
12  0.,
13  0.,
14  0.,
15  0.,
16  0.,
17  0.,
18  0.,
19  0.,
20  0.,
21  0.,
22  0.,
23  0.,
24  0.,
25  0., // thresholds cannot be reapplied
26  conf.getParameter<std::vector<double> >("EBGrid"),
27  conf.getParameter<std::vector<double> >("EBWeights"),
28  conf.getParameter<std::vector<double> >("EEGrid"),
29  conf.getParameter<std::vector<double> >("EEWeights"),
30  conf.getParameter<std::vector<double> >("HBGrid"),
31  conf.getParameter<std::vector<double> >("HBWeights"),
32  conf.getParameter<std::vector<double> >("HESGrid"),
33  conf.getParameter<std::vector<double> >("HESWeights"),
34  conf.getParameter<std::vector<double> >("HEDGrid"),
35  conf.getParameter<std::vector<double> >("HEDWeights"),
36  conf.getParameter<std::vector<double> >("HOGrid"),
37  conf.getParameter<std::vector<double> >("HOWeights"),
38  conf.getParameter<std::vector<double> >("HF1Grid"),
39  conf.getParameter<std::vector<double> >("HF1Weights"),
40  conf.getParameter<std::vector<double> >("HF2Grid"),
41  conf.getParameter<std::vector<double> >("HF2Weights"),
42  conf.getParameter<double>("EBWeight"),
43  conf.getParameter<double>("EEWeight"),
44  conf.getParameter<double>("HBWeight"),
45  conf.getParameter<double>("HESWeight"),
46  conf.getParameter<double>("HEDWeight"),
47  conf.getParameter<double>("HOWeight"),
48  conf.getParameter<double>("HF1Weight"),
49  conf.getParameter<double>("HF2Weight"),
50  0.,
51  0.,
52  0.,
53  conf.getParameter<bool>("UseHO"),
54  // (these have no effect on recreation: here for compatibility)
55  conf.getParameter<int>("MomConstrMethod"),
56  conf.getParameter<double>("MomHBDepth"),
57  conf.getParameter<double>("MomHEDepth"),
58  conf.getParameter<double>("MomEBDepth"),
59  conf.getParameter<double>("MomEEDepth"),
60  conf.getParameter<int>("HcalPhase")),
61  allowMissingInputs_(false) {
62  tok_calo_ = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("caloLabel"));
63  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
64  tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
65  tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
66  tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
67 
68  EBEScale = conf.getParameter<double>("EBEScale");
69  EEEScale = conf.getParameter<double>("EEEScale");
70  HBEScale = conf.getParameter<double>("HBEScale");
71  HESEScale = conf.getParameter<double>("HESEScale");
72  HEDEScale = conf.getParameter<double>("HEDEScale");
73  HOEScale = conf.getParameter<double>("HOEScale");
74  HF1EScale = conf.getParameter<double>("HF1EScale");
75  HF2EScale = conf.getParameter<double>("HF2EScale");
76  // two notes:
77  // 1) all this could go in a pset
78  // 2) not clear the instanceLabel thing
79 
80  produces<CaloTowerCollection>();
81 }

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

◆ ~CaloTowersReCreator()

CaloTowersReCreator::~CaloTowersReCreator ( )
inlineoverride

Definition at line 25 of file CaloTowersReCreator.h.

25 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 128 of file CaloTowersReCreator.cc.

128  {
130  desc.add<double>("EBWeight", 1.0);
131  desc.add<double>("HBEScale", 50.0);
132  desc.add<double>("HEDWeight", 1.0);
133  desc.add<double>("EEWeight", 1.0);
134  desc.add<double>("HF1Weight", 1.0);
135  desc.add<double>("HOWeight", 1.0);
136  desc.add<double>("HESWeight", 1.0);
137  desc.add<double>("HF2Weight", 1.0);
138  desc.add<double>("HESEScale", 50.0);
139  desc.add<double>("HEDEScale", 50.0);
140  desc.add<double>("EBEScale", 50.0);
141  desc.add<double>("HBWeight", 1.0);
142  desc.add<double>("EEEScale", 50.0);
143  desc.add<double>("MomHBDepth", 0.2);
144  desc.add<double>("MomHEDepth", 0.4);
145  desc.add<double>("MomEBDepth", 0.3);
146  desc.add<double>("MomEEDepth", 0.0);
147  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});
148  desc.add<std::vector<double> >("EEWeights", {0.51, 1.39, 1.71, 2.37, 2.32, 2.2, 2.1, 1.98, 1.8});
149  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
150  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
151  desc.add<std::vector<double> >("EEGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
152  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});
153  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
154  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});
155  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
156  desc.add<std::vector<double> >("EBWeights", {0.86, 1.47, 1.66, 2.01, 1.98, 1.86, 1.83, 1.74, 1.65});
157  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
158  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});
159  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});
160  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});
161  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
162  desc.add<std::vector<double> >("EBGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
163  desc.add<edm::InputTag>("caloLabel", edm::InputTag("calotowermaker"));
164  desc.add<int>("MomConstrMethod", 1);
165  desc.add<int>("HcalPhase", 0);
166 
167  descriptions.addDefault(desc);
168 }

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

◆ produce()

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

Definition at line 83 of file CaloTowersReCreator.cc.

83  {
84  // get the necessary event setup objects...
85  edm::ESHandle<CaloGeometry> pG = c.getHandle(tok_geom_);
86  edm::ESHandle<HcalTopology> htopo = c.getHandle(tok_topo_);
89 
98  algo_.setGeometry(cttopo.product(), ctmap.product(), htopo.product(), pG.product());
99 
100  algo_.begin(); // clear the internal buffer
101 
102  // Step A/C: Get Inputs and process (repeatedly)
104  e.getByToken(tok_calo_, calt);
105 
106  // modified to rescale the CaloTowers directly
107  // without going through metatowers
108  // required for the algorithms that make use of individual
109  // crystal information
110 
111  if (!calt.isValid()) {
112  // can't find it!
113  if (!allowMissingInputs_) {
114  *calt; // will throw the proper exception
115  }
116  } else {
117  // Step B: Create empty output
118  auto prod = std::make_unique<CaloTowerCollection>();
119 
120  // step C: rescale (without going threough metataowers)
121  algo_.rescaleTowers(*calt, *prod);
122 
123  // Step D: Put into the event
124  e.put(std::move(prod));
125  }
126 }

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), 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_.

Member Data Documentation

◆ algo_

CaloTowersCreationAlgo CaloTowersReCreator::algo_
private

Definition at line 32 of file CaloTowersReCreator.h.

Referenced by produce().

◆ allowMissingInputs_

bool CaloTowersReCreator::allowMissingInputs_
private

Definition at line 38 of file CaloTowersReCreator.h.

Referenced by produce().

◆ EBEScale

double CaloTowersReCreator::EBEScale

Definition at line 28 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ EEEScale

double CaloTowersReCreator::EEEScale

Definition at line 28 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HBEScale

double CaloTowersReCreator::HBEScale

Definition at line 28 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HEDEScale

double CaloTowersReCreator::HEDEScale

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HESEScale

double CaloTowersReCreator::HESEScale

Definition at line 28 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HF1EScale

double CaloTowersReCreator::HF1EScale

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HF2EScale

double CaloTowersReCreator::HF2EScale

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HOEScale

double CaloTowersReCreator::HOEScale

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_calo_

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

Definition at line 33 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_ctmap_

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

Definition at line 37 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_cttopo_

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

Definition at line 36 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_geom_

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

Definition at line 34 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_topo_

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

Definition at line 35 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
CaloTowersCreationAlgo::setHF1EScale
void setHF1EScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1383
CaloTowersReCreator::EBEScale
double EBEScale
Definition: CaloTowersReCreator.h:28
CaloTowersReCreator::HBEScale
double HBEScale
Definition: CaloTowersReCreator.h:28
CaloTowersCreationAlgo::setGeometry
void setGeometry(const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
Definition: CaloTowersCreationAlgo.cc:354
CaloTowersReCreator::allowMissingInputs_
bool allowMissingInputs_
Definition: CaloTowersReCreator.h:38
CaloTowersCreationAlgo::setHOEScale
void setHOEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1376
CaloTowersReCreator::EEEScale
double EEEScale
Definition: CaloTowersReCreator.h:28
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CaloTowersReCreator::HESEScale
double HESEScale
Definition: CaloTowersReCreator.h:28
CaloTowersCreationAlgo::setHF2EScale
void setHF2EScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1390
CaloTowersReCreator::HEDEScale
double HEDEScale
Definition: CaloTowersReCreator.h:29
CaloTowersReCreator::HF1EScale
double HF1EScale
Definition: CaloTowersReCreator.h:29
CaloTowersReCreator::tok_topo_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
Definition: CaloTowersReCreator.h:35
edm::Handle
Definition: AssociativeIterator.h:50
CaloTowersReCreator::tok_geom_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Definition: CaloTowersReCreator.h:34
CaloTowersCreationAlgo::setHBEScale
void setHBEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1355
CaloTowersReCreator::HOEScale
double HOEScale
Definition: CaloTowersReCreator.h:29
CaloTowersReCreator::tok_ctmap_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > tok_ctmap_
Definition: CaloTowersReCreator.h:37
CaloTowersCreationAlgo::begin
void begin()
Definition: CaloTowersCreationAlgo.cc:368
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::ESHandle< CaloGeometry >
CaloTowersReCreator::tok_calo_
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
Definition: CaloTowersReCreator.h:33
CaloTowersCreationAlgo::setHEDEScale
void setHEDEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1369
CaloTowersCreationAlgo::setEEEScale
void setEEEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1348
CaloTowersReCreator::algo_
CaloTowersCreationAlgo algo_
Definition: CaloTowersReCreator.h:32
CaloTowersReCreator::tok_cttopo_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
Definition: CaloTowersReCreator.h:36
CaloTowersCreationAlgo::rescaleTowers
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
Definition: CaloTowersCreationAlgo.cc:426
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
CaloTowersCreationAlgo::setEBEScale
void setEBEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1341
CaloTowersReCreator::HF2EScale
double HF2EScale
Definition: CaloTowersReCreator.h:29
CaloTowersCreationAlgo::setHESEScale
void setHESEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1362
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37