CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
HLTHcalMETNoiseCleaner Class Reference

#include <HLTHcalMETNoiseCleaner.h>

Inheritance diagram for HLTHcalMETNoiseCleaner:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  noisedatacomp
 

Public Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 
 HLTHcalMETNoiseCleaner (const edm::ParameterSet &)
 
 ~HLTHcalMETNoiseCleaner () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Types

typedef std::set< CommonHcalNoiseRBXData, noisedatacompnoisedataset_t
 

Private Member Functions

reco::CaloMET BuildCaloMet (float sumet, float pt, float phi)
 

Private Attributes

bool accept2NoiseRBXEvents_
 
edm::InputTag CaloMetCollectionTag_
 
double CaloMetCut_
 
edm::InputTag HcalNoiseRBXCollectionTag_
 
edm::EDGetTokenT< reco::CaloMETCollectionm_theCaloMetToken
 
edm::EDGetTokenT< reco::HcalNoiseRBXCollectionm_theHcalNoiseToken
 
double maxHighEHitTime_
 
int maxNumRBXs_
 
double maxRatio_
 
double maxRBXEMF_
 
double minHighEHitTime_
 
double minHighHitE_
 
int minHPDHits_
 
int minHPDNoOtherHits_
 
double minLowHitE_
 
double minR45HitE_
 
double minRatio_
 
double minRBXEnergy_
 
int minRBXHits_
 
double minRecHitE_
 
int minZeros_
 
bool needEMFCoincidence_
 
int numRBXsToConsider_
 
int severity_
 
double TS4TS5EnergyThreshold_
 
std::vector< std::pair< double, double > > TS4TS5LowerCut_
 
std::vector< std::pair< double, double > > TS4TS5UpperCut_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: HLT filter module for cleaning HCal Noise from MET or MHT

Implementation: <Notes on="" implementation>="">

Definition at line 20 of file HLTHcalMETNoiseCleaner.h.

Member Typedef Documentation

◆ noisedataset_t

Definition at line 65 of file HLTHcalMETNoiseCleaner.h.

Constructor & Destructor Documentation

◆ HLTHcalMETNoiseCleaner()

HLTHcalMETNoiseCleaner::HLTHcalMETNoiseCleaner ( const edm::ParameterSet iConfig)
explicit

Definition at line 47 of file HLTHcalMETNoiseCleaner.cc.

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_(5.0),
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");
75 
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]));
78  sort(TS4TS5UpperCut_.begin(), TS4TS5UpperCut_.end());
79 
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]));
82  sort(TS4TS5LowerCut_.begin(), TS4TS5LowerCut_.end());
83 
84  m_theCaloMetToken = consumes<reco::CaloMETCollection>(CaloMetCollectionTag_);
85  m_theHcalNoiseToken = consumes<reco::HcalNoiseRBXCollection>(HcalNoiseRBXCollectionTag_);
86 
87  if (iConfig.existsAs<double>("minR45HitE"))
88  minR45HitE_ = iConfig.getParameter<double>("minR45HitE");
89 
90  produces<reco::CaloMETCollection>();
91 }

References CaloMetCollectionTag_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), HcalNoiseRBXCollectionTag_, mps_fire::i, createfilelist::int, m_theCaloMetToken, m_theHcalNoiseToken, minR45HitE_, TS4TS5LowerCut_, and TS4TS5UpperCut_.

◆ ~HLTHcalMETNoiseCleaner()

HLTHcalMETNoiseCleaner::~HLTHcalMETNoiseCleaner ( )
overridedefault

Member Function Documentation

◆ BuildCaloMet()

reco::CaloMET HLTHcalMETNoiseCleaner::BuildCaloMet ( float  sumet,
float  pt,
float  phi 
)
private

Definition at line 342 of file HLTHcalMETNoiseCleaner.cc.

