CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L3MumuTrackingRegion Class Reference

#include <L3MumuTrackingRegion.h>

Inheritance diagram for L3MumuTrackingRegion:
TrackingRegionProducer

Public Member Functions

 L3MumuTrackingRegion (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
std::vector< std::unique_ptr< TrackingRegion > > regions (const edm::Event &ev, const edm::EventSetup &es) const override
 
 ~L3MumuTrackingRegion () override=default
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_howToUseMeasurementTracker
 
bool m_searchOpt
 
double theDeltaEta
 
double theDeltaPhi
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheFieldToken
 
edm::InputTag theInputTrkTag
 
edm::EDGetTokenT< reco::TrackCollectiontheInputTrkToken
 
edm::EDGetTokenT< MeasurementTrackerEventtheMeasurementTrackerToken
 
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecordtheMSMakerToken
 
double theOriginHalfLength
 
double theOriginRadius
 
double theOriginZPos
 
double thePtMin
 
bool theVertex
 
edm::InputTag theVertexTag
 
edm::EDGetTokenT< reco::VertexCollectiontheVertexToken
 
bool useVtxTks
 

Detailed Description

Definition at line 21 of file L3MumuTrackingRegion.h.

Constructor & Destructor Documentation

◆ L3MumuTrackingRegion()

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

Definition at line 23 of file L3MumuTrackingRegion.h.

References looper::cfg, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), RectangularEtaPhiTrackingRegion::kNever, edm::InputTag::label(), m_howToUseMeasurementTracker, m_searchOpt, AlCaHLTBitMon_QueryRunRegistry::string, RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker(), theDeltaEta, theDeltaPhi, theInputTrkTag, theInputTrkToken, theMeasurementTrackerToken, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertex, theVertexTag, theVertexToken, and useVtxTks.

25  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
26 
27  theVertexTag = regionPSet.getParameter<edm::InputTag>("vertexSrc");
28  theVertex = (theVertexTag.label().length() > 1);
29  theInputTrkTag = regionPSet.getParameter<edm::InputTag>("TrkSrc");
30  useVtxTks = regionPSet.getParameter<bool>("UseVtxTks");
31 
32  if (theVertex)
34  if (!(theVertex && useVtxTks))
36 
37  thePtMin = regionPSet.getParameter<double>("ptMin");
38  theOriginRadius = regionPSet.getParameter<double>("originRadius");
39  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
40  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
41 
42  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
43  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
44  if (regionPSet.exists("searchOpt")) {
45  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
46  } else {
47  m_searchOpt = false;
48  }
50  regionPSet.getParameter<std::string>("howToUseMeasurementTracker"));
53  iC.consumes<MeasurementTrackerEvent>(regionPSet.getParameter<edm::InputTag>("measurementTrackerName"));
54  }
55  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::TrackCollection > theInputTrkToken
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< reco::VertexCollection > theVertexToken
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_howToUseMeasurementTracker

◆ ~L3MumuTrackingRegion()

L3MumuTrackingRegion::~L3MumuTrackingRegion ( )
overridedefault

Member Function Documentation

◆ regions()

