1 #ifndef RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h 2 #define RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h 23 threshold_(iConfig.getParameter<double>(
"threshold"))
31 return fullReadOut
or pass(hit);
74 applySelectionsToAllCrystals_(iConfig.getParameter<
bool>(
"applySelectionsToAllCrystals")),
83 if (applySelectionsToAllCrystals_)
return pass(hit);
84 return fullReadOut
or pass(hit);
137 thresholds_ = iConfig.
getParameter<std::vector<int> >(
"maxSeverities");
138 cleanThresholds_ = iConfig.
getParameter<std::vector<double> >(
"cleaningThresholds");
139 std::vector<std::string>
flags = iConfig.
getParameter<std::vector<std::string> >(
"flags");
140 for (
auto &
flag : flags) {
141 if (
flag ==
"Standard") {
142 flags_.push_back(-1);
143 depths_.push_back(-1);
145 else if (
flag ==
"HFInTime") {
147 depths_.push_back(-1);
149 else if (
flag ==
"HFDigi") {
151 depths_.push_back(-1);
153 else if (
flag ==
"HFLong") {
155 depths_.push_back(1);
157 else if (
flag ==
"HFShort") {
159 depths_.push_back(2);
162 flags_.push_back(-1);
163 depths_.push_back(-1);
171 theHcalTopology_ = topo.
product();
174 theHcalChStatus_ = hcalChStatus.
product();
177 hcalSevLvlComputer_ = hcalSevLvlComputerHndl.
product();
214 detid = theHcalTopology_->
idFront(detid);
218 unsigned theStatusValue = theStatus->
getValue();
220 for (
unsigned int i=0;
i<thresholds_.size();++
i) {
222 if (energy < cleanThresholds_[
i])
226 hitSeverity=hcalSevLvlComputer_->
getSeverityLevel(detid, flags, theStatusValue);
229 hitSeverity=hcalSevLvlComputer_->
getSeverityLevel(detid, flags & flags_[i], theStatusValue);
232 if (hitSeverity>thresholds_[i] and ((depths_[i]<0
or (depths_[i]==detid.
depth())))) {
253 std::vector<edm::ParameterSet> psets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"cuts");
254 for (
auto &
pset : psets) {
255 depths_.push_back(
pset.getParameter<
int>(
"depth"));
256 minTimes_.push_back(
pset.getParameter<
double>(
"minTime"));
257 maxTimes_.push_back(
pset.getParameter<
double>(
"maxTime"));
258 thresholds_.push_back(
pset.getParameter<
double>(
"threshold"));
295 for (
unsigned int i=0;
i<depths_.size();++
i) {
296 if (detid.
depth() == depths_[
i]) {
297 if ((time <minTimes_[
i]
or time >maxTimes_[
i] ) and energy>thresholds_[
i])
323 std::vector<edm::ParameterSet> psets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"cuts");
324 for (
auto &
pset : psets) {
325 depths_=
pset.getParameter<std::vector<int> >(
"depth");
326 thresholds_=
pset.getParameter<std::vector<double> >(
"threshold");
327 detector_=
pset.getParameter<
int>(
"detectorEnum");
328 if(thresholds_.size()!=depths_.size()) {
330 <<
"PFRecHitThreshold mismatch with the numbers of depths";
368 for (
unsigned int i=0;
i<thresholds_.size();++
i) {
369 if (detid.
depth() == depths_[
i] && detid.
subdet() == detector_ ) {
370 if ( energy<thresholds_[
i])
399 threshold0_(iConfig.getParameter<double>(
"threshold_ring0")),
400 threshold12_(iConfig.getParameter<double>(
"threshold_ring12"))
421 if (
abs(detid.ieta())<=4 and hit.
energy()>threshold0_)
423 if (
abs(detid.ieta())>4 and hit.
energy()>threshold12_)
457 thresholds_(iConfig.getParameter<
std::vector<double> >(
"thresholds")),
458 applySelectionsToAllCrystals_(iConfig.getParameter<
bool>(
"applySelectionsToAllCrystals"))
469 endcapGeometrySet_=
false;
470 if (endcapGeometry) {
472 endcapGeometrySet_=
true;
477 if (applySelectionsToAllCrystals_)
return pass(hit);
478 else return fullReadOut
or pass(hit);
513 if (not endcapGeometrySet_) {
516 if(detId.subdetId() !=
EcalBarrel)
return true;
522 return (hit.
energy() > thresholds_[firstEBRing]);
526 if (hit.
energy() > thresholds_[iring])
return true;
543 thresholdCleaning_(iConfig.getParameter<double>(
"cleaningThreshold")),
544 timingCleaning_(iConfig.getParameter<
bool>(
"timingCleaning")),
545 topologicalCleaning_(iConfig.getParameter<
bool>(
"topologicalCleaning")),
546 skipTTRecoveredHits_(iConfig.getParameter<
bool>(
"skipTTRecoveredHits"))
559 if (timingCleaning_ and rh.
energy() > thresholdCleaning_ and
566 if (topologicalCleaning_ and (
611 thresholdCleaning_(0.),
612 topologicalCleaning_(
false)
618 thresholdCleaning_(iConfig.getParameter<double>(
"cleaningThreshold")),
619 topologicalCleaning_(iConfig.getParameter<
bool>(
"topologicalCleaning"))
628 if ( rh.
energy() < thresholdCleaning_ ) {
633 if ( topologicalCleaning_ and
688 calibFactor_(iConfig.getParameter<double>(
"calibFactor"))
700 if (
abs(detId.ieta())==29)
714 if (detId.ietaAbs()==29)
730 recHitEnergy_keV_(
false),
733 recHitEnergyMultiplier_(0.)
739 recHitEnergy_keV_(iConfig.getParameter<
bool>(
"recHitEnergyIs_keV")),
740 threshold_(iConfig.getParameter<double>(
"thresholdInMIPs")),
741 mip_(iConfig.getParameter<double>(
"mipValueInkeV")),
742 recHitEnergyMultiplier_(iConfig.getParameter<double>(
"recHitEnergyMultiplier"))
751 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
756 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
762 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
767 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
773 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
778 const double newE = ( recHitEnergy_keV_ ?
779 1.0e-6*rh.
energy()*recHitEnergyMultiplier_ :
780 rh.
energy()*recHitEnergyMultiplier_ );
790 const double hitValueInMIPs = 1e6*hit.
energy()/mip_;
799 geometryInstance_(
""),
800 recHitEnergy_keV_(0.),
803 recHitEnergyMultiplier_(0.) {
808 geometryInstance_(iConfig.getParameter<
std::
string>(
"geometryInstance")),
809 recHitEnergy_keV_(iConfig.getParameter<
bool>(
"recHitEnergyIs_keV")),
810 threshold_(iConfig.getParameter<double>(
"thresholdInMIPs")),
811 mip_(iConfig.getParameter<double>(
"mipValueInkeV")),
812 recHitEnergyMultiplier_(iConfig.getParameter<double>(
"recHitEnergyMultiplier")) {
823 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
828 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
834 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
839 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
845 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
850 const double newE = ( recHitEnergy_keV_ ?
851 1.0e-6*rh.
energy()*recHitEnergyMultiplier_ :
852 rh.
energy()*recHitEnergyMultiplier_ );
854 const float mult = (
float) ddd_->waferTypeL(wafer);
856 return pass(hit, mult);
866 const double hitValueInMIPs = 1e6*hit.
energy()/(mult*mip_);
881 PFRecHitQTestBase(iConfig), thresholdSNR_(iConfig.getParameter<double>(
"thresholdSNR"))
892 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
898 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
905 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
911 <<
"PFRecHitQTestHGCalThresholdSNR only works for HGCAL!";
918 <<
"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 applySelectionsToAllCrystals_
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_
bool getMergePositionFlag() const
bool pass(const reco::PFRecHit &hit)
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 CaloTower &rh, bool &clean) override
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 HFRecHit &rh, bool &clean) override
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 HBHERecHit &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
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean) 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)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup) override
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 HGCRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
PFRecHitQTestHOThreshold(const edm::ParameterSet &iConfig)
PFRecHitQTestDBThreshold()
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()
bool applySelectionsToAllCrystals_
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
const edm::EventSetup * eventSetup_
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
uint32_t getValue() 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)
PFRecHitQTestDBThreshold(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