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
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

GlobalVector theDirection
 
GlobalPoint theOrigin
 
double theOriginHalfLength
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
edm::InputTag theSiPixelRecHits
 
edm::EDGetTokenT< SiPixelRecHitCollectiontheSiPixelRecHitsToken
 

Detailed Description

Definition at line 20 of file HITrackingRegionProducer.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file HITrackingRegionProducer.h.

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

22  {
23  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
24 
25  thePtMin = regionPSet.getParameter<double>("ptMin");
26  theOriginRadius = regionPSet.getParameter<double>("originRadius");
27  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
28  double xPos = regionPSet.getParameter<double>("originXPos");
29  double yPos = regionPSet.getParameter<double>("originYPos");
30  double zPos = regionPSet.getParameter<double>("originZPos");
31  double xDir = regionPSet.getParameter<double>("directionXCoord");
32  double yDir = regionPSet.getParameter<double>("directionYCoord");
33  double zDir = regionPSet.getParameter<double>("directionZCoord");
34  thePrecise = regionPSet.getParameter<bool>("precise");
35  theSiPixelRecHits = regionPSet.getParameter<edm::InputTag>("siPixelRecHits");
37  theOrigin = GlobalPoint(xPos, yPos, zPos);
38  theDirection = GlobalVector(xDir, yDir, zDir);
39  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Global3DVector GlobalVector
Definition: GlobalVector.h:10
HITrackingRegionProducer::~HITrackingRegionProducer ( )
inlineoverride

Definition at line 41 of file HITrackingRegionProducer.h.

41 {}

Member Function Documentation

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

Definition at line 43 of file HITrackingRegionProducer.h.

References edmNew::DetSetVector< T >::begin(), DetId::det(), edmNew::DetSet< T >::detId(), edmNew::DetSetVector< T >::end(), edm::EventSetup::get(), edm::Event::getByToken(), hfClusterShapes_cfi::hits, TrackerTopology::pxbLayer(), edmNew::DetSet< T >::size(), DetId::subdetId(), and theSiPixelRecHitsToken.

Referenced by regions().

43  {
44  //rechits
46  ev.getByToken(theSiPixelRecHitsToken, recHitColl);
47 
48  //Retrieve tracker topology from geometry
50  es.get<IdealGeometryRecord>().get(tTopo);
51 
52  int numRecHits = 0;
53  //FIXME: this can be optimized quite a bit by looping only on the per-det 'items' of DetSetVector
54  for (SiPixelRecHitCollection::const_iterator recHitIdIterator = recHitColl->begin(),
55  recHitIdIteratorEnd = recHitColl->end();
56  recHitIdIterator != recHitIdIteratorEnd;
57  recHitIdIterator++) {
58  SiPixelRecHitCollection::DetSet hits = *recHitIdIterator;
59  DetId detId = DetId(hits.detId()); // Get the Detid object
60  unsigned int detType = detId.det(); // det type, tracker=1
61  unsigned int subid = detId.subdetId(); //subdetector type, barrel=1, fpix=2
62 
63  unsigned int layer = 0;
64  layer = tTopo->pxbLayer(detId);
65  if (detType == 1 && subid == 1 && layer == 1) {
66  numRecHits += hits.size();
67  }
68  }
69  return numRecHits;
70  }
const_iterator end(bool update=false) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int pxbLayer(const DetId &id) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
id_type detId() const
Definition: DetSetNew.h:66
T get() const
Definition: EventSetup.h:73
size_type size() const
Definition: DetSetNew.h:68
const_iterator begin(bool update=false) const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
std::vector<std::unique_ptr<TrackingRegion> > HITrackingRegionProducer::regions ( const edm::Event ev,
const edm::EventSetup es 
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 72 of file HITrackingRegionProducer.h.

References estimateMultiplicity(), RectangularEtaPhiTrackingRegion::kNever, LogTrace, Pi, mps_fire::result, theDirection, theOrigin, theOriginHalfLength, theOriginRadius, thePrecise, and thePtMin.

73  {
74  int estMult = estimateMultiplicity(ev, es);
75 
76  // fit from MC information
77  float aa = 1.90935e-04;
78  float bb = -2.90167e-01;
79  float cc = 3.86125e+02;
80 
81  float estTracks = aa * estMult * estMult + bb * estMult + cc;
82 
83  LogTrace("heavyIonHLTVertexing") << "[HIVertexing]";
84  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: hits in the 1. layer:" << estMult << "]";
85  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: estimated number of tracks:" << estTracks << "]";
86 
87  float regTracking = 400.; //if we have more tracks -> regional tracking
88  float etaB = 10.;
89  float phiB = TMath::Pi() / 2.;
90 
91  float decEta = estTracks / 600.;
92  etaB = 2.5 / decEta;
93 
94  if (estTracks > regTracking) {
95  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: Regional Tracking]";
96  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: eta range: -" << etaB << ", " << etaB << "]";
97  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: phi range: -" << phiB << ", " << phiB << "]";
98  LogTrace("heavyIonHLTVertexing") << " [Regional Tracking: factor of decrease: " << decEta * 2.
99  << "]"; // 2:from phi
100  }
101 
102  // tracking region selection
103  std::vector<std::unique_ptr<TrackingRegion> > result;
104  if (estTracks > regTracking) { // regional tracking
105  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
106  theDirection,
107  theOrigin,
108  thePtMin,
111  etaB,
112  phiB,
114  thePrecise));
115  } else { // global tracking
116  LogTrace("heavyIonHLTVertexing") << " [HIVertexing: Global Tracking]";
117  result.push_back(std::make_unique<GlobalTrackingRegion>(
119  }
120  return result;
121  }
const double Pi
int estimateMultiplicity(const edm::Event &ev, const edm::EventSetup &es) const
#define LogTrace(id)

Member Data Documentation

GlobalVector HITrackingRegionProducer::theDirection
private

Definition at line 131 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

GlobalPoint HITrackingRegionProducer::theOrigin
private

Definition at line 127 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

double HITrackingRegionProducer::theOriginHalfLength
private

Definition at line 129 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

double HITrackingRegionProducer::theOriginRadius
private

Definition at line 128 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

bool HITrackingRegionProducer::thePrecise
private

Definition at line 130 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

double HITrackingRegionProducer::thePtMin
private

Definition at line 126 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer(), and regions().

edm::InputTag HITrackingRegionProducer::theSiPixelRecHits
private

Definition at line 124 of file HITrackingRegionProducer.h.

Referenced by HITrackingRegionProducer().

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

Definition at line 125 of file HITrackingRegionProducer.h.

Referenced by estimateMultiplicity(), and HITrackingRegionProducer().