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 
11 
15 
16 #include "TMath.h"
17 
19 
20  public:
21 
23 
24  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
25 
26  thePtMin = regionPSet.getParameter<double>("ptMin");
27  theOriginRadius = regionPSet.getParameter<double>("originRadius");
28  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
29  double xPos = regionPSet.getParameter<double>("originXPos");
30  double yPos = regionPSet.getParameter<double>("originYPos");
31  double zPos = regionPSet.getParameter<double>("originZPos");
32  double xDir = regionPSet.getParameter<double>("directionXCoord");
33  double yDir = regionPSet.getParameter<double>("directionYCoord");
34  double zDir = regionPSet.getParameter<double>("directionZCoord");
35  thePrecise = regionPSet.getParameter<bool>("precise");
36  theSiPixelRecHits = regionPSet.getParameter<std::string>("siPixelRecHits");
37  theOrigin = GlobalPoint(xPos,yPos,zPos);
38  theDirection = GlobalVector(xDir, yDir, zDir);
39  }
40 
42 
44  (const edm::Event& ev, const edm::EventSetup& es) const
45  {
46  //rechits
48  ev.getByLabel(theSiPixelRecHits, recHitColl);
49 
50  int numRecHits = 0;
51  //FIXME: this can be optimized quite a bit by looping only on the per-det 'items' of DetSetVector
52  for(SiPixelRecHitCollection::const_iterator recHitIdIterator = recHitColl->begin(), recHitIdIteratorEnd = recHitColl->end();
53  recHitIdIterator != recHitIdIteratorEnd; recHitIdIterator++) {
54  SiPixelRecHitCollection::DetSet hits = *recHitIdIterator;
55  DetId detId = DetId(hits.detId()); // Get the Detid object
56  unsigned int detType=detId.det(); // det type, tracker=1
57  unsigned int subid=detId.subdetId(); //subdetector type, barrel=1, fpix=2
58  PXBDetId pdetId = PXBDetId(detId);
59  unsigned int layer=0;
60  layer=pdetId.layer();
61  if(detType==1 && subid==1 && layer==1) {
62  numRecHits += hits.size();
63  }
64  }
65  return numRecHits;
66  }
67 
68  virtual std::vector<TrackingRegion* > regions(const edm::Event& ev, const edm::EventSetup& es) const {
69 
70  int estMult = estimateMultiplicity(ev, es);
71 
72  // fit from MC information
73  float aa = 1.90935e-04;
74  float bb = -2.90167e-01;
75  float cc = 3.86125e+02;
76 
77  float estTracks = aa*estMult*estMult+bb*estMult+cc;
78 
79  LogTrace("heavyIonHLTVertexing")<<"[HIVertexing]";
80  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: hits in the 1. layer:" << estMult << "]";
81  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: estimated number of tracks:" << estTracks << "]";
82 
83  float regTracking = 400.; //if we have more tracks -> regional tracking
84  float etaB = 10.;
85  float phiB = TMath::Pi()/2.;
86 
87  float decEta = estTracks/600.;
88  etaB = 2.5/decEta;
89 
90  if(estTracks>regTracking) {
91  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: Regional Tracking]";
92  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: eta range: -" << etaB << ", "<< etaB <<"]";
93  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: phi range: -" << phiB << ", "<< phiB <<"]";
94  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: factor of decrease: " << decEta*2. << "]"; // 2:from phi
95  }
96 
97  // tracking region selection
98  std::vector<TrackingRegion* > result;
99  if(estTracks>regTracking) { // regional tracking
101  }
102  else { // global tracking
103  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: Global Tracking]";
105  }
106  return
107  result;
108  }
109 
110  private:
111  std::string theSiPixelRecHits;
112  double thePtMin;
118 };
119 
120 #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
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
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:359
#define LogTrace(id)
Definition: DetId.h:20
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