342  {
343  // Instantiate the container to hold the calorimeter specific information
344 
345  typedef math::XYZPoint Point;
347 
349  // Initialise the container
350  specific.MaxEtInEmTowers = 0.0; // Maximum energy in EM towers
351  specific.MaxEtInHadTowers = 0.0; // Maximum energy in HCAL towers
352  specific.HadEtInHO = 0.0; // Hadronic energy fraction in HO
353  specific.HadEtInHB = 0.0; // Hadronic energy in HB
354  specific.HadEtInHF = 0.0; // Hadronic energy in HF
355  specific.HadEtInHE = 0.0; // Hadronic energy in HE
356  specific.EmEtInEB = 0.0; // Em energy in EB
357  specific.EmEtInEE = 0.0; // Em energy in EE
358  specific.EmEtInHF = 0.0; // Em energy in HF
359  specific.EtFractionHadronic = 0.0; // Hadronic energy fraction
360  specific.EtFractionEm = 0.0; // Em energy fraction
361  specific.CaloSETInpHF = 0.0; // CaloSET in HF+
362  specific.CaloSETInmHF = 0.0; // CaloSET in HF-
363  specific.CaloMETInpHF = 0.0; // CaloMET in HF+
364  specific.CaloMETInmHF = 0.0; // CaloMET in HF-
365  specific.CaloMETPhiInpHF = 0.0; // CaloMET-phi in HF+
366  specific.CaloMETPhiInmHF = 0.0; // CaloMET-phi in HF-
367  specific.METSignificance = 0.0;
368 
369  TLorentzVector p4TL;
370  p4TL.SetPtEtaPhiM(pt, 0., phi, 0.);
371  const LorentzVector p4(p4TL.X(), p4TL.Y(), 0, p4TL.T());
372  const Point vtx(0.0, 0.0, 0.0);
373  reco::CaloMET specificmet(specific, sumet, p4, vtx);
374  return specificmet;
375 }

References p4, phi, DiDispStaMuonMonitor_cfi::pt, timingPdfMaker::specific, and extraflags_cff::vtx.

Referenced by filter().

◆ fillDescriptions()

void HLTHcalMETNoiseCleaner::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 95 of file HLTHcalMETNoiseCleaner.cc.

95  {
97  desc.add<edm::InputTag>("HcalNoiseRBXCollection", edm::InputTag("hltHcalNoiseInfoProducer"));
98  desc.add<edm::InputTag>("CaloMetCollection", edm::InputTag("hltMet"));
99  desc.add<double>("CaloMetCut", 0.0);
100  desc.add<int>("severity", 1);
101  desc.add<int>("maxNumRBXs", 2);
102  desc.add<int>("numRBXsToConsider", 2);
103  desc.add<bool>("accept2NoiseRBXEvents", true);
104  desc.add<bool>("needEMFCoincidence", true);
105  desc.add<double>("minRBXEnergy", 50.0);
106  desc.add<double>("minRatio", -999.);
107  desc.add<double>("maxRatio", 999.);
108  desc.add<int>("minHPDHits", 17);
109  desc.add<int>("minRBXHits", 999);
110  desc.add<int>("minHPDNoOtherHits", 10);
111  desc.add<int>("minZeros", 10);
112  desc.add<double>("minHighEHitTime", -9999.0);
113  desc.add<double>("maxHighEHitTime", 9999.0);
114  desc.add<double>("maxRBXEMF", 0.02);
115  desc.add<double>("minRecHitE", 1.5);
116  desc.add<double>("minLowHitE", 10.0);
117  desc.add<double>("minHighHitE", 25.0);
118  desc.add<double>("minR45HitE", 5.0);
119  desc.add<double>("TS4TS5EnergyThreshold", 50.0);
120 
121  double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000};
122  double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
123  double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
124  double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
125  std::vector<double> TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray + 5);
126  std::vector<double> TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray + 5);
127  std::vector<double> TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray + 7);
128  std::vector<double> TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray + 7);
129 
130  desc.add<std::vector<double> >("TS4TS5UpperThreshold", TS4TS5UpperThreshold);
131  desc.add<std::vector<double> >("TS4TS5UpperCut", TS4TS5UpperCut);
132  desc.add<std::vector<double> >("TS4TS5LowerThreshold", TS4TS5LowerThreshold);
133  desc.add<std::vector<double> >("TS4TS5LowerCut", TS4TS5LowerCut);
134  descriptions.add("hltHcalMETNoiseCleaner", desc);
135 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, HLT_FULL_cff::TS4TS5LowerCut, HLT_FULL_cff::TS4TS5LowerThreshold, HLT_FULL_cff::TS4TS5UpperCut, and HLT_FULL_cff::TS4TS5UpperThreshold.

