CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
HitPixelLayersTPSelector Class Reference

#include <HitPixelLayersTPSelector.h>

Public Types

typedef TrackingParticleCollection collection
 
typedef container::const_iterator const_iterator
 
typedef TrackingParticleRefVector container
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
bool goodHitPattern (const std::vector< bool > &hitpattern)
 
 HitPixelLayersTPSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
std::vector< bool > pixelHitPattern (const TrackingParticleRef &simTrack, const TrackerTopology *tTopo)
 
void select (const edm::Handle< collection > &TPCH, const edm::Event &iEvent, const edm::EventSetup &iSetup)
 
size_t size () const
 

Public Attributes

bool chargedOnly_
 
double lip_
 
double maxRapidity_
 
int minHit_
 
double minRapidity_
 
std::vector< int > pdgId_
 
bool primaryOnly_
 
double ptMin_
 
container selected_
 
bool signalOnly_
 
double tip_
 
bool tpStatusBased_
 
bool tripletSeedOnly_
 

Detailed Description

Selector to select only tracking particles that leave hits in three pixel layers Additional selection done on pt, rapidity, impact parameter, min hits, pdg id, etc.

Inspired by CommonTools.RecoAlgos.TrackingParticleSelector.h

Definition at line 21 of file HitPixelLayersTPSelector.h.

Member Typedef Documentation

Definition at line 26 of file HitPixelLayersTPSelector.h.

Definition at line 33 of file HitPixelLayersTPSelector.h.

Definition at line 30 of file HitPixelLayersTPSelector.h.

Constructor & Destructor Documentation

HitPixelLayersTPSelector::HitPixelLayersTPSelector ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 36 of file HitPixelLayersTPSelector.h.

36  :
37  tripletSeedOnly_(iConfig.getParameter<bool>("tripletSeedOnly")),
38  ptMin_(iConfig.getParameter<double>("ptMin")),
39  minRapidity_(iConfig.getParameter<double>("minRapidity")),
40  maxRapidity_(iConfig.getParameter<double>("maxRapidity")),
41  tip_(iConfig.getParameter<double>("tip")),
42  lip_(iConfig.getParameter<double>("lip")),
43  minHit_(iConfig.getParameter<int>("minHit")),
44  signalOnly_(iConfig.getParameter<bool>("signalOnly")),
45  chargedOnly_(iConfig.getParameter<bool>("chargedOnly")),
46  primaryOnly_(iConfig.getParameter<bool>("primaryOnly")),
47  tpStatusBased_(iConfig.getParameter<bool>("tpStatusBased")),
48  pdgId_(iConfig.getParameter< std::vector<int> >("pdgId"))
49  {};
T getParameter(std::string const &) const

Member Function Documentation

const_iterator HitPixelLayersTPSelector::begin ( void  ) const
inline

Definition at line 118 of file HitPixelLayersTPSelector.h.

References edm::RefVector< C, T, F >::begin(), and selected_.

119  {
120  return selected_.begin();
121  }
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
const_iterator HitPixelLayersTPSelector::end ( void  ) const
inline

Definition at line 124 of file HitPixelLayersTPSelector.h.

References edm::RefVector< C, T, F >::end(), and selected_.

125  {
126  return selected_.end();
127  }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
bool HitPixelLayersTPSelector::goodHitPattern ( const std::vector< bool > &  hitpattern)
inline

Definition at line 107 of file HitPixelLayersTPSelector.h.

Referenced by select().

108  {
109  if( (hitpattern[0] && hitpattern[1] && hitpattern[2]) ||
110  (hitpattern[0] && hitpattern[1] && hitpattern[3]) ||
111  (hitpattern[0] && hitpattern[3] && hitpattern[4]) )
112  return true;
113  else
114  return false;
115  }
std::vector<bool> HitPixelLayersTPSelector::pixelHitPattern ( const TrackingParticleRef simTrack,
const TrackerTopology tTopo 
)
inline

Definition at line 98 of file HitPixelLayersTPSelector.h.

Referenced by select().

99  {
100  std::vector<bool> hitpattern(5,false); // PXB 0,1,2 PXF 0,1
101  // This currently will always return false, since we can no loger use the sim hits to check for triplets. This would need to be fixed if we want to enable this feature, but it's not being used at the moment, since tripletSeedOnly is always set to False - Matt Nguyen, 24/7/2013
102 
103  return hitpattern;
104  }
void HitPixelLayersTPSelector::select ( const edm::Handle< collection > &  TPCH,
const edm::Event iEvent,
const edm::EventSetup iSetup 
)
inline

Definition at line 53 of file HitPixelLayersTPSelector.h.

References chargedOnly_, edm::RefVector< C, T, F >::clear(), edm::EventSetup::get(), goodHitPattern(), mps_fire::i, lip_, maxRapidity_, minHit_, minRapidity_, pdgId_, pixelHitPattern(), primaryOnly_, edm::Handle< T >::product(), edm::ESHandle< T >::product(), ptMin_, edm::RefVector< C, T, F >::push_back(), selected_, signalOnly_, mathSSE::sqrt(), tip_, tpStatusBased_, and tripletSeedOnly_.

