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, edm::ConsumesCollector &&iC)
 
virtual std::vector
< std::unique_ptr
< 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
 
edm::EDGetTokenT< reco::BeamSpottheBeamSpotToken
 
GlobalVector theDirection
 
double theFixedError
 
double theNSigmaZ
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
double theSigmaZVertex
 
edm::InputTag theSiPixelRecHits
 
edm::EDGetTokenT
< SiPixelRecHitCollection
theSiPixelRecHitsToken
 
bool theUseFixedError
 
bool theUseFoundVertices
 
edm::InputTag vertexCollName
 
edm::EDGetTokenT
< reco::VertexCollection
vertexCollToken
 

Detailed Description

Definition at line 28 of file HITrackingRegionForPrimaryVtxProducer.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file HITrackingRegionForPrimaryVtxProducer.h.

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

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

Definition at line 58 of file HITrackingRegionForPrimaryVtxProducer.h.

58 {}

Member Function Documentation

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

Definition at line 61 of file HITrackingRegionForPrimaryVtxProducer.h.

References edmNew::copyDetSetRange(), edm::EventSetup::get(), edm::Event::getByToken(), and theSiPixelRecHitsToken.

Referenced by regions().

62  {
63  //rechits
65  ev.getByToken(theSiPixelRecHitsToken, recHitColl);
66 
68  es.get<TrackerTopologyRcd>().get(httopo);
69 
70  std::vector<const TrackingRecHit*> theChosenHits;
71  edmNew::copyDetSetRange(*recHitColl,theChosenHits, httopo->pxbDetIdLayerComparator(1));
72  return theChosenHits.size();
73 
74  }
void copyDetSetRange(DSTV const &dstv, std::vector< T const * > &v, std::pair< A, B > const &sel)
edm::EDGetTokenT< SiPixelRecHitCollection > theSiPixelRecHitsToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const T & get() const
Definition: EventSetup.h:56
virtual std::vector<std::unique_ptr<TrackingRegion> > HITrackingRegionForPrimaryVtxProducer::regions ( const edm::Event ev,
const edm::EventSetup es 
) const
inlinevirtual

Implements TrackingRegionProducer.

Definition at line 76 of file HITrackingRegionForPrimaryVtxProducer.h.

References doVariablePtMin, estimateMultiplicity(), edm::Event::getByToken(), edm::HandleBase::isValid(), RectangularEtaPhiTrackingRegion::kNever, LogTrace, HLT_FULL_cff::minpt, Pi, mps_fire::result, reco::BeamSpot::sigmaZ(), theBeamSpotToken, theDirection, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theUseFixedError, theUseFoundVertices, GoodVertex_cfg::vertexCollection, vertexCollToken, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

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

Member Data Documentation

bool HITrackingRegionForPrimaryVtxProducer::doVariablePtMin
private
edm::InputTag HITrackingRegionForPrimaryVtxProducer::theBeamSpotTag
private
edm::EDGetTokenT<reco::BeamSpot> HITrackingRegionForPrimaryVtxProducer::theBeamSpotToken
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
edm::EDGetTokenT<SiPixelRecHitCollection> HITrackingRegionForPrimaryVtxProducer::theSiPixelRecHitsToken
private
bool HITrackingRegionForPrimaryVtxProducer::theUseFixedError
private
bool HITrackingRegionForPrimaryVtxProducer::theUseFoundVertices
private
edm::InputTag HITrackingRegionForPrimaryVtxProducer::vertexCollName
private
edm::EDGetTokenT<reco::VertexCollection> HITrackingRegionForPrimaryVtxProducer::vertexCollToken
private