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 
6 
16 
18 
19 public:
20 
22 
23  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
24 
25  theVertexTag = regionPSet.getParameter<edm::InputTag>("vertexSrc");
26  theVertex = (theVertexTag.label().length()>1);
27  theInputTrkTag = regionPSet.getParameter<edm::InputTag>("TrkSrc");
28  useVtxTks = regionPSet.getParameter<bool>("UseVtxTks");
29 
30  if (theVertex) theVertexToken = iC.consumes<reco::VertexCollection>(theVertexTag);
31  if (!(theVertex && useVtxTks)) theInputTrkToken= iC.consumes<reco::TrackCollection>(theInputTrkTag);
32 
33  thePtMin = regionPSet.getParameter<double>("ptMin");
34  theOriginRadius = regionPSet.getParameter<double>("originRadius");
35  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
36  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
37 
38  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
39  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
40  if (regionPSet.exists("searchOpt")){
41  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
42  }
43  else{
44  m_searchOpt = false;
45  }
47  if (regionPSet.exists("measurementTrackerName")){
48  // FIXME: when next time altering the configuration of this
49  // class, please change the types of the following parameters:
50  // - howToUseMeasurementTracker to at least int32 or to a string
51  // corresponding to the UseMeasurementTracker enumeration
52  // - measurementTrackerName to InputTag
53  if (regionPSet.exists("howToUseMeasurementTracker")){
55  }
57  theMeasurementTrackerToken = iC.consumes<MeasurementTrackerEvent>(regionPSet.getParameter<std::string>("measurementTrackerName"));
58  }
59  }
60  }
61 
63 
64  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev,
65  const edm::EventSetup& es) const {
66 
67  std::vector<TrackingRegion* > result;
68 
73  measurementTracker = hmte.product();
74  }
75 
76  // optional constraint for vertex
77  // get highest Pt pixel vertex (if existing)
78  double deltaZVertex = theOriginHalfLength;
79  double originz = theOriginZPos;
80  if (theVertex) {
82  ev.getByToken(theVertexToken,vertices);
83  const reco::VertexCollection vertCollection = *(vertices.product());
84  reco::VertexCollection::const_iterator ci = vertCollection.begin();
85  if (vertCollection.size()>0) {
86  originz = ci->z();
87  } else {
88  originz = theOriginZPos;
89  deltaZVertex = 15.;
90  }
91  if (useVtxTks) {
92  for(ci=vertCollection.begin();ci!=vertCollection.end();ci++)
93  for (reco::Vertex::trackRef_iterator trackIt = ci->tracks_begin();trackIt != ci->tracks_end();trackIt++){
94  reco::TrackRef iTrk = (*trackIt).castTo<reco::TrackRef>() ;
95  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
96  result.push_back(
97  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(ci->z())),
100  true,
102  m_searchOpt) );
103  }
104  return result;
105  }
106  }
107 
110  for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
111  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
112  result.push_back(
113  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(originz)),
116  true,
117  measurementTracker,
118  m_searchOpt) );
119  }
120  return result;
121  }
122 
123 private:
124 
126  bool theVertex;
130 
131  bool useVtxTks;
132 
133  double thePtMin;
137 
138  double theDeltaEta;
139  double theDeltaPhi;
143 };
144 
145 #endif
146 
T getParameter(std::string const &) const
tuple cfg
Definition: looper.py:259
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< reco::TrackCollection > theInputTrkToken
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool ev
edm::EDGetTokenT< reco::VertexCollection > theVertexToken
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const
tuple result
Definition: query.py:137
static UseMeasurementTracker doubleToUseMeasurementTracker(double value)
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_howToUseMeasurementTracker
bool isUninitialized() const
Definition: EDGetToken.h:71
L3MumuTrackingRegion(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)