CMS 3D CMS Logo

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

#include <HITrackingRegionProducer.h>

Inheritance diagram for HITrackingRegionProducer:
TrackingRegionProducer

Public Member Functions

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

Private Attributes

GlobalVector theDirection
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheFieldToken
 
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecordtheMSMakerToken
 
GlobalPoint theOrigin
 
double theOriginHalfLength
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
edm::InputTag theSiPixelRecHits
 
edm::EDGetTokenT< SiPixelRecHitCollectiontheSiPixelRecHitsToken
 
edm::ESGetToken< TrackerTopology, IdealGeometryRecordtheTtopoToken
 

Detailed Description

Definition at line 23 of file HITrackingRegionProducer.h.

Constructor & Destructor Documentation

◆ HITrackingRegionProducer()

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

Definition at line 25 of file HITrackingRegionProducer.h.

References looper::cfg, edm::ParameterSet::getParameter(), theDirection, theMSMakerToken, theOrigin, theOriginHalfLength, theOriginRadius, thePrecise, thePtMin, theSiPixelRecHits, and theSiPixelRecHitsToken.

27  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
28 
29  thePtMin = regionPSet.getParameter<double>("ptMin");
30  theOriginRadius = regionPSet.getParameter<double>("originRadius");
31  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
32  double xPos = regionPSet.getParameter<double>("originXPos");
33  double yPos = regionPSet.getParameter<double>("originYPos");
34  double zPos = regionPSet.getParameter<double>("originZPos");
35  double xDir = regionPSet.getParameter<double>("directionXCoord");
36  double yDir = regionPSet.getParameter<double>("directionYCoord");
37  double zDir = regionPSet.getParameter<double>("directionZCoord");
38  thePrecise = regionPSet.getParameter<bool>("precise");
39  theSiPixelRecHits = regionPSet.getParameter<edm::InputTag>("siPixelRecHits");
41  theOrigin = GlobalPoint(xPos, yPos, zPos);
42  theDirection = GlobalVector(xDir, yDir, zDir);
43  if (thePrecise) {
45  }
46  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
edm::ESGetToken< TrackerTopology, IdealGeometryRecord > theTtopoToken
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ ~HITrackingRegionProducer()

HITrackingRegionProducer::~HITrackingRegionProducer ( )
overridedefault

Member Function Documentation

◆ estimateMultiplicity()

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

Definition at line 50 of file HITrackingRegionProducer.h.

References edmNew::DetSetVector< T >::begin(), hcalRecHitTable_cff::detId, edmNew::DetSetVector< T >::end(), makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), hfClusterShapes_cfi::hits, nano_mu_digi_cff::layer, theSiPixelRecHitsToken, and theTtopoToken.

Referenced by regions().

50  {
51  //rechits
53  ev.getByToken(theSiPixelRecHitsToken, recHitColl);
54 
55  //Retrieve tracker topology from geometry
56  const auto& tTopo = es.getData(theTtopoToken);
57 
58  int numRecHits = 0;
59  //FIXME: this can be optimized quite a bit by looping only on the per-det 'items' of DetSetVector
60  for (SiPixelRecHitCollection::const_iterator recHitIdIterator = recHitColl->begin(),
61  recHitIdIteratorEnd = recHitColl->end();
62  recHitIdIterator != recHitIdIteratorEnd;
63  recHitIdIterator++) {
64  SiPixelRecHitCollection::DetSet hits = *recHitIdIterator;
65  DetId detId = DetId(hits.detId()); // Get the Detid object
66  unsigned int detType = detId.det(); // det type, tracker=1
67  unsigned int subid = detId.subdetId(); //subdetector type, barrel=1, fpix=2
68 
69  unsigned int layer = 0;
70  layer = tTopo.pxbLayer(detId);
71  if (detType == 1 && subid == 1 && layer == 1) {
72  numRecHits += hits.size();
73  }
74  }
75  return numRecHits;
76  }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
const_iterator end(bool update=false) const
edm::ESGetToken< TrackerTopology, IdealGeometryRecord > theTtopoToken
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
const_iterator begin(bool update=false) const

