CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HITrackingRegionForPrimaryVtxProducer Class Reference

#include <HITrackingRegionForPrimaryVtxProducer.h>

Inheritance diagram for HITrackingRegionForPrimaryVtxProducer:
TrackingRegionProducer

Public Member Functions

int estimateMultiplicity (const edm::Event &ev, const edm::EventSetup &es) const
 
 HITrackingRegionForPrimaryVtxProducer (const edm::ParameterSet &cfg)
 
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &es) const
 
virtual ~HITrackingRegionForPrimaryVtxProducer ()
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

bool doVariablePtMin
 
edm::InputTag theBeamSpotTag
 
GlobalVector theDirection
 
double theFixedError
 
double theNSigmaZ
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
double theSigmaZVertex
 
edm::InputTag theSiPixelRecHits
 
bool theUseFixedError
 
bool theUseFoundVertices
 
edm::InputTag vertexCollName
 

Detailed Description

Definition at line 26 of file HITrackingRegionForPrimaryVtxProducer.h.

Constructor & Destructor Documentation

HITrackingRegionForPrimaryVtxProducer::HITrackingRegionForPrimaryVtxProducer ( const edm::ParameterSet cfg)
inline

Definition at line 30 of file HITrackingRegionForPrimaryVtxProducer.h.

References doVariablePtMin, edm::ParameterSet::getParameter(), theBeamSpotTag, theDirection, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theSiPixelRecHits, theUseFixedError, theUseFoundVertices, and vertexCollName.

30  {
31 
32  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
33  thePtMin = regionPSet.getParameter<double>("ptMin");
34  theOriginRadius = regionPSet.getParameter<double>("originRadius");
35  theNSigmaZ = regionPSet.getParameter<double>("nSigmaZ");
36  theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
37  thePrecise = regionPSet.getParameter<bool>("precise");
38  theSiPixelRecHits = regionPSet.getParameter<edm::InputTag>("siPixelRecHits");
39  doVariablePtMin = regionPSet.getParameter<bool>("doVariablePtMin");
40  double xDir = regionPSet.getParameter<double>("directionXCoord");
41  double yDir = regionPSet.getParameter<double>("directionYCoord");
42  double zDir = regionPSet.getParameter<double>("directionZCoord");
43  theDirection = GlobalVector(xDir, yDir, zDir);
44 
45  // for using vertex instead of beamspot
46  theSigmaZVertex = regionPSet.getParameter<double>("sigmaZVertex");
47  theFixedError = regionPSet.getParameter<double>("fixedError");
48  theUseFoundVertices = regionPSet.getParameter<bool>("useFoundVertices");
49  theUseFixedError = regionPSet.getParameter<bool>("useFixedError");
50  vertexCollName = regionPSet.getParameter<edm::InputTag>("VertexCollection");
51  }
T getParameter(std::string const &) const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
virtual HITrackingRegionForPrimaryVtxProducer::~HITrackingRegionForPrimaryVtxProducer ( )
inlinevirtual

Definition at line 53 of file HITrackingRegionForPrimaryVtxProducer.h.

53 {}

Member Function Documentation

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

Definition at line 56 of file HITrackingRegionForPrimaryVtxProducer.h.

References edmNew::copyDetSetRange(), edm::Event::getByLabel(), TrackerLayerIdAccessor::pixelBarrelLayer(), and theSiPixelRecHits.

Referenced by regions().

57  {
58  //rechits
60  ev.getByLabel(theSiPixelRecHits, recHitColl);
61 
62  std::vector<const TrackingRecHit*> theChosenHits;
64  edmNew::copyDetSetRange(*recHitColl,theChosenHits,acc.pixelBarrelLayer(1));
65  return theChosenHits.size();
66 
67  }
void copyDetSetRange(DSTV const &dstv, std::vector< T const * > &v, std::pair< A, B > const &sel)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::pair< DetId, DetIdPXBSameLayerComparator > pixelBarrelLayer(int layer)
virtual std::vector<TrackingRegion* > HITrackingRegionForPrimaryVtxProducer::regions ( const edm::Event ev,
const edm::EventSetup es 
) const
inlinevirtual

Implements TrackingRegionProducer.

Definition at line 69 of file HITrackingRegionForPrimaryVtxProducer.h.

References doVariablePtMin, estimateMultiplicity(), edm::Event::getByLabel(), edm::HandleBase::isValid(), LogTrace, Pi, query::result, reco::BeamSpot::sigmaZ(), theBeamSpotTag, theDirection, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theUseFixedError, theUseFoundVertices, GoodVertex_cfg::vertexCollection, vertexCollName, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