54  {
55  selected_.clear();
56  //Retrieve tracker topology from geometry
58  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
59  const TrackerTopology *tTopo=tTopoHand.product();
60 
61 
62  const collection & tpc = *(TPCH.product());
63 
64  for (TrackingParticleCollection::size_type i=0; i<tpc.size(); i++)
65  {
66  TrackingParticleRef tpr(TPCH, i);
67 
68  // quickly reject if it is from pile-up
69  if (signalOnly_ && !(tpr->eventId().bunchCrossing()==0 && tpr->eventId().event()==0) ) continue;
70  if (chargedOnly_ && tpr->charge()==0) continue; //select only if charge!=0
71  if (tpStatusBased_ && primaryOnly_ && tpr->status()!=1 ) continue; // TP status based sel primary
72  if ((!tpStatusBased_) && primaryOnly_ && tpr->parentVertex()->nSourceTracks()!=0 ) continue; // vertex based sel for primary
73 
74  // loop over specified PID values
75  bool testId = false;
76  unsigned int idSize = pdgId_.size();
77  if (idSize==0) testId = true;
78  else for (unsigned int it=0;it!=idSize;++it){
79  if (tpr->pdgId()==pdgId_[it]) testId = true;
80  }
81 
82  // selection criteria
83  if ( tpr->numberOfTrackerLayers() >= minHit_ &&
84  sqrt(tpr->momentum().perp2()) >= ptMin_ &&
85  tpr->momentum().eta() >= minRapidity_ && tpr->momentum().eta() <= maxRapidity_ &&
86  sqrt(tpr->vertex().perp2()) <= tip_ &&
87  fabs(tpr->vertex().z()) <= lip_ &&
88  testId)
89  {
90  if (tripletSeedOnly_ && !goodHitPattern(pixelHitPattern(tpr,tTopo)) ) continue; //findable triplet seed
91  selected_.push_back(tpr);
92  }
93 
94  }
95  }
std::vector< bool > pixelHitPattern(const TrackingParticleRef &simTrack, const TrackerTopology *tTopo)
uint16_t size_type
TrackingParticleCollection collection
T sqrt(T t)
Definition: SSEVec.h:18
T const * product() const
Definition: Handle.h:74
void clear()
Clear the vector.
Definition: RefVector.h:147
bool goodHitPattern(const std::vector< bool > &hitpattern)
T get() const
Definition: EventSetup.h:71
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
T const * product() const
Definition: ESHandle.h:86
size_t HitPixelLayersTPSelector::size ( void  ) const
inline

Definition at line 130 of file HitPixelLayersTPSelector.h.

References selected_, and edm::RefVector< C, T, F >::size().

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

131  {
132  return selected_.size();
133  }
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107

Member Data Documentation

bool HitPixelLayersTPSelector::chargedOnly_

Definition at line 146 of file HitPixelLayersTPSelector.h.

Referenced by select().

double HitPixelLayersTPSelector::lip_

Definition at line 143 of file HitPixelLayersTPSelector.h.

Referenced by select().

double HitPixelLayersTPSelector::maxRapidity_

Definition at line 141 of file HitPixelLayersTPSelector.h.

Referenced by select().

int HitPixelLayersTPSelector::minHit_

Definition at line 144 of file HitPixelLayersTPSelector.h.

Referenced by select().

double HitPixelLayersTPSelector::minRapidity_

Definition at line 140 of file HitPixelLayersTPSelector.h.

Referenced by select().

std::vector<int> HitPixelLayersTPSelector::pdgId_

Definition at line 149 of file HitPixelLayersTPSelector.h.

Referenced by select().

bool HitPixelLayersTPSelector::primaryOnly_

Definition at line 147 of file HitPixelLayersTPSelector.h.

Referenced by select().

double HitPixelLayersTPSelector::ptMin_

Definition at line 139 of file HitPixelLayersTPSelector.h.

Referenced by select().

container HitPixelLayersTPSelector::selected_

Definition at line 137 of file HitPixelLayersTPSelector.h.

Referenced by begin(), end(), select(), and size().

bool HitPixelLayersTPSelector::signalOnly_

Definition at line 145 of file HitPixelLayersTPSelector.h.

Referenced by select().

double HitPixelLayersTPSelector::tip_

Definition at line 142 of file HitPixelLayersTPSelector.h.

Referenced by select().

bool HitPixelLayersTPSelector::tpStatusBased_

Definition at line 148 of file HitPixelLayersTPSelector.h.

Referenced by select().

bool HitPixelLayersTPSelector::tripletSeedOnly_

Definition at line 138 of file HitPixelLayersTPSelector.h.

Referenced by select().