1 #ifndef RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h 2 #define RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h 31 return fullReadOut ||
pass(hit);
80 thresholds_ = iConfig.
getParameter<std::vector<int> >(
"maxSeverities");
81 cleanThresholds_ = iConfig.
getParameter<std::vector<double> >(
"cleaningThresholds");
82 std::vector<std::string>
flags = iConfig.
getParameter<std::vector<std::string> >(
"flags");
83 for (
unsigned int i=0;
i<flags.size();++
i) {
84 if (flags[
i] ==
"Standard") {
86 depths_.push_back(-1);
89 else if (flags[
i] ==
"HFInTime") {
91 depths_.push_back(-1);
93 else if (flags[
i] ==
"HFDigi") {
95 depths_.push_back(-1);
98 else if (flags[
i] ==
"HFLong") {
100 depths_.push_back(1);
103 else if (flags[
i] ==
"HFShort") {
105 depths_.push_back(2);
109 flags_.push_back(-1);
110 depths_.push_back(-1);
120 theHcalTopology_ = topo.
product();
123 theHcalChStatus_ = hcalChStatus.
product();
126 hcalSevLvlComputer_ = hcalSevLvlComputerHndl.
product();
163 detid = theHcalTopology_->
idFront(detid);
167 unsigned theStatusValue = theStatus->
getValue();
169 for (
unsigned int i=0;
i<thresholds_.size();++
i) {
171 if (energy < cleanThresholds_[
i])
175 hitSeverity=hcalSevLvlComputer_->
getSeverityLevel(detid, flags,theStatusValue);
178 hitSeverity=hcalSevLvlComputer_->
getSeverityLevel(detid, flags & flags_[i],theStatusValue);
181 if (hitSeverity>thresholds_[i] && ((depths_[i]<0 || (depths_[i]==detid.
depth())))) {
203 std::vector<edm::ParameterSet> psets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"cuts");
204 for (
unsigned int i=0;
i<psets.size();++
i) {
205 depths_.push_back(psets[
i].getParameter<int>(
"depth"));
206 minTimes_.push_back(psets[
i].getParameter<double>(
"minTime"));
207 maxTimes_.push_back(psets[
i].getParameter<double>(
"maxTime"));
208 thresholds_.push_back(psets[
i].getParameter<double>(
"threshold"));
245 for (
unsigned int i=0;
i<depths_.size();++
i) {
246 if (detid.
depth() == depths_[
i]) {
247 if ((time <minTimes_[
i] || time >maxTimes_[
i] ) && energy>thresholds_[
i])
274 std::vector<edm::ParameterSet> psets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"cuts");
275 for (
unsigned int i=0;
i<psets.size();++
i) {
276 depths_.push_back(psets[
i].getParameter<int>(
"depth"));
277 thresholds_.push_back(psets[
i].getParameter<double>(
"threshold"));
312 for (
unsigned int i=0;
i<depths_.size();++
i) {
313 if (detid.
depth() == depths_[
i]) {
314 if ( energy<thresholds_[
i])
342 threshold0_ = iConfig.
getParameter<
double>(
"threshold_ring0");
343 threshold12_ = iConfig.
getParameter<
double>(
"threshold_ring12");
361 if (
abs(detid.ieta())<=4 && hit.
energy()>threshold0_)
363 if (
abs(detid.ieta())>4 && hit.
energy()>threshold12_)
399 thresholds_ = iConfig.
getParameter<std::vector<double> >(
"thresholds");
406 endcapGeometrySet_=
false;
407 if (endcapGeometry) {
409 endcapGeometrySet_=
true;
414 return fullReadOut ||
pass(hit);
444 if(!endcapGeometrySet_) {
447 if(detId.subdetId() !=
EcalBarrel)
return true;
453 return (hit.
energy() > thresholds_[firstEBRing]);
457 if ( hit.
energy() > thresholds_[iring] )
return true;
476 thresholdCleaning_ = iConfig.
getParameter<
double>(
"cleaningThreshold");
477 timingCleaning_ = iConfig.
getParameter<
bool>(
"timingCleaning");
478 topologicalCleaning_ = iConfig.
getParameter<
bool>(
"topologicalCleaning");
479 skipTTRecoveredHits_ = iConfig.
getParameter<
bool>(
"skipTTRecoveredHits");
492 if ( timingCleaning_ && rh.
energy() > thresholdCleaning_ &&
498 if ( topologicalCleaning_ &&
552 thresholdCleaning_ = iConfig.
getParameter<
double>(
"cleaningThreshold");
553 topologicalCleaning_ = iConfig.
getParameter<
bool>(
"topologicalCleaning");
561 if ( rh.
energy() < thresholdCleaning_ ) {
566 if ( topologicalCleaning_ &&
624 calibFactor_ =iConfig.
getParameter<
double>(
"calibFactor");
635 if (
abs(detId.ieta())==29)
651 if (detId.ietaAbs()==29)
674 recHitEnergy_keV_ = iConfig.
getParameter<
bool>(
"recHitEnergyIs_keV");
677 recHitEnergyMultiplier_ = iConfig.
getParameter<
double>(
"recHitEnergyMultiplier");
685 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
690 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
696 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
701 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
707 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
712 const double newE = ( recHitEnergy_keV_ ?
713 1.0e-6*rh.
energy()*recHitEnergyMultiplier_ :
714 rh.
energy()*recHitEnergyMultiplier_ );
724 const double hitValueInMIPs = 1e6*hit.
energy()/mip_;
733 geometryInstance_(
""),
734 recHitEnergy_keV_(0.),
737 recHitEnergyMultiplier_(0.) {
742 geometryInstance_(iConfig.getParameter<
std::
string>(
"geometryInstance")),
743 recHitEnergy_keV_(iConfig.getParameter<bool>(
"recHitEnergyIs_keV")),
744 threshold_(iConfig.getParameter<double>(
"thresholdInMIPs")),
745 mip_(iConfig.getParameter<double>(
"mipValueInkeV")),
746 recHitEnergyMultiplier_(iConfig.getParameter<double>(
"recHitEnergyMultiplier")) {
757 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
762 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
768 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
773 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
779 <<
"PFRecHitQTestThresholdInMIPs only works for HGCAL!";
784 const double newE = ( recHitEnergy_keV_ ?
785 1.0e-6*rh.
energy()*recHitEnergyMultiplier_ :
786 rh.
energy()*recHitEnergyMultiplier_ );
788 const float mult = (
float) ddd_->waferTypeL(wafer);
790 return pass(hit,mult);
800 const double hitValueInMIPs = 1e6*hit.
energy()/(mult*mip_);
double thresholdCleaning_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
const HcalChannelQuality * theHcalChStatus_
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
const HGCalDDDConstants * ddd_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
HcalSubdetector subdet() const
get the subdetector
std::vector< double > minTimes_
bool pass(const reco::PFRecHit &hit)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
std::vector< int > depths_
const DetId & detid() const
unsigned detId() const
rechit detId
PFRecHitQTestThreshold(const edm::ParameterSet &iConfig)
bool topologicalCleaning_
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
std::vector< int > depths_
bool skipTTRecoveredHits_
bool pass(const reco::PFRecHit &hit, const float mult)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
const HcalSeverityLevelComputer * hcalSevLvlComputer_
std::vector< double > maxTimes_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
std::vector< Variable::Flags > flags
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
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)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool test(unsigned aDETID, double energy, double time, bool &clean)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
PFRecHitQTestHCALChannel(const edm::ParameterSet &iConfig)
const std::string geometryInstance_
std::vector< double > cleanThresholds_
std::vector< double > thresholds_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
PFRecHitQTestHCALThresholdVsDepth(const edm::ParameterSet &iConfig)
const bool recHitEnergy_keV_
bool topologicalCleaning_
const HcalTopology * theHcalTopology_
PFRecHitQTestHCALChannel()
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
std::vector< double > thresholds_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(unsigned aDETID, double energy, double time, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
PFRecHitQTestHCALCalib29()
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
int depth() const
get the tower depth
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
bool checkFlag(int flag) const
check if the flag is true
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
const HGCalTopology & topology() const
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
PFRecHitQTestHCALCalib29(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
bool pass(const reco::PFRecHit &hit)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
Abs< T >::type abs(const T &t)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
float energy() const
rechit energy
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
PFRecHitQTestThresholdInThicknessNormalizedMIPs()
PFRecHitQTestHCALTimeVsDepth(const edm::ParameterSet &iConfig)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
PFRecHitQTestHOThreshold(const edm::ParameterSet &iConfig)
const HGCalDDDConstants & dddConstants() const
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
PFRecHitQTestHCALThresholdVsDepth()
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
PFRecHitQTestHOThreshold()
PFRecHitQTestThresholdInThicknessNormalizedMIPs(const edm::ParameterSet &iConfig)
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
std::vector< int > depths_
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
std::vector< int > thresholds_
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
void setEnergy(float energy)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
std::vector< double > thresholds_
PFRecHitQTestThresholdInMIPs(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
HcalDetId idFront(const HcalDetId &id) const
bool test(unsigned aDETID, double energy, int flags, bool &clean)
double thresholdCleaning_
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
uint32_t getValue() const
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool withSpecialRBXHBHE() const
PFRecHitQTestECALMultiThreshold(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool pass(const reco::PFRecHit &hit)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
PFRecHitQTestECALMultiThreshold()
T const * product() const
std::vector< int > flags_
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
PFRecHitQTestThresholdInMIPs()
bool test(reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut)
PFRecHitQTestES(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)