◆ regions()

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

Implements TrackingRegionProducer.

Definition at line 78 of file HITrackingRegionProducer.h.

References gpuPixelDoublets::cc, estimateMultiplicity(), makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), LogTrace, Pi, mps_fire::result, theDirection, theFieldToken, theMSMakerToken, theOrigin, theOriginHalfLength, theOriginRadius, thePrecise, and thePtMin.

79  {
80  int estMult = estimateMultiplicity(ev, es);
81 
82  // fit from MC information
83  float aa = 1.90935e-04;
84  float bb = -2.90167e-01;
85  float cc = 3.86125e+02;
86 
87  float estTracks = aa * estMult * estMult + bb * estMult + cc;
88 
89  LogTrace("heavyIonHLTVertexing") << "[HIVertexing]";
90  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: hits in the 1. layer:" << estMult << "]";
91  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: estimated number of tracks:" << estTracks << "]";
92 
93  float regTracking = 400.; //if we have more tracks -> regional tracking
94  float etaB = 10.;
95  float phiB = TMath::Pi() / 2.;
96 
97  float decEta = estTracks / 600.;
98  etaB = 2.5 / decEta;
99 
100  if (estTracks > regTracking) {
101  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: Regional Tracking]";
102  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: eta range: -" << etaB << ", " << etaB << "]";
103  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: phi range: -" << phiB << ", " << phiB << "]";
104  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: factor of decrease: " << decEta * 2.
105  << "]"; // 2:from phi
106  }
107 
108  // tracking region selection
109  std::vector<std::unique_ptr<TrackingRegion> > result;
110  if (estTracks > regTracking) { // regional tracking
111  const auto& field = es.getData(theFieldToken);
112  const MultipleScatteringParametrisationMaker* msmaker = nullptr;
113  if (thePrecise) {
114  msmaker = &es.getData(theMSMakerToken);
115  }
116 
117  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(theDirection,
118  theOrigin,
119  thePtMin,
122  etaB,
123  phiB,
124  field,
125  msmaker,
126  thePrecise));
127  } else { // global tracking
128  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: Global Tracking]";
129  result.push_back(std::make_unique<GlobalTrackingRegion>(
131  }
132  return result;
133  }
const double Pi
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
#define LogTrace(id)
int estimateMultiplicity(const edm::Event &ev, const edm::EventSetup &es) const
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken

Member Data Documentation

◆ theDirection

GlobalVector HITrackingRegionProducer::theDirection
private

Definition at line 146 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ theFieldToken

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

Definition at line 139 of file HITrackingRegionProducer.h.

Referenced by regions().

◆ theMSMakerToken

edm::ESGetToken<MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord> HITrackingRegionProducer::theMSMakerToken
private

Definition at line 140 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ theOrigin

GlobalPoint HITrackingRegionProducer::theOrigin
private

Definition at line 142 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ theOriginHalfLength

double HITrackingRegionProducer::theOriginHalfLength
private

Definition at line 144 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ theOriginRadius

double HITrackingRegionProducer::theOriginRadius
private

Definition at line 143 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ thePrecise

bool HITrackingRegionProducer::thePrecise
private

Definition at line 145 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ thePtMin

double HITrackingRegionProducer::thePtMin
private

Definition at line 141 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

◆ theSiPixelRecHits

edm::InputTag HITrackingRegionProducer::theSiPixelRecHits
private

Definition at line 136 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer().

◆ theSiPixelRecHitsToken

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

Definition at line 137 of file HITrackingRegionProducer.h.

Referenced by estimateMultiplicity(), and HITrackingRegionProducer().

◆ theTtopoToken

edm::ESGetToken<TrackerTopology, IdealGeometryRecord> HITrackingRegionProducer::theTtopoToken
private

Definition at line 138 of file HITrackingRegionProducer.h.

Referenced by estimateMultiplicity().