CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
PointSeededTrackingRegionsProducer Class Reference

#include <PointSeededTrackingRegionsProducer.h>

Inheritance diagram for PointSeededTrackingRegionsProducer:
TrackingRegionProducer

Public Types

enum  Mode { BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, VERTICES_FIXED, VERTICES_SIGMA }
 

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

std::vector< double > etaPoints
 
float m_deltaEta
 
float m_deltaPhi
 
int m_maxNRegions
 
int m_maxNVertices
 
Mode m_mode
 
float m_nSigmaZBeamSpot
 
float m_nSigmaZVertex
 
float m_originRadius
 
bool m_precise
 
float m_ptMin
 
bool m_searchOpt
 
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
 
float m_zErrorBeamSpot
 
float m_zErrorVetex
 
std::vector< double > phiPoints
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT< MeasurementTrackerEventtoken_measurementTracker
 
edm::EDGetTokenT< reco::VertexCollectiontoken_vertex
 

Detailed Description

class PointSeededTrackingRegionsProducer

eta-phi TrackingRegions producer in directions defined by Point-based objects of interest from the "input" parameters.

Four operational modes are supported ("mode" parameter):

BeamSpotFixed: origin is defined by the beam spot z-half-length is defined by a fixed zErrorBeamSpot parameter BeamSpotSigma: origin is defined by the beam spot z-half-length is defined by nSigmaZBeamSpot * beamSpot.sigmaZ VerticesFixed: origins are defined by vertices from VertexCollection (use maximum MaxNVertices of them) z-half-length is defined by a fixed zErrorVetex parameter VerticesSigma: origins are defined by vertices from VertexCollection (use maximum MaxNVertices of them) z-half-length is defined by nSigmaZVertex * vetex.zError

If, while using one of the "Vertices" modes, there's no vertices in an event, we fall back into either BeamSpotSigma or BeamSpotFixed mode, depending on the positiveness of nSigmaZBeamSpot.

Definition at line 48 of file PointSeededTrackingRegionsProducer.h.

Member Enumeration Documentation

◆ Mode

Enumerator
BEAM_SPOT_FIXED 
BEAM_SPOT_SIGMA 
VERTICES_FIXED 
VERTICES_SIGMA 

Definition at line 50 of file PointSeededTrackingRegionsProducer.h.

Constructor & Destructor Documentation

◆ PointSeededTrackingRegionsProducer()

PointSeededTrackingRegionsProducer::PointSeededTrackingRegionsProducer ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)
inlineexplicit

Definition at line 52 of file PointSeededTrackingRegionsProducer.h.

52  {
53  edm::ParameterSet regPSet = conf.getParameter<edm::ParameterSet>("RegionPSet");
54 
55  // operation mode
56  std::string modeString = regPSet.getParameter<std::string>("mode");
57  if (modeString == "BeamSpotFixed")
59  else if (modeString == "BeamSpotSigma")
61  else if (modeString == "VerticesFixed")
63  else if (modeString == "VerticesSigma")
65  else
66  edm::LogError("PointSeededTrackingRegionsProducer") << "Unknown mode string: " << modeString;
67 
68  // basic inputsi
70  etaPoints = points.getParameter<std::vector<double>>("eta");
71  phiPoints = points.getParameter<std::vector<double>>("phi");
72  if (!(etaPoints.size() == phiPoints.size()))
73  throw edm::Exception(edm::errors::Configuration) << "The parameters 'eta' and 'phi' must have the same size";
74  ;
75  m_maxNRegions = regPSet.getParameter<int>("maxNRegions");
77  m_maxNVertices = 1;
79  token_vertex = iC.consumes<reco::VertexCollection>(regPSet.getParameter<edm::InputTag>("vertexCollection"));
80  m_maxNVertices = regPSet.getParameter<int>("maxNVertices");
81  }
82 
83  // RectangularEtaPhiTrackingRegion parameters:
84  m_ptMin = regPSet.getParameter<double>("ptMin");
85  m_originRadius = regPSet.getParameter<double>("originRadius");
86  m_zErrorBeamSpot = regPSet.getParameter<double>("zErrorBeamSpot");
87  m_deltaEta = regPSet.getParameter<double>("deltaEta");
88  m_deltaPhi = regPSet.getParameter<double>("deltaPhi");
89  m_precise = regPSet.getParameter<bool>("precise");
91  regPSet.getParameter<std::string>("whereToUseMeasurementTracker"));
94  iC.consumes<MeasurementTrackerEvent>(regPSet.getParameter<edm::InputTag>("measurementTrackerName"));
95  }
96  m_searchOpt = false;
97  if (regPSet.exists("searchOpt"))
98  m_searchOpt = regPSet.getParameter<bool>("searchOpt");
99 
100  // mode-dependent z-halflength of tracking regions
101  if (m_mode == VERTICES_SIGMA)
102  m_nSigmaZVertex = regPSet.getParameter<double>("nSigmaZVertex");
103  if (m_mode == VERTICES_FIXED)
104  m_zErrorVetex = regPSet.getParameter<double>("zErrorVetex");
105  m_nSigmaZBeamSpot = -1.;
106  if (m_mode == BEAM_SPOT_SIGMA) {
107  m_nSigmaZBeamSpot = regPSet.getParameter<double>("nSigmaZBeamSpot");
108  if (m_nSigmaZBeamSpot < 0.)
109  edm::LogError("PointSeededTrackingRegionsProducer")
110  << "nSigmaZBeamSpot must be positive for BeamSpotSigma mode!";
111  }
112  }

References BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, edm::errors::Configuration, etaPoints, Exception, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), RectangularEtaPhiTrackingRegion::kNever, m_deltaEta, m_deltaPhi, m_maxNRegions, m_maxNVertices, m_mode, m_nSigmaZBeamSpot, m_nSigmaZVertex, m_originRadius, m_precise, m_ptMin, m_searchOpt, m_whereToUseMeasurementTracker, m_zErrorBeamSpot, m_zErrorVetex, phiPoints, HLT_FULL_cff::points, AlCaHLTBitMon_QueryRunRegistry::string, RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker(), token_beamSpot, token_measurementTracker, token_vertex, VERTICES_FIXED, and VERTICES_SIGMA.

◆ ~PointSeededTrackingRegionsProducer()

PointSeededTrackingRegionsProducer::~PointSeededTrackingRegionsProducer ( )
inlineoverride

Definition at line 114 of file PointSeededTrackingRegionsProducer.h.

114 {}

Member Function Documentation

◆ fillDescriptions()

static void PointSeededTrackingRegionsProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 116 of file PointSeededTrackingRegionsProducer.h.

116  {
118 
119  edm::ParameterSetDescription descPoints;
120  descPoints.add<std::vector<double>>("eta", {0.});
121  descPoints.add<std::vector<double>>("phi", {0.});
122  desc.add<edm::ParameterSetDescription>("points", descPoints);
123 
124  desc.add<std::string>("mode", "BeamSpotFixed");
125  desc.add<int>("maxNRegions", 10);
126  desc.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
127  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"));
128  desc.add<int>("maxNVertices", 1);
129 
130  desc.add<double>("ptMin", 0.9);
131  desc.add<double>("originRadius", 0.2);
132  desc.add<double>("zErrorBeamSpot", 24.2);
133  desc.add<double>("deltaEta", 0.5);
134  desc.add<double>("deltaPhi", 0.5);
135  desc.add<bool>("precise", true);
136 
137  desc.add<double>("nSigmaZVertex", 3.);
138  desc.add<double>("zErrorVetex", 0.2);
139  desc.add<double>("nSigmaZBeamSpot", 4.);
140 
141  desc.add<std::string>("whereToUseMeasurementTracker", "ForSiStrips");
142  desc.add<edm::InputTag>("measurementTrackerName", edm::InputTag(""));
143 
144  desc.add<bool>("searchOpt", false);
145 
146  // Only for backwards-compatibility
147  edm::ParameterSetDescription descRegion;
148  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
149  //edm::ParameterSetDescription descPoint;
150  //descPoint.add<edm::ParameterSetDescription>("point_input", desc);
151 
152  descriptions.add("pointSeededTrackingRegion", descRegion);
153  }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ regions()

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

Implements TrackingRegionProducer.

Definition at line 155 of file PointSeededTrackingRegionsProducer.h.

