CMS 3D CMS Logo

HITrackingRegionProducer.h
Go to the documentation of this file.
1 #ifndef RecoHI_HiTracking_HITrackingRegionProducer_H
2 #define RecoHI_HiTracking_HITrackingRegionProducer_H
3 
6 
17 
18 #include "TMath.h"
19 
21 public:
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  }
40 
42 
43  int estimateMultiplicity(const edm::Event& ev, const edm::EventSetup& es) const {
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  }
71 
72  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& ev,
73  const edm::EventSetup& es) const override {
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  }
122 
123 private:
126  double thePtMin;
132 };
133 
134 #endif
Vector3DBase
Definition: Vector3DBase.h:8
GlobalTrackingRegion.h
HITrackingRegionProducer::theOriginRadius
double theOriginRadius
Definition: HITrackingRegionProducer.h:128
MessageLogger.h
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ESHandle.h
HITrackingRegionProducer::thePtMin
double thePtMin
Definition: HITrackingRegionProducer.h:126
edm::EDGetTokenT
Definition: EDGetToken.h:33
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:530
HITrackingRegionProducer::thePrecise
bool thePrecise
Definition: HITrackingRegionProducer.h:130
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
edm::Handle
Definition: AssociativeIterator.h:50
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TrackingRegionProducer.h
DetId
Definition: DetId.h:17
TrackerTopology.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
edm::ESHandle< TrackerTopology >
edmNew::DetSet
Definition: DetSetNew.h:22
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HITrackingRegionProducer::theOriginHalfLength
double theOriginHalfLength
Definition: HITrackingRegionProducer.h:129
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
SiPixelRecHitCollection.h
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
HITrackingRegionProducer::HITrackingRegionProducer
HITrackingRegionProducer(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: HITrackingRegionProducer.h:22
HITrackingRegionProducer::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &ev, const edm::EventSetup &es) const override
Definition: HITrackingRegionProducer.h:72
RectangularEtaPhiTrackingRegion.h
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:58
DetSetVector.h
HITrackingRegionProducer::estimateMultiplicity
int estimateMultiplicity(const edm::Event &ev, const edm::EventSetup &es) const
Definition: HITrackingRegionProducer.h:43
HITrackingRegionProducer::theDirection
GlobalVector theDirection
Definition: HITrackingRegionProducer.h:131
get
#define get
cc
HITrackingRegionProducer::theSiPixelRecHitsToken
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
Definition: HITrackingRegionProducer.h:125
looper.cfg
cfg
Definition: looper.py:297
HITrackingRegionProducer::~HITrackingRegionProducer
~HITrackingRegionProducer() override
Definition: HITrackingRegionProducer.h:41
edmNew::DetSetVector
Definition: DetSetNew.h:13
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
HITrackingRegionProducer
Definition: HITrackingRegionProducer.h:20
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
HITrackingRegionProducer::theOrigin
GlobalPoint theOrigin
Definition: HITrackingRegionProducer.h:127
HITrackingRegionProducer::theSiPixelRecHits
edm::InputTag theSiPixelRecHits
Definition: HITrackingRegionProducer.h:124