48 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >
toks_ecal_;
99 : algo_(conf.getParameter<double>(
"EBThreshold"),
100 conf.getParameter<double>(
"EEThreshold"),
102 conf.getParameter<
bool>(
"UseEtEBTreshold"),
103 conf.getParameter<
bool>(
"UseEtEETreshold"),
104 conf.getParameter<
bool>(
"UseSymEBTreshold"),
105 conf.getParameter<
bool>(
"UseSymEETreshold"),
107 conf.getParameter<double>(
"HcalThreshold"),
108 conf.getParameter<double>(
"HBThreshold"),
109 conf.getParameter<double>(
"HBThreshold1"),
110 conf.getParameter<double>(
"HBThreshold2"),
111 conf.getParameter<double>(
"HESThreshold"),
112 conf.getParameter<double>(
"HESThreshold1"),
113 conf.getParameter<double>(
"HEDThreshold"),
114 conf.getParameter<double>(
"HEDThreshold1"),
115 conf.getParameter<double>(
"HOThreshold0"),
116 conf.getParameter<double>(
"HOThresholdPlus1"),
117 conf.getParameter<double>(
"HOThresholdMinus1"),
118 conf.getParameter<double>(
"HOThresholdPlus2"),
119 conf.getParameter<double>(
"HOThresholdMinus2"),
120 conf.getParameter<double>(
"HF1Threshold"),
121 conf.getParameter<double>(
"HF2Threshold"),
122 conf.getParameter<
std::
vector<double> >(
"EBGrid"),
123 conf.getParameter<
std::
vector<double> >(
"EBWeights"),
124 conf.getParameter<
std::
vector<double> >(
"EEGrid"),
125 conf.getParameter<
std::
vector<double> >(
"EEWeights"),
126 conf.getParameter<
std::
vector<double> >(
"HBGrid"),
127 conf.getParameter<
std::
vector<double> >(
"HBWeights"),
128 conf.getParameter<
std::
vector<double> >(
"HESGrid"),
129 conf.getParameter<
std::
vector<double> >(
"HESWeights"),
130 conf.getParameter<
std::
vector<double> >(
"HEDGrid"),
131 conf.getParameter<
std::
vector<double> >(
"HEDWeights"),
132 conf.getParameter<
std::
vector<double> >(
"HOGrid"),
133 conf.getParameter<
std::
vector<double> >(
"HOWeights"),
134 conf.getParameter<
std::
vector<double> >(
"HF1Grid"),
135 conf.getParameter<
std::
vector<double> >(
"HF1Weights"),
136 conf.getParameter<
std::
vector<double> >(
"HF2Grid"),
137 conf.getParameter<
std::
vector<double> >(
"HF2Weights"),
138 conf.getParameter<double>(
"EBWeight"),
139 conf.getParameter<double>(
"EEWeight"),
140 conf.getParameter<double>(
"HBWeight"),
141 conf.getParameter<double>(
"HESWeight"),
142 conf.getParameter<double>(
"HEDWeight"),
143 conf.getParameter<double>(
"HOWeight"),
144 conf.getParameter<double>(
"HF1Weight"),
145 conf.getParameter<double>(
"HF2Weight"),
146 conf.getParameter<double>(
"EcutTower"),
147 conf.getParameter<double>(
"EBSumThreshold"),
148 conf.getParameter<double>(
"EESumThreshold"),
149 conf.getParameter<
bool>(
"UseHO"),
151 conf.getParameter<
int>(
"MomConstrMethod"),
152 conf.getParameter<double>(
"MomHBDepth"),
153 conf.getParameter<double>(
"MomHEDepth"),
154 conf.getParameter<double>(
"MomEBDepth"),
155 conf.getParameter<double>(
"MomEEDepth"),
156 conf.getParameter<
int>(
"HcalPhase")),
159 allowMissingInputs_(conf.getParameter<
bool>(
"AllowMissingInputs")),
161 theHcalAcceptSeverityLevel_(conf.getParameter<unsigned
int>(
"HcalAcceptSeverityLevel")),
163 theRecoveredHcalHitsAreUsed_(conf.getParameter<
bool>(
"UseHcalRecoveredHits")),
164 theRecoveredEcalHitsAreUsed_(conf.getParameter<
bool>(
"UseEcalRecoveredHits")),
168 useRejectedHitsOnly_(conf.getParameter<
bool>(
"UseRejectedHitsOnly")),
170 theHcalAcceptSeverityLevelForRejectedHit_(
171 conf.getParameter<unsigned
int>(
"HcalAcceptSeverityLevelForRejectedHit")),
173 useRejectedRecoveredHcalHits_(conf.getParameter<
bool>(
"UseRejectedRecoveredHcalHits")),
174 useRejectedRecoveredEcalHits_(conf.getParameter<
bool>(
"UseRejectedRecoveredEcalHits")),
175 cutsFromDB(conf.getParameter<
bool>(
"usePFThresholdsFromDB"))
184 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
185 tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
186 tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
187 tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
191 tok_ecalSevAlgo_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
197 for (
unsigned i = 0;
i != nLabels;
i++)
210 const std::vector<std::string> severitynames =
211 conf.
getParameter<std::vector<std::string> >(
"EcalRecHitSeveritiesToBeExcluded");
217 conf.
getParameter<std::vector<std::string> >(
"EcalSeveritiesToBeUsedInBadTowers"));
220 produces<CaloTowerCollection>();
226 << (
allowMissingInputs_ ?
"allowMissing " :
" ") << nLabels <<
' ' << severitynames.size() << std::endl;
307 if (check1 || check2 || check3) {
328 if (!
e.getByToken(*
i, ec_tmp))
364 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator
i;
367 present =
e.getByToken(*
i, ec);
373 auto prod = std::make_unique<CaloTowerCollection>();
382 for (
auto const& tw : (*
prod)) {
383 totc += tw.constituents().size();
386 std::cout <<
"CaloTowerCreator: " << tw.id() <<
" with E " << tw.energy() <<
" and " << tw.constituents().size()
387 <<
" constituents\n";
389 std::cout <<
"VI " << (*prod).size() <<
" " << totc <<
" " << totE <<
" " << totP4 << std::endl;
401 desc.add<
double>(
"EBSumThreshold", 0.2);
402 desc.add<
double>(
"HF2Weight", 1.0);
403 desc.add<
double>(
"EBWeight", 1.0);
404 desc.add<
double>(
"EESumThreshold", 0.45);
405 desc.add<
double>(
"HOThreshold0", 1.1);
406 desc.add<
double>(
"HOThresholdPlus1", 3.5);
407 desc.add<
double>(
"HOThresholdMinus1", 3.5);
408 desc.add<
double>(
"HOThresholdPlus2", 3.5);
409 desc.add<
double>(
"HOThresholdMinus2", 3.5);
410 desc.add<
double>(
"HBThreshold", 0.7);
411 desc.add<
double>(
"HBThreshold1", 0.7);
412 desc.add<
double>(
"HBThreshold2", 0.7);
413 desc.add<
double>(
"HF1Threshold", 0.5);
414 desc.add<
double>(
"HEDWeight", 1.0);
415 desc.add<
double>(
"EEWeight", 1.0);
416 desc.add<
double>(
"HESWeight", 1.0);
417 desc.add<
double>(
"HF1Weight", 1.0);
418 desc.add<
double>(
"HOWeight", 1.0);
419 desc.add<
double>(
"EBThreshold", 0.07);
420 desc.add<
double>(
"EEThreshold", 0.3);
421 desc.add<
double>(
"HcalThreshold", -1000.0);
422 desc.add<
double>(
"HF2Threshold", 0.85);
423 desc.add<
double>(
"HESThreshold", 0.8);
424 desc.add<
double>(
"HESThreshold1", 0.8);
425 desc.add<
double>(
"HEDThreshold", 0.8);
426 desc.add<
double>(
"HEDThreshold1", 0.8);
427 desc.add<
double>(
"EcutTower", -1000.0);
428 desc.add<
double>(
"HBWeight", 1.0);
429 desc.add<
double>(
"MomHBDepth", 0.2);
430 desc.add<
double>(
"MomHEDepth", 0.4);
431 desc.add<
double>(
"MomEBDepth", 0.3);
432 desc.add<
double>(
"MomEEDepth", 0.0);
433 desc.add<
bool>(
"UseHO",
true);
434 desc.add<
bool>(
"UseEtEBTreshold",
false);
435 desc.add<
bool>(
"UseSymEBTreshold",
true);
436 desc.add<
bool>(
"UseEtEETreshold",
false);
437 desc.add<
bool>(
"UseSymEETreshold",
true);
438 desc.add<
bool>(
"UseHcalRecoveredHits",
true);
439 desc.add<
bool>(
"UseEcalRecoveredHits",
false);
440 desc.add<
bool>(
"UseRejectedHitsOnly",
false);
441 desc.add<
bool>(
"UseRejectedRecoveredHcalHits",
true);
442 desc.add<
bool>(
"UseRejectedRecoveredEcalHits",
false);
443 desc.add<
double>(
"missingHcalRescaleFactorForEcal", 0.0);
444 desc.add<
bool>(
"AllowMissingInputs",
false);
445 desc.add<std::vector<double> >(
"HBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
446 desc.add<std::vector<double> >(
"EEWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
447 desc.add<std::vector<double> >(
"HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
448 desc.add<std::vector<double> >(
"HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
449 desc.add<std::vector<double> >(
"EEGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
450 desc.add<std::vector<double> >(
"HBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
451 desc.add<std::vector<double> >(
"HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
452 desc.add<std::vector<double> >(
"HEDWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
453 desc.add<std::vector<double> >(
"HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
454 desc.add<std::vector<double> >(
"EBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
455 desc.add<std::vector<double> >(
"HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
456 desc.add<std::vector<double> >(
"HESGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
457 desc.add<std::vector<double> >(
"HESWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
458 desc.add<std::vector<double> >(
"HEDGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
459 desc.add<std::vector<double> >(
"HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
460 desc.add<std::vector<double> >(
"EBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
464 desc.add<std::vector<edm::InputTag> >(
466 desc.add<
int>(
"MomConstrMethod", 1);
467 desc.add<
unsigned int>(
"HcalAcceptSeverityLevel", 9);
468 desc.add<std::vector<std::string> >(
"EcalRecHitSeveritiesToBeExcluded", {
"kTime",
"kWeird",
"kBad"});
469 desc.add<
unsigned int>(
"HcalAcceptSeverityLevelForRejectedHit", 9999);
470 desc.add<std::vector<std::string> >(
"EcalSeveritiesToBeUsedInBadTowers", {});
471 desc.add<
int>(
"HcalPhase", 0);
472 desc.add<
bool>(
"usePFThresholdsFromDB",
true);
CaloTowersCreator(const edm::ParameterSet &ps)
T getParameter(std::string const &) const
void beginRun(edm::Run const &, edm::EventSetup const &) override
void setEcalChStatusFromDB(const EcalChannelStatus *s)
CaloTowersCreationAlgo algo_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > tok_hcalChStatus_
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)
void setThresFromDB(const HcalPFCuts *cuts)
std::vector< int > theEcalSeveritiesToBeExcluded_
~CaloTowersCreator() override
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
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)
#define DEFINE_FWK_MODULE(type)
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_
HcalPFCuts const * paramPF
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_