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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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_
 

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 19 of file CaloTowersReCreator.h.

Constructor & Destructor Documentation

◆ CaloTowersReCreator()

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

Definition at line 6 of file CaloTowersReCreator.cc.

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 }

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

◆ ~CaloTowersReCreator()

CaloTowersReCreator::~CaloTowersReCreator ( )
inlineoverride

Definition at line 22 of file CaloTowersReCreator.h.

22 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 130 of file CaloTowersReCreator.cc.

130  {
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 }

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

◆ produce()

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

Definition at line 81 of file CaloTowersReCreator.cc.

81  {
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 }

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), HltBtagPostValidation_cff::c, MillePedeFileConverter_cfg::e, EBEScale, EEEScale, get, 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(), and tok_calo_.

Member Data Documentation

◆ algo_

CaloTowersCreationAlgo CaloTowersReCreator::algo_
private

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by produce().

◆ allowMissingInputs_

bool CaloTowersReCreator::allowMissingInputs_
private

Definition at line 31 of file CaloTowersReCreator.h.

Referenced by produce().

◆ EBEScale

double CaloTowersReCreator::EBEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ EEEScale

double CaloTowersReCreator::EEEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HBEScale

double CaloTowersReCreator::HBEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HEDEScale

double CaloTowersReCreator::HEDEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HESEScale

double CaloTowersReCreator::HESEScale

Definition at line 25 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HF1EScale

double CaloTowersReCreator::HF1EScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HF2EScale

double CaloTowersReCreator::HF2EScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ HOEScale

double CaloTowersReCreator::HOEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

◆ tok_calo_

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

Definition at line 30 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
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
CaloTowersReCreator::EBEScale
double EBEScale
Definition: CaloTowersReCreator.h:25
CaloTowersReCreator::HBEScale
double HBEScale
Definition: CaloTowersReCreator.h:25
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
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
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
CaloTowersReCreator::algo_
CaloTowersCreationAlgo algo_
Definition: CaloTowersReCreator.h:29
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
CaloTowersCreationAlgo::rescaleTowers
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
Definition: CaloTowersCreationAlgo.cc:426
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:26
CaloTowersCreationAlgo::setHESEScale
void setHESEScale(double scale)
Definition: CaloTowersCreationAlgo.cc:1362
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