CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HITRegionalPixelSeedGenerator Class Reference

#include <HITRegionalPixelSeedGenerator.h>

Inheritance diagram for HITRegionalPixelSeedGenerator:
TrackingRegionProducer

Public Member Functions

 HITRegionalPixelSeedGenerator (const edm::ParameterSet &conf_, edm::ConsumesCollector &&iC)
 
std::vector< std::unique_ptr< TrackingRegion > > regions (const edm::Event &e, const edm::EventSetup &es) const override
 
 ~HITRegionalPixelSeedGenerator () override
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

edm::ParameterSet conf_
 
float deltaL1JetEta
 
float deltaL1JetPhi
 
float deltaTrackEta
 
float deltaTrackPhi
 
double etaCenter_
 
bool fixedReg_
 
float halflength
 
float originradius
 
double phiCenter_
 
float ptmin
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstoken_isoTrack
 
edm::EDGetTokenT< l1extra::L1JetParticleCollectiontoken_l1jet
 
edm::EDGetTokenT< reco::TrackCollectiontoken_trks
 
edm::EDGetTokenT< reco::VertexCollectiontoken_vertex
 
bool useIsoTracks_
 
bool usejets_
 
bool usetracks_
 

Detailed Description

Definition at line 35 of file HITRegionalPixelSeedGenerator.h.

Constructor & Destructor Documentation

HITRegionalPixelSeedGenerator::HITRegionalPixelSeedGenerator ( const edm::ParameterSet conf_,
edm::ConsumesCollector &&  iC 
)
inlineexplicit

Definition at line 37 of file HITRegionalPixelSeedGenerator.h.

References deltaL1JetEta, deltaL1JetPhi, deltaTrackEta, deltaTrackPhi, etaCenter_, fixedReg_, edm::ParameterSet::getParameter(), halflength, originradius, phiCenter_, ptmin, token_isoTrack, token_l1jet, token_trks, token_vertex, useIsoTracks_, usejets_, and usetracks_.

37  {
38  edm::LogInfo("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_)
58  if (usetracks_ || useIsoTracks_ || fixedReg_ || usejets_)
60  if (useIsoTracks_)
63  if (usejets_)
65  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::VertexCollection > token_vertex
edm::EDGetTokenT< l1extra::L1JetParticleCollection > token_l1jet
std::vector< L1JetParticle > L1JetParticleCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > token_isoTrack
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::TrackCollection > token_trks
HITRegionalPixelSeedGenerator::~HITRegionalPixelSeedGenerator ( )
inlineoverride

Definition at line 67 of file HITRegionalPixelSeedGenerator.h.

67 {}

Member Function Documentation

std::vector<std::unique_ptr<TrackingRegion> > HITRegionalPixelSeedGenerator::regions ( const edm::Event e,
const edm::EventSetup es 
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 69 of file HITRegionalPixelSeedGenerator.h.

References funct::cos(), deltaL1JetEta, deltaL1JetPhi, deltaTrackEta, deltaTrackPhi, etaCenter_, JetChargeProducer_cfi::exp, fixedReg_, edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), halflength, fwrapper::jets, originradius, AlCaHLTBitMon_ParallelJobs::p, phiCenter_, edm::Handle< T >::product(), ptmin, mps_fire::result, funct::sin(), token_isoTrack, token_l1jet, token_trks, token_vertex, HiIsolationCommonParameters_cff::track, l1t::tracks, trigger::TriggerTrack, useIsoTracks_, usejets_, usetracks_, and electrons_cff::vertices.

69  {
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  }
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< reco::VertexCollection > token_vertex
edm::EDGetTokenT< l1extra::L1JetParticleCollection > token_l1jet
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > token_isoTrack
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
vector< PseudoJet > jets
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T const * product() const
Definition: Handle.h:74
edm::EDGetTokenT< reco::TrackCollection > token_trks

Member Data Documentation

edm::ParameterSet HITRegionalPixelSeedGenerator::conf_
private

Definition at line 188 of file HITRegionalPixelSeedGenerator.h.

float HITRegionalPixelSeedGenerator::deltaL1JetEta
private

Definition at line 197 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

float HITRegionalPixelSeedGenerator::deltaL1JetPhi
private

Definition at line 198 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

float HITRegionalPixelSeedGenerator::deltaTrackEta
private

Definition at line 195 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

float HITRegionalPixelSeedGenerator::deltaTrackPhi
private

Definition at line 196 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

double HITRegionalPixelSeedGenerator::etaCenter_
private

Definition at line 193 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

bool HITRegionalPixelSeedGenerator::fixedReg_
private

Definition at line 201 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

float HITRegionalPixelSeedGenerator::halflength
private

Definition at line 192 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

float HITRegionalPixelSeedGenerator::originradius
private

Definition at line 191 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

double HITRegionalPixelSeedGenerator::phiCenter_
private

Definition at line 194 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

float HITRegionalPixelSeedGenerator::ptmin
private

Definition at line 190 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HITRegionalPixelSeedGenerator::token_isoTrack
private

Definition at line 205 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

edm::EDGetTokenT<l1extra::L1JetParticleCollection> HITRegionalPixelSeedGenerator::token_l1jet
private

Definition at line 206 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

edm::EDGetTokenT<reco::TrackCollection> HITRegionalPixelSeedGenerator::token_trks
private

Definition at line 203 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

edm::EDGetTokenT<reco::VertexCollection> HITRegionalPixelSeedGenerator::token_vertex
private

Definition at line 204 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

bool HITRegionalPixelSeedGenerator::useIsoTracks_
private

Definition at line 202 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

bool HITRegionalPixelSeedGenerator::usejets_
private

Definition at line 199 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().

bool HITRegionalPixelSeedGenerator::usetracks_
private

Definition at line 200 of file HITRegionalPixelSeedGenerator.h.

Referenced by HITRegionalPixelSeedGenerator(), and regions().