◆ filter()

bool HLTHcalMETNoiseCleaner::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 141 of file HLTHcalMETNoiseCleaner.cc.

141  {
142  using namespace reco;
143 
144  //output collection
145  std::unique_ptr<CaloMETCollection> CleanedMET(new CaloMETCollection);
146 
147  //get the calo MET / MHT
149  iEvent.getByToken(m_theCaloMetToken, met_h);
150 
151  if (not met_h.isValid() or met_h->empty() or
152  met_h->front().pt() < 0) { //No Valid MET, don't do anything and accept the event
153  return true; // we shouldn't get here, but lets not crash
154  }
155 
156  reco::CaloMET inCaloMet = met_h->front();
157 
158  // in this case, do not filter anything
159  if (severity_ == 0) {
160  CleanedMET->push_back(inCaloMet);
161  iEvent.put(std::move(CleanedMET));
162  return true;
163  }
164 
165  // get the RBXs produced by RecoMET/METProducers/HcalNoiseInfoProducer
167  iEvent.getByToken(m_theHcalNoiseToken, rbxs_h);
168  if (!rbxs_h.isValid()) {
169  edm::LogError("DataNotFound") << "HLTHcalMETNoiseCleaner: Could not find HcalNoiseRBXCollection product named "
170  << HcalNoiseRBXCollectionTag_ << "." << std::endl;
171  CleanedMET->push_back(inCaloMet);
172  iEvent.put(std::move(CleanedMET));
173  return true; // no valid RBXs
174  }
175 
176  // create a sorted set of the RBXs, ordered by energy
178  for (auto const& rbx : *rbxs_h) {
180  minRecHitE_,
181  minLowHitE_,
182  minHighHitE_,
186  minR45HitE_);
187  data.insert(d);
188  }
189  //if 0 RBXs are in the list, just accept
190  if (data.empty()) {
191  CleanedMET->push_back(inCaloMet);
192  iEvent.put(std::move(CleanedMET));
193  return true;
194  }
195  // data is now sorted by RBX energy
196  // only consider top N=numRBXsToConsider_ energy RBXs
197  int cntr = 0;
198  int nNoise = 0;
199 
200  TVector3 metVec;
201  metVec.SetPtEtaPhi(met_h->front().pt(), 0, met_h->front().phi());
202 
203  TVector3 noiseHPDVector(0, 0, 0);
204  TVector3 secondHPDVector(0, 0, 0);
205  for (auto it = data.begin(); it != data.end() && cntr < numRBXsToConsider_; it++, cntr++) {
206  bool isNoise = false;
207  bool passFilter = true;
208  bool passEMF = true;
209  if (it->energy() > minRBXEnergy_) {
210  if (it->validRatio() && it->ratio() < minRatio_)
211  passFilter = false;
212  else if (it->validRatio() && it->ratio() > maxRatio_)
213  passFilter = false;
214  else if (it->numHPDHits() >= minHPDHits_)
215  passFilter = false;
216  else if (it->numRBXHits() >= minRBXHits_)
217  passFilter = false;
218  else if (it->numHPDNoOtherHits() >= minHPDNoOtherHits_)
219  passFilter = false;
220  else if (it->numZeros() >= minZeros_)
221  passFilter = false;
222  else if (it->minHighEHitTime() < minHighEHitTime_)
223  passFilter = false;
224  else if (it->maxHighEHitTime() > maxHighEHitTime_)
225  passFilter = false;
226  else if (!it->PassTS4TS5())
227  passFilter = false;
228 
229  if (it->RBXEMF() < maxRBXEMF_) {
230  passEMF = false;
231  }
232  }
233 
234  if ((needEMFCoincidence_ && !passEMF && !passFilter) || (!needEMFCoincidence_ && !passFilter)) { // check for noise
235  LogDebug("") << "HLTHcalMETNoiseCleaner debug: Found a noisy RBX: "
236  << "energy=" << it->energy() << "; "
237  << "ratio=" << it->ratio() << "; "
238  << "# RBX hits=" << it->numRBXHits() << "; "
239  << "# HPD hits=" << it->numHPDHits() << "; "
240  << "# Zeros=" << it->numZeros() << "; "
241  << "min time=" << it->minHighEHitTime() << "; "
242  << "max time=" << it->maxHighEHitTime() << "; "
243  << "passTS4TS5=" << it->PassTS4TS5() << "; "
244  << "RBX EMF=" << it->RBXEMF() << std::endl;
245  nNoise++;
246  isNoise = true;
247  } // OK, checked for noise
248 
249  //------------First Noisy RBX-----------------------
250  if (isNoise && nNoise == 1) {
251  edm::RefVector<CaloTowerCollection> noiseTowers = it->rbxTowers();
253  // get the energy vector for this RBX from the calotowers
254  for (noiseTowersIt = noiseTowers.begin(); noiseTowersIt != noiseTowers.end(); noiseTowersIt++) {
255  TVector3 towerVec;
256  towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(), (*noiseTowersIt)->eta(), (*noiseTowersIt)->phi());
257  noiseHPDVector += towerVec; // add this tower to the vector for the RBX
258  }
259  if (noiseHPDVector.Mag() > 0)
260  noiseHPDVector.SetPtEtaPhi(noiseHPDVector.Pt(), 0, noiseHPDVector.Phi()); // make the noise transverse
261  else
262  noiseHPDVector.SetPtEtaPhi(0, 0, 0);
263  }
264  //-----------FOUND a SECOND NOISY RBX-------------------
265  if (isNoise && cntr > 0) {
266  CleanedMET->push_back(inCaloMet);
267  iEvent.put(std::move(CleanedMET));
268  return accept2NoiseRBXEvents_; // don't try to clean these for the moment, just keep or throw away
269  }
270  //----------LEADING RBX is NOT NOISY--------------------
271  if (!isNoise && cntr == 0) {
272  CleanedMET->push_back(inCaloMet);
273  iEvent.put(std::move(CleanedMET));
274  return true; // don't reject the event if the leading RBX isn't noise
275  }
276  //-----------SUBLEADING RBX is NOT NOISY: STORE INFO----
277  if (!isNoise && nNoise > 0) { //second RBX isn't noisy (and first one was), so clean
278  edm::RefVector<CaloTowerCollection> noiseTowers = it->rbxTowers();
280  for (noiseTowersIt = noiseTowers.begin(); noiseTowersIt != noiseTowers.end(); noiseTowersIt++) {
281  TVector3 towerVec;
282  towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(), (*noiseTowersIt)->eta(), (*noiseTowersIt)->phi());
283  secondHPDVector += towerVec; // add this tower to the vector for the RBX
284  }
285  if (secondHPDVector.Mag() > 0)
286  secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(), 0, secondHPDVector.Phi()); // make the second transverse
287  else
288  secondHPDVector.SetPtEtaPhi(0, 0, 0);
289  break;
290  }
291  } // end RBX loop
292 
293  if (noiseHPDVector.Mag() == 0) {
294  CleanedMET->push_back(inCaloMet);
295  iEvent.put(std::move(CleanedMET));
296  return true; // don't reject the event if the leading RBX isn't noise
297  }
298 
299  //********************************************************************************
300  //The Event gets here only if it had exactly 1 noisy RBX in the lead position
301  //********************************************************************************
302 
303  float METsumet = met_h->front().energy();
304 
305  metVec += noiseHPDVector;
306 
307  float ZMETsumet = METsumet - noiseHPDVector.Mag();
308  float ZMETpt = metVec.Pt();
309  float ZMETphi = metVec.Phi();
310 
311  //put the second RBX vector in the eta phi position of the leading RBX vector
312 
313  float SMETsumet = 0;
314  float SMETpt = 0;
315  float SMETphi = 0;
316  if (secondHPDVector.Mag() > 0.) {
317  secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(), noiseHPDVector.Eta(), noiseHPDVector.Phi());
318  metVec -= secondHPDVector;
319  SMETsumet = METsumet - noiseHPDVector.Mag();
320  SMETpt = metVec.Pt();
321  SMETphi = metVec.Phi();
322  }
323  //Get the maximum MET:
324  float CorMetSumEt, CorMetPt, CorMetPhi;
325  if (ZMETpt > SMETpt) {
326  CorMetSumEt = ZMETsumet;
327  CorMetPt = ZMETpt;
328  CorMetPhi = ZMETphi;
329  } else {
330  CorMetSumEt = SMETsumet;
331  CorMetPt = SMETpt;
332  CorMetPhi = SMETphi;
333  }
334 
335  reco::CaloMET corMet = BuildCaloMet(CorMetSumEt, CorMetPt, CorMetPhi);
336  CleanedMET->push_back(corMet);
337  iEvent.put(std::move(CleanedMET));
338 
339  return (corMet.pt() > CaloMetCut_);
340 }

