CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L3MumuTrackingRegion.h
Go to the documentation of this file.
1 #ifndef HLTrigger_btau_L3MumuTrackingRegion_H
2 #define HLTrigger_btau_L3MumuTrackingRegion_H
3 
13 
14 
16 
17 public:
18 
20 
21  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
22 
23  theVertexSrc = regionPSet.getParameter<std::string>("vertexSrc");
24  theInputTrkSrc = regionPSet.getParameter<edm::InputTag>("TrkSrc");
25 
26  useVtxTks = regionPSet.getParameter<bool>("UseVtxTks");
27 
28  thePtMin = regionPSet.getParameter<double>("ptMin");
29  theOriginRadius = regionPSet.getParameter<double>("originRadius");
30  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
31  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
32 
33  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
34  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
35  if (regionPSet.exists("searchOpt")){
36  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
37  }
38  else{
39  m_searchOpt = false;
40  }
43  if (regionPSet.exists("measurementTrackerName")){
44  m_measurementTracker = regionPSet.getParameter<std::string>("measurementTrackerName");
45  if (regionPSet.exists("howToUseMeasurementTracker")){
46  m_howToUseMeasurementTracker = regionPSet.getParameter<double>("howToUseMeasurementTracker");
47  }
48  }
49  }
50 
52 
53  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev,
54  const edm::EventSetup& es) const {
55 
56  std::vector<TrackingRegion* > result;
57 
58  // optional constraint for vertex
59  // get highest Pt pixel vertex (if existing)
60  double deltaZVertex = theOriginHalfLength;
61  double originz = theOriginZPos;
62  if (theVertexSrc.length()>1) {
64  ev.getByLabel(theVertexSrc,vertices);
65  const reco::VertexCollection vertCollection = *(vertices.product());
66  reco::VertexCollection::const_iterator ci = vertCollection.begin();
67  if (vertCollection.size()>0) {
68  originz = ci->z();
69  } else {
70  originz = theOriginZPos;
71  deltaZVertex = 15.;
72  }
73  if (useVtxTks) {
74 
75  for(ci=vertCollection.begin();ci!=vertCollection.end();ci++)
76  for (reco::Vertex::trackRef_iterator trackIt = ci->tracks_begin();trackIt != ci->tracks_end();trackIt++){
77  reco::TrackRef iTrk = (*trackIt).castTo<reco::TrackRef>() ;
78  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
79  result.push_back(
80  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(ci->z())),
83  true,
85  m_searchOpt) );
86  }
87  return result;
88  }
89  }
90 
92  ev.getByLabel(theInputTrkSrc, trks);
93 
94  for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
95  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
96  result.push_back(
97  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(originz)),
100  true,
102  m_searchOpt) );
103  }
104  return result;
105  }
106 
107 private:
108 
111 
112  bool useVtxTks;
113 
114  double thePtMin;
118 
119  double theDeltaEta;
120  double theDeltaPhi;
124 };
125 
126 #endif
127 
T getParameter(std::string const &) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
T const * product() const
Definition: Handle.h:74
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
L3MumuTrackingRegion(const edm::ParameterSet &cfg)