CMS 3D CMS Logo

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

#include <GlobalTrackingRegionWithVerticesProducer.h>

Inheritance diagram for GlobalTrackingRegionWithVerticesProducer:
TrackingRegionProducer

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag theBeamSpotTag
 
double theFixedError
 
bool theHalfLengthScaling
 
int theMaxNVertices
 
double theMaxPtMin
 
double theMinHalfLength
 
double theMinOriginR
 
double theNSigmaZ
 
double theOriginRadius
 
bool theOriginRScaling
 
bool thePrecise
 
double thePtMin
 
bool thePtMinScaling
 
double theScalingEnd
 
double theScalingStart
 
double theSigmaZVertex
 
bool theUseFakeVertices
 
bool theUseFixedError
 
bool theUseFoundVertices
 
bool theUseMS
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > token_pc
 
edm::EDGetTokenT< reco::VertexCollectiontoken_vertex
 

Detailed Description

Definition at line 18 of file GlobalTrackingRegionWithVerticesProducer.h.

Constructor & Destructor Documentation

◆ GlobalTrackingRegionWithVerticesProducer()

GlobalTrackingRegionWithVerticesProducer::GlobalTrackingRegionWithVerticesProducer ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 20 of file GlobalTrackingRegionWithVerticesProducer.h.

20  {
21  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
22 
23  thePtMin = regionPSet.getParameter<double>("ptMin");
24  theOriginRadius = regionPSet.getParameter<double>("originRadius");
25  theNSigmaZ = regionPSet.getParameter<double>("nSigmaZ");
26  token_beamSpot = iC.consumes<reco::BeamSpot>(regionPSet.getParameter<edm::InputTag>("beamSpot"));
27  thePrecise = regionPSet.getParameter<bool>("precise");
28  theUseMS = regionPSet.getParameter<bool>("useMultipleScattering");
29 
30  theSigmaZVertex = regionPSet.getParameter<double>("sigmaZVertex");
31  theFixedError = regionPSet.getParameter<double>("fixedError");
32 
33  theMaxNVertices = regionPSet.getParameter<int>("maxNVertices");
34 
35  theUseFoundVertices = regionPSet.getParameter<bool>("useFoundVertices");
36  theUseFakeVertices = regionPSet.getParameter<bool>("useFakeVertices");
37  theUseFixedError = regionPSet.getParameter<bool>("useFixedError");
38  token_vertex = iC.consumes<reco::VertexCollection>(regionPSet.getParameter<edm::InputTag>("VertexCollection"));
39 
40  //information for Heavy ion region scaling
41  theOriginRScaling = regionPSet.getParameter<bool>("originRScaling4BigEvts");
42  thePtMinScaling = regionPSet.getParameter<bool>("ptMinScaling4BigEvts");
43  theHalfLengthScaling = regionPSet.getParameter<bool>("halfLengthScaling4BigEvts");
44  theMinOriginR = regionPSet.getParameter<double>("minOriginR");
45  theMaxPtMin = regionPSet.getParameter<double>("maxPtMin");
46  theMinHalfLength = regionPSet.getParameter<double>("minHalfLength");
47  theScalingStart = regionPSet.getParameter<double>("scalingStartNPix");
48  theScalingEnd = regionPSet.getParameter<double>("scalingEndNPix");
49  edm::InputTag pixelClustersForScaling = regionPSet.getParameter<edm::InputTag>("pixelClustersForScaling");
52  }

References looper::cfg, edm::ParameterSet::getParameter(), HLT_FULL_cff::pixelClustersForScaling, theFixedError, theHalfLengthScaling, theMaxNVertices, theMaxPtMin, theMinHalfLength, theMinOriginR, theNSigmaZ, theOriginRadius, theOriginRScaling, thePrecise, thePtMin, thePtMinScaling, theScalingEnd, theScalingStart, theSigmaZVertex, theUseFakeVertices, theUseFixedError, theUseFoundVertices, theUseMS, token_beamSpot, token_pc, and token_vertex.

◆ ~GlobalTrackingRegionWithVerticesProducer()

GlobalTrackingRegionWithVerticesProducer::~GlobalTrackingRegionWithVerticesProducer ( )
inlineoverride

Definition at line 54 of file GlobalTrackingRegionWithVerticesProducer.h.

54 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 56 of file GlobalTrackingRegionWithVerticesProducer.h.