References accept2NoiseRBXEvents_, edm::RefVector< C, T, F >::begin(), BuildCaloMet(), CaloMetCut_, ztail::d, data, edm::RefVector< C, T, F >::end(), HcalNoiseRBXCollectionTag_, iEvent, edm::HandleBase::isValid(), LogDebug, m_theCaloMetToken, m_theHcalNoiseToken, maxHighEHitTime_, maxRatio_, maxRBXEMF_, minHighEHitTime_, minHighHitE_, minHPDHits_, minHPDNoOtherHits_, minLowHitE_, minR45HitE_, minRatio_, minRBXEnergy_, minRBXHits_, minRecHitE_, minZeros_, eostools::move(), needEMFCoincidence_, numRBXsToConsider_, or, reco::LeafCandidate::pt(), severity_, TS4TS5EnergyThreshold_, TS4TS5LowerCut_, and TS4TS5UpperCut_.

Member Data Documentation

◆ accept2NoiseRBXEvents_

bool HLTHcalMETNoiseCleaner::accept2NoiseRBXEvents_
private

Definition at line 37 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ CaloMetCollectionTag_

edm::InputTag HLTHcalMETNoiseCleaner::CaloMetCollectionTag_
private

Definition at line 32 of file HLTHcalMETNoiseCleaner.h.

