CMS 3D CMS Logo

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

#include <DQM/TrackerMonitorTrack/src/TrackEfficiencyMonitor.cc>

Inheritance diagram for TrackEfficiencyMonitor:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Types

enum  SemiCylinder { Up, Down }
 
typedef reco::Track Track
 
typedef reco::TrackCollection TrackCollection
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
SemiCylinder checkSemiCylinder (const Track &)
 
int compatibleLayers (const NavigationSchool &navigationSchool, TrajectoryStateOnSurface theTSOS)
 
std::pair< TrajectoryStateOnSurface, const DetLayer * > findNextLayer (TrajectoryStateOnSurface startTSOS, const std::vector< const DetLayer *> &trackCompatibleLayers, bool isUpMuon)
 
void testSTATracks (edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks)
 
void testTrackerTracks (edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks, const NavigationSchool &navigationSchool)
 
 TrackEfficiencyMonitor (const edm::ParameterSet &)
 
bool trackerAcceptance (TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ)
 
 ~TrackEfficiencyMonitor () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const MagneticFieldbField
 
edm::ParameterSet conf_
 
MonitorElementdeltaX
 
MonitorElementdeltaY
 
DQMStoredqmStore_
 
int failedToPropagate
 
bool findDetLayer
 
MonitorElementGlobalMuonPtEtaPhiHighPt
 
MonitorElementGlobalMuonPtEtaPhiLowPt
 
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecordgstToken_
 
std::string histname
 
bool isBFieldOff_
 
const MeasurementTrackermeasurementTracker
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmfToken_
 
const edm::ESGetToken< MeasurementTracker, CkfComponentsRecordmtToken_
 
MonitorElementmuonCompatibleLayers
 
MonitorElementmuonD0
 
MonitorElementmuonEta
 
MonitorElementmuonPhi
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 
MonitorElementmuonX
 
MonitorElementmuonY
 
MonitorElementmuonZ
 
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecordnavToken_
 
int nCompatibleLayers
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordpropToken_
 
MonitorElementsignDeltaX
 
MonitorElementsignDeltaY
 
MonitorElementStandaloneMuonPtEtaPhiHighPt
 
MonitorElementStandaloneMuonPtEtaPhiLowPt
 
double theMaxZ_
 
MuonServiceProxytheMuonServiceProxy
 
const DirectTrackerNavigationtheNavigation
 
const PropagatorthePropagator
 
double theRadius_
 
edm::InputTag theSTATracksLabel_
 
edm::EDGetTokenT< reco::TrackCollectiontheSTATracksToken_
 
edm::InputTag theTKTracksLabel_
 
edm::EDGetTokenT< reco::TrackCollectiontheTKTracksToken_
 
const GeometricSearchTrackertheTracker
 
const TransientTrackBuildertheTTrackBuilder
 
MonitorElementtrackCompatibleLayers
 
MonitorElementtrackD0
 
bool trackEfficiency_
 
MonitorElementtrackEta
 
MonitorElementtrackPhi
 
MonitorElementtrackX
 
MonitorElementtrackY
 
MonitorElementtrackZ
 
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordttbToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Monitoring source to measure the track efficiency

Definition at line 43 of file TrackEfficiencyMonitor.h.

Member Typedef Documentation

◆ Track

Definition at line 45 of file TrackEfficiencyMonitor.h.

◆ TrackCollection

Definition at line 46 of file TrackEfficiencyMonitor.h.

Member Enumeration Documentation

◆ SemiCylinder

Constructor & Destructor Documentation

◆ TrackEfficiencyMonitor()

TrackEfficiencyMonitor::TrackEfficiencyMonitor ( const edm::ParameterSet iConfig)
explicit

Definition at line 38 of file TrackEfficiencyMonitor.cc.

References conf_, dqmStore_, edm::ParameterSet::getParameter(), isBFieldOff_, muonToken_, Utilities::operator, theMaxZ_, theRadius_, theSTATracksLabel_, theSTATracksToken_, theTKTracksLabel_, theTKTracksToken_, and trackEfficiency_.

