CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTPMDocaFilter Class Reference

#include <HLTPMDocaFilter.h>

Inheritance diagram for HLTPMDocaFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTPMDocaFilter (const edm::ParameterSet &)
 
 ~HLTPMDocaFilter () 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 Attributes

edm::InputTag candTag_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefscandToken_
 
double docaDiffPerpCutHigh_
 
double docaDiffPerpCutLow_
 
int nZcandcut_
 

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

Original Author: Jeremy Werner Institution: Princeton University, USA * Contact: Jerem.nosp@m.y.We.nosp@m.rner@.nosp@m.cern.nosp@m..ch Date: February 21, 2007

Original Author: Jeremy Werner Institution: Princeton University, USA Contact: Jerem.nosp@m.y.We.nosp@m.rner@.nosp@m.cern.nosp@m..ch Date: February 21, 2007

Definition at line 25 of file HLTPMDocaFilter.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file HLTPMDocaFilter.cc.

References candTag_, candToken_, docaDiffPerpCutHigh_, docaDiffPerpCutLow_, edm::ParameterSet::getParameter(), nZcandcut_, and ~HLTPMDocaFilter().

23  : HLTFilter(iConfig)
24 {
25  candTag_ = iConfig.getParameter< edm::InputTag > ("candTag");
26  docaDiffPerpCutHigh_ = iConfig.getParameter<double> ("docaDiffPerpCutHigh");
27  docaDiffPerpCutLow_ = iConfig.getParameter<double> ("docaDiffPerpCutLow");
28  nZcandcut_ = iConfig.getParameter<int> ("nZcandcut");
29  candToken_ = consumes<trigger::TriggerFilterObjectWithRefs>(candTag_);
30 }
T getParameter(std::string const &) const
edm::InputTag candTag_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > candToken_
double docaDiffPerpCutHigh_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
double docaDiffPerpCutLow_
HLTPMDocaFilter::~HLTPMDocaFilter ( )
overridedefault

Referenced by HLTPMDocaFilter().

Member Function Documentation

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

Definition at line 35 of file HLTPMDocaFilter.cc.

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

35  {
38  desc.add<edm::InputTag>("candTag",edm::InputTag("HltZeePMMassFilter"));
39  desc.add<double>("docaDiffPerpCutHigh",0.055691);
40  desc.add<double>("docaDiffPerpCutLow",0.0);
41  desc.add<int>("nZcandcut",1);
42  descriptions.add("hltPMDocaFilter",desc);
43 }
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 HLTPMDocaFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 47 of file HLTPMDocaFilter.cc.

References accept(), trigger::TriggerRefsCollections::addObject(), candToken_, DEFINE_FWK_MODULE, docaDiffPerpCutHigh_, docaDiffPerpCutLow_, lowPtElectrons_cff::electrons, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, cuy::ii, findQualityFiles::jj, gen::n, nZcandcut_, findQualityFiles::size, mathSSE::sqrt(), and trigger::TriggerElectron.

48 {
49  using namespace std;
50  using namespace edm;
51  using namespace reco;
52  using namespace trigger;
53 
54  // Ref to Candidate object to be recorded in filter object
56 
58  iEvent.getByToken (candToken_,PrevFilterOutput);
59 
60  std::vector<edm::Ref<reco::ElectronCollection> > electrons;
61  PrevFilterOutput->getObjects(TriggerElectron, electrons);
62 
63 
64  int n = 0;
65 
66  unsigned int size = electrons.size();
67  std::vector<double> vx(size);
68  std::vector<double> vy(size);
69 
70  for (unsigned int i=0; i< size; i++) {
71  ref = electrons[i];
72  vx[i]=ref->vx();
73  vy[i]=ref->vy();
74  }
75 
76  for(unsigned int jj=0;jj<size;jj++){
77  for(unsigned int ii=jj+1;ii<size;ii++){
78  double docaDiffPerp = sqrt( (vx[jj]-vx[ii])*(vx[jj]-vx[ii])+(vy[jj]-vy[ii])*(vy[jj]-vy[ii]));
79  // std::cout<<"docaDiffPerp= "<<docaDiffPerp<<std::endl;
80  if((docaDiffPerp>=docaDiffPerpCutLow_) && (docaDiffPerp<= docaDiffPerpCutHigh_)){
81  n++;
82  ref = electrons[ii];
83  filterproduct.addObject(TriggerElectron, ref);
84  ref = electrons[jj];
85  filterproduct.addObject(TriggerElectron, ref);
86 
87  }
88  }
89  }
90 
91 
92  // filter decision
93  bool accept(n>=nZcandcut_);
94 
95  return accept;
96 }
size
Write out results.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
T sqrt(T t)
Definition: SSEVec.h:18
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > candToken_
double docaDiffPerpCutHigh_
ii
Definition: cuy.py:590
double docaDiffPerpCutLow_
fixed size matrix
HLT enums.

Member Data Documentation

edm::InputTag HLTPMDocaFilter::candTag_
private

Definition at line 34 of file HLTPMDocaFilter.h.

Referenced by HLTPMDocaFilter().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTPMDocaFilter::candToken_
private

Definition at line 35 of file HLTPMDocaFilter.h.

Referenced by hltFilter(), and HLTPMDocaFilter().

double HLTPMDocaFilter::docaDiffPerpCutHigh_
private

Definition at line 36 of file HLTPMDocaFilter.h.

Referenced by hltFilter(), and HLTPMDocaFilter().

double HLTPMDocaFilter::docaDiffPerpCutLow_
private

Definition at line 37 of file HLTPMDocaFilter.h.

Referenced by hltFilter(), and HLTPMDocaFilter().

int HLTPMDocaFilter::nZcandcut_
private

Definition at line 38 of file HLTPMDocaFilter.h.

Referenced by hltFilter(), and HLTPMDocaFilter().