69  {
70 
71  int estMult = estimateMultiplicity(ev, es);
72 
73  // from MC relating first layer pixel hits to "findable" sim tracks with pt>1 GeV
74  float cc = -38.6447;
75  float bb = 0.0581765;
76  float aa = 1.34306e-06;
77 
78  float estTracks = aa*estMult*estMult+bb*estMult+cc;
79 
80  LogTrace("heavyIonHLTVertexing")<<"[HIVertexing]";
81  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: hits in the 1. layer:" << estMult << "]";
82  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: estimated number of tracks:" << estTracks << "]";
83 
84  float regTracking = 60.; //if we have more tracks -> regional tracking
85  float etaB = 10.;
86  float phiB = TMath::Pi()/2.;
87 
88  float decEta = estTracks/90.;
89  etaB = 2.5/decEta;
90 
91  if(estTracks>regTracking) {
92  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: Regional Tracking]";
93  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: eta range: -" << etaB << ", "<< etaB <<"]";
94  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: phi range: -" << phiB << ", "<< phiB <<"]";
95  LogTrace("heavyIonHLTVertexing")<<" [Regional Tracking: factor of decrease: " << decEta*2. << "]"; // 2:from phi
96  }
97 
98  float minpt = thePtMin;
99  float varPtCutoff = 1500; //cutoff
100  if(doVariablePtMin && estMult < varPtCutoff) {
101  minpt = 0.075;
102  if(estMult > 0) minpt += estMult * (thePtMin - 0.075)/varPtCutoff; // lower ptMin linearly with pixel hit multiplicity
103  }
104 
105  // tracking region selection
106  std::vector<TrackingRegion* > result;
107  double halflength;
108  GlobalPoint origin;
110  ev.getByLabel( theBeamSpotTag, bsHandle);
111  if(bsHandle.isValid()) {
112  const reco::BeamSpot & bs = *bsHandle;
113  origin=GlobalPoint(bs.x0(), bs.y0(), bs.z0());
114  halflength=theNSigmaZ*bs.sigmaZ();
115 
117  {
119  ev.getByLabel(vertexCollName,vertexCollection);
120 
121  for(reco::VertexCollection::const_iterator iV=vertexCollection->begin();
122  iV != vertexCollection->end() ; iV++) {
123  if (iV->isFake() || !iV->isValid()) continue;
124  origin = GlobalPoint(bs.x0(),bs.y0(),iV->z());
125  halflength = (theUseFixedError ? theFixedError : (iV->zError())*theSigmaZVertex);
126  }
127  }
128 
129  if(estTracks>regTracking) { // regional tracking
130  result.push_back(
131  new RectangularEtaPhiTrackingRegion(theDirection, origin, thePtMin, theOriginRadius, halflength, etaB, phiB, 0, thePrecise) );
132  }
133  else { // global tracking
134  LogTrace("heavyIonHLTVertexing")<<" [HIVertexing: Global Tracking]";
135  result.push_back(
136  new GlobalTrackingRegion(minpt, origin, theOriginRadius, halflength, thePrecise) );
137  }
138  }
139  return result;
140  }
const double Pi
double z0() const
z coordinate
Definition: BeamSpot.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
tuple vertexCollection
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
#define LogTrace(id)
double sigmaZ() const
sigma z
Definition: BeamSpot.h:81
double y0() const
y coordinate
Definition: BeamSpot.h:67
int estimateMultiplicity(const edm::Event &ev, const edm::EventSetup &es) const
double x0() const
x coordinate
Definition: BeamSpot.h:65

Member Data Documentation

bool HITrackingRegionForPrimaryVtxProducer::doVariablePtMin
private
edm::InputTag HITrackingRegionForPrimaryVtxProducer::theBeamSpotTag
private
GlobalVector HITrackingRegionForPrimaryVtxProducer::theDirection
private
double HITrackingRegionForPrimaryVtxProducer::theFixedError
private
double HITrackingRegionForPrimaryVtxProducer::theNSigmaZ
private
double HITrackingRegionForPrimaryVtxProducer::theOriginRadius
private
bool HITrackingRegionForPrimaryVtxProducer::thePrecise
private
double HITrackingRegionForPrimaryVtxProducer::thePtMin
private
double HITrackingRegionForPrimaryVtxProducer::theSigmaZVertex
private
edm::InputTag HITrackingRegionForPrimaryVtxProducer::theSiPixelRecHits
private
bool HITrackingRegionForPrimaryVtxProducer::theUseFixedError
private
bool HITrackingRegionForPrimaryVtxProducer::theUseFoundVertices
private
edm::InputTag HITrackingRegionForPrimaryVtxProducer::vertexCollName
private