39  : ttbToken_(esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))),
40  propToken_(esConsumes(edm::ESInputTag("", "SteppingHelixPropagatorAny"))),
41  navToken_(esConsumes(edm::ESInputTag("", "CosmicNavigationSchool"))),
45 //-----------------------------------------------------------------------------------
46 {
48 
49  theRadius_ = iConfig.getParameter<double>("theRadius");
50  theMaxZ_ = iConfig.getParameter<double>("theMaxZ");
51  isBFieldOff_ = iConfig.getParameter<bool>("isBFieldOff");
52  trackEfficiency_ = iConfig.getParameter<bool>("trackEfficiency");
53  theTKTracksLabel_ = iConfig.getParameter<edm::InputTag>("TKTrackCollection");
54  theSTATracksLabel_ = iConfig.getParameter<edm::InputTag>("STATrackCollection");
55  muonToken_ = consumes<edm::View<reco::Muon> >(iConfig.getParameter<edm::InputTag>("muoncoll"));
56 
57  theTKTracksToken_ = consumes<reco::TrackCollection>(theTKTracksLabel_);
58  theSTATracksToken_ = consumes<reco::TrackCollection>(theSTATracksLabel_);
59 
60  conf_ = iConfig;
61 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttbToken_
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > gstToken_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
const edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > mtToken_
edm::EDGetTokenT< reco::TrackCollection > theTKTracksToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propToken_
edm::EDGetTokenT< reco::TrackCollection > theSTATracksToken_

◆ ~TrackEfficiencyMonitor()

TrackEfficiencyMonitor::~TrackEfficiencyMonitor ( )
override

Definition at line 64 of file TrackEfficiencyMonitor.cc.

66 {}

Member Function Documentation

◆ analyze()

void TrackEfficiencyMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 273 of file TrackEfficiencyMonitor.cc.

References bField, failedToPropagate, dqm::impl::MonitorElement::Fill(), findDetLayer, edm::EventSetup::getData(), GlobalMuonPtEtaPhiHighPt, GlobalMuonPtEtaPhiLowPt, gstToken_, iEvent, isBFieldOff_, muon::isGoodMuon(), measurementTracker, mfToken_, mtToken_, HLT_2022v15_cff::muon, PDWG_BPHSkim_cff::muons, muonToken_, navToken_, nCompatibleLayers, TrackCollections2monitor_cff::normalizedChi2, propToken_, StandaloneMuonPtEtaPhiHighPt, StandaloneMuonPtEtaPhiLowPt, muonTagProbeFilters_cff::staTracks, testSTATracks(), testTrackerTracks(), theNavigation, thePropagator, theSTATracksToken_, theTKTracksToken_, theTracker, theTTrackBuilder, trackEfficiency_, and ttbToken_.

275 {
278 
279  //initialize values
280  failedToPropagate = 0;
281  nCompatibleLayers = 0;
282  findDetLayer = false;
283 
284  const NavigationSchool& nav = iSetup.getData(navToken_);
287  thePropagator = &iSetup.getData(propToken_);
288  bField = &iSetup.getData(mfToken_);
289  theTracker = &iSetup.getData(gstToken_);
291 
293  if (!muons.isValid())
294  return;
295  for (edm::View<reco::Muon>::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
296  if ((*muon).pt() < 5)
297  continue;
298  if (fabs((*muon).eta()) > 2.4)
299  continue;
300  if ((*muon).vertexNormalizedChi2() > 10)
301  continue;
302  if ((*muon).isStandAloneMuon() and (*muon).isGlobalMuon()) {
303  if ((*muon).pt() < 20)
304  GlobalMuonPtEtaPhiLowPt->Fill((*muon).eta(), (*muon).phi());
305  else
306  GlobalMuonPtEtaPhiHighPt->Fill((*muon).eta(), (*muon).phi());
307  }
308  if ((*muon).isStandAloneMuon()) {
309  if ((*muon).pt() < 20)
310  StandaloneMuonPtEtaPhiLowPt->Fill((*muon).eta(), (*muon).phi());
311  else
312  StandaloneMuonPtEtaPhiHighPt->Fill((*muon).eta(), (*muon).phi());
313  }
314  }
315  if (trackEfficiency_) {
316  //---------------------------------------------------
317  // Select muons with good quality
318  // If B field is on, no up-down matching between the muons
319  //---------------------------------------------------
320  bool isGoodMuon = false;
321  double mudd0 = 0., mudphi = 0., muddsz = 0., mudeta = 0.;
322  if (isBFieldOff_) {
323  if (staTracks->size() == 2) {
324  for (unsigned int bindex = 0; bindex < staTracks->size(); ++bindex) {
325  if (0 == bindex) {
326  mudd0 += (*staTracks)[bindex].d0();
327  mudphi += (*staTracks)[bindex].phi();
328  muddsz += (*staTracks)[bindex].dsz();
329  mudeta += (*staTracks)[bindex].eta();
330  }
331  if (1 == bindex) {
332  mudd0 -= (*staTracks)[bindex].d0();
333  mudphi -= (*staTracks)[bindex].phi();
334  muddsz -= (*staTracks)[bindex].dsz();
335  mudeta -= (*staTracks)[bindex].eta();
336  }
337  }
338  if ((fabs(mudd0) < 15.0) && (fabs(mudphi) < 0.045) && (fabs(muddsz) < 20.0) && (fabs(mudeta) < 0.060))
339  isGoodMuon = true;
340  }
341 
342  if (isGoodMuon)
343  testTrackerTracks(tkTracks, staTracks, nav);
344 
345  } else if (staTracks->size() == 1 || staTracks->size() == 2)
346  testTrackerTracks(tkTracks, staTracks, nav);
347  }
348 
349  if (!trackEfficiency_ && tkTracks->size() == 1) {
350  if ((tkTracks->front()).normalizedChi2() < 5 && (tkTracks->front()).hitPattern().numberOfValidHits() > 8)
351  testSTATracks(tkTracks, staTracks);
352  }
353 
354  delete theNavigation;
355 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const MagneticField * bField
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navToken_
MonitorElement * GlobalMuonPtEtaPhiHighPt
void testTrackerTracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks, const NavigationSchool &navigationSchool)
MonitorElement * GlobalMuonPtEtaPhiLowPt
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttbToken_
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > gstToken_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
void Fill(long long x)
const edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > mtToken_
int iEvent
Definition: GenABIO.cc:224
const GeometricSearchTracker * theTracker
MonitorElement * StandaloneMuonPtEtaPhiLowPt
const TransientTrackBuilder * theTTrackBuilder
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
edm::EDGetTokenT< reco::TrackCollection > theTKTracksToken_
MonitorElement * StandaloneMuonPtEtaPhiHighPt
const Propagator * thePropagator
const DirectTrackerNavigation * theNavigation
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
const MeasurementTracker * measurementTracker
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propToken_
void testSTATracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks)
edm::EDGetTokenT< reco::TrackCollection > theSTATracksToken_

◆ bookHistograms()

void TrackEfficiencyMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 69 of file TrackEfficiencyMonitor.cc.

