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  thePtMin = regionPSet.getParameter<double>("ptMin");
27  theOriginRadius = regionPSet.getParameter<double>("originRadius");
28  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
29  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
30 
31  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
32  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
33  }
34 
36 
37  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev,
38  const edm::EventSetup& es) const {
39 
40  std::vector<TrackingRegion* > result;
41 
42  // optional constraint for vertex
43  // get highest Pt pixel vertex (if existing)
44  double deltaZVertex = theOriginHalfLength;
45  double originz = theOriginZPos;
46  if (theVertexSrc.length()>1) {
48  ev.getByLabel(theVertexSrc,vertices);
49  const reco::VertexCollection vertCollection = *(vertices.product());
50  reco::VertexCollection::const_iterator ci = vertCollection.begin();
51  if (vertCollection.size()>0) {
52  originz = ci->z();
53  } else {
54  originz = theOriginZPos;
55  deltaZVertex = 15.;
56  }
57  }
58 
60  ev.getByLabel(theInputTrkSrc, trks);
61 
62  for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
63  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
64  result.push_back(
65  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(originz)),
66  thePtMin, theOriginRadius, deltaZVertex, theDeltaEta, theDeltaPhi) );
67  }
68  return result;
69  }
70 
71 private:
72 
73  std::string theVertexSrc;
75 
76  double thePtMin;
77  double theOriginRadius;
80  double theOriginZPos;
81 
82  double theDeltaEta;
83  double theDeltaPhi;
84 };
85 
86 #endif
87 
T getParameter(std::string const &) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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:355
T const * product() const
Definition: Handle.h:74
L3MumuTrackingRegion(const edm::ParameterSet &cfg)