155  {
156  std::vector<std::unique_ptr<TrackingRegion>> result;
157 
158  // always need the beam spot (as a fall back strategy for vertex modes)
160  e.getByToken(token_beamSpot, bs);
161  if (!bs.isValid())
162  return result;
163 
164  // this is a default origin for all modes
165  GlobalPoint default_origin(bs->x0(), bs->y0(), bs->z0());
166 
167  // vector of origin & halfLength pairs:
168  std::vector<std::pair<GlobalPoint, float>> origins;
169 
170  // fill the origins and halfLengths depending on the mode
172  origins.push_back(std::make_pair(
173  default_origin, (m_mode == BEAM_SPOT_FIXED) ? m_zErrorBeamSpot : m_nSigmaZBeamSpot * bs->sigmaZ()));
174  } else if (m_mode == VERTICES_FIXED || m_mode == VERTICES_SIGMA) {
176  e.getByToken(token_vertex, vertices);
177  int n_vert = 0;
178  for (reco::VertexCollection::const_iterator iv = vertices->begin(), ev = vertices->end();
179  iv != ev && n_vert < m_maxNVertices;
180  ++iv) {
181  if (iv->isFake() || !iv->isValid())
182  continue;
183 
184  origins.push_back(std::make_pair(GlobalPoint(iv->x(), iv->y(), iv->z()),
185  (m_mode == VERTICES_FIXED) ? m_zErrorVetex : m_nSigmaZVertex * iv->zError()));
186  ++n_vert;
187  }
188  // no-vertex fall-back case:
189  if (origins.empty()) {
190  origins.push_back(std::make_pair(
191  default_origin, (m_nSigmaZBeamSpot > 0.) ? m_nSigmaZBeamSpot * bs->z0Error() : m_zErrorBeamSpot));
192  }
193  }
194 
198  e.getByToken(token_measurementTracker, hmte);
199  measurementTracker = hmte.product();
200  }
201 
202  // create tracking regions (maximum MaxNRegions of them) in directions of the
203  // points of interest
204  size_t n_points = etaPoints.size();
205  int n_regions = 0;
206  for (size_t i = 0; i < n_points && n_regions < m_maxNRegions; ++i) {
207  double x = std::cos(phiPoints[i]);
208  double y = std::sin(phiPoints[i]);
209  double theta = 2 * std::atan(std::exp(-etaPoints[i]));
210  double z = 1. / std::tan(theta);
211 
212  GlobalVector direction(x, y, z);
213 
214  for (size_t j = 0; j < origins.size() && n_regions < m_maxNRegions; ++j) {
215  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction, // GlobalVector
216  origins[j].first, // GlobalPoint
217  m_ptMin,
219  origins[j].second,
220  m_deltaEta,
221  m_deltaPhi,
223  m_precise,
225  m_searchOpt));
226  ++n_regions;
227  }
228  }
229  edm::LogInfo("PointSeededTrackingRegionsProducer") << "produced " << n_regions << " regions";
230 
231  return result;
232  }

References BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, cms::cuda::bs, funct::cos(), MillePedeFileConverter_cfg::e, etaPoints, ev, JetChargeProducer_cfi::exp, first, mps_fire::i, edm::EDGetTokenT< T >::isUninitialized(), gpuVertexFinder::iv, dqmiolumiharvest::j, m_deltaEta, m_deltaPhi, m_maxNRegions, m_maxNVertices, m_mode, m_nSigmaZBeamSpot, m_nSigmaZVertex, m_originRadius, m_precise, m_ptMin, m_searchOpt, m_whereToUseMeasurementTracker, m_zErrorBeamSpot, m_zErrorVetex, HLTSiStripMonitoring_cff::measurementTracker, phiPoints, edm::Handle< T >::product(), mps_fire::result, edm::second(), funct::sin(), funct::tan(), theta(), token_beamSpot, token_measurementTracker, token_vertex, AlignmentTracksFromVertexSelector_cfi::vertices, VERTICES_FIXED, VERTICES_SIGMA, x, y, and z.

Member Data Documentation

◆ etaPoints

std::vector<double> PointSeededTrackingRegionsProducer::etaPoints
private

◆ m_deltaEta

float PointSeededTrackingRegionsProducer::m_deltaEta
private

◆ m_deltaPhi

float PointSeededTrackingRegionsProducer::m_deltaPhi
private

◆ m_maxNRegions

int PointSeededTrackingRegionsProducer::m_maxNRegions
private

◆ m_maxNVertices

int PointSeededTrackingRegionsProducer::m_maxNVertices
private

◆ m_mode

Mode PointSeededTrackingRegionsProducer::m_mode
private

◆ m_nSigmaZBeamSpot

float PointSeededTrackingRegionsProducer::m_nSigmaZBeamSpot
private

◆ m_nSigmaZVertex

float PointSeededTrackingRegionsProducer::m_nSigmaZVertex
private

◆ m_originRadius

float PointSeededTrackingRegionsProducer::m_originRadius
private

◆ m_precise

bool PointSeededTrackingRegionsProducer::m_precise
private

◆ m_ptMin

float PointSeededTrackingRegionsProducer::m_ptMin
private

◆ m_searchOpt

bool PointSeededTrackingRegionsProducer::m_searchOpt
private

◆ m_whereToUseMeasurementTracker

RectangularEtaPhiTrackingRegion::UseMeasurementTracker PointSeededTrackingRegionsProducer::m_whereToUseMeasurementTracker
private

◆ m_zErrorBeamSpot

float PointSeededTrackingRegionsProducer::m_zErrorBeamSpot
private

◆ m_zErrorVetex

float PointSeededTrackingRegionsProducer::m_zErrorVetex
private

◆ phiPoints

std::vector<double> PointSeededTrackingRegionsProducer::phiPoints
private

◆ token_beamSpot

edm::EDGetTokenT<reco::BeamSpot> PointSeededTrackingRegionsProducer::token_beamSpot
private

