CMS 3D CMS Logo

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

#include <HLTPixlMBFilt.h>

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

Public Member Functions

virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTPixlMBFilt (const edm::ParameterSet &)
 
 ~HLTPixlMBFilt ()
 
- 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
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilterBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

double min_Pt_
 
float min_sep_
 
unsigned int min_trks_
 
edm::InputTag pixlTag_
 
edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
pixlToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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

See header file for documentation

Author
Mika Huhtinen

Definition at line 28 of file HLTPixlMBFilt.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file HLTPixlMBFilt.cc.

References edm::InputTag::encode(), LogDebug, min_Pt_, min_sep_, min_trks_, pixlTag_, and pixlToken_.

31  : HLTFilter(iConfig),
32  pixlTag_ (iConfig.getParameter<edm::InputTag>("pixlTag")),
33  min_Pt_ (iConfig.getParameter<double>("MinPt")),
34  min_trks_ (iConfig.getParameter<unsigned int>("MinTrks")),
35  min_sep_ (iConfig.getParameter<double>("MinSep"))
36 
37 {
38  pixlToken_ = consumes<reco::RecoChargedCandidateCollection>(pixlTag_);
39  LogDebug("") << "MinPt cut " << min_Pt_ << "pixl: " << pixlTag_.encode();
40  LogDebug("") << "Requesting : " << min_trks_ << " tracks from same vertex ";
41  LogDebug("") << "Requesting tracks from same vertex eta-phi separation by " << min_sep_;
42 }
#define LogDebug(id)
T getParameter(std::string const &) const
edm::InputTag pixlTag_
Definition: HLTPixlMBFilt.h:37
std::string encode() const
Definition: InputTag.cc:164
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > pixlToken_
Definition: HLTPixlMBFilt.h:38
unsigned int min_trks_
Definition: HLTPixlMBFilt.h:41
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
HLTPixlMBFilt::~HLTPixlMBFilt ( )

Definition at line 44 of file HLTPixlMBFilt.cc.

45 {
46 }

Member Function Documentation

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

Definition at line 49 of file HLTPixlMBFilt.cc.

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

49  {
52  desc.add<edm::InputTag>("pixlTag",edm::InputTag("hltPixelCands"));
53  desc.add<double>("MinPt",0.);
54  desc.add<unsigned int>("MinTrks",2);
55  desc.add<double>("MinSep",1.);
56  descriptions.add("hltPixlMBFilt",desc);
57 }
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 HLTPixlMBFilt::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 64 of file HLTPixlMBFilt.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByToken(), relval_steps::k, LogDebug, min_sep_, min_trks_, pixlTag_, pixlToken_, dt_dqm_sourceclient_common_cff::reco, HLTFilter::saveTags(), mathSSE::sqrt(), testEve_cfg::tracks, and trigger::TriggerTrack.