References HLTSiStripMonitoring_cff::AlgoName, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), conf_, deltaX, TrackEfficiencyMonitor_cfi::deltaXBin, TrackEfficiencyMonitor_cfi::deltaXMax, TrackEfficiencyMonitor_cfi::deltaXMin, deltaY, TrackEfficiencyMonitor_cfi::deltaYBin, TrackEfficiencyMonitor_cfi::deltaYMax, TrackEfficiencyMonitor_cfi::deltaYMin, edm::ParameterSet::getParameter(), GlobalMuonPtEtaPhiHighPt, GlobalMuonPtEtaPhiLowPt, histname, muonCompatibleLayers, TrackEfficiencyMonitor_cfi::muonCompatibleLayersBin, TrackEfficiencyMonitor_cfi::muonCompatibleLayersMax, TrackEfficiencyMonitor_cfi::muonCompatibleLayersMin, muonD0, TrackEfficiencyMonitor_cfi::muonD0Bin, TrackEfficiencyMonitor_cfi::muonD0Max, TrackEfficiencyMonitor_cfi::muonD0Min, muonEta, TrackEfficiencyMonitor_cfi::muonEtaBin, TrackEfficiencyMonitor_cfi::muonEtaMax, TrackEfficiencyMonitor_cfi::muonEtaMin, muonPhi, TrackEfficiencyMonitor_cfi::muonPhiBin, TrackEfficiencyMonitor_cfi::muonPhiMax, TrackEfficiencyMonitor_cfi::muonPhiMin, muonX, TrackEfficiencyMonitor_cfi::muonXBin, TrackEfficiencyMonitor_cfi::muonXMax, TrackEfficiencyMonitor_cfi::muonXMin, muonY, TrackEfficiencyMonitor_cfi::muonYBin, TrackEfficiencyMonitor_cfi::muonYMax, TrackEfficiencyMonitor_cfi::muonYMin, muonZ, TrackEfficiencyMonitor_cfi::muonZBin, TrackEfficiencyMonitor_cfi::muonZMax, TrackEfficiencyMonitor_cfi::muonZMin, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), signDeltaX, TrackEfficiencyMonitor_cfi::signDeltaXBin, TrackEfficiencyMonitor_cfi::signDeltaXMax, TrackEfficiencyMonitor_cfi::signDeltaXMin, signDeltaY, TrackEfficiencyMonitor_cfi::signDeltaYBin, TrackEfficiencyMonitor_cfi::signDeltaYMax, TrackEfficiencyMonitor_cfi::signDeltaYMin, StandaloneMuonPtEtaPhiHighPt, StandaloneMuonPtEtaPhiLowPt, AlCaHLTBitMon_QueryRunRegistry::string, trackCompatibleLayers, TrackEfficiencyMonitor_cfi::trackCompatibleLayersBin, TrackEfficiencyMonitor_cfi::trackCompatibleLayersMax, TrackEfficiencyMonitor_cfi::trackCompatibleLayersMin, trackD0, TrackEfficiencyMonitor_cfi::trackD0Bin, TrackEfficiencyMonitor_cfi::trackD0Max, TrackEfficiencyMonitor_cfi::trackD0Min, trackEta, TrackEfficiencyMonitor_cfi::trackEtaBin, TrackEfficiencyMonitor_cfi::trackEtaMax, TrackEfficiencyMonitor_cfi::trackEtaMin, trackPhi, TrackEfficiencyMonitor_cfi::trackPhiBin, TrackEfficiencyMonitor_cfi::trackPhiMax, TrackEfficiencyMonitor_cfi::trackPhiMin, trackX, TrackEfficiencyMonitor_cfi::trackXBin, TrackEfficiencyMonitor_cfi::trackXMax, TrackEfficiencyMonitor_cfi::trackXMin, trackY, TrackEfficiencyMonitor_cfi::trackYBin, TrackEfficiencyMonitor_cfi::trackYMax, TrackEfficiencyMonitor_cfi::trackYMin, trackZ, TrackEfficiencyMonitor_cfi::trackZBin, TrackEfficiencyMonitor_cfi::trackZMax, and TrackEfficiencyMonitor_cfi::trackZMin.

