44 #include <TLorentzVector.h> 48 : HcalNoiseRBXCollectionTag_(iConfig.getParameter<
edm::
InputTag>(
"HcalNoiseRBXCollection")),
49 CaloMetCollectionTag_(iConfig.getParameter<
edm::
InputTag>(
"CaloMetCollection")),
50 CaloMetCut_(iConfig.getParameter<double>(
"CaloMetCut")),
51 severity_(iConfig.getParameter<
int>(
"severity")),
52 maxNumRBXs_(iConfig.getParameter<
int>(
"maxNumRBXs")),
53 numRBXsToConsider_(iConfig.getParameter<
int>(
"numRBXsToConsider")),
54 accept2NoiseRBXEvents_(iConfig.getParameter<
bool>(
"accept2NoiseRBXEvents")),
55 needEMFCoincidence_(iConfig.getParameter<
bool>(
"needEMFCoincidence")),
56 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
57 minRatio_(iConfig.getParameter<double>(
"minRatio")),
58 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
59 minHPDHits_(iConfig.getParameter<
int>(
"minHPDHits")),
60 minRBXHits_(iConfig.getParameter<
int>(
"minRBXHits")),
61 minHPDNoOtherHits_(iConfig.getParameter<
int>(
"minHPDNoOtherHits")),
62 minZeros_(iConfig.getParameter<
int>(
"minZeros")),
63 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
64 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
65 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
66 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
67 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
68 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
69 minR45HitE_(iConfig.getParameter<double>(
"minR45HitE")),
70 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold")) {
71 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
72 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
73 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
74 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
76 for (
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
77 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[
i]));
80 for (
int i = 0;
i < (
int)TS4TS5LowerThresholdTemp.size() &&
i < (
int)TS4TS5LowerCutTemp.size();
i++)
81 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[
i], TS4TS5LowerCutTemp[
i]));
87 produces<reco::CaloMETCollection>();
96 desc.add<
double>(
"CaloMetCut", 0.0);
97 desc.add<
int>(
"severity", 1);
98 desc.add<
int>(
"maxNumRBXs", 2);
99 desc.add<
int>(
"numRBXsToConsider", 2);
100 desc.add<
bool>(
"accept2NoiseRBXEvents",
true);
101 desc.add<
bool>(
"needEMFCoincidence",
true);
102 desc.add<
double>(
"minRBXEnergy", 50.0);
103 desc.add<
double>(
"minRatio", -999.);
104 desc.add<
double>(
"maxRatio", 999.);
105 desc.add<
int>(
"minHPDHits", 17);
106 desc.add<
int>(
"minRBXHits", 999);
107 desc.add<
int>(
"minHPDNoOtherHits", 10);
108 desc.add<
int>(
"minZeros", 10);
109 desc.add<
double>(
"minHighEHitTime", -9999.0);
110 desc.add<
double>(
"maxHighEHitTime", 9999.0);
111 desc.add<
double>(
"maxRBXEMF", 0.02);
112 desc.add<
double>(
"minRecHitE", 1.5);
113 desc.add<
double>(
"minLowHitE", 10.0);
114 desc.add<
double>(
"minHighHitE", 25.0);
115 desc.add<
double>(
"minR45HitE", 5.0);
116 desc.add<
double>(
"TS4TS5EnergyThreshold", 50.0);
118 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000};
119 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
120 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
121 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
122 std::vector<double>
TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray + 5);
123 std::vector<double>
TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray + 5);
124 std::vector<double>
TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray + 7);
125 std::vector<double>
TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray + 7);
131 descriptions.
add(
"hltHcalMETNoiseCleaner",
desc);
139 using namespace reco;
149 met_h->front().pt() < 0) {
157 CleanedMET->push_back(inCaloMet);
166 edm::LogError(
"DataNotFound") <<
"HLTHcalMETNoiseCleaner: Could not find HcalNoiseRBXCollection product named " 168 CleanedMET->push_back(inCaloMet);
175 for (
auto const& rbx : *rbxs_h) {
188 CleanedMET->push_back(inCaloMet);
198 metVec.SetPtEtaPhi(met_h->front().pt(), 0, met_h->front().phi());
200 TVector3 noiseHPDVector(0, 0, 0);
201 TVector3 secondHPDVector(0, 0, 0);
203 bool isNoise =
false;
204 bool passFilter =
true;
223 else if (!
it->PassTS4TS5())
232 LogDebug(
"") <<
"HLTHcalMETNoiseCleaner debug: Found a noisy RBX: " 233 <<
"energy=" <<
it->energy() <<
"; " 234 <<
"ratio=" <<
it->ratio() <<
"; " 235 <<
"# RBX hits=" <<
it->numRBXHits() <<
"; " 236 <<
"# HPD hits=" <<
it->numHPDHits() <<
"; " 237 <<
"# Zeros=" <<
it->numZeros() <<
"; " 238 <<
"min time=" <<
it->minHighEHitTime() <<
"; " 239 <<
"max time=" <<
it->maxHighEHitTime() <<
"; " 240 <<
"passTS4TS5=" <<
it->PassTS4TS5() <<
"; " 241 <<
"RBX EMF=" <<
it->RBXEMF() << std::endl;
247 if (isNoise && nNoise == 1) {
251 for (noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++) {
253 towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(), (*noiseTowersIt)->eta(), (*noiseTowersIt)->phi());
254 noiseHPDVector += towerVec;
256 if (noiseHPDVector.Mag() > 0)
257 noiseHPDVector.SetPtEtaPhi(noiseHPDVector.Pt(), 0, noiseHPDVector.Phi());
259 noiseHPDVector.SetPtEtaPhi(0, 0, 0);
262 if (isNoise && cntr > 0) {
263 CleanedMET->push_back(inCaloMet);
268 if (!isNoise && cntr == 0) {
269 CleanedMET->push_back(inCaloMet);
274 if (!isNoise && nNoise > 0) {
277 for (noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++) {
279 towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(), (*noiseTowersIt)->eta(), (*noiseTowersIt)->phi());
280 secondHPDVector += towerVec;
282 if (secondHPDVector.Mag() > 0)
283 secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(), 0, secondHPDVector.Phi());
285 secondHPDVector.SetPtEtaPhi(0, 0, 0);
290 if (noiseHPDVector.Mag() == 0) {
291 CleanedMET->push_back(inCaloMet);
300 float METsumet = met_h->front().energy();
302 metVec += noiseHPDVector;
304 float ZMETsumet = METsumet - noiseHPDVector.Mag();
305 float ZMETpt = metVec.Pt();
306 float ZMETphi = metVec.Phi();
313 if (secondHPDVector.Mag() > 0.) {
314 secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(), noiseHPDVector.Eta(), noiseHPDVector.Phi());
315 metVec -= secondHPDVector;
316 SMETsumet = METsumet - noiseHPDVector.Mag();
317 SMETpt = metVec.Pt();
318 SMETphi = metVec.Phi();
321 float CorMetSumEt, CorMetPt, CorMetPhi;
322 if (ZMETpt > SMETpt) {
323 CorMetSumEt = ZMETsumet;
327 CorMetSumEt = SMETsumet;
333 CleanedMET->push_back(corMet);
367 p4TL.SetPtEtaPhiM(
pt, 0.,
phi, 0.);
bool filter(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
T getParameter(std::string const &) const
const edm::InputTag HcalNoiseRBXCollectionTag_
const int numRBXsToConsider_
double pt() const final
transverse momentum
~HLTHcalMETNoiseCleaner() override
const int minHPDNoOtherHits_
const double minHighEHitTime_
std::vector< std::pair< double, double > > TS4TS5UpperCut_
edm::EDGetTokenT< reco::CaloMETCollection > m_theCaloMetToken
const double minRBXEnergy_
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
Log< level::Error, false > LogError
const double TS4TS5EnergyThreshold_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
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
HLTHcalMETNoiseCleaner(const edm::ParameterSet &)
math::XYZTLorentzVector LorentzVector
reco::CaloMET BuildCaloMet(float sumet, float pt, float phi) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
XYZPointD XYZPoint
point in space with cartesian internal representation
const_iterator end() const
Termination of iteration.
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double minHighHitE_
char data[epos_bytes_allocation]
Structure Point Contains parameters of Gaussian fits to DMRs.
const edm::InputTag CaloMetCollectionTag_
const bool accept2NoiseRBXEvents_
const double maxHighEHitTime_
const_iterator begin() const
Initialize an iterator over the RefVector.
const bool needEMFCoincidence_
math::PtEtaPhiELorentzVectorF LorentzVector
std::vector< std::pair< double, double > > TS4TS5LowerCut_