CMS 3D CMS Logo

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

#include <HLTPixlMBFilt.h>

Inheritance diagram for HLTPixlMBFilt:
HLTFilter edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 
 HLTPixlMBFilt (const edm::ParameterSet &)
 
 ~HLTPixlMBFilt ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module () const
 
const std::string * moduleLabel () const
 
int path () const
 
const std::string * pathName () const
 
std::pair< int, int > pmid () const
 
bool saveTags () const
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- 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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

double min_Pt_
 
float min_sep_
 
unsigned int min_trks_
 
edm::InputTag pixlTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- 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

Date:
2012/01/21 15:00:22
Revision:
1.4
Author
Mika Huhtinen

Definition at line 22 of file HLTPixlMBFilt.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file HLTPixlMBFilt.cc.

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

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

Definition at line 46 of file HLTPixlMBFilt.cc.

47 {
48 }

Member Function Documentation

bool HLTPixlMBFilt::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
virtual

Implements HLTFilter.

Definition at line 55 of file HLTPixlMBFilt.cc.

References accept(), trigger::TriggerRefsCollections::addObject(), edm::Event::getByLabel(), gen::k, LogDebug, min_sep_, min_trks_, pixlTag_, L1Trigger_dataformats::reco, mathSSE::sqrt(), testEve_cfg::tracks, and trigger::TriggerTrack.

56 {
57  using namespace std;
58  using namespace edm;
59  using namespace reco;
60  using namespace trigger;
61 
62  // All HLT filters must create and fill an HLT filter object,
63  // recording any reconstructed physics objects satisfying (or not)
64  // this HLT filter, and place it in the Event.
65 
66 
67 
68  // Specific filter code
69 
70  // get hold of products from Event
71 
73 
74  iEvent.getByLabel(pixlTag_,tracks);
75 
76  // pixel tracks
77  int npixl_tot = 0;
78  vector<double> etastore;
79  vector<double> phistore;
80  vector<int> itstore;
81  bool accept;
82  RecoChargedCandidateCollection::const_iterator apixl(tracks->begin());
83  RecoChargedCandidateCollection::const_iterator epixl(tracks->end());
84  RecoChargedCandidateCollection::const_iterator ipixl, jpixl;
85  unsigned int nsame_vtx=0;
86  int itrk = -1;
87  if (tracks->size() >= min_trks_) {
88  for (ipixl=apixl; ipixl!=epixl; ipixl++){
89  itrk++;
90  const double& ztrk1 = ipixl->vz();
91  const double& etatrk1 = ipixl->momentum().eta();
92  const double& phitrk1 = ipixl->momentum().phi();
93  nsame_vtx=1;
94  etastore.clear();
95  phistore.clear();
96  itstore.clear();
97  etastore.push_back(etatrk1);
98  phistore.push_back(phitrk1);
99  itstore.push_back(itrk);
100  if (fabs(ztrk1) < 15.0) {
101  // check this track against all others to see if others start from same point
102  int jtrk=-1;
103  for (jpixl=apixl; jpixl!=epixl; jpixl++) {
104  jtrk++;
105  if (jpixl==ipixl) continue;
106  const double& ztrk2 = jpixl->vz();
107  const double& etatrk2 = jpixl->momentum().eta();
108  const double& phitrk2 = jpixl->momentum().phi();
109  double eta_dist=etatrk2-etatrk1;
110  double phi_dist=phitrk2-phitrk1;
111  double etaphi_dist=sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
112  if (fabs(ztrk2-ztrk1) < 1.0 && etaphi_dist > min_sep_) {
113  if (min_trks_ <= 2 || itstore.size() <= 1) {
114  etastore.push_back(etatrk2);
115  phistore.push_back(phitrk2);
116  itstore.push_back(jtrk);
117  nsame_vtx++;
118  } else {
119  // check also separation to already found 'second' tracks
120  LogDebug("") << "HLTPixlMBFilt: with mintrks=2 we should not be here...";
121  bool isok = true;
122  for (unsigned int k=1; k < itstore.size(); k++) {
123  eta_dist=etatrk2-etastore.at(k);
124  phi_dist=phitrk2-phistore.at(k);
125  etaphi_dist=sqrt(eta_dist*eta_dist + phi_dist*phi_dist);
126  if (etaphi_dist < min_sep_) {
127  isok=false;
128  break;
129  }
130  }
131  if (isok) {
132  etastore.push_back(etatrk2);
133  phistore.push_back(phitrk2);
134  itstore.push_back(jtrk);
135  nsame_vtx++;
136  }
137  }
138  }
139  if (nsame_vtx >= min_trks_) break;
140  }
141  }
142  npixl_tot++;
143 
144  if (nsame_vtx >= min_trks_) break;
145  }
146 
147  // final filter decision:
148  // request at least min_trks_ tracks compatible with vertex-region
149  accept = (nsame_vtx >= min_trks_ ) ;
150 
151  } else {
152  accept = false;
153  }
154 
155  // At this point we have the indices of the accepted tracks stored in itstore
156  // we now move them to the filterproduct
157 
158  if (accept) {
159  for (unsigned int ipos=0; ipos < itstore.size(); ipos++) {
160  int iaddr=itstore.at(ipos);
162  }
163  }
164 
165  LogDebug("") << "Number of pixel-track objects accepted:"
166  << " " << npixl_tot;
167 
168  // return with final filter decision
169  return accept;
170 
171 }
#define LogDebug(id)
edm::InputTag pixlTag_
Definition: HLTPixlMBFilt.h:30
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:22
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
unsigned int min_trks_
Definition: HLTPixlMBFilt.h:33
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
int k[5][pyjets_maxn]
tuple tracks
Definition: testEve_cfg.py:39

Member Data Documentation

double HLTPixlMBFilt::min_Pt_
private

Definition at line 32 of file HLTPixlMBFilt.h.

Referenced by HLTPixlMBFilt().

float HLTPixlMBFilt::min_sep_
private

Definition at line 34 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().

unsigned int HLTPixlMBFilt::min_trks_
private

Definition at line 33 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().

edm::InputTag HLTPixlMBFilt::pixlTag_
private

Definition at line 30 of file HLTPixlMBFilt.h.

Referenced by hltFilter(), and HLTPixlMBFilt().