73 {
74  std::string MEFolderName = conf_.getParameter<std::string>("FolderName");
76 
77  ibooker.setCurrentFolder(MEFolderName);
78 
79  //
80  int muonXBin = conf_.getParameter<int>("muonXBin");
81  double muonXMin = conf_.getParameter<double>("muonXMin");
82  double muonXMax = conf_.getParameter<double>("muonXMax");
83 
84  histname = "muonX_";
86  muonX->setAxisTitle("");
87 
88  //
89  int muonYBin = conf_.getParameter<int>("muonYBin");
90  double muonYMin = conf_.getParameter<double>("muonYMin");
91  double muonYMax = conf_.getParameter<double>("muonYMax");
92 
93  histname = "muonY_";
95  muonY->setAxisTitle("");
96 
97  //
98  int muonZBin = conf_.getParameter<int>("muonZBin");
99  double muonZMin = conf_.getParameter<double>("muonZMin");
100  double muonZMax = conf_.getParameter<double>("muonZMax");
101 
102  histname = "muonZ_";
104  muonZ->setAxisTitle("");
105 
106  //
107  int muonEtaBin = conf_.getParameter<int>("muonEtaBin");
108  double muonEtaMin = conf_.getParameter<double>("muonEtaMin");
109  double muonEtaMax = conf_.getParameter<double>("muonEtaMax");
110 
111  histname = "muonEta_";
113  muonEta->setAxisTitle("");
114 
115  //
116  int muonPhiBin = conf_.getParameter<int>("muonPhiBin");
117  double muonPhiMin = conf_.getParameter<double>("muonPhiMin");
118  double muonPhiMax = conf_.getParameter<double>("muonPhiMax");
119 
120  histname = "muonPhi_";
122  muonPhi->setAxisTitle("");
123 
124  //
125  int muonD0Bin = conf_.getParameter<int>("muonD0Bin");
126  double muonD0Min = conf_.getParameter<double>("muonD0Min");
127  double muonD0Max = conf_.getParameter<double>("muonD0Max");
128 
129  histname = "muonD0_";
131  muonD0->setAxisTitle("");
132 
133  //
134  int muonCompatibleLayersBin = conf_.getParameter<int>("muonCompatibleLayersBin");
135  double muonCompatibleLayersMin = conf_.getParameter<double>("muonCompatibleLayersMin");
136  double muonCompatibleLayersMax = conf_.getParameter<double>("muonCompatibleLayersMax");
137 
138  histname = "muonCompatibleLayers_";
140  histname + AlgoName,
145 
146  //------------------------------------------------------------------------------------
147 
148  //
149  int trackXBin = conf_.getParameter<int>("trackXBin");
150  double trackXMin = conf_.getParameter<double>("trackXMin");
151  double trackXMax = conf_.getParameter<double>("trackXMax");
152 
153  histname = "trackX_";
155  trackX->setAxisTitle("");
156 
157  //
158  int trackYBin = conf_.getParameter<int>("trackYBin");
159  double trackYMin = conf_.getParameter<double>("trackYMin");
160  double trackYMax = conf_.getParameter<double>("trackYMax");
161 
162  histname = "trackY_";
164  trackY->setAxisTitle("");
165 
166  //
167  int trackZBin = conf_.getParameter<int>("trackZBin");
168  double trackZMin = conf_.getParameter<double>("trackZMin");
169  double trackZMax = conf_.getParameter<double>("trackZMax");
170 
171  histname = "trackZ_";
173  trackZ->setAxisTitle("");
174 
175  //
176  int trackEtaBin = conf_.getParameter<int>("trackEtaBin");
177  double trackEtaMin = conf_.getParameter<double>("trackEtaMin");
178  double trackEtaMax = conf_.getParameter<double>("trackEtaMax");
179 
180  histname = "trackEta_";
182  trackEta->setAxisTitle("");
183 
184  //
185  int trackPhiBin = conf_.getParameter<int>("trackPhiBin");
186  double trackPhiMin = conf_.getParameter<double>("trackPhiMin");
187  double trackPhiMax = conf_.getParameter<double>("trackPhiMax");
188 
189  histname = "trackPhi_";
191  trackPhi->setAxisTitle("");
192 
193  //
194  int trackD0Bin = conf_.getParameter<int>("trackD0Bin");
195  double trackD0Min = conf_.getParameter<double>("trackD0Min");
196  double trackD0Max = conf_.getParameter<double>("trackD0Max");
197 
198  histname = "trackD0_";
200  trackD0->setAxisTitle("");
201 
202  //
203  int trackCompatibleLayersBin = conf_.getParameter<int>("trackCompatibleLayersBin");
204  double trackCompatibleLayersMin = conf_.getParameter<double>("trackCompatibleLayersMin");
205  double trackCompatibleLayersMax = conf_.getParameter<double>("trackCompatibleLayersMax");
206 
207  histname = "trackCompatibleLayers_";
209  histname + AlgoName,
214 
215  //------------------------------------------------------------------------------------
216 
217  //
218  int deltaXBin = conf_.getParameter<int>("deltaXBin");
219  double deltaXMin = conf_.getParameter<double>("deltaXMin");
220  double deltaXMax = conf_.getParameter<double>("deltaXMax");
221 
222  histname = "deltaX_";
224  deltaX->setAxisTitle("");
225 
226  //
227  int deltaYBin = conf_.getParameter<int>("deltaYBin");
228  double deltaYMin = conf_.getParameter<double>("deltaYMin");
229  double deltaYMax = conf_.getParameter<double>("deltaYMax");
230 
231  histname = "deltaY_";
233  deltaY->setAxisTitle("");
234 
235  //
236  int signDeltaXBin = conf_.getParameter<int>("signDeltaXBin");
237  double signDeltaXMin = conf_.getParameter<double>("signDeltaXMin");
238  double signDeltaXMax = conf_.getParameter<double>("signDeltaXMax");
239 
240  histname = "signDeltaX_";
243 
244  //
245  int signDeltaYBin = conf_.getParameter<int>("signDeltaYBin");
246  double signDeltaYMin = conf_.getParameter<double>("signDeltaYMin");
247  double signDeltaYMax = conf_.getParameter<double>("signDeltaYMax");
248 
249  histname = "signDeltaY_";
252 
253  histname = "GlobalMuonPtEtaPhi_LowPt_";
254  GlobalMuonPtEtaPhiLowPt = ibooker.book2D(histname + AlgoName, histname + AlgoName, 20, -2.4, 2.4, 20, -3.25, 3.25);
256 
257  histname = "StandaloneMuonPtEtaPhi_LowPt_";
259  ibooker.book2D(histname + AlgoName, histname + AlgoName, 20, -2.4, 2.4, 20, -3.25, 3.25);
261 
262  histname = "GlobalMuonPtEtaPhi_HighPt_";
263  GlobalMuonPtEtaPhiHighPt = ibooker.book2D(histname + AlgoName, histname + AlgoName, 20, -2.4, 2.4, 20, -3.25, 3.25);
265 
266  histname = "StandaloneMuonPtEtaPhi_HighPt_";
268  ibooker.book2D(histname + AlgoName, histname + AlgoName, 20, -2.4, 2.4, 20, -3.25, 3.25);
270 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * GlobalMuonPtEtaPhiHighPt
MonitorElement * GlobalMuonPtEtaPhiLowPt
MonitorElement * muonCompatibleLayers
MonitorElement * StandaloneMuonPtEtaPhiLowPt
MonitorElement * StandaloneMuonPtEtaPhiHighPt
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * trackCompatibleLayers
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ checkSemiCylinder()

TrackEfficiencyMonitor::SemiCylinder TrackEfficiencyMonitor::checkSemiCylinder ( const Track tk)

◆ compatibleLayers()

int TrackEfficiencyMonitor::compatibleLayers ( const NavigationSchool navigationSchool,
TrajectoryStateOnSurface  theTSOS 
)

Definition at line 599 of file TrackEfficiencyMonitor.cc.

References alongMomentum, Propagator::clone(), findDetLayer, findNextLayer(), TrajectoryStateOnSurface::freeState(), MeasurementTracker::geometricSearchTracker(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), dqmdumpme::k, hgcalTBTopologyTester_cfi::layers, measurementTracker, NavigationSchool::nextLayers(), Propagator::propagate(), Propagator::setPropagationDirection(), GeometricSearchDet::surface(), thePropagator, GeometricSearchTracker::tobLayers(), trackCompatibleLayers, and PV3DBase< T, PVType, FrameType >::y().

Referenced by testTrackerTracks().

601 {
602  //---------------------------------------------------
603  // check the number of compatible layers
604  //---------------------------------------------------
605 
606  std::vector<const BarrelDetLayer*> barrelTOBLayers = measurementTracker->geometricSearchTracker()->tobLayers();
607 
608  unsigned int layers = 0;
609  for (unsigned int k = 0; k < barrelTOBLayers.size(); k++) {
610  const DetLayer* firstLay = barrelTOBLayers[barrelTOBLayers.size() - 1 - k];
611 
612  //Propagator* theTmpPropagator = new SteppingHelixPropagator(&*bField,anyDirection);
613 
614  Propagator* theTmpPropagator = thePropagator->clone();
615  theTmpPropagator->setPropagationDirection(alongMomentum);
616 
617  TrajectoryStateOnSurface startTSOS = theTmpPropagator->propagate(*theTSOS.freeState(), firstLay->surface());
618 
619  std::vector<const DetLayer*> trackCompatibleLayers;
620 
621  findDetLayer = true;
622  bool isUpMuon = false;
623  bool firstdtep = true;
624 
625  if (startTSOS.isValid()) {
626  if (firstdtep)
627  layers++;
628 
629  int nwhile = 0;
630 
631  //for other compatible layers
632  while (startTSOS.isValid() && firstLay && findDetLayer) {
633  if (firstdtep && startTSOS.globalPosition().y() > 0)
634  isUpMuon = true;
635 
636  if (firstdtep) {
637  std::vector<const DetLayer*> firstCompatibleLayers;
638  firstCompatibleLayers.push_back(firstLay);
639  std::pair<TrajectoryStateOnSurface, const DetLayer*> nextLayer =
640  findNextLayer(theTSOS, firstCompatibleLayers, isUpMuon);
641  firstdtep = false;
642  } else {
643  trackCompatibleLayers = navigationSchool.nextLayers(*firstLay, *(startTSOS.freeState()), alongMomentum);
644  if (!trackCompatibleLayers.empty()) {
645  std::pair<TrajectoryStateOnSurface, const DetLayer*> nextLayer =
646  findNextLayer(startTSOS, trackCompatibleLayers, isUpMuon);
647  if (firstLay != nextLayer.second) {
648  firstLay = nextLayer.second;
649  startTSOS = nextLayer.first;
650  layers++;
651  } else
652  firstLay = nullptr;
653  }
654  }
655  nwhile++;
656  if (nwhile > 100)
657  break;
658  }
659  delete theTmpPropagator;
660  break;
661  }
662  delete theTmpPropagator;
663  }
664  return layers;
665 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
std::pair< TrajectoryStateOnSurface, const DetLayer * > findNextLayer(TrajectoryStateOnSurface startTSOS, const std::vector< const DetLayer *> &trackCompatibleLayers, bool isUpMuon)
virtual Propagator * clone() const =0
const GeometricSearchTracker * geometricSearchTracker() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
const Propagator * thePropagator
std::vector< BarrelDetLayer const * > const & tobLayers() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
const MeasurementTracker * measurementTracker
MonitorElement * trackCompatibleLayers

◆ findNextLayer()

std::pair< TrajectoryStateOnSurface, const DetLayer * > TrackEfficiencyMonitor::findNextLayer ( TrajectoryStateOnSurface  startTSOS,
const std::vector< const DetLayer *> &  trackCompatibleLayers,
bool  isUpMuon 
)

Definition at line 668 of file TrackEfficiencyMonitor.cc.

References alongMomentum, Propagator::clone(), findDetLayer, TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), Propagator::setPropagationDirection(), thePropagator, and trackCompatibleLayers.

Referenced by compatibleLayers().

671 {
672  //Propagator* theTmpPropagator = new SteppingHelixPropagator(&*bField,anyDirection);
673 
674  Propagator* theTmpPropagator = thePropagator->clone();
675  theTmpPropagator->setPropagationDirection(alongMomentum);
676 
677  std::vector<const DetLayer*>::const_iterator itl;
678  findDetLayer = false;
679  for (itl = trackCompatibleLayers.begin(); itl != trackCompatibleLayers.end(); ++itl) {
680  TrajectoryStateOnSurface tsos = theTmpPropagator->propagate(*(sTSOS.freeState()), (**itl).surface());
681  if (tsos.isValid()) {
682  sTSOS = tsos;
683  findDetLayer = true;
684 
685  break;
686  }
687  }
688  std::pair<TrajectoryStateOnSurface, const DetLayer*> blabla;
689  blabla.first = sTSOS;
690  blabla.second = &**itl;
691  delete theTmpPropagator;
692  return blabla;
693 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
virtual Propagator * clone() const =0
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
const Propagator * thePropagator
MonitorElement * trackCompatibleLayers

◆ testSTATracks()

void TrackEfficiencyMonitor::testSTATracks ( edm::Handle< TrackCollection tkTracks,
edm::Handle< TrackCollection staTracks 
)

Definition at line 478 of file TrackEfficiencyMonitor.cc.

References TransientTrackBuilder::build(), checkSemiCylinder(), d0, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), failedToPropagate, dqm::impl::MonitorElement::Fill(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::impactPointState(), reco::TransientTrack::innermostMeasurementState(), PFRecoTauChargedHadronQualityPlugins_cfi::isTrack, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localPosition(), muonD0, muonEta, muonPhi, muonX, muonY, muonZ, reco::TransientTrack::outermostMeasurementState(), phi, PV3DBase< T, PVType, FrameType >::phi(), funct::pow(), Propagator::propagate(), muonTagProbeFilters_cff::staTracks, TrajectoryStateOnSurface::surface(), thePropagator, theTTrackBuilder, trackD0, trackEta, trackPhi, trackX, trackY, trackZ, Up, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

481 {
482  reco::TransientTrack tkTT = theTTrackBuilder->build(tkTracks->front());
483  double ipX = tkTT.impactPointState().globalPosition().x();
484  double ipY = tkTT.impactPointState().globalPosition().y();
485  double ipZ = tkTT.impactPointState().globalPosition().z();
486  double eta = tkTT.impactPointState().globalDirection().eta();
487  double phi = tkTT.impactPointState().globalDirection().phi();
488  double d0 = (*tkTracks)[0].d0();
489 
491  LocalVector diffLocal;
492  TrajectoryStateOnSurface staState;
493  bool isTrack = false;
494 
495  if (!staTracks->empty()) {
496  //---------------------------------------------------
497  //look for associated muons
498  //---------------------------------------------------
499 
500  float DR2min = 1000;
501  reco::TrackCollection::const_iterator closestTrk = staTracks->end();
502  //----------------------loop on tracker tracks:
503  for (reco::TrackCollection::const_iterator staTrack = staTracks->begin(); staTrack != staTracks->end();
504  ++staTrack) {
505  if (checkSemiCylinder(*staTrack) == TrackEfficiencyMonitor::Up) {
506  reco::TransientTrack staTT = theTTrackBuilder->build(*staTrack);
507  failedToPropagate = 1;
508  staState = thePropagator->propagate(staTT.outermostMeasurementState(), tkInner.surface());
509 
510  if (staState.isValid()) {
511  failedToPropagate = 0;
512  diffLocal = tkInner.localPosition() - staState.localPosition();
513 
514  double DR2 = diffLocal.x() * diffLocal.x() + diffLocal.y() * diffLocal.y();
515  if (DR2 < DR2min) {
516  DR2min = DR2;
517  closestTrk = staTrack;
518  }
519  if (pow(DR2, 0.5) < 100.)
520  isTrack = true;
521  }
522  }
523  }
524  }
525 
526  if (failedToPropagate == 0) {
527  trackX->Fill(ipX);
528  trackY->Fill(ipY);
529  trackZ->Fill(ipZ);
530  trackEta->Fill(eta);
531  trackPhi->Fill(phi);
532  trackD0->Fill(d0);
533 
534  if (isTrack) {
535  muonX->Fill(ipX);
536  muonY->Fill(ipY);
537  muonZ->Fill(ipZ);
538  muonEta->Fill(eta);
539  muonPhi->Fill(phi);
540  muonD0->Fill(d0);
541  }
542  }
543 }
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
const SurfaceType & surface() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
reco::TransientTrack build(const reco::Track *p) const
void Fill(long long x)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
TrajectoryStateOnSurface outermostMeasurementState() const
const TransientTrackBuilder * theTTrackBuilder
TrajectoryStateOnSurface innermostMeasurementState() const
static constexpr float d0
GlobalVector globalDirection() const
const Propagator * thePropagator
SemiCylinder checkSemiCylinder(const Track &)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
TrajectoryStateOnSurface impactPointState() const

◆ testTrackerTracks()

void TrackEfficiencyMonitor::testTrackerTracks ( edm::Handle< TrackCollection tkTracks,
edm::Handle< TrackCollection staTracks,
const NavigationSchool navigationSchool 
)

Definition at line 358 of file TrackEfficiencyMonitor.cc.

References TransientTrackBuilder::build(), checkSemiCylinder(), compatibleLayers(), d0, deltaX, deltaY, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), failedToPropagate, dqm::impl::MonitorElement::Fill(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), mps_fire::i, reco::TransientTrack::impactPointState(), reco::TransientTrack::innermostMeasurementState(), PFRecoTauChargedHadronQualityPlugins_cfi::isTrack, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), metname, muonCompatibleLayers, muonD0, muonEta, muonPhi, muonX, muonY, muonZ, nCompatibleLayers, TrackCollections2monitor_cff::numberOfValidHits, reco::TransientTrack::outermostMeasurementState(), phi, PV3DBase< T, PVType, FrameType >::phi(), LocalTrajectoryError::positionError(), funct::pow(), Propagator::propagate(), signDeltaX, signDeltaY, muonTagProbeFilters_cff::staTracks, AlCaHLTBitMon_QueryRunRegistry::string, TrajectoryStateOnSurface::surface(), theMaxZ_, thePropagator, theRadius_, theTTrackBuilder, trackCompatibleLayers, trackD0, trackerAcceptance(), trackEta, trackPhi, trackX, trackY, trackZ, Up, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