56  {
58 
59  desc.add<bool>("precise", true);
60  desc.add<bool>("useMultipleScattering", false);
61  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
62  desc.add<bool>("useFixedError", true);
63  desc.add<double>("originRadius", 0.2);
64  desc.add<double>("sigmaZVertex", 3.0);
65  desc.add<double>("fixedError", 0.2);
66  desc.add<edm::InputTag>("VertexCollection", edm::InputTag("firstStepPrimaryVertices"));
67  desc.add<double>("ptMin", 0.9);
68  desc.add<bool>("useFoundVertices", true);
69  desc.add<bool>("useFakeVertices", false);
70  desc.add<int>("maxNVertices", -1)->setComment("-1 for all vertices");
71  desc.add<double>("nSigmaZ", 4.0);
72  desc.add<edm::InputTag>("pixelClustersForScaling", edm::InputTag("siPixelClusters"));
73  desc.add<bool>("originRScaling4BigEvts", false);
74  desc.add<bool>("ptMinScaling4BigEvts", false);
75  desc.add<bool>("halfLengthScaling4BigEvts", false);
76  desc.add<double>("minOriginR", 0);
77  desc.add<double>("maxPtMin", 1000);
78  desc.add<double>("minHalfLength", 0);
79  desc.add<double>("scalingStartNPix", 0.0);
80  desc.add<double>("scalingEndNPix", 1.0);
81 
82  // Only for backwards-compatibility
84  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
85 
86  descriptions.add("globalTrackingRegionWithVertices", descRegion);
87  }

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

◆ regions()

std::vector<std::unique_ptr<TrackingRegion> > GlobalTrackingRegionWithVerticesProducer::regions ( const edm::Event ev,
const edm::EventSetup  
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 89 of file GlobalTrackingRegionWithVerticesProducer.h.

89  {
90  std::vector<std::unique_ptr<TrackingRegion> > result;
91 
92  GlobalPoint theOrigin;
94  ev.getByToken(token_beamSpot, bsHandle);
95  double bsSigmaZ;
96  if (bsHandle.isValid()) {
97  const reco::BeamSpot& bs = *bsHandle;
98  bsSigmaZ = theNSigmaZ * bs.sigmaZ();
99  theOrigin = GlobalPoint(bs.x0(), bs.y0(), bs.z0());
100  } else {
101  throw cms::Exception("Seeding") << "ERROR: input beamSpot is not valid in GlobalTrackingRegionWithVertices";
102  }
103 
104  if (theUseFoundVertices) {
106  ev.getByToken(token_vertex, vertexCollection);
107 
110  if (doScaling)
111  ev.getByToken(token_pc, pixelClusterDSV);
112 
113  for (reco::VertexCollection::const_iterator iV = vertexCollection->begin(); iV != vertexCollection->end(); iV++) {
114  if (!iV->isValid())
115  continue;
116  if (iV->isFake() && !(theUseFakeVertices && theUseFixedError))
117  continue;
118  GlobalPoint theOrigin_ = GlobalPoint(iV->x(), iV->y(), iV->z());
119 
120  //scaling origin radius, half length, min pt for high-occupancy HI events to keep timing reasonable
121  if (doScaling) {
122  //Use the unscaled radius unless one of the two conditions below is met
123  double scaledOriginRadius = theOriginRadius;
124  double scaledHalfLength = theFixedError;
125  double scaledPtMin = thePtMin;
126 
127  //calculate nPixels (adapted from TkSeedGenerator/src/ClusterChecker.cc)
128  double nPix = 0;
129 
130  const edmNew::DetSetVector<SiPixelCluster>& input = *pixelClusterDSV;
131  nPix = input.dataSize();
132 
133  //first condition is for high occupancy, second makes sure we won't divide by zero or a negative number
134  if ((nPix > theScalingEnd) || ((theScalingEnd - theScalingStart) <= 0)) {
135  if (theOriginRScaling)
136  scaledOriginRadius = theMinOriginR; // sets parameters to minimum value from PSet
138  scaledHalfLength = theMinHalfLength;
139  if (thePtMinScaling)
140  scaledPtMin = theMaxPtMin;
141  }
142  //second condition - scale radius linearly by Npix in the region from ScalingStart to ScalingEnd
143  else if ((nPix <= theScalingEnd) && (nPix > theScalingStart)) {
144  float slopeFactor = (nPix - theScalingStart) / (theScalingEnd - theScalingStart);
145  if (theOriginRScaling)
146  scaledOriginRadius = theOriginRadius - (theOriginRadius - theMinOriginR) * slopeFactor;
148  scaledHalfLength = theFixedError - (theFixedError - theMinHalfLength) * slopeFactor;
149  if (thePtMinScaling)
150  scaledPtMin = thePtMin - (thePtMin - theMaxPtMin) * slopeFactor;
151  }
152  //if region has 0 size, return 'result' empty, otherwise make a tracking region
153  if (scaledOriginRadius != 0 && scaledHalfLength != 0) {
154  result.push_back(std::make_unique<GlobalTrackingRegion>(
155  scaledPtMin, theOrigin_, scaledOriginRadius, scaledHalfLength, thePrecise, theUseMS));
156  }
157  } //end of region scaling code, pp behavior below
158 
159  else {
160  double theOriginHalfLength_ = (theUseFixedError ? theFixedError : (iV->zError()) * theSigmaZVertex);
161  result.push_back(std::make_unique<GlobalTrackingRegion>(
162  thePtMin, theOrigin_, theOriginRadius, theOriginHalfLength_, thePrecise, theUseMS));
163  if (theMaxNVertices >= 0 && result.size() >= static_cast<unsigned>(theMaxNVertices))
164  break;
165  }
166  }
167 
169  result.push_back(std::make_unique<GlobalTrackingRegion>(
170  thePtMin, theOrigin, theOriginRadius, bsSigmaZ, thePrecise, theUseMS));
171  }
172  } else {
173  result.push_back(
174  std::make_unique<GlobalTrackingRegion>(thePtMin, theOrigin, theOriginRadius, bsSigmaZ, thePrecise, theUseMS));
175  }
176 
177  return result;
178  }

