CMS 3D CMS Logo

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

#include <HITrackingRegionForPrimaryVtxProducer.h>

Inheritance diagram for HITrackingRegionForPrimaryVtxProducer:
TrackingRegionProducer

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

bool doVariablePtMin
 
edm::InputTag theBeamSpotTag
 
edm::EDGetTokenT< reco::BeamSpottheBeamSpotToken
 
GlobalVector theDirection
 
double theFixedError
 
double theNSigmaZ
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
double theSigmaZVertex
 
edm::InputTag theSiPixelRecHits
 
edm::EDGetTokenT< SiPixelRecHitCollectiontheSiPixelRecHitsToken
 
bool theUseFixedError
 
bool theUseFoundVertices
 
edm::InputTag vertexCollName
 
edm::EDGetTokenT< reco::VertexCollectionvertexCollToken
 

Detailed Description

Definition at line 29 of file HITrackingRegionForPrimaryVtxProducer.h.

Constructor & Destructor Documentation

◆ HITrackingRegionForPrimaryVtxProducer()

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

Definition at line 31 of file HITrackingRegionForPrimaryVtxProducer.h.

31  {
32  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
33  thePtMin = regionPSet.getParameter<double>("ptMin");
34  theOriginRadius = regionPSet.getParameter<double>("originRadius");
35  theNSigmaZ = regionPSet.getParameter<double>("nSigmaZ");
36  theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
38  thePrecise = regionPSet.getParameter<bool>("precise");
39  theSiPixelRecHits = regionPSet.getParameter<edm::InputTag>("siPixelRecHits");
41  doVariablePtMin = regionPSet.getParameter<bool>("doVariablePtMin");
42  double xDir = regionPSet.getParameter<double>("directionXCoord");
43  double yDir = regionPSet.getParameter<double>("directionYCoord");
44  double zDir = regionPSet.getParameter<double>("directionZCoord");
45  theDirection = GlobalVector(xDir, yDir, zDir);
46 
47  // for using vertex instead of beamspot
48  theSigmaZVertex = regionPSet.getParameter<double>("sigmaZVertex");
49  theFixedError = regionPSet.getParameter<double>("fixedError");
50  theUseFoundVertices = regionPSet.getParameter<bool>("useFoundVertices");
51  theUseFixedError = regionPSet.getParameter<bool>("useFixedError");
52  vertexCollName = regionPSet.getParameter<edm::InputTag>("VertexCollection");
54  }

References looper::cfg, doVariablePtMin, edm::ParameterSet::getParameter(), theBeamSpotTag, theBeamSpotToken, theDirection, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theSiPixelRecHits, theSiPixelRecHitsToken, theUseFixedError, theUseFoundVertices, vertexCollName, and vertexCollToken.

◆ ~HITrackingRegionForPrimaryVtxProducer()

HITrackingRegionForPrimaryVtxProducer::~HITrackingRegionForPrimaryVtxProducer ( )
inlineoverride

Definition at line 56 of file HITrackingRegionForPrimaryVtxProducer.h.

56 {}

Member Function Documentation

◆ estimateMultiplicity()

int HITrackingRegionForPrimaryVtxProducer::estimateMultiplicity ( const edm::Event ev,
const edm::EventSetup es 
) const
inline

Definition at line 86 of file HITrackingRegionForPrimaryVtxProducer.h.

86  {
87  //rechits
89  ev.getByToken(theSiPixelRecHitsToken, recHitColl);
90 
92  es.get<TrackerTopologyRcd>().get(httopo);
93 
94  std::vector<const TrackingRecHit*> theChosenHits;
95  edmNew::copyDetSetRange(*recHitColl, theChosenHits, httopo->pxbDetIdLayerComparator(1));
96  return theChosenHits.size();
97  }

References edmNew::copyDetSetRange(), ev, edm::EventSetup::get(), get, TrackerTopology::pxbDetIdLayerComparator(), and theSiPixelRecHitsToken.

Referenced by regions().

◆ fillDescriptions()

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

Definition at line 58 of file HITrackingRegionForPrimaryVtxProducer.h.

58  {
60 
61  desc.add<double>("ptMin", 0.7);
62  desc.add<bool>("doVariablePtMin", true);
63  desc.add<double>("originRadius", 0.2);
64  desc.add<double>("nSigmaZ", 3.0);
65  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
66  desc.add<bool>("precise", true);
67  desc.add<bool>("useMultipleScattering", false);
68  desc.add<bool>("useFakeVertices", false);
69  desc.add<edm::InputTag>("siPixelRecHits", edm::InputTag("siPixelRecHits"));
70  desc.add<double>("directionXCoord", 1.0);
71  desc.add<double>("directionYCoord", 1.0);
72  desc.add<double>("directionZCoord", 0.0);
73  desc.add<bool>("useFoundVertices", true);
74  desc.add<edm::InputTag>("VertexCollection", edm::InputTag("hiPixelClusterVertex"));
75  desc.add<bool>("useFixedError", true);
76  desc.add<double>("fixedError", 3.0);
77  desc.add<double>("sigmaZVertex", 3.0);
78 
79  // Only for backwards-compatibility
81  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
82 
83  descriptions.add("hiTrackingRegionFromClusterVtx", descRegion);
84  }

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