362 {
363  const std::string metname = "testStandAloneMuonTracks";
364 
365  //---------------------------------------------------
366  // get the index of the "up" muon
367  // histograms will only be computed for the "up" muon
368  //---------------------------------------------------
369 
370  int nUpMuon = 0;
371  int idxUpMuon = -1;
372  for (unsigned int i = 0; i < staTracks->size(); i++) {
374  nUpMuon++;
375  idxUpMuon = i;
376  }
377  }
378 
379  if (nUpMuon == 1) {
380  //---------------------------------------------------
381  //get the muon informations
382  //---------------------------------------------------
383 
384  reco::TransientTrack staTT = theTTrackBuilder->build((*staTracks)[idxUpMuon]);
385  double ipX = staTT.impactPointState().globalPosition().x();
386  double ipY = staTT.impactPointState().globalPosition().y();
387  double ipZ = staTT.impactPointState().globalPosition().z();
388  double eta = staTT.impactPointState().globalDirection().eta();
389  double phi = staTT.impactPointState().globalDirection().phi();
390  double d0 = (*staTracks)[idxUpMuon].d0();
391 
393  TrajectoryStateOnSurface theTSOSCompLayers = staTT.outermostMeasurementState();
394 
395  //---------------------------------------------------
396  //check if the muon is in the tracker acceptance
397  //---------------------------------------------------
398  bool isInTrackerAcceptance = false;
399  isInTrackerAcceptance = trackerAcceptance(theTSOS, theRadius_, theMaxZ_);
400 
401  //---------------------------------------------------st
402  //count the number of compatible layers
403  //---------------------------------------------------
404  nCompatibleLayers = compatibleLayers(navigationSchool, theTSOSCompLayers);
405 
406  if (isInTrackerAcceptance && (*staTracks)[idxUpMuon].hitPattern().numberOfValidHits() > 28) {
407  //---------------------------------------------------
408  //count the number of good muon candidates
409  //---------------------------------------------------
410 
411  TrajectoryStateOnSurface staState;
412  LocalVector diffLocal;
413 
414  bool isTrack = false;
415  if (!tkTracks->empty()) {
416  //---------------------------------------------------
417  //look for associated tracks
418  //---------------------------------------------------
419  float DR2min = 1000;
420  reco::TrackCollection::const_iterator closestTrk = tkTracks->end();
421 
422  for (reco::TrackCollection::const_iterator tkTrack = tkTracks->begin(); tkTrack != tkTracks->end(); ++tkTrack) {
423  reco::TransientTrack tkTT = theTTrackBuilder->build(*tkTrack);
425  staState = thePropagator->propagate(staTT.outermostMeasurementState(), tkInner.surface());
426  failedToPropagate = 1;
427 
428  if (staState.isValid()) {
429  failedToPropagate = 0;
430  diffLocal = tkInner.localPosition() - staState.localPosition();
431  double DR2 = diffLocal.x() * diffLocal.x() + diffLocal.y() * diffLocal.y();
432  if (DR2 < DR2min) {
433  DR2min = DR2;
434  closestTrk = tkTrack;
435  }
436  if (pow(DR2, 0.5) < 100.)
437  isTrack = true;
438  }
439  }
440 
441  if (DR2min != 1000) {
442  reco::TransientTrack tkTT = theTTrackBuilder->build(*closestTrk);
444  staState = thePropagator->propagate(staTT.outermostMeasurementState(), tkInner.surface());
445  deltaX->Fill(diffLocal.x());
446  deltaY->Fill(diffLocal.y());
447  signDeltaX->Fill(diffLocal.x() /
448  (tkInner.localError().positionError().xx() + staState.localError().positionError().xx()));
449  signDeltaY->Fill(diffLocal.y() /
450  (tkInner.localError().positionError().yy() + staState.localError().positionError().yy()));
451  }
452  }
453 
454  if (failedToPropagate == 0) {
455  muonX->Fill(ipX);
456  muonY->Fill(ipY);
457  muonZ->Fill(ipZ);
458  muonEta->Fill(eta);
459  muonPhi->Fill(phi);
460  muonD0->Fill(d0);
462 
463  if (isTrack) {
464  trackX->Fill(ipX);
465  trackY->Fill(ipY);
466  trackZ->Fill(ipZ);
467  trackEta->Fill(eta);
468  trackPhi->Fill(phi);
469  trackD0->Fill(d0);
471  }
472  }
473  }
474  }
475 }
const LocalTrajectoryError & localError() const
T z() const
Definition: PV3DBase.h:61
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
LocalError positionError() const
const SurfaceType & surface() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
reco::TransientTrack build(const reco::Track *p) const
void Fill(long long x)
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
MonitorElement * muonCompatibleLayers
GlobalPoint globalPosition() const
TrajectoryStateOnSurface outermostMeasurementState() const
const TransientTrackBuilder * theTTrackBuilder
TrajectoryStateOnSurface innermostMeasurementState() const
static constexpr float d0
GlobalVector globalDirection() const
const Propagator * thePropagator
bool trackerAcceptance(TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ)
int compatibleLayers(const NavigationSchool &navigationSchool, TrajectoryStateOnSurface theTSOS)
SemiCylinder checkSemiCylinder(const Track &)
MonitorElement * trackCompatibleLayers
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
float xx() const
Definition: LocalError.h:22
TrajectoryStateOnSurface impactPointState() const

