CMS 3D CMS Logo

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 public:
20  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
21 
22  theVertexTag = regionPSet.getParameter<edm::InputTag>("vertexSrc");
23  theVertex = (theVertexTag.label().length() > 1);
24  theInputTrkTag = regionPSet.getParameter<edm::InputTag>("TrkSrc");
25  useVtxTks = regionPSet.getParameter<bool>("UseVtxTks");
26 
27  if (theVertex)
29  if (!(theVertex && useVtxTks))
31 
32  thePtMin = regionPSet.getParameter<double>("ptMin");
33  theOriginRadius = regionPSet.getParameter<double>("originRadius");
34  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
35  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
36 
37  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
38  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
39  if (regionPSet.exists("searchOpt")) {
40  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
41  } else {
42  m_searchOpt = false;
43  }
45  regionPSet.getParameter<std::string>("howToUseMeasurementTracker"));
48  iC.consumes<MeasurementTrackerEvent>(regionPSet.getParameter<edm::InputTag>("measurementTrackerName"));
49  }
50  }
51 
52  ~L3MumuTrackingRegion() override {}
53 
54  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& ev,
55  const edm::EventSetup& es) const override {
56  std::vector<std::unique_ptr<TrackingRegion> > result;
57 
61  ev.getByToken(theMeasurementTrackerToken, hmte);
62  measurementTracker = hmte.product();
63  }
64 
65  // optional constraint for vertex
66  // get highest Pt pixel vertex (if existing)
67  double deltaZVertex = theOriginHalfLength;
68  double originz = theOriginZPos;
69  if (theVertex) {
71  ev.getByToken(theVertexToken, vertices);
72  const reco::VertexCollection vertCollection = *(vertices.product());
73  reco::VertexCollection::const_iterator ci = vertCollection.begin();
74  if (!vertCollection.empty()) {
75  originz = ci->z();
76  } else {
77  originz = theOriginZPos;
78  deltaZVertex = 15.;
79  }
80  if (useVtxTks) {
81  for (ci = vertCollection.begin(); ci != vertCollection.end(); ci++)
82  for (reco::Vertex::trackRef_iterator trackIt = ci->tracks_begin(); trackIt != ci->tracks_end(); trackIt++) {
83  reco::TrackRef iTrk = (*trackIt).castTo<reco::TrackRef>();
84  GlobalVector dirVector((iTrk)->px(), (iTrk)->py(), (iTrk)->pz());
85  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(dirVector,
86  GlobalPoint(0, 0, float(ci->z())),
87  thePtMin,
89  deltaZVertex,
93  true,
95  m_searchOpt));
96  }
97  return result;
98  }
99  }
100 
103  ev.getByToken(theInputTrkToken, trks);
104  for (reco::TrackCollection::const_iterator iTrk = trks->begin(); iTrk != trks->end(); iTrk++) {
105  GlobalVector dirVector((iTrk)->px(), (iTrk)->py(), (iTrk)->pz());
106  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(dirVector,
107  GlobalPoint(0, 0, float(originz)),
108  thePtMin,
110  deltaZVertex,
111  theDeltaEta,
112  theDeltaPhi,
114  true,
116  m_searchOpt));
117  }
118  return result;
119  }
120 
121 private:
123  bool theVertex;
127 
128  bool useVtxTks;
129 
130  double thePtMin;
134 
135  double theDeltaEta;
136  double theDeltaPhi;
140 };
141 
142 #endif
Vector3DBase
Definition: Vector3DBase.h:8
L3MumuTrackingRegion::theVertex
bool theVertex
Definition: L3MumuTrackingRegion.h:123
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
GlobalTrackingRegion.h
MeasurementTrackerEvent.h
L3MumuTrackingRegion::theOriginRadius
double theOriginRadius
Definition: L3MumuTrackingRegion.h:131
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
L3MumuTrackingRegion::L3MumuTrackingRegion
L3MumuTrackingRegion(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: L3MumuTrackingRegion.h:19
edm::EDGetTokenT< reco::VertexCollection >
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
L3MumuTrackingRegion::theVertexToken
edm::EDGetTokenT< reco::VertexCollection > theVertexToken
Definition: L3MumuTrackingRegion.h:124
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
L3MumuTrackingRegion::theInputTrkTag
edm::InputTag theInputTrkTag
Definition: L3MumuTrackingRegion.h:125
L3MumuTrackingRegion::theOriginZPos
double theOriginZPos
Definition: L3MumuTrackingRegion.h:133
L3MumuTrackingRegion::thePtMin
double thePtMin
Definition: L3MumuTrackingRegion.h:130
edm::Handle< MeasurementTrackerEvent >
L3MumuTrackingRegion::theOriginHalfLength
double theOriginHalfLength
Definition: L3MumuTrackingRegion.h:132
edm::Ref< TrackCollection >
TrackingRegionProducer.h
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
Track.h
L3MumuTrackingRegion::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &ev, const edm::EventSetup &es) const override
Definition: L3MumuTrackingRegion.h:54
L3MumuTrackingRegion::m_searchOpt
bool m_searchOpt
Definition: L3MumuTrackingRegion.h:139
L3MumuTrackingRegion
Definition: L3MumuTrackingRegion.h:17
L3MumuTrackingRegion::theInputTrkToken
edm::EDGetTokenT< reco::TrackCollection > theInputTrkToken
Definition: L3MumuTrackingRegion.h:126
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
L3MumuTrackingRegion::~L3MumuTrackingRegion
~L3MumuTrackingRegion() override
Definition: L3MumuTrackingRegion.h:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
L3MumuTrackingRegion::useVtxTks
bool useVtxTks
Definition: L3MumuTrackingRegion.h:128
Event.h
RectangularEtaPhiTrackingRegion.h
L3MumuTrackingRegion::theMeasurementTrackerToken
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
Definition: L3MumuTrackingRegion.h:137
L3MumuTrackingRegion::theDeltaPhi
double theDeltaPhi
Definition: L3MumuTrackingRegion.h:136
edm::EventSetup
Definition: EventSetup.h:57
RectangularEtaPhiTrackingRegion::UseMeasurementTracker
UseMeasurementTracker
Definition: RectangularEtaPhiTrackingRegion.h:27
InputTag.h
looper.cfg
cfg
Definition: looper.py:297
VertexFwd.h
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
L3MumuTrackingRegion::theVertexTag
edm::InputTag theVertexTag
Definition: L3MumuTrackingRegion.h:122
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
L3MumuTrackingRegion::m_howToUseMeasurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_howToUseMeasurementTracker
Definition: L3MumuTrackingRegion.h:138
ParameterSet.h
edm::Event
Definition: Event.h:73
L3MumuTrackingRegion::theDeltaEta
double theDeltaEta
Definition: L3MumuTrackingRegion.h:135
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
Definition: RectangularEtaPhiTrackingRegion.cc:82
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7