CMS 3D CMS Logo

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

#include <CandidateSeededTrackingRegionsProducer.h>

Inheritance diagram for CandidateSeededTrackingRegionsProducer:
TrackingRegionProducer

Public Types

enum  Mode { BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, VERTICES_FIXED, VERTICES_SIGMA }
 

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

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
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT< reco::CandidateViewtoken_input
 
edm::EDGetTokenT< MeasurementTrackerEventtoken_measurementTracker
 
edm::EDGetTokenT< reco::VertexCollectiontoken_vertex
 

Detailed Description

class CandidateSeededTrackingRegionsProducer

eta-phi TrackingRegions producer in directions defined by Candidate-based objects of interest from a collection defined by the "input" parameter.

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.

Author
Vadim Khotilovich

Definition at line 45 of file CandidateSeededTrackingRegionsProducer.h.

Member Enumeration Documentation

◆ Mode

Enumerator
BEAM_SPOT_FIXED 
BEAM_SPOT_SIGMA 
VERTICES_FIXED 
VERTICES_SIGMA 

Definition at line 47 of file CandidateSeededTrackingRegionsProducer.h.

Constructor & Destructor Documentation

◆ CandidateSeededTrackingRegionsProducer()

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

Definition at line 49 of file CandidateSeededTrackingRegionsProducer.h.

49  {
50  edm::ParameterSet regPSet = conf.getParameter<edm::ParameterSet>("RegionPSet");
51 
52  // operation mode
53  std::string modeString = regPSet.getParameter<std::string>("mode");
54  if (modeString == "BeamSpotFixed")
56  else if (modeString == "BeamSpotSigma")
58  else if (modeString == "VerticesFixed")
60  else if (modeString == "VerticesSigma")
62  else
63  edm::LogError("CandidateSeededTrackingRegionsProducer") << "Unknown mode string: " << modeString;
64 
65  // basic inputs
67  m_maxNRegions = regPSet.getParameter<int>("maxNRegions");
69  m_maxNVertices = 1;
71  token_vertex = iC.consumes<reco::VertexCollection>(regPSet.getParameter<edm::InputTag>("vertexCollection"));
72  m_maxNVertices = regPSet.getParameter<int>("maxNVertices");
73  }
74 
75  // RectangularEtaPhiTrackingRegion parameters:
76  m_ptMin = regPSet.getParameter<double>("ptMin");
77  m_originRadius = regPSet.getParameter<double>("originRadius");
78  m_zErrorBeamSpot = regPSet.getParameter<double>("zErrorBeamSpot");
79  m_deltaEta = regPSet.getParameter<double>("deltaEta");
80  m_deltaPhi = regPSet.getParameter<double>("deltaPhi");
81  m_precise = regPSet.getParameter<bool>("precise");
83  regPSet.getParameter<std::string>("whereToUseMeasurementTracker"));
86  iC.consumes<MeasurementTrackerEvent>(regPSet.getParameter<edm::InputTag>("measurementTrackerName"));
87  }
88  m_searchOpt = false;
89  if (regPSet.exists("searchOpt"))
90  m_searchOpt = regPSet.getParameter<bool>("searchOpt");
91 
92  // mode-dependent z-halflength of tracking regions
93  if (m_mode == VERTICES_SIGMA)
94  m_nSigmaZVertex = regPSet.getParameter<double>("nSigmaZVertex");
95  if (m_mode == VERTICES_FIXED)
96  m_zErrorVetex = regPSet.getParameter<double>("zErrorVetex");
97  m_nSigmaZBeamSpot = -1.;
98  if (m_mode == BEAM_SPOT_SIGMA) {
99  m_nSigmaZBeamSpot = regPSet.getParameter<double>("nSigmaZBeamSpot");
100  if (m_nSigmaZBeamSpot < 0.)
101  edm::LogError("CandidateSeededTrackingRegionsProducer")
102  << "nSigmaZBeamSpot must be positive for BeamSpotSigma mode!";
103  }
104  }

References BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, 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, AlCaHLTBitMon_QueryRunRegistry::string, RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker(), token_beamSpot, token_input, token_measurementTracker, token_vertex, VERTICES_FIXED, and VERTICES_SIGMA.

◆ ~CandidateSeededTrackingRegionsProducer()

CandidateSeededTrackingRegionsProducer::~CandidateSeededTrackingRegionsProducer ( )
inlineoverride

Definition at line 106 of file CandidateSeededTrackingRegionsProducer.h.

106 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 108 of file CandidateSeededTrackingRegionsProducer.h.

108  {
110 
111  desc.add<std::string>("mode", "BeamSpotFixed");
112 
113  desc.add<edm::InputTag>("input", edm::InputTag(""));
114  desc.add<int>("maxNRegions", 10);
115  desc.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
116  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"));
117  desc.add<int>("maxNVertices", 1);
118 
119  desc.add<double>("ptMin", 0.9);
120  desc.add<double>("originRadius", 0.2);
121  desc.add<double>("zErrorBeamSpot", 24.2);
122  desc.add<double>("deltaEta", 0.5);
123  desc.add<double>("deltaPhi", 0.5);
124  desc.add<bool>("precise", true);
125 
126  desc.add<double>("nSigmaZVertex", 3.);
127  desc.add<double>("zErrorVetex", 0.2);
128  desc.add<double>("nSigmaZBeamSpot", 4.);
129 
130  desc.add<std::string>("whereToUseMeasurementTracker", "ForSiStrips");
131  desc.add<edm::InputTag>("measurementTrackerName", edm::InputTag(""));
132 
133  desc.add<bool>("searchOpt", false);
134 
135  // Only for backwards-compatibility
136  edm::ParameterSetDescription descRegion;
137  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
138 
139  descriptions.add("seededTrackingRegionsFromBeamSpotFixedZLength", descRegion);
140  }

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

◆ regions()

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

Implements TrackingRegionProducer.

Definition at line 142 of file CandidateSeededTrackingRegionsProducer.h.

142  {
143  std::vector<std::unique_ptr<TrackingRegion> > result;
144 
145  // pick up the candidate objects of interest
147  e.getByToken(token_input, objects);
148  size_t n_objects = objects->size();
149  if (n_objects == 0)
150  return result;
151 
152  // always need the beam spot (as a fall back strategy for vertex modes)
154  e.getByToken(token_beamSpot, bs);
155  if (!bs.isValid())
156  return result;
157 
158  // this is a default origin for all modes
159  GlobalPoint default_origin(bs->x0(), bs->y0(), bs->z0());
160 
161  // vector of origin & halfLength pairs:
162  std::vector<std::pair<GlobalPoint, float> > origins;
163 
164  // fill the origins and halfLengths depending on the mode
166  origins.push_back(std::make_pair(
167  default_origin, (m_mode == BEAM_SPOT_FIXED) ? m_zErrorBeamSpot : m_nSigmaZBeamSpot * bs->sigmaZ()));
168  } else if (m_mode == VERTICES_FIXED || m_mode == VERTICES_SIGMA) {
170  e.getByToken(token_vertex, vertices);
171  int n_vert = 0;
172  for (reco::VertexCollection::const_iterator v = vertices->begin();
173  v != vertices->end() && n_vert < m_maxNVertices;
174  ++v) {
175  if (v->isFake() || !v->isValid())
176  continue;
177 
178  origins.push_back(std::make_pair(GlobalPoint(v->x(), v->y(), v->z()),
179  (m_mode == VERTICES_FIXED) ? m_zErrorVetex : m_nSigmaZVertex * v->zError()));
180  ++n_vert;
181  }
182  // no-vertex fall-back case:
183  if (origins.empty()) {
184  origins.push_back(std::make_pair(
185  default_origin, (m_nSigmaZBeamSpot > 0.) ? m_nSigmaZBeamSpot * bs->z0Error() : m_zErrorBeamSpot));
186  }
187  }
188 
192  e.getByToken(token_measurementTracker, hmte);
193  measurementTracker = hmte.product();
194  }
195 
196  // create tracking regions (maximum MaxNRegions of them) in directions of the
197  // objects of interest (we expect that the collection was sorted in decreasing pt order)
198  int n_regions = 0;
199  for (size_t i = 0; i < n_objects && n_regions < m_maxNRegions; ++i) {
200  const reco::Candidate& object = (*objects)[i];
201  GlobalVector direction(object.momentum().x(), object.momentum().y(), object.momentum().z());
202 
203  for (size_t j = 0; j < origins.size() && n_regions < m_maxNRegions; ++j) {
204  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
205  origins[j].first,
206  m_ptMin,
208  origins[j].second,
209  m_deltaEta,
210  m_deltaPhi,
212  m_precise,
214  m_searchOpt));
215  ++n_regions;
216  }
217  }
218  //std::cout<<"n_seeded_regions = "<<n_regions<<std::endl;
219  edm::LogInfo("CandidateSeededTrackingRegionsProducer") << "produced " << n_regions << " regions";
220 
221  return result;
222  }

References BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, cms::cuda::bs, MillePedeFileConverter_cfg::e, dqmdumpme::first, mps_fire::i, edm::EDGetTokenT< T >::isUninitialized(), 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, hgcalPerformanceValidation::objects, edm::Handle< T >::product(), mps_fire::result, edm::second(), token_beamSpot, token_input, token_measurementTracker, token_vertex, findQualityFiles::v, pwdgSkimBPark_cfi::vertices, VERTICES_FIXED, VERTICES_SIGMA, x, y, and z.

Member Data Documentation

◆ m_deltaEta

float CandidateSeededTrackingRegionsProducer::m_deltaEta
private

◆ m_deltaPhi

float CandidateSeededTrackingRegionsProducer::m_deltaPhi
private

◆ m_maxNRegions

int CandidateSeededTrackingRegionsProducer::m_maxNRegions
private

◆ m_maxNVertices

int CandidateSeededTrackingRegionsProducer::m_maxNVertices
private

◆ m_mode

Mode CandidateSeededTrackingRegionsProducer::m_mode
private

◆ m_nSigmaZBeamSpot

float CandidateSeededTrackingRegionsProducer::m_nSigmaZBeamSpot
private

◆ m_nSigmaZVertex

float CandidateSeededTrackingRegionsProducer::m_nSigmaZVertex
private

◆ m_originRadius

float CandidateSeededTrackingRegionsProducer::m_originRadius
private

◆ m_precise

bool CandidateSeededTrackingRegionsProducer::m_precise
private

◆ m_ptMin

float CandidateSeededTrackingRegionsProducer::m_ptMin
private

◆ m_searchOpt

bool CandidateSeededTrackingRegionsProducer::m_searchOpt
private

◆ m_whereToUseMeasurementTracker

RectangularEtaPhiTrackingRegion::UseMeasurementTracker CandidateSeededTrackingRegionsProducer::m_whereToUseMeasurementTracker
private

◆ m_zErrorBeamSpot

float CandidateSeededTrackingRegionsProducer::m_zErrorBeamSpot
private

◆ m_zErrorVetex

float CandidateSeededTrackingRegionsProducer::m_zErrorVetex
private

◆ token_beamSpot

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

◆ token_input

edm::EDGetTokenT<reco::CandidateView> CandidateSeededTrackingRegionsProducer::token_input
private

◆ token_measurementTracker

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

◆ token_vertex

