CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HLTHcalTowerFilter Class Reference
Inheritance diagram for HLTHcalTowerFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTHcalTowerFilter (const edm::ParameterSet &)
 
 ~HLTHcalTowerFilter () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 

Private Attributes

edm::InputTag inputTag_
 
edm::EDGetTokenT< CaloTowerCollectioninputToken_
 
int max_N_HB_
 
int max_N_HE_
 
int max_N_HF_
 
double min_E_HB_
 
double min_E_HE_
 
double min_E_HF_
 
int min_N_HF_
 
int min_N_HFM_
 
int min_N_HFP_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

This class is an EDFilter implementing the following requirement: the number of caltowers with hadEnergy>E_Thr less than N_Thr for HB/HE/HF sperately.

Author
Li Wenbo (PKU)

Definition at line 20 of file HLTHcalTowerFilter.cc.

Constructor & Destructor Documentation

HLTHcalTowerFilter::HLTHcalTowerFilter ( const edm::ParameterSet config)
explicit

Definition at line 54 of file HLTHcalTowerFilter.cc.

References edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), inputTag_, inputToken_, min_N_HF_, min_N_HFM_, min_N_HFP_, and ~HLTHcalTowerFilter().

54  : HLTFilter(config),
55  inputTag_ (config.getParameter<edm::InputTag>("inputTag")),
56  min_E_HB_ (config.getParameter<double> ("MinE_HB")),
57  min_E_HE_ (config.getParameter<double> ("MinE_HE")),
58  min_E_HF_ (config.getParameter<double> ("MinE_HF")),
59  max_N_HB_ (config.getParameter<int> ("MaxN_HB")),
60  max_N_HE_ (config.getParameter<int> ("MaxN_HE")),
61  max_N_HF_ (config.getParameter<int> ("MaxN_HF")),
62  min_N_HF_ (-1),
63  min_N_HFM_ (-1),
64  min_N_HFP_ (-1)
65 {
66 
67  if (config.existsAs<int>("MinN_HF")){
68  min_N_HF_=config.getParameter<int>("MinN_HF");
69  }
70  if (config.existsAs<int>("MinN_HFM")){
71  min_N_HFM_=config.getParameter<int>("MinN_HFM");
72  }
73  if (config.existsAs<int>("MinN_HFP")){
74  min_N_HFP_=config.getParameter<int>("MinN_HFP");
75  }
76 
77  inputToken_ = consumes<CaloTowerCollection>(inputTag_);
78 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
edm::EDGetTokenT< CaloTowerCollection > inputToken_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLTHcalTowerFilter::~HLTHcalTowerFilter ( )
overridedefault

Referenced by HLTHcalTowerFilter().

Member Function Documentation

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

Definition at line 83 of file HLTHcalTowerFilter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLTFilter::makeHLTFilterDescription().

83  {
86  desc.add<edm::InputTag>("inputTag",edm::InputTag("hltTowerMakerForHcal"));
87  desc.add<double>("MinE_HB",1.5);
88  desc.add<double>("MinE_HE",2.5);
89  desc.add<double>("MinE_HF",9.0);
90  desc.add<int>("MaxN_HB",2);
91  desc.add<int>("MaxN_HE",2);
92  desc.add<int>("MaxN_HF",8);
93  desc.add<int>("MinN_HF",-1);
94  desc.add<int>("MinN_HFM",-1);
95  desc.add<int>("MinN_HFP",-1);
96  descriptions.add("hltHcalTowerFilter",desc);
97 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTHcalTowerFilter::hltFilter ( edm::Event event,
const edm::EventSetup setup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overrideprivatevirtual

Implements HLTFilter.

Definition at line 105 of file HLTHcalTowerFilter.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), DEFINE_FWK_MODULE, PVValHelper::eta, mps_fire::i, inputTag_, inputToken_, max_N_HB_, max_N_HE_, min_E_HB_, min_E_HE_, min_E_HF_, min_N_HF_, min_N_HFM_, min_N_HFP_, and HLTFilter::saveTags().

106 {
107  using namespace std;
108  using namespace edm;
109  using namespace reco;
110  using namespace trigger;
111 
112  // The filter object
113  if (saveTags()) filterproduct.addCollectionTag(inputTag_);
114 
115  // get hold of collection of objects
117  event.getByToken(inputToken_, towers);
118 
119  // look at all objects, check cuts and add to filter object
120  int n_HB = 0;
121  int n_HE = 0;
122  int n_HF = 0;
123  int n_HFM = 0;
124  int n_HFP = 0;
125  double abseta = 0.0;
126  double eta = 0.0;
127  for(auto const & i : *towers)
128  {
129  eta = i.eta();
130  abseta = std::abs(eta);
131  if(abseta<1.305)
132  {
133  if(i.hadEnergy() >= min_E_HB_)
134  {
135  n_HB++;
136  //edm::Ref<CaloTowerCollection> ref(towers, std::distance(towers->begin(), i));
137  //filterproduct.addObject(TriggerJet, ref);
138  }
139  }
140  else if(abseta>=1.305 && abseta<3)
141  {
142  if(i.hadEnergy() >= min_E_HE_)
143  {
144  n_HE++;
145  //edm::Ref<CaloTowerCollection> ref(towers, std::distance(towers->begin(), i));
146  //filterproduct.addObject(TriggerJet, ref);
147  }
148  }
149  else
150  {
151  if(i.hadEnergy() >= min_E_HF_)
152  {
153  n_HF++;
154  //edm::Ref<CaloTowerCollection> ref(towers, std::distance(towers->begin(), i));
155  //filterproduct.addObject(TriggerJet, ref);
156  if(eta >= 3) { n_HFP++; } else { n_HFM++; }
157  }
158  }
159  }
160 
161  // filter decision
162  bool accept(n_HB<max_N_HB_ && n_HE<max_N_HE_ && n_HF<max_N_HF_ && n_HFP>=min_N_HFP_ && n_HFM>=min_N_HFM_ && n_HF>=min_N_HF_);
163 
164  return accept;
165 }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
edm::EDGetTokenT< CaloTowerCollection > inputToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
fixed size matrix
bool saveTags() const
Definition: HLTFilter.h:45
HLT enums.

Member Data Documentation

edm::InputTag HLTHcalTowerFilter::inputTag_
private

Definition at line 31 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter(), and HLTHcalTowerFilter().

edm::EDGetTokenT<CaloTowerCollection> HLTHcalTowerFilter::inputToken_
private

Definition at line 30 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter(), and HLTHcalTowerFilter().

int HLTHcalTowerFilter::max_N_HB_
private

Definition at line 35 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter().

int HLTHcalTowerFilter::max_N_HE_
private

Definition at line 36 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter().

int HLTHcalTowerFilter::max_N_HF_
private

Definition at line 37 of file HLTHcalTowerFilter.cc.

double HLTHcalTowerFilter::min_E_HB_
private

Definition at line 32 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter().

double HLTHcalTowerFilter::min_E_HE_
private

Definition at line 33 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter().

double HLTHcalTowerFilter::min_E_HF_
private

Definition at line 34 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter().

int HLTHcalTowerFilter::min_N_HF_
private

Definition at line 38 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter(), and HLTHcalTowerFilter().

int HLTHcalTowerFilter::min_N_HFM_
private

Definition at line 39 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter(), and HLTHcalTowerFilter().

int HLTHcalTowerFilter::min_N_HFP_
private

Definition at line 40 of file HLTHcalTowerFilter.cc.

Referenced by hltFilter(), and HLTHcalTowerFilter().