50 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >
toks_ecal_;
106 : algo_(conf.getParameter<double>(
"EBThreshold"),
107 conf.getParameter<double>(
"EEThreshold"),
109 conf.getParameter<
bool>(
"UseEtEBTreshold"),
110 conf.getParameter<
bool>(
"UseEtEETreshold"),
111 conf.getParameter<
bool>(
"UseSymEBTreshold"),
112 conf.getParameter<
bool>(
"UseSymEETreshold"),
114 conf.getParameter<double>(
"HcalThreshold"),
115 conf.getParameter<double>(
"HBThreshold"),
116 conf.getParameter<double>(
"HBThreshold1"),
117 conf.getParameter<double>(
"HBThreshold2"),
118 conf.getParameter<double>(
"HESThreshold"),
119 conf.getParameter<double>(
"HESThreshold1"),
120 conf.getParameter<double>(
"HEDThreshold"),
121 conf.getParameter<double>(
"HEDThreshold1"),
122 conf.getParameter<double>(
"HOThreshold0"),
123 conf.getParameter<double>(
"HOThresholdPlus1"),
124 conf.getParameter<double>(
"HOThresholdMinus1"),
125 conf.getParameter<double>(
"HOThresholdPlus2"),
126 conf.getParameter<double>(
"HOThresholdMinus2"),
127 conf.getParameter<double>(
"HF1Threshold"),
128 conf.getParameter<double>(
"HF2Threshold"),
129 conf.getParameter<
std::
vector<double> >(
"EBGrid"),
130 conf.getParameter<
std::
vector<double> >(
"EBWeights"),
131 conf.getParameter<
std::
vector<double> >(
"EEGrid"),
132 conf.getParameter<
std::
vector<double> >(
"EEWeights"),
133 conf.getParameter<
std::
vector<double> >(
"HBGrid"),
134 conf.getParameter<
std::
vector<double> >(
"HBWeights"),
135 conf.getParameter<
std::
vector<double> >(
"HESGrid"),
136 conf.getParameter<
std::
vector<double> >(
"HESWeights"),
137 conf.getParameter<
std::
vector<double> >(
"HEDGrid"),
138 conf.getParameter<
std::
vector<double> >(
"HEDWeights"),
139 conf.getParameter<
std::
vector<double> >(
"HOGrid"),
140 conf.getParameter<
std::
vector<double> >(
"HOWeights"),
141 conf.getParameter<
std::
vector<double> >(
"HF1Grid"),
142 conf.getParameter<
std::
vector<double> >(
"HF1Weights"),
143 conf.getParameter<
std::
vector<double> >(
"HF2Grid"),
144 conf.getParameter<
std::
vector<double> >(
"HF2Weights"),
145 conf.getParameter<double>(
"EBWeight"),
146 conf.getParameter<double>(
"EEWeight"),
147 conf.getParameter<double>(
"HBWeight"),
148 conf.getParameter<double>(
"HESWeight"),
149 conf.getParameter<double>(
"HEDWeight"),
150 conf.getParameter<double>(
"HOWeight"),
151 conf.getParameter<double>(
"HF1Weight"),
152 conf.getParameter<double>(
"HF2Weight"),
153 conf.getParameter<double>(
"EcutTower"),
154 conf.getParameter<double>(
"EBSumThreshold"),
155 conf.getParameter<double>(
"EESumThreshold"),
156 conf.getParameter<
bool>(
"UseHO"),
158 conf.getParameter<
int>(
"MomConstrMethod"),
159 conf.getParameter<double>(
"MomHBDepth"),
160 conf.getParameter<double>(
"MomHEDepth"),
161 conf.getParameter<double>(
"MomEBDepth"),
162 conf.getParameter<double>(
"MomEEDepth"),
163 conf.getParameter<
int>(
"HcalPhase")),
166 allowMissingInputs_(conf.getParameter<
bool>(
"AllowMissingInputs")),
168 theHcalAcceptSeverityLevel_(conf.getParameter<unsigned
int>(
"HcalAcceptSeverityLevel")),
170 theRecoveredHcalHitsAreUsed_(conf.getParameter<
bool>(
"UseHcalRecoveredHits")),
171 theRecoveredEcalHitsAreUsed_(conf.getParameter<
bool>(
"UseEcalRecoveredHits")),
175 useRejectedHitsOnly_(conf.getParameter<
bool>(
"UseRejectedHitsOnly")),
177 theHcalAcceptSeverityLevelForRejectedHit_(
178 conf.getParameter<unsigned
int>(
"HcalAcceptSeverityLevelForRejectedHit")),
180 useRejectedRecoveredHcalHits_(conf.getParameter<
bool>(
"UseRejectedRecoveredHcalHits")),
181 useRejectedRecoveredEcalHits_(conf.getParameter<
bool>(
"UseRejectedRecoveredEcalHits")),
182 cutsFromDB(conf.getParameter<
bool>(
"usePFThresholdsFromDB")),
183 ecalRecHitThresh_(conf.getParameter<
bool>(
"EcalRecHitThresh")) {
190 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
191 tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
192 tok_cttopo_ = esConsumes<CaloTowerTopology, HcalRecNumberingRecord>();
193 tok_ctmap_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>();
197 tok_ecalSevAlgo_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
205 esConsumes<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd, edm::Transition::BeginRun>();
209 for (
unsigned i = 0;
i != nLabels;
i++)
222 const std::vector<std::string> severitynames =
223 conf.
getParameter<std::vector<std::string> >(
"EcalRecHitSeveritiesToBeExcluded");
229 conf.
getParameter<std::vector<std::string> >(
"EcalSeveritiesToBeUsedInBadTowers"));
232 produces<CaloTowerCollection>();
238 << (
allowMissingInputs_ ?
"allowMissing " :
" ") << nLabels <<
' ' << severitynames.size() << std::endl;
324 if (check1 || check2 || check3) {
345 if (!
e.getByToken(*
i, ec_tmp))
381 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator
i;
384 present =
e.getByToken(*
i, ec);
390 auto prod = std::make_unique<CaloTowerCollection>();
399 for (
auto const& tw : (*
prod)) {
400 totc += tw.constituents().size();
403 std::cout <<
"CaloTowerCreator: " << tw.id() <<
" with E " << tw.energy() <<
" and " << tw.constituents().size()
404 <<
" constituents\n";
406 std::cout <<
"VI " << (*prod).size() <<
" " << totc <<
" " << totE <<
" " << totP4 << std::endl;
418 desc.add<
double>(
"EBSumThreshold", 0.2);
419 desc.add<
double>(
"HF2Weight", 1.0);
420 desc.add<
double>(
"EBWeight", 1.0);
421 desc.add<
double>(
"EESumThreshold", 0.45);
422 desc.add<
double>(
"HOThreshold0", 1.1);
423 desc.add<
double>(
"HOThresholdPlus1", 3.5);
424 desc.add<
double>(
"HOThresholdMinus1", 3.5);
425 desc.add<
double>(
"HOThresholdPlus2", 3.5);
426 desc.add<
double>(
"HOThresholdMinus2", 3.5);
427 desc.add<
double>(
"HBThreshold", 0.7);
428 desc.add<
double>(
"HBThreshold1", 0.7);
429 desc.add<
double>(
"HBThreshold2", 0.7);
430 desc.add<
double>(
"HF1Threshold", 0.5);
431 desc.add<
double>(
"HEDWeight", 1.0);
432 desc.add<
double>(
"EEWeight", 1.0);
433 desc.add<
double>(
"HESWeight", 1.0);
434 desc.add<
double>(
"HF1Weight", 1.0);
435 desc.add<
double>(
"HOWeight", 1.0);
436 desc.add<
double>(
"EBThreshold", 0.07);
437 desc.add<
double>(
"EEThreshold", 0.3);
438 desc.add<
double>(
"HcalThreshold", -1000.0);
439 desc.add<
double>(
"HF2Threshold", 0.85);
440 desc.add<
double>(
"HESThreshold", 0.8);
441 desc.add<
double>(
"HESThreshold1", 0.8);
442 desc.add<
double>(
"HEDThreshold", 0.8);
443 desc.add<
double>(
"HEDThreshold1", 0.8);
444 desc.add<
double>(
"EcutTower", -1000.0);
445 desc.add<
double>(
"HBWeight", 1.0);
446 desc.add<
double>(
"MomHBDepth", 0.2);
447 desc.add<
double>(
"MomHEDepth", 0.4);
448 desc.add<
double>(
"MomEBDepth", 0.3);
449 desc.add<
double>(
"MomEEDepth", 0.0);
450 desc.add<
bool>(
"UseHO",
true);
451 desc.add<
bool>(
"UseEtEBTreshold",
false);
452 desc.add<
bool>(
"UseSymEBTreshold",
true);
453 desc.add<
bool>(
"UseEtEETreshold",
false);
454 desc.add<
bool>(
"UseSymEETreshold",
true);
455 desc.add<
bool>(
"UseHcalRecoveredHits",
true);
456 desc.add<
bool>(
"UseEcalRecoveredHits",
false);
457 desc.add<
bool>(
"UseRejectedHitsOnly",
false);
458 desc.add<
bool>(
"UseRejectedRecoveredHcalHits",
true);
459 desc.add<
bool>(
"UseRejectedRecoveredEcalHits",
false);
460 desc.add<
double>(
"missingHcalRescaleFactorForEcal", 0.0);
461 desc.add<
bool>(
"AllowMissingInputs",
false);
462 desc.add<std::vector<double> >(
"HBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
463 desc.add<std::vector<double> >(
"EEWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
464 desc.add<std::vector<double> >(
"HF2Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
465 desc.add<std::vector<double> >(
"HOWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
466 desc.add<std::vector<double> >(
"EEGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
467 desc.add<std::vector<double> >(
"HBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
468 desc.add<std::vector<double> >(
"HF2Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
469 desc.add<std::vector<double> >(
"HEDWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
470 desc.add<std::vector<double> >(
"HF1Grid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
471 desc.add<std::vector<double> >(
"EBWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
472 desc.add<std::vector<double> >(
"HF1Weights", {1.0, 1.0, 1.0, 1.0, 1.0});
473 desc.add<std::vector<double> >(
"HESGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
474 desc.add<std::vector<double> >(
"HESWeights", {1.0, 1.0, 1.0, 1.0, 1.0});
475 desc.add<std::vector<double> >(
"HEDGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
476 desc.add<std::vector<double> >(
"HOGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
477 desc.add<std::vector<double> >(
"EBGrid", {-1.0, 1.0, 10.0, 100.0, 1000.0});
481 desc.add<std::vector<edm::InputTag> >(
483 desc.add<
int>(
"MomConstrMethod", 1);
484 desc.add<
unsigned int>(
"HcalAcceptSeverityLevel", 9);
485 desc.add<std::vector<std::string> >(
"EcalRecHitSeveritiesToBeExcluded", {
"kTime",
"kWeird",
"kBad"});
486 desc.add<
unsigned int>(
"HcalAcceptSeverityLevelForRejectedHit", 9999);
487 desc.add<std::vector<std::string> >(
"EcalSeveritiesToBeUsedInBadTowers", {});
488 desc.add<
int>(
"HcalPhase", 0);
489 desc.add<
bool>(
"usePFThresholdsFromDB",
true);
490 desc.add<
bool>(
"EcalRecHitThresh",
false);
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
EcalPFRecHitThresholds const * ecalThresholds
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
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)
edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
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)
void setThresFromDB(const EcalPFRecHitThresholds *EcalCuts, const HcalPFCuts *HcalCuts)
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_