edm::EDGetTokenT<reco::VertexCollection> CandidateSeededTrackingRegionsProducer::token_vertex
private
Vector3DBase
Definition: Vector3DBase.h:8
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
CandidateSeededTrackingRegionsProducer::VERTICES_FIXED
Definition: CandidateSeededTrackingRegionsProducer.h:47
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
CandidateSeededTrackingRegionsProducer::m_originRadius
float m_originRadius
Definition: CandidateSeededTrackingRegionsProducer.h:234
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
CandidateSeededTrackingRegionsProducer::BEAM_SPOT_SIGMA
Definition: CandidateSeededTrackingRegionsProducer.h:47
objects
Definition: __init__.py:1
CandidateSeededTrackingRegionsProducer::m_zErrorVetex
float m_zErrorVetex
Definition: CandidateSeededTrackingRegionsProducer.h:244
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CandidateSeededTrackingRegionsProducer::m_nSigmaZBeamSpot
float m_nSigmaZBeamSpot
Definition: CandidateSeededTrackingRegionsProducer.h:245
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
findQualityFiles.v
v
Definition: findQualityFiles.py:179
CandidateSeededTrackingRegionsProducer::m_mode
Mode m_mode
Definition: CandidateSeededTrackingRegionsProducer.h:225
edm::Handle
Definition: AssociativeIterator.h:50
dqmdumpme.first
first
Definition: dqmdumpme.py:55
CandidateSeededTrackingRegionsProducer::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: CandidateSeededTrackingRegionsProducer.h:229
cms::cuda::bs
bs
Definition: HistoContainer.h:127
CandidateSeededTrackingRegionsProducer::m_whereToUseMeasurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
Definition: CandidateSeededTrackingRegionsProducer.h:240
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CandidateSeededTrackingRegionsProducer::m_ptMin
float m_ptMin
Definition: CandidateSeededTrackingRegionsProducer.h:233
CandidateSeededTrackingRegionsProducer::Mode
Mode
Definition: CandidateSeededTrackingRegionsProducer.h:47
CandidateSeededTrackingRegionsProducer::m_maxNVertices
int m_maxNVertices
Definition: CandidateSeededTrackingRegionsProducer.h:231
reco::BeamSpot
Definition: BeamSpot.h:21
DDAxes::z
CandidateSeededTrackingRegionsProducer::m_maxNRegions
int m_maxNRegions
Definition: CandidateSeededTrackingRegionsProducer.h:227
CandidateSeededTrackingRegionsProducer::token_measurementTracker
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
Definition: CandidateSeededTrackingRegionsProducer.h:239
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CandidateSeededTrackingRegionsProducer::VERTICES_SIGMA
Definition: CandidateSeededTrackingRegionsProducer.h:47
Point3DBase< float, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CandidateSeededTrackingRegionsProducer::m_nSigmaZVertex
float m_nSigmaZVertex
Definition: CandidateSeededTrackingRegionsProducer.h:243
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::View
Definition: CaloClusterFwd.h:14
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
CandidateSeededTrackingRegionsProducer::m_deltaEta
float m_deltaEta
Definition: CandidateSeededTrackingRegionsProducer.h:236
CandidateSeededTrackingRegionsProducer::m_deltaPhi
float m_deltaPhi
Definition: CandidateSeededTrackingRegionsProducer.h:237
hgcalPerformanceValidation.objects
objects
Definition: hgcalPerformanceValidation.py:695
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CandidateSeededTrackingRegionsProducer::BEAM_SPOT_FIXED
Definition: CandidateSeededTrackingRegionsProducer.h:47
CandidateSeededTrackingRegionsProducer::token_input
edm::EDGetTokenT< reco::CandidateView > token_input
Definition: CandidateSeededTrackingRegionsProducer.h:230
reco::Candidate
Definition: Candidate.h:27
CandidateSeededTrackingRegionsProducer::m_searchOpt
bool m_searchOpt
Definition: CandidateSeededTrackingRegionsProducer.h:241
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CandidateSeededTrackingRegionsProducer::m_precise
bool m_precise
Definition: CandidateSeededTrackingRegionsProducer.h:238
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CandidateSeededTrackingRegionsProducer::token_vertex
edm::EDGetTokenT< reco::VertexCollection > token_vertex
Definition: CandidateSeededTrackingRegionsProducer.h:228
mps_fire.result
result
Definition: mps_fire.py:311
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CandidateSeededTrackingRegionsProducer::m_zErrorBeamSpot
float m_zErrorBeamSpot
Definition: CandidateSeededTrackingRegionsProducer.h:235
edm::InputTag
Definition: InputTag.h:15
RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
Definition: RectangularEtaPhiTrackingRegion.cc:82
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37