◆ regions()

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

Implements TrackingRegionProducer.

Definition at line 99 of file HITrackingRegionForPrimaryVtxProducer.h.

100  {
101  int estMult = estimateMultiplicity(ev, es);
102 
103  // from MC relating first layer pixel hits to "findable" sim tracks with pt>1 GeV
104  float cc = -38.6447;
105  float bb = 0.0581765;
106  float aa = 1.34306e-06;
107 
108  float estTracks = aa * estMult * estMult + bb * estMult + cc;
109 
110  LogTrace("heavyIonHLTVertexing") << "[HIVertexing]";
111  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: hits in the 1. layer:" << estMult << "]";
112  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: estimated number of tracks:" << estTracks << "]";
113 
114  float regTracking = 60.; //if we have more tracks -> regional tracking
115  float etaB = 10.;
116  float phiB = TMath::Pi() / 2.;
117 
118  float decEta = estTracks / 90.;
119  etaB = 2.5 / decEta;
120 
121  if (estTracks > regTracking) {
122  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: Regional Tracking]";
123  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: eta range: -" << etaB << ", " << etaB << "]";
124  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: phi range: -" << phiB << ", " << phiB << "]";
125  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: factor of decrease: " << decEta * 2.
126  << "]"; // 2:from phi
127  }
128 
129  float minpt = thePtMin;
130  float varPtCutoff = 1500; //cutoff
131  if (doVariablePtMin && estMult < varPtCutoff) {
132  minpt = 0.075;
133  if (estMult > 0)
134  minpt += estMult * (thePtMin - 0.075) / varPtCutoff; // lower ptMin linearly with pixel hit multiplicity
135  }
136 
137  // tracking region selection
138  std::vector<std::unique_ptr<TrackingRegion> > result;
139  double halflength;
140  GlobalPoint origin;
142  ev.getByToken(theBeamSpotToken, bsHandle);
143  if (bsHandle.isValid()) {
144  const reco::BeamSpot& bs = *bsHandle;
145  origin = GlobalPoint(bs.x0(), bs.y0(), bs.z0());
146  halflength = theNSigmaZ * bs.sigmaZ();
147 
148  if (theUseFoundVertices) {
150  ev.getByToken(vertexCollToken, vertexCollection);
151 
152  for (reco::VertexCollection::const_iterator iV = vertexCollection->begin(); iV != vertexCollection->end();
153  iV++) {
154  if (iV->isFake() || !iV->isValid())
155  continue;
156  origin = GlobalPoint(bs.x0(), bs.y0(), iV->z());
157  halflength = (theUseFixedError ? theFixedError : (iV->zError()) * theSigmaZVertex);
158  }
159  }
160 
161  if (estTracks > regTracking) { // regional tracking
162  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
163  theDirection,
164  origin,
165  thePtMin,
167  halflength,
168  etaB,
169  phiB,
171  thePrecise));
172  } else { // global tracking
173  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: Global Tracking]";
174  result.push_back(
175  std::make_unique<GlobalTrackingRegion>(minpt, origin, theOriginRadius, halflength, thePrecise));
176  }
177  }
178  return result;
179  }

References cms::cuda::bs, doVariablePtMin, estimateMultiplicity(), ev, edm::HandleBase::isValid(), RectangularEtaPhiTrackingRegion::kNever, LogTrace, HiEvtPlane_cfi::minpt, Pi, mps_fire::result, theBeamSpotToken, theDirection, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theUseFixedError, theUseFoundVertices, spclusmultinvestigator_cfi::vertexCollection, and vertexCollToken.

Member Data Documentation

◆ doVariablePtMin

bool HITrackingRegionForPrimaryVtxProducer::doVariablePtMin
private

◆ theBeamSpotTag

edm::InputTag HITrackingRegionForPrimaryVtxProducer::theBeamSpotTag
private

◆ theBeamSpotToken

edm::EDGetTokenT<reco::BeamSpot> HITrackingRegionForPrimaryVtxProducer::theBeamSpotToken
private

◆ theDirection

GlobalVector HITrackingRegionForPrimaryVtxProducer::theDirection
private

◆ theFixedError

double HITrackingRegionForPrimaryVtxProducer::theFixedError
private

◆ theNSigmaZ

double HITrackingRegionForPrimaryVtxProducer::theNSigmaZ
private

◆ theOriginRadius

double HITrackingRegionForPrimaryVtxProducer::theOriginRadius
private

◆ thePrecise

bool HITrackingRegionForPrimaryVtxProducer::thePrecise
private

◆ thePtMin