◆ trackerAcceptance()

bool TrackEfficiencyMonitor::trackerAcceptance ( TrajectoryStateOnSurface  theTSOS,
double  theRadius,
double  theMaxZ 
)

Definition at line 553 of file TrackEfficiencyMonitor.cc.

References accept(), alongMomentum, Cylinder::build(), Propagator::clone(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), oppositeToMomentum, Propagator::propagate(), Propagator::setPropagationDirection(), TrackEfficiencyMonitor_cfi::theMaxZ, thePropagator, TrackEfficiencyMonitor_cfi::theRadius, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by testTrackerTracks().

555 {
556  //---------------------------------------------------
557  // check if the muon is in the tracker acceptance
558  // check the compatibility with a cylinder of radius "theRadius"
559  //---------------------------------------------------
560 
561  //Propagator* theTmpPropagator = new SteppingHelixPropagator(&*bField,anyDirection);
562 
563  //Propagator* theTmpPropagator = &*thePropagator;
564  Propagator* theTmpPropagator = thePropagator->clone();
565 
566  if (theTSOS.globalPosition().y() < 0)
567  theTmpPropagator->setPropagationDirection(oppositeToMomentum);
568  else
569  theTmpPropagator->setPropagationDirection(alongMomentum);
570 
573  const Cylinder::CylinderPointer cyl = Cylinder::build(pos0, rot0, theRadius);
574  TrajectoryStateOnSurface tsosAtCyl = theTmpPropagator->propagate(*theTSOS.freeState(), *cyl);
575  double accept = false;
576  if (tsosAtCyl.isValid()) {
577  if (fabs(tsosAtCyl.globalPosition().z()) < theMaxZ) {
580  const Cylinder::CylinderPointer cyl2 = Cylinder::build(pos02, rot02, theRadius - 10);
581  TrajectoryStateOnSurface tsosAtCyl2 = theTmpPropagator->propagate(*tsosAtCyl.freeState(), *cyl2);
582  if (tsosAtCyl2.isValid()) {
585  const Cylinder::CylinderPointer cyl3 = Cylinder::build(pos03, rot03, theRadius);
586  TrajectoryStateOnSurface tsosAtCyl3 = theTmpPropagator->propagate(*tsosAtCyl2.freeState(), *cyl3);
587  if (tsosAtCyl3.isValid()) {
588  accept = true;
589  }
590  }
591  }
592  }
593  delete theTmpPropagator;
594  //muon propagated to the barrel cylinder
595  return accept;
596 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
T z() const
Definition: PV3DBase.h:61
virtual Propagator * clone() const =0
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
const Propagator * thePropagator
FreeTrajectoryState const * freeState(bool withErrors=true) const

Member Data Documentation

◆ bField

const MagneticField* TrackEfficiencyMonitor::bField
private

Definition at line 126 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ conf_

edm::ParameterSet TrackEfficiencyMonitor::conf_
private

Definition at line 70 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), and TrackEfficiencyMonitor().