References cms::cuda::bs, ev, Exception, input, edm::HandleBase::isValid(), mps_fire::result, theFixedError, theHalfLengthScaling, theMaxNVertices, theMaxPtMin, theMinHalfLength, theMinOriginR, theNSigmaZ, theOriginRadius, theOriginRScaling, thePrecise, thePtMin, thePtMinScaling, theScalingEnd, theScalingStart, theSigmaZVertex, theUseFakeVertices, theUseFixedError, theUseFoundVertices, theUseMS, token_beamSpot, token_pc, token_vertex, and spclusmultinvestigator_cfi::vertexCollection.

Member Data Documentation

◆ theBeamSpotTag

edm::InputTag GlobalTrackingRegionWithVerticesProducer::theBeamSpotTag
private

Definition at line 184 of file GlobalTrackingRegionWithVerticesProducer.h.

◆ theFixedError

double GlobalTrackingRegionWithVerticesProducer::theFixedError
private

◆ theHalfLengthScaling

bool GlobalTrackingRegionWithVerticesProducer::theHalfLengthScaling
private

◆ theMaxNVertices

int GlobalTrackingRegionWithVerticesProducer::theMaxNVertices
private

◆ theMaxPtMin

double GlobalTrackingRegionWithVerticesProducer::theMaxPtMin
private

◆ theMinHalfLength

double GlobalTrackingRegionWithVerticesProducer::theMinHalfLength
private

◆ theMinOriginR

double GlobalTrackingRegionWithVerticesProducer::theMinOriginR
private

◆ theNSigmaZ

double GlobalTrackingRegionWithVerticesProducer::theNSigmaZ
private

◆ theOriginRadius

double GlobalTrackingRegionWithVerticesProducer::theOriginRadius
private

◆ theOriginRScaling

bool GlobalTrackingRegionWithVerticesProducer::theOriginRScaling
private

◆ thePrecise

bool GlobalTrackingRegionWithVerticesProducer::thePrecise
private

◆ thePtMin

double GlobalTrackingRegionWithVerticesProducer::thePtMin
private

◆ thePtMinScaling

bool GlobalTrackingRegionWithVerticesProducer::thePtMinScaling
private

◆ theScalingEnd

double GlobalTrackingRegionWithVerticesProducer::theScalingEnd
private

◆ theScalingStart

double GlobalTrackingRegionWithVerticesProducer::theScalingStart
private

◆ theSigmaZVertex

double GlobalTrackingRegionWithVerticesProducer::theSigmaZVertex
private

◆ theUseFakeVertices

bool GlobalTrackingRegionWithVerticesProducer::theUseFakeVertices
private

◆ theUseFixedError

bool GlobalTrackingRegionWithVerticesProducer::theUseFixedError
private

◆ theUseFoundVertices

bool GlobalTrackingRegionWithVerticesProducer::theUseFoundVertices
private

◆ theUseMS

bool GlobalTrackingRegionWithVerticesProducer::theUseMS
private

