46 #include <TLorentzVector.h> 54 : HcalNoiseRBXCollectionTag_(iConfig.getParameter<
edm::InputTag>(
"HcalNoiseRBXCollection")),
55 TowerCollectionTag_(iConfig.getParameter<
edm::InputTag>(
"CaloTowerCollection")),
56 severity_(iConfig.getParameter<
int> (
"severity")),
57 maxNumRBXs_(iConfig.getParameter<
int>(
"maxNumRBXs")),
58 numRBXsToConsider_(iConfig.getParameter<
int>(
"numRBXsToConsider")),
59 needEMFCoincidence_(iConfig.getParameter<
bool>(
"needEMFCoincidence")),
60 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
61 minRatio_(iConfig.getParameter<double>(
"minRatio")),
62 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
63 minHPDHits_(iConfig.getParameter<
int>(
"minHPDHits")),
64 minRBXHits_(iConfig.getParameter<
int>(
"minRBXHits")),
65 minHPDNoOtherHits_(iConfig.getParameter<
int>(
"minHPDNoOtherHits")),
66 minZeros_(iConfig.getParameter<
int>(
"minZeros")),
67 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
68 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
69 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
70 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
71 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
72 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
74 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold"))
78 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
79 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
80 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
81 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
83 for(
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
84 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[i]));
87 for(
int i = 0; i < (
int)TS4TS5LowerThresholdTemp.size() && i < (
int)TS4TS5LowerCutTemp.size(); i++)
88 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
94 if(iConfig.
existsAs<
double>(
"minR45HitE"))
97 produces<CaloTowerCollection>();
108 desc.
add<
double>(
"maxTowerNoiseEnergyFraction",0.5);
109 desc.
add<
int>(
"severity",1);
110 desc.
add<
int>(
"maxNumRBXs",2);
111 desc.
add<
int>(
"numRBXsToConsider",2);
112 desc.
add<
bool>(
"needEMFCoincidence",
true);
113 desc.
add<
double>(
"minRBXEnergy",50.0);
114 desc.
add<
double>(
"minRatio",-999.);
115 desc.
add<
double>(
"maxRatio",999.);
116 desc.
add<
int>(
"minHPDHits",17);
117 desc.
add<
int>(
"minRBXHits",999);
118 desc.
add<
int>(
"minHPDNoOtherHits",10);
119 desc.
add<
int>(
"minZeros",10);
120 desc.
add<
double>(
"minHighEHitTime",-9999.0);
121 desc.
add<
double>(
"maxHighEHitTime",9999.0);
122 desc.
add<
double>(
"maxRBXEMF",0.02);
123 desc.
add<
double>(
"minRecHitE",1.5);
124 desc.
add<
double>(
"minLowHitE",10.0);
125 desc.
add<
double>(
"minHighHitE",25.0);
126 desc.
add<
double>(
"minR45HitE",5.0);
127 desc.
add<
double>(
"TS4TS5EnergyThreshold",50.0);
129 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000 };
130 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
131 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
132 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
133 double hltRBXRecHitR45CutsArray[8] = { 0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 1.0, -1.0 };
134 std::vector<double>
TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray+5);
135 std::vector<double>
TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray+5);
136 std::vector<double>
TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray+7);
137 std::vector<double>
TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray+7);
138 std::vector<double> hltRBXRecHitR45Cuts(hltRBXRecHitR45CutsArray, hltRBXRecHitR45CutsArray+8);
144 desc.
add<std::vector<double> >(
"hltRBXRecHitR45Cuts", hltRBXRecHitR45Cuts);
145 descriptions.
add(
"hltHcalTowerNoiseCleanerWithrechit",desc);
154 using namespace reco;
165 std::set<unsigned int> noisyTowers;
168 edm::LogError(
"HLTHcalTowerNoiseCleanerWithrechit") <<
"Input Tower Collection is not Valid";
177 edm::LogWarning(
"HLTHcalTowerNoiseCleanerWithrechit") <<
"Could not find HcalNoiseRBXCollection product named " 184 for(
auto const & rbx : *rbxs_h) {
193 for(
auto const & it : data) {
196 bool passRechitr45 =
true;
197 int r45Count = it.r45Count();
198 double r45Fraction = it.r45Fraction();
199 double r45EnergyFraction = it.r45EnergyFraction();
202 if (Value > 0) passRechitr45=
false;
205 bool passFilter=
true;
208 if(it.validRatio() && it.ratio()<
minRatio_) passFilter=
false;
209 else if(it.validRatio() && it.ratio()>
maxRatio_) passFilter=
false;
210 else if(it.numHPDHits()>=
minHPDHits_) passFilter=
false;
211 else if(it.numRBXHits()>=
minRBXHits_) passFilter=
false;
213 else if(it.numZeros()>=
minZeros_) passFilter=
false;
216 else if (passRechitr45==
false) passFilter=
false;
224 LogDebug(
"") <<
"HLTHcalTowerNoiseCleanerWithrechit debug: Found a noisy RBX: " 225 <<
"energy=" << it.energy() <<
"; " 226 <<
"ratio=" << it.ratio() <<
"; " 227 <<
"# RBX hits=" << it.numRBXHits() <<
"; " 228 <<
"# HPD hits=" << it.numHPDHits() <<
"; " 229 <<
"# Zeros=" << it.numZeros() <<
"; " 230 <<
"min time=" << it.minHighEHitTime() <<
"; " 231 <<
"max time=" << it.maxHighEHitTime() <<
"; " 232 <<
"RBX EMF=" << it.RBXEMF()
238 for( noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++){
241 noisyTowers.insert( caloTowerTopology->
denseIndex(
id) );
251 for(inTowersIt = tower_h->
begin(); inTowersIt != tower_h->
end(); inTowersIt++){
255 if(noisyTowers.find( caloTowerTopology->
denseIndex(
id) ) == noisyTowers.end()){
256 OutputTowers->push_back(*inTowersIt);
std::vector< double > hltMinRBXRechitR45Cuts_
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< CaloTowerCollection > m_theCaloTowerCollectionToken
std::vector< CaloTower >::const_iterator const_iterator
HLTHcalTowerNoiseCleanerWithrechit(const edm::ParameterSet &)
std::vector< std::pair< double, double > > TS4TS5UpperCut_
const_iterator end() const
Termination of iteration.
ProductID id() const
Accessor for product ID.
const_iterator begin() const
Initialize an iterator over the RefVector.
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
reco::JetExtendedAssociation::JetExtendedData Value
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::SortedCollection< CaloTower > CaloTowerCollection
double TS4TS5EnergyThreshold_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const_iterator end() const
uint32_t denseIndex(const DetId &id) const
CaloTowerDetId id() const
edm::InputTag TowerCollectionTag_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
char data[epos_bytes_allocation]
edm::InputTag HcalNoiseRBXCollectionTag_
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
std::vector< std::pair< double, double > > TS4TS5LowerCut_
~HLTHcalTowerNoiseCleanerWithrechit() override
void produce(edm::Event &, const edm::EventSetup &) override
const_iterator begin() const