◆ deltaX

MonitorElement* TrackEfficiencyMonitor::deltaX
private

Definition at line 103 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), and testTrackerTracks().

◆ deltaY

MonitorElement* TrackEfficiencyMonitor::deltaY
private

Definition at line 104 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), and testTrackerTracks().

◆ dqmStore_

DQMStore* TrackEfficiencyMonitor::dqmStore_
private

Definition at line 69 of file TrackEfficiencyMonitor.h.

Referenced by TrackEfficiencyMonitor().

◆ failedToPropagate

int TrackEfficiencyMonitor::failedToPropagate
private

Definition at line 83 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), testSTATracks(), and testTrackerTracks().

◆ findDetLayer

bool TrackEfficiencyMonitor::findDetLayer
private

Definition at line 85 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), compatibleLayers(), and findNextLayer().

◆ GlobalMuonPtEtaPhiHighPt

MonitorElement* TrackEfficiencyMonitor::GlobalMuonPtEtaPhiHighPt
private

Definition at line 109 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ GlobalMuonPtEtaPhiLowPt

MonitorElement* TrackEfficiencyMonitor::GlobalMuonPtEtaPhiLowPt
private

Definition at line 107 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ gstToken_

const edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> TrackEfficiencyMonitor::gstToken_
private

Definition at line 117 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ histname

