46 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >
toks_ecal_;
93 : algo_(conf.getParameter<double>(
"EBThreshold"),
94 conf.getParameter<double>(
"EEThreshold"),
96 conf.getParameter<
bool>(
"UseEtEBTreshold"),
97 conf.getParameter<
bool>(
"UseEtEETreshold"),
98 conf.getParameter<
bool>(
"UseSymEBTreshold"),
99 conf.getParameter<
bool>(
"UseSymEETreshold"),
101 conf.getParameter<double>(
"HcalThreshold"),
102 conf.getParameter<double>(
"HBThreshold"),
103 conf.getParameter<double>(
"HBThreshold1"),
104 conf.getParameter<double>(
"HBThreshold2"),
105 conf.getParameter<double>(
"HESThreshold"),
106 conf.getParameter<double>(
"HESThreshold1"),
107 conf.getParameter<double>(
"HEDThreshold"),
108 conf.getParameter<double>(
"HEDThreshold1"),
109 conf.getParameter<double>(
"HOThreshold0"),
110 conf.getParameter<double>(
"HOThresholdPlus1"),
111 conf.getParameter<double>(
"HOThresholdMinus1"),
112 conf.getParameter<double>(
"HOThresholdPlus2"),
113 conf.getParameter<double>(
"HOThresholdMinus2"),
114 conf.getParameter<double>(
"HF1Threshold"),
115 conf.getParameter<double>(
"HF2Threshold"),
116 conf.getParameter<
std::
vector<double> >(
"EBGrid"),
117 conf.getParameter<
std::
vector<double> >(
"EBWeights"),
118 conf.getParameter<
std::
vector<double> >(
"EEGrid"),
119 conf.getParameter<
std::
vector<double> >(
"EEWeights"),
120 conf.getParameter<
std::
vector<double> >(
"HBGrid"),
121 conf.getParameter<
std::
vector<double> >(
"HBWeights"),
122 conf.getParameter<
std::
vector<double> >(
"HESGrid"),
123 conf.getParameter<
std::
vector<double> >(
"HESWeights"),
124 conf.getParameter<
std::
vector<double> >(
"HEDGrid"),
125 conf.getParameter<
std::
vector<double> >(
"HEDWeights"),
126 conf.getParameter<
std::
vector<double> >(
"HOGrid"),
127 conf.getParameter<
std::
vector<double> >(
"HOWeights"),
128 conf.getParameter<
std::
vector<double> >(
"HF1Grid"),
129 conf.getParameter<
std::
vector<double> >(
"HF1Weights"),
130 conf.getParameter<
std::
vector<double> >(
"HF2Grid"),
131 conf.getParameter<
std::
vector<double> >(
"HF2Weights"),
132 conf.getParameter<double>(
"EBWeight"),
133 conf.getParameter<double>(
"EEWeight"),
134 conf.getParameter<double>(
"HBWeight"),
135 conf.getParameter<double>(
"HESWeight"),
136 conf.getParameter<double>(
"HEDWeight"),
137 conf.getParameter<double>(
"HOWeight"),
138 conf.getParameter<double>(
"HF1Weight"),
139 conf.getParameter<double>(
"HF2Weight"),
140 conf.getParameter<double>(
"EcutTower"),
141 conf.getParameter<double>(
"EBSumThreshold"),
142 conf.getParameter<double>(
"EESumThreshold"),
143 conf.getParameter<
bool>(
"UseHO"),
145 conf.getParameter<
int>(
"MomConstrMethod"),
146 conf.getParameter<double>(
"MomHBDepth"),
147 conf.getParameter<double>(
"MomHEDepth"),
148 conf.getParameter<double>(
"MomEBDepth"),
149 conf.getParameter<double>(
"MomEEDepth"),
150 conf.getParameter<
int>(
"HcalPhase")),
153 allowMissingInputs_(conf.getParameter<
bool>(
"AllowMissingInputs")),
155 theHcalAcceptSeverityLevel_(conf.getParameter<unsigned
int>(
"HcalAcceptSeverityLevel")),
157 theRecoveredHcalHitsAreUsed_(conf.getParameter<
bool>(
"UseHcalRecoveredHits")),
158 theRecoveredEcalHitsAreUsed_(conf.getParameter<
bool>(
"UseEcalRecoveredHits")),
162 useRejectedHitsOnly_(conf.getParameter<
bool>(
"UseRejectedHitsOnly")),
164 theHcalAcceptSeverityLevelForRejectedHit_(
165 conf.getParameter<unsigned
int>(
"HcalAcceptSeverityLevelForRejectedHit")),
167 useRejectedRecoveredHcalHits_(conf.getParameter<
bool>(
"UseRejectedRecoveredHcalHits")),
168 useRejectedRecoveredEcalHits_(conf.getParameter<
bool>(
"UseRejectedRecoveredEcalHits"))
177 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
178 tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
179 tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
180 tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
184 tok_ecalSevAlgo_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
187 for (
unsigned i = 0;
i != nLabels;
i++)
200 const std::vector<std::string> severitynames =
201 conf.
getParameter<std::vector<std::string> >(
"EcalRecHitSeveritiesToBeExcluded");
207 conf.
getParameter<std::vector<std::string> >(
"EcalSeveritiesToBeUsedInBadTowers"));
210 produces<CaloTowerCollection>();
216 << (
allowMissingInputs_ ?
"allowMissing " :
" ") << nLabels <<
' ' << severitynames.size() << std::endl;
290 if (check1 || check2 || check3) {
311 if (!
e.getByToken(*
i, ec_tmp))
347 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator
i;
350 present =
e.getByToken(*
i, ec);
356 auto prod = std::make_unique<CaloTowerCollection>();
365 for (
auto const& tw : (*
prod)) {
366 totc += tw.constituents().size();
369 std::cout <<
"CaloTowerCreator: " << tw.id() <<
" with E " << tw.energy() <<
" and " << tw.constituents().size()
370 <<
" constituents\n";
372 std::cout <<
"VI " << (*prod).size() <<
" " << totc <<
" " << totE <<
" " << totP4 << std::endl;
384 desc.add<
double>(
"EBSumThreshold", 0.2);
385 desc.add<
double>(
"HF2Weight", 1.0);
386 desc.add<
double>(
"EBWeight", 1.0);
387 desc.add<
double>(
"EESumThreshold", 0.45);
388 desc.add<
double>(
"HOThreshold0", 1.1);
389 desc.add<
double>(
"HOThresholdPlus1", 3.5);
390 desc.add<
double>(
"HOThresholdMinus1", 3.5);
391 desc.add<
double>(
"HOThresholdPlus2", 3.5);
392 desc.add<
double>(
"HOThresholdMinus2", 3.5);
393 desc.add<
double>(
"HBThreshold", 0.7);
394 desc.add<
double>(
"HBThreshold1", 0.7);
395 desc.add<
double>(
"HBThreshold2", 0.7);
396 desc.add<
double>(
"HF1Threshold", 0.5);
397 desc.add<
double>(
"HEDWeight", 1.0);
398 desc.add<
double>(
"EEWeight", 1.0);
399 desc.add<
double>(
"HESWeight", 1.0);
400 desc.add<
double>(
"HF1Weight", 1.0);
401 desc.add<
double>(
"HOWeight", 1.0);
402 desc.add<
double>(
"EBThreshold", 0.07);
403 desc.add<
double>(
"EEThreshold", 0.3);
404 desc.add<
double>(
"HcalThreshold", -1000.0);
405 desc.add<
double>(
"HF2Threshold", 0.85);
406 desc.add<
double>(
"HESThreshold", 0.8);
407 desc.add<
double>(
"HESThreshold1", 0.8);
408 desc.add<
double>(
"HEDThreshold", 0.8);
409 desc.add<
double>(
"HEDThreshold1", 0.8);
410 desc.add<
double>(
"EcutTower", -1000.0);
411 desc.add<
double>(
"HBWeight", 1.0);
412 desc.add<
double>(
"MomHBDepth", 0.2);
413 desc.add<
double>(
"MomHEDepth", 0.4);
414 desc.add<
double>(
"MomEBDepth", 0.3);
415 desc.add<
double>(
"MomEEDepth", 0.0);
416 desc.add<
bool>(
"UseHO",
true);
417 desc.add<
bool>(
"UseEtEBTreshold",
false);
418 desc.add<
bool>(
"UseSymEBTreshold",
true);
419 desc.add<
bool>(
"UseEtEETreshold",
false);
420 desc.add<
bool>(
"UseSymEETreshold",
true);
421 desc.add<
bool>(
"UseHcalRecoveredHits",
true);
422 desc.add<
bool>(
"UseEcalRecoveredHits",
false);
423 desc.add<
bool>(
"UseRejectedHitsOnly",
false);
424 desc.add<
bool>(
"UseRejectedRecoveredHcalHits",
true);
425 desc.add<
bool>(
"UseRejectedRecoveredEcalHits",
false);
426 desc.add<
double>(
"missingHcalRescaleFactorForEcal", 0.0);
427 desc.add<
bool>(
"AllowMissingInputs",
false);
428 desc.add<std::vector<double> >(
"HBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
429 desc.add<std::vector<double> >(
"EEWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
430 desc.add<std::vector<double> >(
"HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
431 desc.add<std::vector<double> >(
"HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
432 desc.add<std::vector<double> >(
"EEGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
433 desc.add<std::vector<double> >(
"HBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
434 desc.add<std::vector<double> >(
"HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
435 desc.add<std::vector<double> >(
"HEDWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
436 desc.add<std::vector<double> >(
"HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
437 desc.add<std::vector<double> >(
"EBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
438 desc.add<std::vector<double> >(
"HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
439 desc.add<std::vector<double> >(
"HESGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
440 desc.add<std::vector<double> >(
"HESWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
441 desc.add<std::vector<double> >(
"HEDGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
442 desc.add<std::vector<double> >(
"HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
443 desc.add<std::vector<double> >(
"EBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
447 desc.add<std::vector<edm::InputTag> >(
449 desc.add<
int>(
"MomConstrMethod", 1);
450 desc.add<
unsigned int>(
"HcalAcceptSeverityLevel", 9);
451 desc.add<std::vector<std::string> >(
"EcalRecHitSeveritiesToBeExcluded", {
"kTime",
"kWeird",
"kBad"});
452 desc.add<
unsigned int>(
"HcalAcceptSeverityLevelForRejectedHit", 9999);
453 desc.add<std::vector<std::string> >(
"EcalSeveritiesToBeUsedInBadTowers", {});
454 desc.add<
int>(
"HcalPhase", 0);
CaloTowersCreator(const edm::ParameterSet &ps)
T getParameter(std::string const &) const
void setEcalChStatusFromDB(const EcalChannelStatus *s)
CaloTowersCreationAlgo algo_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > tok_hcalChStatus_
#define DEFINE_FWK_MODULE(type)
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
void setHF1EScale(double scale)
void produce(edm::Event &e, const edm::EventSetup &c) override
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_ecalSevAlgo_
bool theRecoveredHcalHitsAreUsed_
void setHcalChStatusFromDB(const HcalChannelQuality *s)
void setHF2EScale(double scale)
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > tok_ctmap_
void finish(CaloTowerCollection &destCollection)
void setEeHandle(const edm::Handle< EcalRecHitCollection > ee)
std::vector< int > theEcalSeveritiesToBeExcluded_
~CaloTowersCreator() override
static const std::vector< double > & getGridValues()
void setHBEScale(double scale)
bool useRejectedHitsOnly_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
void setGeometry(const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
void setEbHandle(const edm::Handle< EcalRecHitCollection > eb)
void setUseRejectedRecoveredEcalHits(bool flag)
T const * product() const
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_ecalChStatus_
void addDefault(ParameterSetDescription const &psetDescription)
void setEcalSeveritiesToBeExcluded(const std::vector< int > &ecalSev)
void setHcalAcceptSeverityLevelForRejectedHit(unsigned int level)
void setHcalSevLvlComputer(const HcalSeverityLevelComputer *c)
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
void SetEcalSeveritiesToBeUsedInBadTowers(const std::vector< int > &ecalSev)
const_iterator begin() const
void setRecoveredEcalHitsAreUsed(bool flag)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
edm::ESWatcher< HcalChannelQualityRcd > hcalChStatusWatcher_
void process(const HBHERecHitCollection &hbhe)
void setHESEScale(double scale)
void setHEDEScale(double scale)
void setEEEScale(double scale)
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > tok_hcalSevComputer_
std::string instanceLabel
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
void setRecoveredHcalHitsAreUsed(bool flag)
void setUseRejectedHitsOnly(bool flag)
bool check(const edm::EventSetup &iSetup)
void setMissingHcalRescaleFactorForEcal(float factor)
void setHOEScale(double scale)
unsigned int theHcalAcceptSeverityLevel_
edm::ESGetToken< CaloTowerTopology, HcalRecNumberingRecord > tok_cttopo_
bool theRecoveredEcalHitsAreUsed_
void setHcalAcceptSeverityLevel(unsigned int level)
bool useRejectedRecoveredHcalHits_
std::vector< edm::InputTag > ecalLabels_
edm::ESWatcher< HcalSeverityLevelComputerRcd > hcalSevLevelWatcher_
void setEcalSevLvlAlgo(const EcalSeverityLevelAlgo *a)
void setUseRejectedRecoveredHcalHits(bool flag)
edm::ESWatcher< IdealGeometryRecord > caloTowerConstituentsWatcher_
void setEBEScale(double scale)
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
edm::ESWatcher< EcalSeverityLevelAlgoRcd > ecalSevLevelWatcher_
bool useRejectedRecoveredEcalHits_