CMS 3D CMS Logo

CaloTowersReCreator.cc
Go to the documentation of this file.
5 
7  : algo_(0.,
8  0.,
9  false,
10  false,
11  false,
12  false,
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.,
26  0.,
27  0., // thresholds cannot be reapplied
28  conf.getParameter<std::vector<double> >("EBGrid"),
29  conf.getParameter<std::vector<double> >("EBWeights"),
30  conf.getParameter<std::vector<double> >("EEGrid"),
31  conf.getParameter<std::vector<double> >("EEWeights"),
32  conf.getParameter<std::vector<double> >("HBGrid"),
33  conf.getParameter<std::vector<double> >("HBWeights"),
34  conf.getParameter<std::vector<double> >("HESGrid"),
35  conf.getParameter<std::vector<double> >("HESWeights"),
36  conf.getParameter<std::vector<double> >("HEDGrid"),
37  conf.getParameter<std::vector<double> >("HEDWeights"),
38  conf.getParameter<std::vector<double> >("HOGrid"),
39  conf.getParameter<std::vector<double> >("HOWeights"),
40  conf.getParameter<std::vector<double> >("HF1Grid"),
41  conf.getParameter<std::vector<double> >("HF1Weights"),
42  conf.getParameter<std::vector<double> >("HF2Grid"),
43  conf.getParameter<std::vector<double> >("HF2Weights"),
44  conf.getParameter<double>("EBWeight"),
45  conf.getParameter<double>("EEWeight"),
46  conf.getParameter<double>("HBWeight"),
47  conf.getParameter<double>("HESWeight"),
48  conf.getParameter<double>("HEDWeight"),
49  conf.getParameter<double>("HOWeight"),
50  conf.getParameter<double>("HF1Weight"),
51  conf.getParameter<double>("HF2Weight"),
52  0.,
53  0.,
54  0.,
55  conf.getParameter<bool>("UseHO"),
56  // (these have no effect on recreation: here for compatibility)
57  conf.getParameter<int>("MomConstrMethod"),
58  conf.getParameter<double>("MomHBDepth"),
59  conf.getParameter<double>("MomHEDepth"),
60  conf.getParameter<double>("MomEBDepth"),
61  conf.getParameter<double>("MomEEDepth"),
62  conf.getParameter<int>("HcalPhase")),
63  allowMissingInputs_(false) {
64  tok_calo_ = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("caloLabel"));
65 
66  EBEScale = conf.getParameter<double>("EBEScale");
67  EEEScale = conf.getParameter<double>("EEEScale");
68  HBEScale = conf.getParameter<double>("HBEScale");
69  HESEScale = conf.getParameter<double>("HESEScale");
70  HEDEScale = conf.getParameter<double>("HEDEScale");
71  HOEScale = conf.getParameter<double>("HOEScale");
72  HF1EScale = conf.getParameter<double>("HF1EScale");
73  HF2EScale = conf.getParameter<double>("HF2EScale");
74  // two notes:
75  // 1) all this could go in a pset
76  // 2) not clear the instanceLabel thing
77 
78  produces<CaloTowerCollection>();
79 }
80 
82  // get the necessary event setup objects...
87  c.get<CaloGeometryRecord>().get(pG);
88  c.get<HcalRecNumberingRecord>().get(htopo);
89  c.get<HcalRecNumberingRecord>().get(cttopo);
90  c.get<CaloGeometryRecord>().get(ctmap);
91 
100  algo_.setGeometry(cttopo.product(), ctmap.product(), htopo.product(), pG.product());
101 
102  algo_.begin(); // clear the internal buffer
103 
104  // Step A/C: Get Inputs and process (repeatedly)
106  e.getByToken(tok_calo_, calt);
107 
108  // modified to rescale the CaloTowers directly
109  // without going through metatowers
110  // required for the algorithms that make use of individual
111  // crystal information
112 
113  if (!calt.isValid()) {
114  // can't find it!
115  if (!allowMissingInputs_) {
116  *calt; // will throw the proper exception
117  }
118  } else {
119  // Step B: Create empty output
120  auto prod = std::make_unique<CaloTowerCollection>();
121 
122  // step C: rescale (without going threough metataowers)
123  algo_.rescaleTowers(*calt, *prod);
124 
125  // Step D: Put into the event
126  e.put(std::move(prod));
127  }
128 }
129 
132  desc.add<double>("EBWeight", 1.0);
133  desc.add<double>("HBEScale", 50.0);
134  desc.add<double>("HEDWeight", 1.0);
135  desc.add<double>("EEWeight", 1.0);
136  desc.add<double>("HF1Weight", 1.0);
137  desc.add<double>("HOWeight", 1.0);
138  desc.add<double>("HESWeight", 1.0);
139  desc.add<double>("HF2Weight", 1.0);
140  desc.add<double>("HESEScale", 50.0);
141  desc.add<double>("HEDEScale", 50.0);
142  desc.add<double>("EBEScale", 50.0);
143  desc.add<double>("HBWeight", 1.0);
144  desc.add<double>("EEEScale", 50.0);
145  desc.add<double>("MomHBDepth", 0.2);
146  desc.add<double>("MomHEDepth", 0.4);
147  desc.add<double>("MomEBDepth", 0.3);
148  desc.add<double>("MomEEDepth", 0.0);
149  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});
150  desc.add<std::vector<double> >("EEWeights", {0.51, 1.39, 1.71, 2.37, 2.32, 2.2, 2.1, 1.98, 1.8});
151  desc.add<std::vector<double> >("HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
152  desc.add<std::vector<double> >("HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
153  desc.add<std::vector<double> >("EEGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
154  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});
155  desc.add<std::vector<double> >("HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
156  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});
157  desc.add<std::vector<double> >("HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
158  desc.add<std::vector<double> >("EBWeights", {0.86, 1.47, 1.66, 2.01, 1.98, 1.86, 1.83, 1.74, 1.65});
159  desc.add<std::vector<double> >("HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
160  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});
161  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});
162  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});
163  desc.add<std::vector<double> >("HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
164  desc.add<std::vector<double> >("EBGrid", {2.0, 4.0, 5.0, 9.0, 20.0, 30.0, 50.0, 100.0, 300.0});
165  desc.add<edm::InputTag>("caloLabel", edm::InputTag("calotowermaker"));
166  desc.add<int>("MomConstrMethod", 1);
167  desc.add<int>("HcalPhase", 0);
168 
169  descriptions.addDefault(desc);
170 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
electrons_cff.bool
bool
Definition: electrons_cff.py:372
CaloTowersCreationAlgo::setHF1EScale
void setHF1EScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1383
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
CaloTowersReCreator::EBEScale
double EBEScale
Definition: CaloTowersReCreator.h:25
funct::false
false
Definition: Factorize.h:34
CaloTowersReCreator::HBEScale
double HBEScale
Definition: CaloTowersReCreator.h:25
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:31
CaloTowersCreationAlgo::setHOEScale
void setHOEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1376
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
CaloTowersReCreator::EEEScale
double EEEScale
Definition: CaloTowersReCreator.h:25
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CaloTowersReCreator::HESEScale
double HESEScale
Definition: CaloTowersReCreator.h:25
CaloTowersCreationAlgo::setHF2EScale
void setHF2EScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1390
CaloTowersReCreator::HEDEScale
double HEDEScale
Definition: CaloTowersReCreator.h:26
CaloTowersReCreator::HF1EScale
double HF1EScale
Definition: CaloTowersReCreator.h:26
edm::Handle
Definition: AssociativeIterator.h:50
CaloTowersReCreator.h
CaloTowersCreationAlgo::setHBEScale
void setHBEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1355
CaloTowersReCreator::HOEScale
double HOEScale
Definition: CaloTowersReCreator.h:26
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:30
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
CaloGeometryRecord.h
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
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
CaloTowersReCreator::algo_
CaloTowersCreationAlgo algo_
Definition: CaloTowersReCreator.h:29
createfilelist.int
int
Definition: createfilelist.py:10
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
CaloTowersReCreator::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CaloTowersReCreator.cc:130
CaloTowersCreationAlgo::rescaleTowers
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
Definition: CaloTowersCreationAlgo.cc:426
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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:81
CaloGeometry.h
CaloTowersCreationAlgo::setEBEScale
void setEBEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1341
CaloTowersReCreator::HF2EScale
double HF2EScale
Definition: CaloTowersReCreator.h:26
CaloTowersReCreator::CaloTowersReCreator
CaloTowersReCreator(const edm::ParameterSet &ps)
Definition: CaloTowersReCreator.cc:6
CaloTowersCreationAlgo::setHESEScale
void setHESEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1362
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