CMS 3D CMS Logo

CaloTowersReCreator.cc
Go to the documentation of this file.
3 
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 }
82 
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 }
127 
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 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
electrons_cff.bool
bool
Definition: electrons_cff.py:366
CaloTowersCreationAlgo::setHF1EScale
void setHF1EScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1383
CaloTowersReCreator::EBEScale
double EBEScale
Definition: CaloTowersReCreator.h:28
funct::false
false
Definition: Factorize.h:29
CaloTowersReCreator::HBEScale
double HBEScale
Definition: CaloTowersReCreator.h:28
ESHandle.h
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:89281
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.h
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
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CaloTowersCreationAlgo::setHEDEScale
void setHEDEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1369
CaloTowersCreationAlgo::setEEEScale
void setEEEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1348
edm::ParameterSet
Definition: ParameterSet.h:47
CaloTowersReCreator::algo_
CaloTowersCreationAlgo algo_
Definition: CaloTowersReCreator.h:32
CaloTowersReCreator::tok_cttopo_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
Definition: CaloTowersReCreator.h:36
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
CaloTowersReCreator::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CaloTowersReCreator.cc:128
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
std
Definition: JetResolutionObject.h:76
CaloTowersReCreator::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: CaloTowersReCreator.cc:83
CaloTowersCreationAlgo::setEBEScale
void setEBEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1341
CaloTowersReCreator::HF2EScale
double HF2EScale
Definition: CaloTowersReCreator.h:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CaloTowersReCreator::CaloTowersReCreator
CaloTowersReCreator(const edm::ParameterSet &ps)
Definition: CaloTowersReCreator.cc:4
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::Event
Definition: Event.h:73
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