Referenced by HLTHcalMETNoiseCleaner().

◆ CaloMetCut_

double HLTHcalMETNoiseCleaner::CaloMetCut_
private

Definition at line 33 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ HcalNoiseRBXCollectionTag_

edm::InputTag HLTHcalMETNoiseCleaner::HcalNoiseRBXCollectionTag_
private

Definition at line 31 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter(), and HLTHcalMETNoiseCleaner().

◆ m_theCaloMetToken

edm::EDGetTokenT<reco::CaloMETCollection> HLTHcalMETNoiseCleaner::m_theCaloMetToken
private

Definition at line 28 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter(), and HLTHcalMETNoiseCleaner().

◆ m_theHcalNoiseToken

edm::EDGetTokenT<reco::HcalNoiseRBXCollection> HLTHcalMETNoiseCleaner::m_theHcalNoiseToken
private

Definition at line 29 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter(), and HLTHcalMETNoiseCleaner().

◆ maxHighEHitTime_

double HLTHcalMETNoiseCleaner::maxHighEHitTime_
private

Definition at line 47 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ maxNumRBXs_

int HLTHcalMETNoiseCleaner::maxNumRBXs_
private

Definition at line 35 of file HLTHcalMETNoiseCleaner.h.

◆ maxRatio_

double HLTHcalMETNoiseCleaner::maxRatio_
private

Definition at line 41 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ maxRBXEMF_

double HLTHcalMETNoiseCleaner::maxRBXEMF_
private

Definition at line 48 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minHighEHitTime_

double HLTHcalMETNoiseCleaner::minHighEHitTime_
private

Definition at line 46 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minHighHitE_

double HLTHcalMETNoiseCleaner::minHighHitE_
private

Definition at line 51 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minHPDHits_

int HLTHcalMETNoiseCleaner::minHPDHits_
private

Definition at line 42 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minHPDNoOtherHits_

int HLTHcalMETNoiseCleaner::minHPDNoOtherHits_
private