std::vector<std::unique_ptr<TrackingRegion> > L3MumuTrackingRegion::regions ( const edm::Event ev,
const edm::EventSetup es 
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 59 of file L3MumuTrackingRegion.h.

References makeMEIFBenchmarkPlots::ev, edm::EventSetup::getData(), edm::EDGetTokenT< T >::isUninitialized(), m_howToUseMeasurementTracker, m_searchOpt, HLTSiStripMonitoring_cff::measurementTracker, edm::Handle< T >::product(), multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, mps_fire::result, theDeltaEta, theDeltaPhi, theFieldToken, theInputTrkToken, theMeasurementTrackerToken, theMSMakerToken, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertex, theVertexToken, hltEgammaHLTExtra_cfi::trks, useVtxTks, and AlignmentTracksFromVertexSelector_cfi::vertices.

60  {
61  std::vector<std::unique_ptr<TrackingRegion> > result;
62 
66  ev.getByToken(theMeasurementTrackerToken, hmte);
67  measurementTracker = hmte.product();
68  }
69  const auto& field = es.getData(theFieldToken);
70  const auto& msmaker = es.getData(theMSMakerToken);
71 
72  // optional constraint for vertex
73  // get highest Pt pixel vertex (if existing)
74  double deltaZVertex = theOriginHalfLength;
75  double originz = theOriginZPos;
76  if (theVertex) {
78  ev.getByToken(theVertexToken, vertices);
79  const reco::VertexCollection vertCollection = *(vertices.product());
80  reco::VertexCollection::const_iterator ci = vertCollection.begin();
81  if (!vertCollection.empty()) {
82  originz = ci->z();
83  } else {
84  originz = theOriginZPos;
85  deltaZVertex = 15.;
86  }
87  if (useVtxTks) {
88  for (ci = vertCollection.begin(); ci != vertCollection.end(); ci++)
89  for (reco::Vertex::trackRef_iterator trackIt = ci->tracks_begin(); trackIt != ci->tracks_end(); trackIt++) {
90  reco::TrackRef iTrk = (*trackIt).castTo<reco::TrackRef>();
91  GlobalVector dirVector((iTrk)->px(), (iTrk)->py(), (iTrk)->pz());
92  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(dirVector,
93  GlobalPoint(0, 0, float(ci->z())),
94  thePtMin,
96  deltaZVertex,
99  field,
100  &msmaker,
101  true,
104  m_searchOpt));
105  }
106  return result;
107  }
108  }
109 
112  ev.getByToken(theInputTrkToken, trks);
113  for (reco::TrackCollection::const_iterator iTrk = trks->begin(); iTrk != trks->end(); iTrk++) {
114  GlobalVector dirVector((iTrk)->px(), (iTrk)->py(), (iTrk)->pz());
115  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(dirVector,
116  GlobalPoint(0, 0, float(originz)),
117  thePtMin,
119  deltaZVertex,
120  theDeltaEta,
121  theDeltaPhi,
122  field,
123  &msmaker,
124  true,
127  m_searchOpt));
128  }
129  return result;
130  }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< reco::TrackCollection > theInputTrkToken
T const * product() const
Definition: Handle.h:70
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::VertexCollection > theVertexToken
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_howToUseMeasurementTracker
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38

Member Data Documentation

◆ m_howToUseMeasurementTracker

RectangularEtaPhiTrackingRegion::UseMeasurementTracker L3MumuTrackingRegion::m_howToUseMeasurementTracker
private

Definition at line 149 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ m_searchOpt

bool L3MumuTrackingRegion::m_searchOpt
private

Definition at line 152 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theDeltaEta

double L3MumuTrackingRegion::theDeltaEta
private

Definition at line 146 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theDeltaPhi

double L3MumuTrackingRegion::theDeltaPhi
private

Definition at line 147 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theFieldToken

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> L3MumuTrackingRegion::theFieldToken
private

Definition at line 150 of file L3MumuTrackingRegion.h.

Referenced by regions().

◆ theInputTrkTag

edm::InputTag L3MumuTrackingRegion::theInputTrkTag
private

Definition at line 136 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion().

◆ theInputTrkToken

edm::EDGetTokenT<reco::TrackCollection> L3MumuTrackingRegion::theInputTrkToken
private

Definition at line 137 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theMeasurementTrackerToken

edm::EDGetTokenT<MeasurementTrackerEvent> L3MumuTrackingRegion::theMeasurementTrackerToken
private

Definition at line 148 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theMSMakerToken

Definition at line 151 of file L3MumuTrackingRegion.h.

Referenced by regions().

◆ theOriginHalfLength

double L3MumuTrackingRegion::theOriginHalfLength
private

Definition at line 143 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theOriginRadius

double L3MumuTrackingRegion::theOriginRadius
private

Definition at line 142 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theOriginZPos

double L3MumuTrackingRegion::theOriginZPos
private

Definition at line 144 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ thePtMin

double L3MumuTrackingRegion::thePtMin
private

Definition at line 141 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theVertex

bool L3MumuTrackingRegion::theVertex
private

Definition at line 134 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ theVertexTag

edm::InputTag L3MumuTrackingRegion::theVertexTag
private

Definition at line 133 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion().

◆ theVertexToken

edm::EDGetTokenT<reco::VertexCollection> L3MumuTrackingRegion::theVertexToken
private

Definition at line 135 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

◆ useVtxTks

bool L3MumuTrackingRegion::useVtxTks
private

Definition at line 139 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().