double HITrackingRegionForPrimaryVtxProducer::thePtMin
private

◆ theSigmaZVertex

double HITrackingRegionForPrimaryVtxProducer::theSigmaZVertex
private

◆ theSiPixelRecHits

edm::InputTag HITrackingRegionForPrimaryVtxProducer::theSiPixelRecHits
private

◆ theSiPixelRecHitsToken

edm::EDGetTokenT<SiPixelRecHitCollection> HITrackingRegionForPrimaryVtxProducer::theSiPixelRecHitsToken
private

◆ theUseFixedError

bool HITrackingRegionForPrimaryVtxProducer::theUseFixedError
private

◆ theUseFoundVertices

bool HITrackingRegionForPrimaryVtxProducer::theUseFoundVertices
private

◆ vertexCollName

edm::InputTag HITrackingRegionForPrimaryVtxProducer::vertexCollName
private

◆ vertexCollToken

edm::EDGetTokenT<reco::VertexCollection> HITrackingRegionForPrimaryVtxProducer::vertexCollToken
private
HITrackingRegionForPrimaryVtxProducer::theNSigmaZ
double theNSigmaZ
Definition: HITrackingRegionForPrimaryVtxProducer.h:184
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HITrackingRegionForPrimaryVtxProducer::estimateMultiplicity
int estimateMultiplicity(const edm::Event &ev, const edm::EventSetup &es) const
Definition: HITrackingRegionForPrimaryVtxProducer.h:86
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
HITrackingRegionForPrimaryVtxProducer::thePtMin
double thePtMin
Definition: HITrackingRegionForPrimaryVtxProducer.h:182
HITrackingRegionForPrimaryVtxProducer::theBeamSpotToken
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
Definition: HITrackingRegionForPrimaryVtxProducer.h:186
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
edm::Handle
Definition: AssociativeIterator.h:50
HiEvtPlane_cfi.minpt
minpt
Definition: HiEvtPlane_cfi.py:17
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ESHandle< TrackerTopology >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
edmNew::copyDetSetRange
void copyDetSetRange(DSTV const &dstv, std::vector< T const * > &v, std::pair< A, B > const &sel)
Definition: DetSetAlgorithm.h:42
HITrackingRegionForPrimaryVtxProducer::theUseFixedError
bool theUseFixedError
Definition: HITrackingRegionForPrimaryVtxProducer.h:196
HITrackingRegionForPrimaryVtxProducer::vertexCollToken
edm::EDGetTokenT< reco::VertexCollection > vertexCollToken
Definition: HITrackingRegionForPrimaryVtxProducer.h:198
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
edm::ParameterSet
Definition: ParameterSet.h:47
HITrackingRegionForPrimaryVtxProducer::theOriginRadius
double theOriginRadius
Definition: HITrackingRegionForPrimaryVtxProducer.h:183
HITrackingRegionForPrimaryVtxProducer::theDirection
GlobalVector theDirection
Definition: HITrackingRegionForPrimaryVtxProducer.h:188
HITrackingRegionForPrimaryVtxProducer::theSiPixelRecHitsToken
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
Definition: HITrackingRegionForPrimaryVtxProducer.h:190
HITrackingRegionForPrimaryVtxProducer::theSigmaZVertex
double theSigmaZVertex
Definition: HITrackingRegionForPrimaryVtxProducer.h:193
HITrackingRegionForPrimaryVtxProducer::doVariablePtMin
bool doVariablePtMin
Definition: HITrackingRegionForPrimaryVtxProducer.h:191
TrackerTopology::pxbDetIdLayerComparator
std::pair< DetId, SameLayerComparator > pxbDetIdLayerComparator(uint32_t layer) const
Definition: TrackerTopology.h:532
HITrackingRegionForPrimaryVtxProducer::theUseFoundVertices
bool theUseFoundVertices
Definition: HITrackingRegionForPrimaryVtxProducer.h:195
get
#define get
cc
HITrackingRegionForPrimaryVtxProducer::theSiPixelRecHits
edm::InputTag theSiPixelRecHits
Definition: HITrackingRegionForPrimaryVtxProducer.h:189
looper.cfg
cfg
Definition: looper.py:297
HITrackingRegionForPrimaryVtxProducer::theFixedError
double theFixedError
Definition: HITrackingRegionForPrimaryVtxProducer.h:194
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
HITrackingRegionForPrimaryVtxProducer::vertexCollName
edm::InputTag vertexCollName
Definition: HITrackingRegionForPrimaryVtxProducer.h:197
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HITrackingRegionForPrimaryVtxProducer::theBeamSpotTag
edm::InputTag theBeamSpotTag
Definition: HITrackingRegionForPrimaryVtxProducer.h:185
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HITrackingRegionForPrimaryVtxProducer::thePrecise
bool thePrecise
Definition: HITrackingRegionForPrimaryVtxProducer.h:187
edm::InputTag
Definition: InputTag.h:15