Definition at line 44 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minLowHitE_

double HLTHcalMETNoiseCleaner::minLowHitE_
private

Definition at line 51 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minR45HitE_

double HLTHcalMETNoiseCleaner::minR45HitE_
private

Definition at line 51 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter(), and HLTHcalMETNoiseCleaner().

◆ minRatio_

double HLTHcalMETNoiseCleaner::minRatio_
private

Definition at line 40 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minRBXEnergy_

double HLTHcalMETNoiseCleaner::minRBXEnergy_
private

Definition at line 39 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minRBXHits_

int HLTHcalMETNoiseCleaner::minRBXHits_
private

Definition at line 43 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minRecHitE_

double HLTHcalMETNoiseCleaner::minRecHitE_
private

Definition at line 51 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ minZeros_

int HLTHcalMETNoiseCleaner::minZeros_
private

Definition at line 45 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ needEMFCoincidence_

bool HLTHcalMETNoiseCleaner::needEMFCoincidence_
private

Definition at line 38 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ numRBXsToConsider_

int HLTHcalMETNoiseCleaner::numRBXsToConsider_
private

Definition at line 36 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ severity_

int HLTHcalMETNoiseCleaner::severity_
private

Definition at line 34 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ TS4TS5EnergyThreshold_

double HLTHcalMETNoiseCleaner::TS4TS5EnergyThreshold_
private

Definition at line 53 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter().

◆ TS4TS5LowerCut_

std::vector<std::pair<double, double> > HLTHcalMETNoiseCleaner::TS4TS5LowerCut_
private

Definition at line 55 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter(), and HLTHcalMETNoiseCleaner().

◆ TS4TS5UpperCut_

std::vector<std::pair<double, double> > HLTHcalMETNoiseCleaner::TS4TS5UpperCut_
private

Definition at line 54 of file HLTHcalMETNoiseCleaner.h.

Referenced by filter(), and HLTHcalMETNoiseCleaner().