◆ token_beamSpot

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

◆ token_pc

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > GlobalTrackingRegionWithVerticesProducer::token_pc
private

◆ token_vertex

edm::EDGetTokenT<reco::VertexCollection> GlobalTrackingRegionWithVerticesProducer::token_vertex
private
GlobalTrackingRegionWithVerticesProducer::theMinOriginR
double theMinOriginR
Definition: GlobalTrackingRegionWithVerticesProducer.h:202
GlobalTrackingRegionWithVerticesProducer::theHalfLengthScaling
bool theHalfLengthScaling
Definition: GlobalTrackingRegionWithVerticesProducer.h:201
GlobalTrackingRegionWithVerticesProducer::theUseMS
bool theUseMS
Definition: GlobalTrackingRegionWithVerticesProducer.h:190
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
GlobalTrackingRegionWithVerticesProducer::theOriginRadius
double theOriginRadius
Definition: GlobalTrackingRegionWithVerticesProducer.h:182
GlobalTrackingRegionWithVerticesProducer::theSigmaZVertex
double theSigmaZVertex
Definition: GlobalTrackingRegionWithVerticesProducer.h:186
GlobalTrackingRegionWithVerticesProducer::theUseFixedError
bool theUseFixedError
Definition: GlobalTrackingRegionWithVerticesProducer.h:194
GlobalTrackingRegionWithVerticesProducer::theMaxNVertices
int theMaxNVertices
Definition: GlobalTrackingRegionWithVerticesProducer.h:188
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GlobalTrackingRegionWithVerticesProducer::theOriginRScaling
bool theOriginRScaling
Definition: GlobalTrackingRegionWithVerticesProducer.h:199
GlobalTrackingRegionWithVerticesProducer::theMaxPtMin
double theMaxPtMin
Definition: GlobalTrackingRegionWithVerticesProducer.h:203
edm::Handle< reco::BeamSpot >
GlobalTrackingRegionWithVerticesProducer::thePtMinScaling
bool thePtMinScaling
Definition: GlobalTrackingRegionWithVerticesProducer.h:200
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GlobalTrackingRegionWithVerticesProducer::theUseFakeVertices
bool theUseFakeVertices
Definition: GlobalTrackingRegionWithVerticesProducer.h:193
reco::BeamSpot
Definition: BeamSpot.h:21
GlobalTrackingRegionWithVerticesProducer::theFixedError
double theFixedError
Definition: GlobalTrackingRegionWithVerticesProducer.h:187
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
GlobalTrackingRegionWithVerticesProducer::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: GlobalTrackingRegionWithVerticesProducer.h:196
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
GlobalTrackingRegionWithVerticesProducer::token_pc
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > token_pc
Definition: GlobalTrackingRegionWithVerticesProducer.h:207
edm::ParameterSet
Definition: ParameterSet.h:47
GlobalTrackingRegionWithVerticesProducer::theScalingEnd
double theScalingEnd
Definition: GlobalTrackingRegionWithVerticesProducer.h:206
GlobalTrackingRegionWithVerticesProducer::token_vertex
edm::EDGetTokenT< reco::VertexCollection > token_vertex
Definition: GlobalTrackingRegionWithVerticesProducer.h:195
looper.cfg
cfg
Definition: looper.py:297
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
GlobalTrackingRegionWithVerticesProducer::theNSigmaZ
double theNSigmaZ
Definition: GlobalTrackingRegionWithVerticesProducer.h:183
GlobalTrackingRegionWithVerticesProducer::theMinHalfLength
double theMinHalfLength
Definition: GlobalTrackingRegionWithVerticesProducer.h:204
GlobalTrackingRegionWithVerticesProducer::thePrecise
bool thePrecise
Definition: GlobalTrackingRegionWithVerticesProducer.h:189
GlobalTrackingRegionWithVerticesProducer::theUseFoundVertices
bool theUseFoundVertices
Definition: GlobalTrackingRegionWithVerticesProducer.h:192
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
GlobalTrackingRegionWithVerticesProducer::thePtMin
double thePtMin
Definition: GlobalTrackingRegionWithVerticesProducer.h:181
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
mps_fire.result
result
Definition: mps_fire.py:311
HLT_FULL_cff.pixelClustersForScaling
pixelClustersForScaling
Definition: HLT_FULL_cff.py:109591
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
GlobalTrackingRegionWithVerticesProducer::theScalingStart
double theScalingStart
Definition: GlobalTrackingRegionWithVerticesProducer.h:205