CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HITrackingRegionProducer.h
Go to the documentation of this file.
1 #ifndef RecoHI_HiTracking_HITrackingRegionProducer_H
2 #define RecoHI_HiTracking_HITrackingRegionProducer_H
3 
5 
16 
17 #include "TMath.h"
18 
20 
21  public:
22 
24 
25  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
26 
27  thePtMin = regionPSet.getParameter<double>("ptMin");
28  theOriginRadius = regionPSet.getParameter<double>("originRadius");
29  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
30  double xPos = regionPSet.getParameter<double>("originXPos");
31  double yPos = regionPSet.getParameter<double>("originYPos");
32  double zPos = regionPSet.getParameter<double>("originZPos");
33  double xDir = regionPSet.getParameter<double>("directionXCoord");
34  double yDir = regionPSet.getParameter<double>("directionYCoord");
35  double zDir = regionPSet.getParameter<double>("directionZCoord");
36  thePrecise = regionPSet.getParameter<bool>("precise");
37  theSiPixelRecHits = regionPSet.getParameter<std::string>("siPixelRecHits");
38  theOrigin = GlobalPoint(xPos,yPos,zPos);
39  theDirection = GlobalVector(xDir, yDir, zDir);
40  }
41 
43 
45  (const edm::Event& ev, const edm::EventSetup& es) const
46  {
47  //rechits
49  ev.getByLabel(theSiPixelRecHits, recHitColl);
50 
51  //Retrieve tracker topology from geometry
53  es.get<IdealGeometryRecord>().get(tTopo);
54 
55  int numRecHits = 0;
56  //FIXME: this can be optimized quite a bit by looping only on the per-det 'items' of DetSetVector
57  for(SiPixelRecHitCollection::const_iterator recHitIdIterator = recHitColl->begin(), recHitIdIteratorEnd = recHitColl->end();
58  recHitIdIterator != recHitIdIteratorEnd; recHitIdIterator++) {
59  SiPixelRecHitCollection::DetSet hits = *recHitIdIterator;
60  DetId detId = DetId(hits.detId()); // Get the Detid object
61  unsigned int detType=detId.det(); // det type, tracker=1
62  unsigned int subid=detId.subdetId(); //subdetector type, barrel=1, fpix=2
63 
64  unsigned int layer=0;
65  layer=tTopo->pxbLayer(detId);
66  if(detType==1 && subid==1 && layer==1) {
67  numRecHits += hits.size();
68  }
69  }
70  return numRecHits;
71  }
72 
73  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev, const edm::EventSetup& es) const {
74 
75  int estMult = estimateMultiplicity(ev, es);
76 
77  // fit from MC information
78  float aa = 1.90935e-04;
79  float bb = -2.90167e-01;
80  float cc = 3.86125e+02;
81 
82  float estTracks = aa*estMult*estMult+bb*estMult+cc;
83 
84  LogTrace("heavyIonHLTVertexing")<<"[HIVertexing]";
85  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: hits in the 1. layer:" << estMult << "]";
86  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: estimated number of tracks:" << estTracks << "]";
87 
88  float regTracking = 400.; //if we have more tracks -> regional tracking
89  float etaB = 10.;
90  float phiB = TMath::Pi()/2.;
91 
92  float decEta = estTracks/600.;
93  etaB = 2.5/decEta;
94 
95  if(estTracks>regTracking) {
96  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: Regional Tracking]";
97  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: eta range: -" << etaB << ", "<< etaB <<"]";
98  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: phi range: -" << phiB << ", "<< phiB <<"]";
99  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: factor of decrease: " << decEta*2. << "]"; // 2:from phi
100  }
101 
102  // tracking region selection
103  std::vector<TrackingRegion* > result;
104  if(estTracks>regTracking) { // regional tracking
106  }
107  else { // global tracking
108  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: Global Tracking]";
110  }
111  return
112  result;
113  }
114 
115  private:
117  double thePtMin;
123 };
124 
125 #endif
const double Pi
T getParameter(std::string const &) const
int estimateMultiplicity(const edm::Event &ev, const edm::EventSetup &es) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
HITrackingRegionProducer(const edm::ParameterSet &cfg)
double zPos
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double xPos
tuple result
Definition: query.py:137
double yPos
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
#define LogTrace(id)
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
id_type detId() const
Definition: DetSetNew.h:72
size_type size() const
Definition: DetSetNew.h:75
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const
Global3DVector GlobalVector
Definition: GlobalVector.h:10