◆ token_measurementTracker

edm::EDGetTokenT<MeasurementTrackerEvent> PointSeededTrackingRegionsProducer::token_measurementTracker
private

◆ token_vertex

edm::EDGetTokenT<reco::VertexCollection> PointSeededTrackingRegionsProducer::token_vertex
private
Vector3DBase
Definition: Vector3DBase.h:8
PointSeededTrackingRegionsProducer::BEAM_SPOT_FIXED
Definition: PointSeededTrackingRegionsProducer.h:50
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21469
PointSeededTrackingRegionsProducer::BEAM_SPOT_SIGMA
Definition: PointSeededTrackingRegionsProducer.h:50
gpuVertexFinder::iv
int32_t *__restrict__ iv
Definition: gpuClusterTracksDBSCAN.h:42
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PointSeededTrackingRegionsProducer::m_originRadius
float m_originRadius
Definition: PointSeededTrackingRegionsProducer.h:246
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DDAxes::x
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< reco::BeamSpot >
AlignmentTracksFromVertexSelector_cfi.vertices
vertices
Definition: AlignmentTracksFromVertexSelector_cfi.py:5
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PointSeededTrackingRegionsProducer::etaPoints
std::vector< double > etaPoints
Definition: PointSeededTrackingRegionsProducer.h:242
cms::cuda::bs
bs
Definition: HistoContainer.h:76
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PointSeededTrackingRegionsProducer::m_maxNVertices
int m_maxNVertices
Definition: PointSeededTrackingRegionsProducer.h:240
reco::BeamSpot
Definition: BeamSpot.h:21
DDAxes::z
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
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
PointSeededTrackingRegionsProducer::phiPoints
std::vector< double > phiPoints
Definition: PointSeededTrackingRegionsProducer.h:243
PointSeededTrackingRegionsProducer::VERTICES_FIXED
Definition: PointSeededTrackingRegionsProducer.h:50
PointSeededTrackingRegionsProducer::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: PointSeededTrackingRegionsProducer.h:239
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
PointSeededTrackingRegionsProducer::m_nSigmaZBeamSpot
float m_nSigmaZBeamSpot
Definition: PointSeededTrackingRegionsProducer.h:257
PointSeededTrackingRegionsProducer::m_nSigmaZVertex
float m_nSigmaZVertex
Definition: PointSeededTrackingRegionsProducer.h:255
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PointSeededTrackingRegionsProducer::m_precise
bool m_precise
Definition: PointSeededTrackingRegionsProducer.h:250
PointSeededTrackingRegionsProducer::m_maxNRegions
int m_maxNRegions
Definition: PointSeededTrackingRegionsProducer.h:237
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PointSeededTrackingRegionsProducer::m_zErrorBeamSpot
float m_zErrorBeamSpot
Definition: PointSeededTrackingRegionsProducer.h:247
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
PointSeededTrackingRegionsProducer::token_measurementTracker
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
Definition: PointSeededTrackingRegionsProducer.h:251
PointSeededTrackingRegionsProducer::Mode
Mode
Definition: PointSeededTrackingRegionsProducer.h:50
PointSeededTrackingRegionsProducer::m_whereToUseMeasurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
Definition: PointSeededTrackingRegionsProducer.h:252
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PointSeededTrackingRegionsProducer::m_mode
Mode m_mode
Definition: PointSeededTrackingRegionsProducer.h:235
PointSeededTrackingRegionsProducer::m_zErrorVetex
float m_zErrorVetex
Definition: PointSeededTrackingRegionsProducer.h:256
mps_fire.result
result
Definition: mps_fire.py:311
PointSeededTrackingRegionsProducer::m_searchOpt
bool m_searchOpt
Definition: PointSeededTrackingRegionsProducer.h:253
PointSeededTrackingRegionsProducer::m_ptMin
float m_ptMin
Definition: PointSeededTrackingRegionsProducer.h:245
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
edm::errors::Configuration
Definition: EDMException.h:36
PointSeededTrackingRegionsProducer::VERTICES_SIGMA
Definition: PointSeededTrackingRegionsProducer.h:50
edm::InputTag
Definition: InputTag.h:15
PointSeededTrackingRegionsProducer::m_deltaPhi
float m_deltaPhi
Definition: PointSeededTrackingRegionsProducer.h:249
RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
Definition: RectangularEtaPhiTrackingRegion.cc:82
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PointSeededTrackingRegionsProducer::token_vertex
edm::EDGetTokenT< reco::VertexCollection > token_vertex
Definition: PointSeededTrackingRegionsProducer.h:238
PointSeededTrackingRegionsProducer::m_deltaEta
float m_deltaEta
Definition: PointSeededTrackingRegionsProducer.h:248