HLTHcalMETNoiseCleaner::maxRatio_
double maxRatio_
Definition: HLTHcalMETNoiseCleaner.h:41
HLTHcalMETNoiseCleaner::HcalNoiseRBXCollectionTag_
edm::InputTag HcalNoiseRBXCollectionTag_
Definition: HLTHcalMETNoiseCleaner.h:31
HLTHcalMETNoiseCleaner::noisedataset_t
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
Definition: HLTHcalMETNoiseCleaner.h:65
HLTHcalMETNoiseCleaner::CaloMetCollectionTag_
edm::InputTag CaloMetCollectionTag_
Definition: HLTHcalMETNoiseCleaner.h:32
HLTHcalMETNoiseCleaner::numRBXsToConsider_
int numRBXsToConsider_
Definition: HLTHcalMETNoiseCleaner.h:36
HLTHcalMETNoiseCleaner::minR45HitE_
double minR45HitE_
Definition: HLTHcalMETNoiseCleaner.h:51
mps_fire.i
i
Definition: mps_fire.py:428
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HLTHcalMETNoiseCleaner::minHighEHitTime_
double minHighEHitTime_
Definition: HLTHcalMETNoiseCleaner.h:46
HLTHcalMETNoiseCleaner::minRecHitE_
double minRecHitE_
Definition: HLTHcalMETNoiseCleaner.h:51
HLTHcalMETNoiseCleaner::needEMFCoincidence_
bool needEMFCoincidence_
Definition: HLTHcalMETNoiseCleaner.h:38
edm::RefVector::begin
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
HLTHcalMETNoiseCleaner::minHPDNoOtherHits_
int minHPDNoOtherHits_
Definition: HLTHcalMETNoiseCleaner.h:44
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::RefVector
Definition: EDProductfwd.h:27
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
HLTHcalMETNoiseCleaner::severity_
int severity_
Definition: HLTHcalMETNoiseCleaner.h:34
edm::Handle
Definition: AssociativeIterator.h:50
HLTHcalMETNoiseCleaner::TS4TS5EnergyThreshold_
double TS4TS5EnergyThreshold_
Definition: HLTHcalMETNoiseCleaner.h:53
reco::CaloMET
Definition: CaloMET.h:21
Point
math::XYZPoint Point
Definition: TrackerDpgAnalysis.cc:106
CommonHcalNoiseRBXData
Definition: HcalNoiseAlgo.h:11
edm::RefVector::end
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
HLTHcalMETNoiseCleaner::minRBXEnergy_
double minRBXEnergy_
Definition: HLTHcalMETNoiseCleaner.h:39
HLTHcalMETNoiseCleaner::maxHighEHitTime_
double maxHighEHitTime_
Definition: HLTHcalMETNoiseCleaner.h:47
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
timingPdfMaker.specific
specific
Definition: timingPdfMaker.py:78
HLT_FULL_cff.TS4TS5LowerThreshold
TS4TS5LowerThreshold
Definition: HLT_FULL_cff.py:8420
HLTHcalMETNoiseCleaner::minRatio_
double minRatio_
Definition: HLTHcalMETNoiseCleaner.h:40
HLTHcalMETNoiseCleaner::minLowHitE_
double minLowHitE_
Definition: HLTHcalMETNoiseCleaner.h:51
HLT_FULL_cff.TS4TS5UpperThreshold
TS4TS5UpperThreshold
Definition: HLT_FULL_cff.py:8423
HLTHcalMETNoiseCleaner::accept2NoiseRBXEvents_
bool accept2NoiseRBXEvents_
Definition: HLTHcalMETNoiseCleaner.h:37
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
HLTHcalMETNoiseCleaner::BuildCaloMet
reco::CaloMET BuildCaloMet(float sumet, float pt, float phi)
Definition: HLTHcalMETNoiseCleaner.cc:342
HLTHcalMETNoiseCleaner::TS4TS5UpperCut_
std::vector< std::pair< double, double > > TS4TS5UpperCut_
Definition: HLTHcalMETNoiseCleaner.h:54
HLTHcalMETNoiseCleaner::maxRBXEMF_
double maxRBXEMF_
Definition: HLTHcalMETNoiseCleaner.h:48
HLTHcalMETNoiseCleaner::m_theCaloMetToken
edm::EDGetTokenT< reco::CaloMETCollection > m_theCaloMetToken
Definition: HLTHcalMETNoiseCleaner.h:28
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTHcalMETNoiseCleaner::minHPDHits_
int minHPDHits_
Definition: HLTHcalMETNoiseCleaner.h:42
p4
double p4[4]
Definition: TauolaWrapper.h:92
HLTHcalMETNoiseCleaner::CaloMetCut_
double CaloMetCut_
Definition: HLTHcalMETNoiseCleaner.h:33
HLTHcalMETNoiseCleaner::TS4TS5LowerCut_
std::vector< std::pair< double, double > > TS4TS5LowerCut_
Definition: HLTHcalMETNoiseCleaner.h:55
HLTHcalMETNoiseCleaner::minZeros_
int minZeros_
Definition: HLTHcalMETNoiseCleaner.h:45
SpecificCaloMETData
Definition: SpecificCaloMETData.h:22
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
DDAxes::phi
HLTHcalMETNoiseCleaner::minRBXHits_
int minRBXHits_
Definition: HLTHcalMETNoiseCleaner.h:43
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
HLTHcalMETNoiseCleaner::minHighHitE_
double minHighHitE_
Definition: HLTHcalMETNoiseCleaner.h:51
edm::RefVectorIterator
Definition: EDProductfwd.h:33
HLT_FULL_cff.TS4TS5UpperCut
TS4TS5UpperCut
Definition: HLT_FULL_cff.py:8442
or
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
Definition: Activities.doc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ztail.d
d
Definition: ztail.py:151
CaloMETCollection
Collection of Calo MET.
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HLTHcalMETNoiseCleaner::maxNumRBXs_
int maxNumRBXs_
Definition: HLTHcalMETNoiseCleaner.h:35
HLT_FULL_cff.TS4TS5LowerCut
TS4TS5LowerCut
Definition: HLT_FULL_cff.py:8426
edm::InputTag
Definition: InputTag.h:15
HLTHcalMETNoiseCleaner::m_theHcalNoiseToken
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
Definition: HLTHcalMETNoiseCleaner.h:29