CMS 3D CMS Logo

HITRegionalPixelSeedGenerator.h
Go to the documentation of this file.
1 #ifndef HITRegionalPixelSeedGenerator_h
2 #define HITRegionalPixelSeedGenerator_h
3 
4 //
5 // Class: HITRegionalPixelSeedGenerator
6 
25 
26 // Math
27 #include "Math/GenVector/VectorUtil.h"
28 #include "Math/GenVector/PxPyPzE4D.h"
29 
31 
34 
36 public:
38  edm::LogVerbatim("HITRegionalPixelSeedGenerator") << "Enter the HITRegionalPixelSeedGenerator";
39 
40  edm::ParameterSet regionPSet = conf_.getParameter<edm::ParameterSet>("RegionPSet");
41 
42  ptmin = regionPSet.getParameter<double>("ptMin");
43  originradius = regionPSet.getParameter<double>("originRadius");
44  halflength = regionPSet.getParameter<double>("originHalfLength");
45  etaCenter_ = regionPSet.getParameter<double>("etaCenter");
46  phiCenter_ = regionPSet.getParameter<double>("phiCenter");
47  deltaTrackEta = regionPSet.getParameter<double>("deltaEtaTrackRegion");
48  deltaTrackPhi = regionPSet.getParameter<double>("deltaPhiTrackRegion");
49  deltaL1JetEta = regionPSet.getParameter<double>("deltaEtaL1JetRegion");
50  deltaL1JetPhi = regionPSet.getParameter<double>("deltaPhiL1JetRegion");
51  usejets_ = regionPSet.getParameter<bool>("useL1Jets");
52  usetracks_ = regionPSet.getParameter<bool>("useTracks");
53  useIsoTracks_ = regionPSet.getParameter<bool>("useIsoTracks");
54  fixedReg_ = regionPSet.getParameter<bool>("fixedReg");
55 
56  if (usetracks_)
57  token_trks = iC.consumes<reco::TrackCollection>(regionPSet.getParameter<edm::InputTag>("trackSrc"));
59  token_vertex = iC.consumes<reco::VertexCollection>(regionPSet.getParameter<edm::InputTag>("vertexSrc"));
60  if (useIsoTracks_)
62  iC.consumes<trigger::TriggerFilterObjectWithRefs>(regionPSet.getParameter<edm::InputTag>("isoTrackSrc"));
63  if (usejets_)
64  token_l1jet = iC.consumes<l1extra::L1JetParticleCollection>(regionPSet.getParameter<edm::InputTag>("l1tjetSrc"));
65  }
66 
68 
69  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& e, const edm::EventSetup& es) const override {
70  std::vector<std::unique_ptr<TrackingRegion> > result;
71  float originz = 0.;
72 
73  double deltaZVertex = halflength;
74 
75  if (usetracks_) {
77  e.getByToken(token_trks, tracks);
78 
80  e.getByToken(token_vertex, vertices);
81  const reco::VertexCollection vertCollection = *(vertices.product());
82  reco::VertexCollection::const_iterator ci = vertCollection.begin();
83 
84  if (!vertCollection.empty()) {
85  originz = ci->z();
86  } else {
87  deltaZVertex = 15.;
88  }
89 
90  GlobalVector globalVector(0, 0, 1);
91  if (tracks->empty())
92  return result;
93 
94  reco::TrackCollection::const_iterator itr = tracks->begin();
95  for (; itr != tracks->end(); itr++) {
96  GlobalVector ptrVec((itr)->px(), (itr)->py(), (itr)->pz());
97  globalVector = ptrVec;
98 
99  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
100  globalVector, GlobalPoint(0, 0, originz), ptmin, originradius, deltaZVertex, deltaTrackEta, deltaTrackPhi));
101  }
102  }
103 
104  if (useIsoTracks_) {
106  e.getByToken(token_isoTrack, isotracks);
107 
108  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
109 
110  isotracks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
111 
113  e.getByToken(token_vertex, vertices);
114  const reco::VertexCollection vertCollection = *(vertices.product());
115  reco::VertexCollection::const_iterator ci = vertCollection.begin();
116 
117  if (!vertCollection.empty()) {
118  originz = ci->z();
119  } else {
120  deltaZVertex = 15.;
121  }
122 
123  GlobalVector globalVector(0, 0, 1);
124  if (isoPixTrackRefs.empty())
125  return result;
126 
127  for (uint32_t p = 0; p < isoPixTrackRefs.size(); p++) {
128  GlobalVector ptrVec((isoPixTrackRefs[p]->track())->px(),
129  (isoPixTrackRefs[p]->track())->py(),
130  (isoPixTrackRefs[p]->track())->pz());
131  globalVector = ptrVec;
132 
133  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
134  globalVector, GlobalPoint(0, 0, originz), ptmin, originradius, deltaZVertex, deltaTrackEta, deltaTrackPhi));
135  }
136  }
137 
138  if (usejets_) {
140  e.getByToken(token_l1jet, jets);
141 
143  e.getByToken(token_vertex, vertices);
144  const reco::VertexCollection vertCollection = *(vertices.product());
145  reco::VertexCollection::const_iterator ci = vertCollection.begin();
146  if (!vertCollection.empty()) {
147  originz = ci->z();
148  } else {
149  deltaZVertex = 15.;
150  }
151 
152  GlobalVector globalVector(0, 0, 1);
153  if (jets->empty())
154  return result;
155 
156  for (l1extra::L1JetParticleCollection::const_iterator iJet = jets->begin(); iJet != jets->end(); iJet++) {
157  GlobalVector jetVector(iJet->p4().x(), iJet->p4().y(), iJet->p4().z());
158  GlobalPoint vertex(0, 0, originz);
159 
160  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
161  jetVector, vertex, ptmin, originradius, deltaZVertex, deltaL1JetEta, deltaL1JetPhi));
162  }
163  }
164  if (fixedReg_) {
165  GlobalVector fixedVector(cos(phiCenter_) * sin(2 * atan(exp(-etaCenter_))),
166  sin(phiCenter_) * sin(2 * atan(exp(-etaCenter_))),
167  cos(2 * atan(exp(-etaCenter_))));
168  GlobalPoint vertex(0, 0, originz);
169 
171  e.getByToken(token_vertex, vertices);
172  const reco::VertexCollection vertCollection = *(vertices.product());
173  reco::VertexCollection::const_iterator ci = vertCollection.begin();
174  if (!vertCollection.empty()) {
175  originz = ci->z();
176  } else {
177  deltaZVertex = 15.;
178  }
179 
180  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
181  fixedVector, vertex, ptmin, originradius, deltaZVertex, deltaL1JetEta, deltaL1JetPhi));
182  }
183 
184  return result;
185  }
186 
187 private:
189 
190  float ptmin;
192  float halflength;
193  double etaCenter_;
194  double phiCenter_;
199  bool usejets_;
201  bool fixedReg_;
207 };
208 
209 #endif
Vector3DBase
Definition: Vector3DBase.h:8
trigger::TriggerFilterObjectWithRefs
Definition: TriggerFilterObjectWithRefs.h:35
CaloJetCollection.h
Handle.h
GlobalTrackingRegion.h
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
HITRegionalPixelSeedGenerator::token_isoTrack
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > token_isoTrack
Definition: HITRegionalPixelSeedGenerator.h:205
HITRegionalPixelSeedGenerator::deltaTrackPhi
float deltaTrackPhi
Definition: HITRegionalPixelSeedGenerator.h:196
EDProducer.h
edm::EDGetTokenT< reco::TrackCollection >
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
HITRegionalPixelSeedGenerator::fixedReg_
bool fixedReg_
Definition: HITRegionalPixelSeedGenerator.h:201
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
HITRegionalPixelSeedGenerator
Definition: HITRegionalPixelSeedGenerator.h:35
HITRegionalPixelSeedGenerator::token_vertex
edm::EDGetTokenT< reco::VertexCollection > token_vertex
Definition: HITRegionalPixelSeedGenerator.h:204
Jet.h
TriggerFilterObjectWithRefs.h
trigger::TriggerTrack
Definition: TriggerTypeDefs.h:87
HITRegionalPixelSeedGenerator::token_l1jet
edm::EDGetTokenT< l1extra::L1JetParticleCollection > token_l1jet
Definition: HITRegionalPixelSeedGenerator.h:206
HITRegionalPixelSeedGenerator::usetracks_
bool usetracks_
Definition: HITRegionalPixelSeedGenerator.h:200
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
IsolatedPixelTrackCandidate.h
edm::Handle< reco::TrackCollection >
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:590
AlignmentTracksFromVertexSelector_cfi.vertices
vertices
Definition: AlignmentTracksFromVertexSelector_cfi.py:5
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TrackingRegionProducer.h
HITRegionalPixelSeedGenerator::conf_
edm::ParameterSet conf_
Definition: HITRegionalPixelSeedGenerator.h:188
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Track.h
HITRegionalPixelSeedGenerator::halflength
float halflength
Definition: HITRegionalPixelSeedGenerator.h:192
l1extra::L1JetParticleCollection
std::vector< L1JetParticle > L1JetParticleCollection
Definition: L1JetParticleFwd.h:28
HITRegionalPixelSeedGenerator::deltaL1JetEta
float deltaL1JetEta
Definition: HITRegionalPixelSeedGenerator.h:197
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
HITRegionalPixelSeedGenerator::etaCenter_
double etaCenter_
Definition: HITRegionalPixelSeedGenerator.h:193
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
L1JetParticleFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
HITRegionalPixelSeedGenerator::usejets_
bool usejets_
Definition: HITRegionalPixelSeedGenerator.h:199
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HITRegionalPixelSeedGenerator::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const override
Definition: HITRegionalPixelSeedGenerator.h:69
Event.h
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
HITRegionalPixelSeedGenerator::~HITRegionalPixelSeedGenerator
~HITRegionalPixelSeedGenerator() override
Definition: HITRegionalPixelSeedGenerator.h:67
RectangularEtaPhiTrackingRegion.h
HITRegionalPixelSeedGenerator::ptmin
float ptmin
Definition: HITRegionalPixelSeedGenerator.h:190
HITRegionalPixelSeedGenerator::deltaTrackEta
float deltaTrackEta
Definition: HITRegionalPixelSeedGenerator.h:195
edm::EventSetup
Definition: EventSetup.h:58
HITRegionalPixelSeedGenerator::useIsoTracks_
bool useIsoTracks_
Definition: HITRegionalPixelSeedGenerator.h:202
HITRegionalPixelSeedGenerator::originradius
float originradius
Definition: HITRegionalPixelSeedGenerator.h:191
InputTag.h
VertexFwd.h
HITRegionalPixelSeedGenerator::deltaL1JetPhi
float deltaL1JetPhi
Definition: HITRegionalPixelSeedGenerator.h:198
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
HITRegionalPixelSeedGenerator::HITRegionalPixelSeedGenerator
HITRegionalPixelSeedGenerator(const edm::ParameterSet &conf_, edm::ConsumesCollector &&iC)
Definition: HITRegionalPixelSeedGenerator.h:37
HITRegionalPixelSeedGenerator::phiCenter_
double phiCenter_
Definition: HITRegionalPixelSeedGenerator.h:194
Ref.h
Vertex.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
ParameterSet.h
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::Event
Definition: Event.h:73
Vector3D.h
L1JetParticle.h
HITRegionalPixelSeedGenerator::token_trks
edm::EDGetTokenT< reco::TrackCollection > token_trks
Definition: HITRegionalPixelSeedGenerator.h:203
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
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37