std::string TrackEfficiencyMonitor::histname
private

Definition at line 67 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms().

◆ isBFieldOff_

bool TrackEfficiencyMonitor::isBFieldOff_
private

Definition at line 74 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and TrackEfficiencyMonitor().

◆ measurementTracker

const MeasurementTracker* TrackEfficiencyMonitor::measurementTracker
private

Definition at line 127 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and compatibleLayers().

◆ mfToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> TrackEfficiencyMonitor::mfToken_
private

Definition at line 118 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ mtToken_

const edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> TrackEfficiencyMonitor::mtToken_
private

Definition at line 119 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ muonCompatibleLayers

MonitorElement* TrackEfficiencyMonitor::muonCompatibleLayers
private

Definition at line 93 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), and testTrackerTracks().

◆ muonD0

MonitorElement* TrackEfficiencyMonitor::muonD0
private

Definition at line 92 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ muonEta

MonitorElement* TrackEfficiencyMonitor::muonEta
private

Definition at line 90 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ muonPhi

MonitorElement* TrackEfficiencyMonitor::muonPhi
private

Definition at line 91 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ muonToken_

edm::EDGetTokenT<edm::View<reco::Muon> > TrackEfficiencyMonitor::muonToken_
private

Definition at line 121 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and TrackEfficiencyMonitor().

◆ muonX

MonitorElement* TrackEfficiencyMonitor::muonX
private

Definition at line 87 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ muonY

MonitorElement* TrackEfficiencyMonitor::muonY
private

Definition at line 88 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ muonZ

MonitorElement* TrackEfficiencyMonitor::muonZ
private

Definition at line 89 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ navToken_

const edm::ESGetToken<NavigationSchool, NavigationSchoolRecord> TrackEfficiencyMonitor::navToken_
private

Definition at line 116 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ nCompatibleLayers

int TrackEfficiencyMonitor::nCompatibleLayers
private

Definition at line 84 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and testTrackerTracks().

◆ propToken_

const edm::ESGetToken<Propagator, TrackingComponentsRecord> TrackEfficiencyMonitor::propToken_
private

Definition at line 115 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ signDeltaX

MonitorElement* TrackEfficiencyMonitor::signDeltaX
private

Definition at line 105 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), and testTrackerTracks().

◆ signDeltaY

MonitorElement* TrackEfficiencyMonitor::signDeltaY
private

Definition at line 106 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), and testTrackerTracks().

◆ StandaloneMuonPtEtaPhiHighPt

MonitorElement* TrackEfficiencyMonitor::StandaloneMuonPtEtaPhiHighPt
private

Definition at line 110 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ StandaloneMuonPtEtaPhiLowPt

MonitorElement* TrackEfficiencyMonitor::StandaloneMuonPtEtaPhiLowPt
private

Definition at line 108 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ theMaxZ_

double TrackEfficiencyMonitor::theMaxZ_
private

Definition at line 73 of file TrackEfficiencyMonitor.h.

Referenced by testTrackerTracks(), and TrackEfficiencyMonitor().

◆ theMuonServiceProxy

MuonServiceProxy* TrackEfficiencyMonitor::theMuonServiceProxy
private

Definition at line 112 of file TrackEfficiencyMonitor.h.

◆ theNavigation

const DirectTrackerNavigation* TrackEfficiencyMonitor::theNavigation
private

Definition at line 111 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ thePropagator

const Propagator* TrackEfficiencyMonitor::thePropagator
private

◆ theRadius_

double TrackEfficiencyMonitor::theRadius_
private

Definition at line 72 of file TrackEfficiencyMonitor.h.

Referenced by testTrackerTracks(), and TrackEfficiencyMonitor().

◆ theSTATracksLabel_

edm::InputTag TrackEfficiencyMonitor::theSTATracksLabel_
private

Definition at line 79 of file TrackEfficiencyMonitor.h.

Referenced by TrackEfficiencyMonitor().

◆ theSTATracksToken_

edm::EDGetTokenT<reco::TrackCollection> TrackEfficiencyMonitor::theSTATracksToken_
private

Definition at line 81 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and TrackEfficiencyMonitor().

◆ theTKTracksLabel_

edm::InputTag TrackEfficiencyMonitor::theTKTracksLabel_
private

Definition at line 78 of file TrackEfficiencyMonitor.h.

Referenced by TrackEfficiencyMonitor().

◆ theTKTracksToken_

edm::EDGetTokenT<reco::TrackCollection> TrackEfficiencyMonitor::theTKTracksToken_
private

Definition at line 80 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and TrackEfficiencyMonitor().

◆ theTracker

const GeometricSearchTracker* TrackEfficiencyMonitor::theTracker
private

Definition at line 125 of file TrackEfficiencyMonitor.h.

Referenced by analyze().

◆ theTTrackBuilder

const TransientTrackBuilder* TrackEfficiencyMonitor::theTTrackBuilder
private

Definition at line 124 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), testSTATracks(), and testTrackerTracks().

◆ trackCompatibleLayers

MonitorElement* TrackEfficiencyMonitor::trackCompatibleLayers
private

◆ trackD0

MonitorElement* TrackEfficiencyMonitor::trackD0
private

Definition at line 100 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ trackEfficiency_

bool TrackEfficiencyMonitor::trackEfficiency_
private

Definition at line 75 of file TrackEfficiencyMonitor.h.

Referenced by analyze(), and TrackEfficiencyMonitor().

◆ trackEta

MonitorElement* TrackEfficiencyMonitor::trackEta
private

Definition at line 98 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ trackPhi

MonitorElement* TrackEfficiencyMonitor::trackPhi
private

Definition at line 99 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ trackX

MonitorElement* TrackEfficiencyMonitor::trackX
private

Definition at line 95 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ trackY

MonitorElement* TrackEfficiencyMonitor::trackY
private

Definition at line 96 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ trackZ

MonitorElement* TrackEfficiencyMonitor::trackZ
private

Definition at line 97 of file TrackEfficiencyMonitor.h.

Referenced by bookHistograms(), testSTATracks(), and testTrackerTracks().

◆ ttbToken_

const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> TrackEfficiencyMonitor::ttbToken_
private

Definition at line 114 of file TrackEfficiencyMonitor.h.

Referenced by analyze().