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=default
 
- 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
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheFieldToken
 
double theFixedError
 
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecordtheMSMakerToken
 
double theNSigmaZ
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
double theSigmaZVertex
 
edm::InputTag theSiPixelRecHits
 
edm::EDGetTokenT< SiPixelRecHitCollectiontheSiPixelRecHitsToken
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtheTtopoToken
 
bool theUseFixedError
 
bool theUseFoundVertices
 
edm::InputTag vertexCollName
 
edm::EDGetTokenT< reco::VertexCollectionvertexCollToken
 

Detailed Description

Definition at line 34 of file HITrackingRegionForPrimaryVtxProducer.h.

Constructor & Destructor Documentation

◆ HITrackingRegionForPrimaryVtxProducer()

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

Definition at line 36 of file HITrackingRegionForPrimaryVtxProducer.h.

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

38  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
39  thePtMin = regionPSet.getParameter<double>("ptMin");
40  theOriginRadius = regionPSet.getParameter<double>("originRadius");
41  theNSigmaZ = regionPSet.getParameter<double>("nSigmaZ");
42  theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
44  thePrecise = regionPSet.getParameter<bool>("precise");
45  theSiPixelRecHits = regionPSet.getParameter<edm::InputTag>("siPixelRecHits");
47  doVariablePtMin = regionPSet.getParameter<bool>("doVariablePtMin");
48  double xDir = regionPSet.getParameter<double>("directionXCoord");
49  double yDir = regionPSet.getParameter<double>("directionYCoord");
50  double zDir = regionPSet.getParameter<double>("directionZCoord");
51  theDirection = GlobalVector(xDir, yDir, zDir);
52 
53  // for using vertex instead of beamspot
54  theSigmaZVertex = regionPSet.getParameter<double>("sigmaZVertex");
55  theFixedError = regionPSet.getParameter<double>("fixedError");
56  theUseFoundVertices = regionPSet.getParameter<bool>("useFoundVertices");
57  theUseFixedError = regionPSet.getParameter<bool>("useFixedError");
58  vertexCollName = regionPSet.getParameter<edm::InputTag>("VertexCollection");
60 
61  if (thePrecise) {
63  }
64  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopoToken
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
edm::EDGetTokenT< reco::VertexCollection > vertexCollToken
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ ~HITrackingRegionForPrimaryVtxProducer()

HITrackingRegionForPrimaryVtxProducer::~HITrackingRegionForPrimaryVtxProducer ( )
overridedefault

Member Function Documentation

◆ estimateMultiplicity()

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

Definition at line 96 of file HITrackingRegionForPrimaryVtxProducer.h.

References edmNew::copyDetSetRange(), makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), theSiPixelRecHitsToken, and theTtopoToken.

Referenced by regions().

96  {
97  //rechits
99  ev.getByToken(theSiPixelRecHitsToken, recHitColl);
100 
101  auto const& ttopo = es.getData(theTtopoToken);
102 
103  std::vector<const TrackingRecHit*> theChosenHits;
104  edmNew::copyDetSetRange(*recHitColl, theChosenHits, ttopo.pxbDetIdLayerComparator(1));
105  return theChosenHits.size();
106  }
void copyDetSetRange(DSTV const &dstv, std::vector< T const *> &v, std::pair< A, B > const &sel)
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopoToken

◆ fillDescriptions()

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

Definition at line 68 of file HITrackingRegionForPrimaryVtxProducer.h.

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

68  {
70 
71  desc.add<double>("ptMin", 0.7);
72  desc.add<bool>("doVariablePtMin", true);
73  desc.add<double>("originRadius", 0.2);
74  desc.add<double>("nSigmaZ", 3.0);
75  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
76  desc.add<bool>("precise", true);
77  desc.add<bool>("useMultipleScattering", false);
78  desc.add<bool>("useFakeVertices", false);
79  desc.add<edm::InputTag>("siPixelRecHits", edm::InputTag("siPixelRecHits"));
80  desc.add<double>("directionXCoord", 1.0);
81  desc.add<double>("directionYCoord", 1.0);
82  desc.add<double>("directionZCoord", 0.0);
83  desc.add<bool>("useFoundVertices", true);
84  desc.add<edm::InputTag>("VertexCollection", edm::InputTag("hiPixelClusterVertex"));
85  desc.add<bool>("useFixedError", true);
86  desc.add<double>("fixedError", 3.0);
87  desc.add<double>("sigmaZVertex", 3.0);
88 
89  // Only for backwards-compatibility
91  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
92 
93  descriptions.add("hiTrackingRegionFromClusterVtx", descRegion);
94  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ regions()

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

Implements TrackingRegionProducer.

Definition at line 108 of file HITrackingRegionForPrimaryVtxProducer.h.

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

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

◆ theFieldToken

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> HITrackingRegionForPrimaryVtxProducer::theFieldToken
private

Definition at line 207 of file HITrackingRegionForPrimaryVtxProducer.h.

Referenced by regions().

◆ theFixedError

double HITrackingRegionForPrimaryVtxProducer::theFixedError
private

◆ theMSMakerToken

edm::ESGetToken<MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord> HITrackingRegionForPrimaryVtxProducer::theMSMakerToken
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

◆ theTtopoToken

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> HITrackingRegionForPrimaryVtxProducer::theTtopoToken
private

Definition at line 206 of file HITrackingRegionForPrimaryVtxProducer.h.

Referenced by estimateMultiplicity().

◆ theUseFixedError

bool HITrackingRegionForPrimaryVtxProducer::theUseFixedError
private

◆ theUseFoundVertices

bool HITrackingRegionForPrimaryVtxProducer::theUseFoundVertices
private

◆ vertexCollName

edm::InputTag HITrackingRegionForPrimaryVtxProducer::vertexCollName
private

◆ vertexCollToken

edm::EDGetTokenT<reco::VertexCollection> HITrackingRegionForPrimaryVtxProducer::vertexCollToken
private