1 #ifndef RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h 2 #define RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h 21 threshold_(iConfig.getParameter<double>(
"threshold"))
29 return fullReadOut
or pass(hit);
74 thresholds_ = iConfig.
getParameter<std::vector<int> >(
"maxSeverities");
75 cleanThresholds_ = iConfig.
getParameter<std::vector<double> >(
"cleaningThresholds");
76 std::vector<std::string>
flags = iConfig.
getParameter<std::vector<std::string> >(
"flags");
77 for (
auto &
flag : flags) {
78 if (
flag ==
"Standard") {
80 depths_.push_back(-1);
82 else if (
flag ==
"HFInTime") {
84 depths_.push_back(-1);
86 else if (
flag ==
"HFDigi") {
88 depths_.push_back(-1);
90 else if (
flag ==
"HFLong") {
94 else if (
flag ==
"HFShort") {
100 depths_.push_back(-1);
108 theHcalTopology_ = topo.
product();
111 theHcalChStatus_ = hcalChStatus.
product();
114 hcalSevLvlComputer_ = hcalSevLvlComputerHndl.
product();
151 detid = theHcalTopology_->
idFront(detid);
155 unsigned theStatusValue = theStatus->
getValue();
157 for (
unsigned int i=0;
i<thresholds_.size();++
i) {
159 if (energy < cleanThresholds_[
i])
163 hitSeverity=hcalSevLvlComputer_->
getSeverityLevel(detid, flags, theStatusValue);
166 hitSeverity=hcalSevLvlComputer_->
getSeverityLevel(detid, flags & flags_[i], theStatusValue);
169 if (hitSeverity>thresholds_[i] and ((depths_[i]<0
or (depths_[i]==detid.
depth())))) {
190 std::vector<edm::ParameterSet> psets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"cuts");
191 for (
auto &
pset : psets) {
192 depths_.push_back(
pset.getParameter<
int>(
"depth"));
193 minTimes_.push_back(
pset.getParameter<
double>(
"minTime"));
194 maxTimes_.push_back(
pset.getParameter<
double>(
"maxTime"));
195 thresholds_.push_back(
pset.getParameter<
double>(
"threshold"));
232 for (
unsigned int i=0;
i<depths_.size();++
i) {
233 if (detid.
depth() == depths_[
i]) {
234 if ((time <minTimes_[
i]
or time >maxTimes_[
i] ) and energy>thresholds_[
i])
260 std::vector<edm::ParameterSet> psets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"cuts");
261 for (
auto &
pset : psets) {
262 depths_=
pset.getParameter<std::vector<int> >(
"depth");
263 thresholds_=
pset.getParameter<std::vector<double> >(
"threshold");
264 detector_=
pset.getParameter<
int>(
"detectorEnum");
265 if(thresholds_.size()!=depths_.size()) {
267 <<
"PFRecHitThreshold mismatch with the numbers of depths";
305 for (
unsigned int i=0;
i<thresholds_.size();++
i) {
306 if (detid.
depth() == depths_[
i] && detid.
subdet() == detector_ ) {
307 if ( energy<thresholds_[
i])
336 threshold0_(iConfig.getParameter<double>(
"threshold_ring0")),
337 threshold12_(iConfig.getParameter<double>(
"threshold_ring12"))
358 if (
abs(detid.ieta())<=4 and hit.
energy()>threshold0_)
360 if (
abs(detid.ieta())>4 and hit.
energy()>threshold12_)
394 thresholds_(iConfig.getParameter<
std::vector<double> >(
"thresholds"))
405 endcapGeometrySet_=
false;
406 if (endcapGeometry) {
408 endcapGeometrySet_=
true;
413 return fullReadOut
or pass(hit);
444 if (not endcapGeometrySet_) {
447 if(detId.subdetId() !=
EcalBarrel)
return true;
453 return (hit.
energy() > thresholds_[firstEBRing]);
457 if (hit.
energy() > thresholds_[iring])
return true;
474 thresholdCleaning_(iConfig.getParameter<double>(
"cleaningThreshold")),
475 timingCleaning_(iConfig.getParameter<
bool>(
"timingCleaning")),
476 topologicalCleaning_(iConfig.getParameter<
bool>(
"topologicalCleaning")),
477 skipTTRecoveredHits_(iConfig.getParameter<
bool>(
"skipTTRecoveredHits"))
490 if (timingCleaning_ and rh.
energy() > thresholdCleaning_ and
497 if (topologicalCleaning_ and (
542 thresholdCleaning_(0.),
543 topologicalCleaning_(
false)
549 thresholdCleaning_(iConfig.getParameter<double>(
"cleaningThreshold")),
550 topologicalCleaning_(iConfig.getParameter<
bool>(
"topologicalCleaning"))
559 if ( rh.
energy() < thresholdCleaning_ ) {
564 if ( topologicalCleaning_ and
619 calibFactor_(iConfig.getParameter<double>(
"calibFactor"))
631 if (
abs(detId.ieta())==29)
645 if (detId.ietaAbs()==29)
661 recHitEnergy_keV_(
false),
664 recHitEnergyMultiplier_(0.)
670 recHitEnergy_keV_(iConfig.getParameter<
bool>(
"recHitEnergyIs_keV")),
671 threshold_(iConfig.getParameter<double>(
"thresholdInMIPs")),
672 mip_(iConfig.getParameter<double>(
"mipValueInkeV")),
673 recHitEnergyMultiplier_(iConfig.getParameter<double>(
"recHitEnergyMultiplier"))
682 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
687 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
693 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
698 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
704 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
709 const double newE = ( recHitEnergy_keV_ ?
710 1.0e-6*rh.
energy()*recHitEnergyMultiplier_ :
711 rh.
energy()*recHitEnergyMultiplier_ );
721 const double hitValueInMIPs = 1e6*hit.
energy()/mip_;
730 geometryInstance_(
""),
731 recHitEnergy_keV_(0.),
734 recHitEnergyMultiplier_(0.) {
739 geometryInstance_(iConfig.getParameter<
std::
string>(
"geometryInstance")),
740 recHitEnergy_keV_(iConfig.getParameter<
bool>(
"recHitEnergyIs_keV")),
741 threshold_(iConfig.getParameter<double>(
"thresholdInMIPs")),
742 mip_(iConfig.getParameter<double>(
"mipValueInkeV")),
743 recHitEnergyMultiplier_(iConfig.getParameter<double>(
"recHitEnergyMultiplier")) {
754 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
759 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
765 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
770 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
776 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
781 const double newE = ( recHitEnergy_keV_ ?
782 1.0e-6*rh.
energy()*recHitEnergyMultiplier_ :
783 rh.
energy()*recHitEnergyMultiplier_ );
785 const float mult = (
float) ddd_->waferTypeL(wafer);
787 return pass(hit, mult);
797 const double hitValueInMIPs = 1e6*hit.
energy()/(mult*mip_);
812 PFRecHitQTestBase(iConfig), thresholdSNR_(iConfig.getParameter<double>(
"thresholdSNR"))
823 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
829 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
836 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
842 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
849 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
PFRecHitQTestHGCalThresholdSNR()
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
const HcalChannelQuality * theHcalChStatus_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
const HGCalDDDConstants * ddd_
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
HcalSubdetector subdet() const
get the subdetector
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
std::vector< double > minTimes_
bool pass(const reco::PFRecHit &hit)
std::vector< int > depths_
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
const DetId & detid() const
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
unsigned detId() const
rechit detId
PFRecHitQTestThreshold(const edm::ParameterSet &iConfig)
bool topologicalCleaning_
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
const double thresholdSNR_
std::vector< int > depths_
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
bool skipTTRecoveredHits_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool pass(const reco::PFRecHit &hit, const float mult)
const HcalSeverityLevelComputer * hcalSevLvlComputer_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
const bool recHitEnergy_keV_
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
std::vector< double > maxTimes_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
std::vector< Variable::Flags > flags
PFRecHitQTestECAL(const edm::ParameterSet &iConfig)
PFRecHitQTestHCALTimeVsDepth()
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool test(unsigned aDETID, double energy, double time, bool &clean)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
PFRecHitQTestHCALChannel(const edm::ParameterSet &iConfig)
const std::string geometryInstance_
std::vector< double > cleanThresholds_
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
std::vector< double > thresholds_
PFRecHitQTestHCALThresholdVsDepth(const edm::ParameterSet &iConfig)
const bool recHitEnergy_keV_
const HcalTopology * theHcalTopology_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
const double threshold12_
PFRecHitQTestHCALChannel()
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
float signalOverSigmaNoise() const
std::vector< double > thresholds_
bool test(unsigned aDETID, double energy, double time, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
PFRecHitQTestHCALCalib29()
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
int depth() const
get the tower depth
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
bool checkFlag(int flag) const
check if the flag is true
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const HGCalTopology & topology() const
PFRecHitQTestHCALCalib29(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool pass(const reco::PFRecHit &hit)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
Abs< T >::type abs(const T &t)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
float energy() const
rechit energy
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
const std::vector< double > thresholds_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
PFRecHitQTestThresholdInThicknessNormalizedMIPs()
PFRecHitQTestHCALTimeVsDepth(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
PFRecHitQTestHOThreshold(const edm::ParameterSet &iConfig)
const HGCalDDDConstants & dddConstants() const
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
PFRecHitQTestHCALThresholdVsDepth()
PFRecHitQTestHOThreshold()
PFRecHitQTestThresholdInThicknessNormalizedMIPs(const edm::ParameterSet &iConfig)
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
std::vector< int > depths_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
std::vector< int > thresholds_
void setEnergy(float energy)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
const bool topologicalCleaning_
PFRecHitQTestThresholdInMIPs(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
HcalDetId idFront(const HcalDetId &id) const
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
bool test(unsigned aDETID, double energy, int flags, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
double thresholdCleaning_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
uint32_t getValue() const
bool withSpecialRBXHBHE() const
PFRecHitQTestECALMultiThreshold(const edm::ParameterSet &iConfig)
bool pass(const reco::PFRecHit &hit)
const double thresholdCleaning_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
PFRecHitQTestECALMultiThreshold()
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
T const * product() const
std::vector< int > flags_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
PFRecHitQTestHGCalThresholdSNR(const edm::ParameterSet &iConfig)
PFRecHitQTestThresholdInMIPs()
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
PFRecHitQTestES(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override