65 {
66  using namespace std;
67  using namespace edm;
68  using namespace reco;
69  using namespace trigger;
70 
71  // All HLT filters must create and fill an HLT filter object,
72  // recording any reconstructed physics objects satisfying (or not)
73  // this HLT filter, and place it in the Event.
74  if (saveTags()) {
75  filterproduct.addCollectionTag(pixlTag_);
76  }
77 
78  // Specific filter code
79 
80  // get hold of products from Event
81 
84 
85  // pixel tracks
86  int npixl_tot = 0;
87  vector<double> etastore;
88  vector<double> phistore;
89  vector<int> itstore;
90  bool accept;
91  RecoChargedCandidateCollection::const_iterator apixl(tracks->begin());
92  RecoChargedCandidateCollection::const_iterator epixl(tracks->end());
93  RecoChargedCandidateCollection::const_iterator ipixl, jpixl;
94  unsigned int nsame_vtx=0;
95  int itrk = -1;
96  if (tracks->size() >= min_trks_) {
97  for (ipixl=apixl; ipixl!=epixl; ipixl++){
98  itrk++;
99  const double& ztrk1 = ipixl->vz();
100  const double& etatrk1 = ipixl->momentum().eta();
101  const double& phitrk1 = ipixl->momentum().phi();
102  nsame_vtx=1;
103  etastore.clear();
104  phistore.clear();
105  itstore.clear();
106  etastore.push_back(etatrk1);
107  phistore.push_back(phitrk1);
108  itstore.push_back(itrk);
109  if (fabs(ztrk1) < 15.0) {
110  // check this track against all others to see if others start from same point
111  int jtrk=-1;
112  for (jpixl=apixl; jpixl!=epixl; jpixl++) {
113  jtrk++;
114  if (jpixl==ipixl) continue;
115  const double& ztrk2 = jpixl->vz();
116  const double& etatrk2 = jpixl->momentum().eta();
117  const double& phitrk2 = jpixl->momentum().phi();
118  double eta_dist=etatrk2-etatrk1;
119  double phi_dist=phitrk2-phitrk1;
120  double etaphi_dist=sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
121  if (fabs(ztrk2-ztrk1) < 1.0 && etaphi_dist > min_sep_) {
122  if (min_trks_ <= 2 || itstore.size() <= 1) {
123  etastore.push_back(etatrk2);
124  phistore.push_back(phitrk2);
125  itstore.push_back(jtrk);
126  nsame_vtx++;
127  } else {
128  // check also separation to already found 'second' tracks
129  LogDebug("") << "HLTPixlMBFilt: with mintrks=2 we should not be here...";
130  bool isok = true;
131  for (unsigned int k=1; k < itstore.size(); k++) {
132  eta_dist=etatrk2-etastore.at(k);
133  phi_dist=phitrk2-phistore.at(k);
134  etaphi_dist=sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
135  if (etaphi_dist < min_sep_) {
136  isok=false;
137  break;
138  }
139  }
140  if (isok) {
141  etastore.push_back(etatrk2);
142  phistore.push_back(phitrk2);
143  itstore.push_back(jtrk);
144  nsame_vtx++;
145  }
146  }
147  }
148  if (nsame_vtx >= min_trks_) break;
149  }
150  }
151  npixl_tot++;
152 
153  if (nsame_vtx >= min_trks_) break;
154  }
155 
156  // final filter decision:
157  // request at least min_trks_ tracks compatible with vertex-region
158  accept = (nsame_vtx >= min_trks_ ) ;
159 
160  } else {
161  accept = false;
162  }
163 
164  // At this point we have the indices of the accepted tracks stored in itstore
165  // we now move them to the filterproduct
166 
167  if (accept) {
168  for (unsigned int ipos=0; ipos < itstore.size(); ipos++) {
169  int iaddr=itstore.at(ipos);
171  }
172  }
173 
174  LogDebug("") << "Number of pixel-track objects accepted:"
175  << " " << npixl_tot;
176 
177  // return with final filter decision
178  return accept;
179 
180 }
#define LogDebug(id)
edm::InputTag pixlTag_
Definition: HLTPixlMBFilt.h:37
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:25
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref&lt;C&gt;)
T sqrt(T t)
Definition: SSEVec.h:48
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > pixlToken_
Definition: HLTPixlMBFilt.h:38
unsigned int min_trks_
Definition: HLTPixlMBFilt.h:41
tuple tracks
Definition: testEve_cfg.py:39
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
bool saveTags() const
Definition: HLTFilter.h:45

Member Data Documentation

double HLTPixlMBFilt::min_Pt_
private

Definition at line 40 of file HLTPixlMBFilt.h.

Referenced by HLTPixlMBFilt().

float HLTPixlMBFilt::min_sep_
private

Definition at line 42 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().

unsigned int HLTPixlMBFilt::min_trks_
private

Definition at line 41 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().

edm::InputTag HLTPixlMBFilt::pixlTag_
private

Definition at line 37 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTPixlMBFilt::pixlToken_
private

Definition at line 38 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().