CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
StandaloneTrackMonitor Class Reference
Inheritance diagram for StandaloneTrackMonitor:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 StandaloneTrackMonitor (const edm::ParameterSet &)
 
- 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
 
 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
 

Protected Member Functions

void addClusterToMap (uint32_t detid, const SiStripCluster *cluster)
 
void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
void processClusters (edm::Event const &iEvent, edm::EventSetup const &iSetup, double wfac=1)
 
void processHit (const TrackingRecHit &recHit, edm::EventSetup const &iSetup, double wfac=1)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

MonitorElementbeamSpotXYposerrH_
 
MonitorElementbeamSpotXYposH_
 
MonitorElementbeamSpotZposerrH_
 
MonitorElementbeamSpotZposH_
 
const edm::InputTag bsTag_
 
const edm::EDGetTokenT
< reco::BeamSpot
bsToken_
 
MonitorElementbunchCrossingH_
 
std::map< uint32_t, std::set
< const SiStripCluster * > > 
clusterMap_
 
const edm::InputTag clusterTag_
 
const edm::EDGetTokenT
< edmNew::DetSetVector
< SiStripCluster > > 
clusterToken_
 
const bool doPUCorrection_
 
std::string folderName_
 
const edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
geomToken_
 
const bool haveAllHistograms_
 
MonitorElementhOffTrkClusChargeThickH_
 
MonitorElementhOffTrkClusChargeThinH_
 
MonitorElementhOffTrkClusWidthThickH_
 
MonitorElementhOffTrkClusWidthThinH_
 
MonitorElementhOnTrkClusChargeThickH_
 
MonitorElementhOnTrkClusChargeThinH_
 
MonitorElementhOnTrkClusWidthThickH_
 
MonitorElementhOnTrkClusWidthThinH_
 
const bool isMC_
 
unsigned long long m_cacheID_
 
std::string moduleName_
 
MonitorElementnHitsVsCosThetaH_
 
MonitorElementnHitsVsEtaH_
 
MonitorElementnHitsVsnVtxH_
 
MonitorElementnHitsVsPhiH_
 
MonitorElementnHitsVspTH_
 
MonitorElementnlostHitsH_
 
MonitorElementnLostHitsVsCosThetaH_
 
MonitorElementnLostHitsVsEtaH_
 
MonitorElementnLostHitsVsPhiH_
 
MonitorElementnLostHitsVspTH_
 
MonitorElementnPixBarrelH_
 
MonitorElementnPixEndcapH_
 
MonitorElementnPUH_
 
MonitorElementnStripTECH_
 
MonitorElementnStripTIBH_
 
MonitorElementnStripTIDH_
 
MonitorElementnStripTOBH_
 
MonitorElementnTracksH_
 
MonitorElementnvalidPixelHitsH_
 
MonitorElementnvalidStripHitsH_
 
MonitorElementnvalidTrackerHitsH_
 
MonitorElementnVertexH_
 
edm::ParameterSet parameters_
 
MonitorElementpixelLayerwithMeasurementH_
 
const std::string puScaleFactorFile_
 
const edm::InputTag puSummaryTag_
 
const edm::EDGetTokenT
< std::vector
< PileupSummaryInfo > > 
puSummaryToken_
 
SiStripClusterInfo siStripClusterInfo_
 
MonitorElementstripLayerwithMeasurementH_
 
const TrackerGeometrytkGeom_ = nullptr
 
MonitorElementtrackChargeH_
 
MonitorElementtrackChi2bynDOFH_
 
MonitorElementtrackChi2H_
 
MonitorElementtrackCosThetaH_
 
MonitorElementtrackd0H_
 
MonitorElementtrackEtaerrH_
 
MonitorElementtrackEtaH_
 
MonitorElementtracknDOFH_
 
MonitorElementtrackPH_
 
MonitorElementtrackPhierrH_
 
MonitorElementtrackPhiH_
 
MonitorElementtrackPterrH_
 
MonitorElementtrackPtH_
 
MonitorElementtrackPtOver10GeVH_
 
MonitorElementtrackPtUpto2GeVH_
 
MonitorElementtrackqOverperrH_
 
MonitorElementtrackqOverpH_
 
const std::string trackQuality_
 
const edm::InputTag trackTag_
 
MonitorElementtrackThetaerrH_
 
const edm::EDGetTokenT
< reco::TrackCollection
trackToken_
 
MonitorElementtrkLayerwithMeasurementH_
 
MonitorElementtrueNIntH_
 
const bool verbose_
 
const edm::InputTag vertexTag_
 
const edm::EDGetTokenT
< reco::VertexCollection
vertexToken_
 
MonitorElementvertexXposH_
 
MonitorElementvertexYposH_
 
MonitorElementvertexZposH_
 
std::vector< float > vpu_
 

Additional Inherited Members

- 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
 
- 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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 44 of file StandaloneTrackMonitor.cc.

Constructor & Destructor Documentation

StandaloneTrackMonitor::StandaloneTrackMonitor ( const edm::ParameterSet ps)

Definition at line 162 of file StandaloneTrackMonitor.cc.

References beamSpotXYposerrH_, beamSpotXYposH_, beamSpotZposerrH_, beamSpotZposH_, bunchCrossingH_, doPUCorrection_, validate-o2o-wbm::f1, hOffTrkClusChargeThickH_, hOffTrkClusChargeThinH_, hOffTrkClusWidthThickH_, hOffTrkClusWidthThinH_, hOnTrkClusChargeThickH_, hOnTrkClusChargeThinH_, hOnTrkClusWidthThickH_, hOnTrkClusWidthThinH_, mps_fire::i, isMC_, nHitsVsCosThetaH_, nHitsVsEtaH_, nHitsVsnVtxH_, nHitsVsPhiH_, nHitsVspTH_, nlostHitsH_, nLostHitsVsCosThetaH_, nLostHitsVsEtaH_, nLostHitsVsPhiH_, nLostHitsVspTH_, nPixBarrelH_, nPixEndcapH_, nPUH_, nStripTECH_, nStripTIBH_, nStripTIDH_, nStripTOBH_, nTracksH_, nvalidPixelHitsH_, nvalidStripHitsH_, nvalidTrackerHitsH_, nVertexH_, pixelLayerwithMeasurementH_, puScaleFactorFile_, stripLayerwithMeasurementH_, trackChargeH_, trackChi2bynDOFH_, trackChi2H_, trackCosThetaH_, trackd0H_, trackEtaerrH_, trackEtaH_, tracknDOFH_, trackPH_, trackPhierrH_, trackPhiH_, trackPterrH_, trackPtH_, trackPtOver10GeVH_, trackPtUpto2GeVH_, trackqOverperrH_, trackqOverpH_, trackThetaerrH_, trkLayerwithMeasurementH_, trueNIntH_, vertexXposH_, vertexYposH_, vertexZposH_, and vpu_.

163  : parameters_(ps),
164  moduleName_(parameters_.getUntrackedParameter<std::string>("moduleName", "StandaloneTrackMonitor")),
165  folderName_(parameters_.getUntrackedParameter<std::string>("folderName", "highPurityTracks")),
166  trackTag_(parameters_.getUntrackedParameter<edm::InputTag>("trackInputTag", edm::InputTag("generalTracks"))),
167  bsTag_(parameters_.getUntrackedParameter<edm::InputTag>("offlineBeamSpot", edm::InputTag("offlineBeamSpot"))),
168  vertexTag_(
169  parameters_.getUntrackedParameter<edm::InputTag>("vertexTag", edm::InputTag("offlinePrimaryVertices"))),
171  clusterTag_(parameters_.getUntrackedParameter<edm::InputTag>("clusterTag", edm::InputTag("siStripClusters"))),
172  trackToken_(consumes<reco::TrackCollection>(trackTag_)),
173  bsToken_(consumes<reco::BeamSpot>(bsTag_)),
174  vertexToken_(consumes<reco::VertexCollection>(vertexTag_)),
175  puSummaryToken_(consumes<std::vector<PileupSummaryInfo> >(puSummaryTag_)),
177  trackQuality_(parameters_.getUntrackedParameter<std::string>("trackQuality", "highPurity")),
178  siStripClusterInfo_(consumesCollector()),
179  doPUCorrection_(parameters_.getUntrackedParameter<bool>("doPUCorrection", false)),
180  isMC_(parameters_.getUntrackedParameter<bool>("isMC", false)),
181  haveAllHistograms_(parameters_.getUntrackedParameter<bool>("haveAllHistograms", false)),
183  parameters_.getUntrackedParameter<std::string>("puScaleFactorFile", "PileupScaleFactor_run203002.root")),
184  verbose_(parameters_.getUntrackedParameter<bool>("verbose", false)),
185  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()) {
186  trackEtaH_ = nullptr;
187  trackEtaerrH_ = nullptr;
188  trackCosThetaH_ = nullptr;
189  trackThetaerrH_ = nullptr;
190  trackPhiH_ = nullptr;
191  trackPhierrH_ = nullptr;
192  trackPH_ = nullptr;
193  trackPtH_ = nullptr;
194  trackPtUpto2GeVH_ = nullptr;
195  trackPtOver10GeVH_ = nullptr;
196  trackPterrH_ = nullptr;
197  trackqOverpH_ = nullptr;
198  trackqOverperrH_ = nullptr;
199  trackChargeH_ = nullptr;
200  nlostHitsH_ = nullptr;
201  nvalidTrackerHitsH_ = nullptr;
202  nvalidPixelHitsH_ = nullptr;
203  nvalidStripHitsH_ = nullptr;
204  trkLayerwithMeasurementH_ = nullptr;
205  pixelLayerwithMeasurementH_ = nullptr;
206  stripLayerwithMeasurementH_ = nullptr;
207  beamSpotXYposH_ = nullptr;
208  beamSpotXYposerrH_ = nullptr;
209  beamSpotZposH_ = nullptr;
210  beamSpotZposerrH_ = nullptr;
211  trackChi2H_ = nullptr;
212  tracknDOFH_ = nullptr;
213  trackd0H_ = nullptr;
214  trackChi2bynDOFH_ = nullptr;
215  vertexXposH_ = nullptr;
216  vertexYposH_ = nullptr;
217  vertexZposH_ = nullptr;
218 
219  nPixBarrelH_ = nullptr;
220  nPixEndcapH_ = nullptr;
221  nStripTIBH_ = nullptr;
222  nStripTOBH_ = nullptr;
223  nStripTECH_ = nullptr;
224  nStripTIDH_ = nullptr;
225  nTracksH_ = nullptr;
226 
227  // for MC only
228  nVertexH_ = nullptr;
229  bunchCrossingH_ = nullptr;
230  nPUH_ = nullptr;
231  trueNIntH_ = nullptr;
232 
233  nHitsVspTH_ = nullptr;
234  nHitsVsEtaH_ = nullptr;
235  nHitsVsCosThetaH_ = nullptr;
236  nHitsVsPhiH_ = nullptr;
237  nHitsVsnVtxH_ = nullptr;
238  nLostHitsVspTH_ = nullptr;
239  nLostHitsVsEtaH_ = nullptr;
240  nLostHitsVsCosThetaH_ = nullptr;
241  nLostHitsVsPhiH_ = nullptr;
242 
243  hOnTrkClusChargeThinH_ = nullptr;
244  hOnTrkClusWidthThinH_ = nullptr;
245  hOnTrkClusChargeThickH_ = nullptr;
246  hOnTrkClusWidthThickH_ = nullptr;
247 
248  hOffTrkClusChargeThinH_ = nullptr;
249  hOffTrkClusWidthThinH_ = nullptr;
250  hOffTrkClusChargeThickH_ = nullptr;
251  hOffTrkClusWidthThickH_ = nullptr;
252 
253  // Read pileup weight factors
254  if (isMC_ && doPUCorrection_) {
255  vpu_.clear();
256  TFile* f1 = TFile::Open(puScaleFactorFile_.c_str());
257  TH1F* h1 = dynamic_cast<TH1F*>(f1->Get("pileupweight"));
258  for (int i = 1; i <= h1->GetNbinsX(); ++i)
259  vpu_.push_back(h1->GetBinContent(i));
260  f1->Close();
261  }
262 }
MonitorElement * pixelLayerwithMeasurementH_
MonitorElement * hOnTrkClusChargeThickH_
const edm::InputTag trackTag_
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hOnTrkClusChargeThinH_
MonitorElement * trackPtOver10GeVH_
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
MonitorElement * trackChi2bynDOFH_
MonitorElement * hOffTrkClusWidthThickH_
const edm::EDGetTokenT< reco::TrackCollection > trackToken_
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > puSummaryToken_
MonitorElement * stripLayerwithMeasurementH_
MonitorElement * hOnTrkClusWidthThinH_
MonitorElement * hOffTrkClusWidthThinH_
const std::string puScaleFactorFile_
MonitorElement * hOffTrkClusChargeThinH_
SiStripClusterInfo siStripClusterInfo_
const edm::InputTag vertexTag_
MonitorElement * hOnTrkClusWidthThickH_
const edm::InputTag puSummaryTag_
MonitorElement * nLostHitsVsCosThetaH_
MonitorElement * hOffTrkClusChargeThickH_
const edm::InputTag clusterTag_
MonitorElement * nvalidTrackerHitsH_
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
MonitorElement * trkLayerwithMeasurementH_
const edm::EDGetTokenT< reco::VertexCollection > vertexToken_
MonitorElement * trackPtUpto2GeVH_

Member Function Documentation

void StandaloneTrackMonitor::addClusterToMap ( uint32_t  detid,
const SiStripCluster cluster 
)
protected

Definition at line 752 of file StandaloneTrackMonitor.cc.

References clusterMap_, and alignCSCRings::s.

Referenced by processHit().

752  {
753  std::map<uint32_t, std::set<const SiStripCluster*> >::iterator it = clusterMap_.find(detid);
754  if (it == clusterMap_.end()) {
755  std::set<const SiStripCluster*> s;
756  s.insert(cluster);
757  clusterMap_.insert(std::pair<uint32_t, std::set<const SiStripCluster*> >(detid, s));
758  } else {
759  std::set<const SiStripCluster*>& s = it->second;
760  s.insert(cluster);
761  }
762 }
std::map< uint32_t, std::set< const SiStripCluster * > > clusterMap_
void StandaloneTrackMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 462 of file StandaloneTrackMonitor.cc.

References beam_dqm_sourceclient-live_cfg::beamSpot, beamSpotXYposerrH_, beamSpotXYposH_, beamSpotZposerrH_, beamSpotZposH_, bsToken_, bunchCrossingH_, makePileupJSON::bx, RecoTauCleanerPlugins::charge, HLT_FULL_cff::chi2, funct::cos(), DetId::det(), doPUCorrection_, PVValHelper::dxy, PVValHelper::dz, PVValHelper::eta, dqm::impl::MonitorElement::Fill(), TrackingRecHit::geographicalId(), edm::Event::getByToken(), haveAllHistograms_, SiStripClusterInfo::initEvent(), edm::EventBase::isRealData(), edm::HandleBase::isValid(), TrackingRecHit::isValid(), ndof, nHitsVsCosThetaH_, nHitsVsEtaH_, nHitsVsnVtxH_, nHitsVsPhiH_, nHitsVspTH_, nlostHitsH_, nLostHitsVsCosThetaH_, nLostHitsVsEtaH_, nLostHitsVsPhiH_, nLostHitsVspTH_, nPixBarrelH_, nPixEndcapH_, nPUH_, nStripTECH_, nStripTIBH_, nStripTIDH_, nStripTOBH_, nTracksH_, reco::HitPattern::numberOfValidPixelHits(), reco::HitPattern::numberOfValidStripHits(), reco::HitPattern::numberOfValidTrackerHits(), nvalidPixelHitsH_, nvalidStripHitsH_, nvalidTrackerHitsH_, nVertexH_, AlCaHLTBitMon_ParallelJobs::p, phi, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, reco::HitPattern::pixelLayersWithMeasurement(), pixelLayerwithMeasurementH_, processClusters(), processHit(), DiDispStaMuonMonitor_cfi::pt, puSummaryToken_, quality, reco::TrackBase::qualityByName(), siStripClusterInfo_, reco::HitPattern::stripLayersWithMeasurement(), stripLayerwithMeasurementH_, DetId::subdetId(), StripSubdetector::TEC, theta(), StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, HLT_FULL_cff::track, trackChargeH_, trackChi2bynDOFH_, trackChi2H_, trackCosThetaH_, trackd0H_, DetId::Tracker, reco::HitPattern::trackerLayersWithMeasurement(), trackEtaerrH_, trackEtaH_, tracknDOFH_, trackPH_, trackPhierrH_, trackPhiH_, trackPterrH_, trackPtH_, trackPtOver10GeVH_, trackPtUpto2GeVH_, trackqOverperrH_, trackqOverpH_, trackQuality_, tracks, trackTag_, trackThetaerrH_, trackToken_, trkLayerwithMeasurementH_, trueNIntH_, findQualityFiles::v, verbose_, vertexTag_, vertexToken_, vertexXposH_, vertexYposH_, vertexZposH_, and vpu_.

462  {
463  // Get event setup (to get global transformation)
464 
466 
467  // Primary vertex collection
469  iEvent.getByToken(vertexToken_, vertexColl);
470 
471  // Beam spot
473  iEvent.getByToken(bsToken_, beamSpot);
474 
475  // Track collection
477  iEvent.getByToken(trackToken_, tracks);
478 
479  // Access PU information
480  double wfac = 1.0; // for data
481  if (!iEvent.isRealData()) {
483  iEvent.getByToken(puSummaryToken_, PupInfo);
484 
485  if (verbose_)
486  edm::LogInfo("StandaloneTrackMonitor") << "nPUColl = " << PupInfo->size();
487  for (auto const& v : *PupInfo) {
488  int bx = v.getBunchCrossing();
489  if (bunchCrossingH_)
490  bunchCrossingH_->Fill(bx);
491  if (bx == 0) {
492  if (nPUH_)
493  nPUH_->Fill(v.getPU_NumInteractions());
494  int ntrueInt = v.getTrueNumInteractions();
495  if (trueNIntH_)
496  trueNIntH_->Fill(ntrueInt);
497  if (doPUCorrection_)
498  if (ntrueInt > -1 && ntrueInt < int(vpu_.size()))
499  wfac = vpu_.at(ntrueInt);
500  }
501  }
502  }
503  if (verbose_)
504  edm::LogInfo("StandaloneTrackMonitor") << "PU reweight factor = " << wfac;
505 
506  if (!vertexColl.isValid())
507  edm::LogError("DqmTrackStudy") << "Error! Failed to get reco::Vertex Collection, " << vertexTag_;
508  if (haveAllHistograms_) {
509  int nvtx = (vertexColl.isValid() ? vertexColl->size() : 0);
510  nVertexH_->Fill(nvtx);
511  }
512 
513  int ntracks = 0;
514  if (tracks.isValid()) {
515  edm::LogInfo("StandaloneTrackMonitor") << "Total # of Tracks: " << tracks->size();
516  if (verbose_)
517  edm::LogInfo("StandaloneTrackMonitor") << "Total # of Tracks: " << tracks->size();
519  for (auto const& track : *tracks) {
520  if (!track.quality(quality))
521  continue;
522 
523  ++ntracks;
524 
525  double eta = track.eta();
526  double theta = track.theta();
527  double phi = track.phi();
528  double pt = track.pt();
529 
530  const reco::HitPattern& hitp = track.hitPattern();
531  double nValidTrackerHits = hitp.numberOfValidTrackerHits();
532  nHitsVsEtaH_->Fill(eta, nValidTrackerHits);
533  nHitsVsCosThetaH_->Fill(std::cos(theta), nValidTrackerHits);
534  nHitsVsPhiH_->Fill(phi, nValidTrackerHits);
535  nHitsVspTH_->Fill(pt, nValidTrackerHits);
536  nHitsVsnVtxH_->Fill(vertexColl->size(), nValidTrackerHits);
537 
538  int nLostHits = track.numberOfLostHits();
539  nLostHitsVspTH_->Fill(pt, nLostHits);
540  nLostHitsVsEtaH_->Fill(eta, nLostHits);
541  nLostHitsVsCosThetaH_->Fill(std::cos(theta), nLostHits);
542  nLostHitsVsPhiH_->Fill(phi, nLostHits);
543 
544  double nValidPixelHits = hitp.numberOfValidPixelHits();
545  double nValidStripHits = hitp.numberOfValidStripHits();
546  double pixelLayersWithMeasurement = hitp.pixelLayersWithMeasurement();
547  double stripLayersWithMeasurement = hitp.stripLayersWithMeasurement();
548 
549  if (haveAllHistograms_) {
550  double etaError = track.etaError();
551  double thetaError = track.thetaError();
552  double phiError = track.phiError();
553  double p = track.p();
554  double ptError = track.ptError();
555  double qoverp = track.qoverp();
556  double qoverpError = track.qoverpError();
557  double charge = track.charge();
558 
559  double trackerLayersWithMeasurement = hitp.trackerLayersWithMeasurement();
560 
561  double dxy = track.dxy(beamSpot->position());
562  double dxyError = track.dxyError();
563  double dz = track.dz(beamSpot->position());
564  double dzError = track.dzError();
565 
566  double trkd0 = track.d0();
567  double chi2 = track.chi2();
568  double ndof = track.ndof();
569  double vx = track.vx();
570  double vy = track.vy();
571  double vz = track.vz();
572 
573  // Fill the histograms
574  trackEtaH_->Fill(eta, wfac);
575  trackEtaerrH_->Fill(etaError, wfac);
576  trackCosThetaH_->Fill(std::cos(theta), wfac);
577  trackThetaerrH_->Fill(thetaError, wfac);
578  trackPhiH_->Fill(phi, wfac);
579  trackPhierrH_->Fill(phiError, wfac);
580  trackPH_->Fill(p, wfac);
581  trackPtH_->Fill(pt, wfac);
582  if (pt <= 2)
583  trackPtUpto2GeVH_->Fill(pt, wfac);
584  if (pt >= 10)
585  trackPtOver10GeVH_->Fill(pt, wfac);
586  trackPterrH_->Fill(ptError, wfac);
587  trackqOverpH_->Fill(qoverp, wfac);
588  trackqOverperrH_->Fill(qoverpError, wfac);
589  trackChargeH_->Fill(charge, wfac);
590  trackChi2H_->Fill(chi2, wfac);
591  trackd0H_->Fill(trkd0, wfac);
592  tracknDOFH_->Fill(ndof, wfac);
593  trackChi2bynDOFH_->Fill(chi2 / ndof, wfac);
594 
595  nlostHitsH_->Fill(nLostHits, wfac);
596  nvalidTrackerHitsH_->Fill(nValidTrackerHits, wfac);
597  nvalidPixelHitsH_->Fill(nValidPixelHits, wfac);
598  nvalidStripHitsH_->Fill(nValidStripHits, wfac);
599 
600  trkLayerwithMeasurementH_->Fill(trackerLayersWithMeasurement, wfac);
601  pixelLayerwithMeasurementH_->Fill(pixelLayersWithMeasurement, wfac);
602  stripLayerwithMeasurementH_->Fill(stripLayersWithMeasurement, wfac);
603 
604  beamSpotXYposH_->Fill(dxy, wfac);
605  beamSpotXYposerrH_->Fill(dxyError, wfac);
606  beamSpotZposH_->Fill(dz, wfac);
607  beamSpotZposerrH_->Fill(dzError, wfac);
608 
609  vertexXposH_->Fill(vx, wfac);
610  vertexYposH_->Fill(vy, wfac);
611  vertexZposH_->Fill(vz, wfac);
612  }
613  int nPixBarrel = 0, nPixEndcap = 0, nStripTIB = 0, nStripTOB = 0, nStripTEC = 0, nStripTID = 0;
614  for (auto it = track.recHitsBegin(); it != track.recHitsEnd(); ++it) {
615  const TrackingRecHit& hit = (**it);
616  if (hit.isValid()) {
617  if (hit.geographicalId().det() == DetId::Tracker) {
618  int subdetId = hit.geographicalId().subdetId();
619  if (subdetId == PixelSubdetector::PixelBarrel)
620  ++nPixBarrel;
621  else if (subdetId == PixelSubdetector::PixelEndcap)
622  ++nPixEndcap;
623  else if (subdetId == StripSubdetector::TIB)
624  ++nStripTIB;
625  else if (subdetId == StripSubdetector::TOB)
626  ++nStripTOB;
627  else if (subdetId == StripSubdetector::TEC)
628  ++nStripTEC;
629  else if (subdetId == StripSubdetector::TID)
630  ++nStripTID;
631 
632  // Find on-track clusters
633  processHit(hit, iSetup, wfac);
634  }
635  }
636  }
637  if (verbose_)
638  edm::LogInfo("StandaloneTrackMonitor")
639  << " >>> HITs: nPixBarrel: " << nPixBarrel << " nPixEndcap: " << nPixEndcap << " nStripTIB: " << nStripTIB
640  << " nStripTOB: " << nStripTOB << " nStripTEC: " << nStripTEC << " nStripTID: " << nStripTID;
641  if (haveAllHistograms_) {
642  nPixBarrelH_->Fill(nPixBarrel, wfac);
643  nPixEndcapH_->Fill(nPixEndcap, wfac);
644  nStripTIBH_->Fill(nStripTIB, wfac);
645  nStripTOBH_->Fill(nStripTOB, wfac);
646  nStripTECH_->Fill(nStripTEC, wfac);
647  nStripTIDH_->Fill(nStripTID, wfac);
648  }
649  }
650  } else {
651  edm::LogError("DqmTrackStudy") << "Error! Failed to get reco::Track collection, " << trackTag_;
652  }
653  if (haveAllHistograms_)
654  nTracksH_->Fill(ntracks);
655 
656  // off track cluster properties
657  processClusters(iEvent, iSetup, wfac);
658 }
MonitorElement * pixelLayerwithMeasurementH_
const edm::InputTag trackTag_
static constexpr auto TEC
MonitorElement * trackPtOver10GeVH_
MonitorElement * trackChi2bynDOFH_
TrackQuality
track quality
Definition: TrackBase.h:150
const edm::EDGetTokenT< reco::TrackCollection > trackToken_
void processClusters(edm::Event const &iEvent, edm::EventSetup const &iSetup, double wfac=1)
uint32_t const *__restrict__ Quality * quality
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > puSummaryToken_
Geom::Theta< T > theta() const
MonitorElement * stripLayerwithMeasurementH_
int numberOfValidStripHits() const
Definition: HitPattern.h:837
auto const & tracks
cannot be loose
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:500
void processHit(const TrackingRecHit &recHit, edm::EventSetup const &iSetup, double wfac=1)
Log< level::Error, false > LogError
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:521
SiStripClusterInfo siStripClusterInfo_
const edm::InputTag vertexTag_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * nLostHitsVsCosThetaH_
Log< level::Info, false > LogInfo
MonitorElement * nvalidTrackerHitsH_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
static constexpr auto TIB
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
MonitorElement * trkLayerwithMeasurementH_
int stripLayersWithMeasurement() const
Definition: HitPattern.h:999
bool isValid() const
int numberOfValidTrackerHits() const
Definition: HitPattern.h:813
const edm::EDGetTokenT< reco::VertexCollection > vertexToken_
int numberOfValidPixelHits() const
Definition: HitPattern.h:825
MonitorElement * trackPtUpto2GeVH_
DetId geographicalId() const
void initEvent(const edm::EventSetup &iSetup)
static constexpr auto TID
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
void StandaloneTrackMonitor::bookHistograms ( DQMStore::IBooker iBook,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 268 of file StandaloneTrackMonitor.cc.

References beamSpotXYposerrH_, beamSpotXYposH_, beamSpotZposerrH_, beamSpotZposH_, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), bunchCrossingH_, folderName_, edm::ParameterSet::getParameter(), haveAllHistograms_, hOffTrkClusChargeThickH_, hOffTrkClusChargeThinH_, hOffTrkClusWidthThickH_, hOffTrkClusWidthThinH_, hOnTrkClusChargeThickH_, hOnTrkClusChargeThinH_, hOnTrkClusWidthThickH_, hOnTrkClusWidthThinH_, isMC_, moduleName_, nHitsVsCosThetaH_, nHitsVsEtaH_, nHitsVsnVtxH_, nHitsVsPhiH_, nHitsVspTH_, nlostHitsH_, nLostHitsVsCosThetaH_, nLostHitsVsEtaH_, nLostHitsVsPhiH_, nLostHitsVspTH_, nPixBarrelH_, nPixEndcapH_, nPUH_, nStripTECH_, nStripTIBH_, nStripTIDH_, nStripTOBH_, nTracksH_, nvalidPixelHitsH_, nvalidStripHitsH_, nvalidTrackerHitsH_, nVertexH_, parameters_, pixelLayerwithMeasurementH_, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, stripLayerwithMeasurementH_, trackChargeH_, trackChi2bynDOFH_, trackChi2H_, trackCosThetaH_, trackd0H_, trackEtaerrH_, trackEtaH_, tracknDOFH_, trackPH_, trackPhierrH_, trackPhiH_, trackPterrH_, trackPtH_, trackPtOver10GeVH_, trackPtUpto2GeVH_, trackqOverperrH_, trackqOverpH_, trackThetaerrH_, trkLayerwithMeasurementH_, trueNIntH_, vertexXposH_, vertexYposH_, and vertexZposH_.

270  {
271  edm::ParameterSet TrackEtaHistoPar = parameters_.getParameter<edm::ParameterSet>("trackEtaH");
272  edm::ParameterSet TrackPtHistoPar = parameters_.getParameter<edm::ParameterSet>("trackPtH");
273 
274  std::string currentFolder = moduleName_ + "/" + folderName_;
275  iBook.setCurrentFolder(currentFolder);
276 
277  // The following are common with the official tool
278  if (haveAllHistograms_) {
279  if (!trackEtaH_)
280  trackEtaH_ = iBook.book1D("trackEta",
281  "Track Eta",
282  TrackEtaHistoPar.getParameter<int32_t>("Xbins"),
283  TrackEtaHistoPar.getParameter<double>("Xmin"),
284  TrackEtaHistoPar.getParameter<double>("Xmax"));
285  if (!trackEtaerrH_)
286  trackEtaerrH_ = iBook.book1D("trackEtaerr", "Track Eta Error", 50, 0.0, 1.0);
287  if (!trackCosThetaH_)
288  trackCosThetaH_ = iBook.book1D("trackCosTheta", "Track Cos(Theta)", 50, -1.0, 1.0);
289  if (!trackThetaerrH_)
290  trackThetaerrH_ = iBook.book1D("trackThetaerr", "Track Theta Error", 50, 0.0, 1.0);
291  if (!trackPhiH_)
292  trackPhiH_ = iBook.book1D("trackPhi", "Track Phi", 70, -3.5, 3.5);
293  if (!trackPhierrH_)
294  trackPhierrH_ = iBook.book1D("trackPhierr", "Track Phi Error", 50, 0.0, 1.0);
295 
296  if (!trackPH_)
297  trackPH_ = iBook.book1D("trackP", "Track 4-momentum", 50, 0.0, 10.0);
298  if (!trackPtH_)
299  trackPtH_ = iBook.book1D("trackPt",
300  "Track Pt",
301  TrackPtHistoPar.getParameter<int32_t>("Xbins"),
302  TrackPtHistoPar.getParameter<double>("Xmin"),
303  TrackPtHistoPar.getParameter<double>("Xmax"));
304  if (!trackPtUpto2GeVH_)
305  trackPtUpto2GeVH_ = iBook.book1D("trackPtUpto2GeV", "Track Pt upto 2GeV", 100, 0, 2.0);
306  if (!trackPtOver10GeVH_)
307  trackPtOver10GeVH_ = iBook.book1D("trackPtOver10GeV", "Track Pt greater than 10 GeV", 100, 0, 100.0);
308  if (!trackPterrH_)
309  trackPterrH_ = iBook.book1D("trackPterr", "Track Pt Error", 100, 0.0, 100.0);
310  if (!trackqOverpH_)
311  trackqOverpH_ = iBook.book1D("trackqOverp", "q Over p", 40, -10.0, 10.0);
312  if (!trackqOverperrH_)
313  trackqOverperrH_ = iBook.book1D("trackqOverperr", "q Over p Error", 50, 0.0, 25.0);
314  if (!trackChargeH_)
315  trackChargeH_ = iBook.book1D("trackCharge", "Track Charge", 50, -5, 5);
316  if (!trackChi2H_)
317  trackChi2H_ = iBook.book1D("trackChi2", "Chi2", 100, 0.0, 100.0);
318  if (!tracknDOFH_)
319  tracknDOFH_ = iBook.book1D("tracknDOF", "nDOF", 100, 0.0, 100.0);
320  if (!trackd0H_)
321  trackd0H_ = iBook.book1D("trackd0", "Track d0", 100, -1, 1);
322  if (!trackChi2bynDOFH_)
323  trackChi2bynDOFH_ = iBook.book1D("trackChi2bynDOF", "Chi2 Over nDOF", 100, 0.0, 10.0);
324 
325  if (!nlostHitsH_)
326  nlostHitsH_ = iBook.book1D("nlostHits", "No. of Lost Hits", 10, 0.0, 10.0);
327  if (!nvalidTrackerHitsH_)
328  nvalidTrackerHitsH_ = iBook.book1D("nvalidTrackerhits", "No. of Valid Tracker Hits", 35, 0.0, 35.0);
329  if (!nvalidPixelHitsH_)
330  nvalidPixelHitsH_ = iBook.book1D("nvalidPixelHits", "No. of Valid Hits in Pixel", 10, 0.0, 10.0);
331  if (!nvalidStripHitsH_)
332  nvalidStripHitsH_ = iBook.book1D("nvalidStripHits", "No.of Valid Hits in Strip", 25, 0.0, 25.0);
333 
335  trkLayerwithMeasurementH_ = iBook.book1D("trkLayerwithMeasurement", "No. of Layers per Track", 25, 0.0, 25.0);
338  iBook.book1D("pixelLayerwithMeasurement", "No. of Pixel Layers per Track", 10, 0.0, 10.0);
341  iBook.book1D("stripLayerwithMeasurement", "No. of Strip Layers per Track", 20, 0.0, 20.0);
342 
343  if (!beamSpotXYposH_)
344  beamSpotXYposH_ = iBook.book1D("beamSpotXYpos", "XY position of beam spot", 40, -4.0, 4.0);
345  if (!beamSpotXYposerrH_)
346  beamSpotXYposerrH_ = iBook.book1D("beamSpotXYposerr", "Error in XY position of beam spot", 20, 0.0, 4.0);
347  if (!beamSpotZposH_)
348  beamSpotZposH_ = iBook.book1D("beamSpotZpos", "Z position of beam spot", 100, -20.0, 20.0);
349  if (!beamSpotZposerrH_)
350  beamSpotZposerrH_ = iBook.book1D("beamSpotZposerr", "Error in Z position of beam spot", 50, 0.0, 5.0);
351 
352  if (!vertexXposH_)
353  vertexXposH_ = iBook.book1D("vertexXpos", "Vertex X position", 50, -1.0, 1.0);
354  if (!vertexYposH_)
355  vertexYposH_ = iBook.book1D("vertexYpos", "Vertex Y position", 50, -1.0, 1.0);
356  if (!vertexZposH_)
357  vertexZposH_ = iBook.book1D("vertexZpos", "Vertex Z position", 100, -20.0, 20.0);
358  if (!nVertexH_)
359  nVertexH_ = iBook.book1D("nVertex", "# of vertices", 60, -0.5, 59.5);
360 
361  if (!nPixBarrelH_)
362  nPixBarrelH_ = iBook.book1D("nHitPixelBarrel", "No. of hits in Pixel Barrel per Track", 20, 0, 20.0);
363  if (!nPixEndcapH_)
364  nPixEndcapH_ = iBook.book1D("nHitPixelEndcap", "No. of hits in Pixel Endcap per Track", 20, 0, 20.0);
365  if (!nStripTIBH_)
366  nStripTIBH_ = iBook.book1D("nHitStripTIB", "No. of hits in Strip TIB per Track", 30, 0, 30.0);
367  if (!nStripTOBH_)
368  nStripTOBH_ = iBook.book1D("nHitStripTOB", "No. of hits in Strip TOB per Track", 30, 0, 30.0);
369  if (!nStripTECH_)
370  nStripTECH_ = iBook.book1D("nHitStripTEC", "No. of hits in Strip TEC per Track", 30, 0, 30.0);
371  if (!nStripTIDH_)
372  nStripTIDH_ = iBook.book1D("nHitStripTID", "No. of hits in Strip TID per Tracks", 30, 0, 30.0);
373 
374  if (!nTracksH_)
375  nTracksH_ = iBook.book1D("nTracks", "No. of Tracks", 100, -0.5, 999.5);
376  }
377  if (isMC_) {
378  if (!bunchCrossingH_)
379  bunchCrossingH_ = iBook.book1D("bunchCrossing", "Bunch Crosssing", 60, 0, 60.0);
380  if (!nPUH_)
381  nPUH_ = iBook.book1D("nPU", "No of Pileup", 60, 0, 60.0);
382  if (!trueNIntH_)
383  trueNIntH_ = iBook.book1D("trueNInt", "True no of Interactions", 60, 0, 60.0);
384  }
385  // Exclusive histograms
386  if (!nHitsVspTH_)
387  nHitsVspTH_ = iBook.bookProfile("nHitsVspT",
388  "Number of Hits Vs pT",
389  TrackPtHistoPar.getParameter<int32_t>("Xbins"),
390  TrackPtHistoPar.getParameter<double>("Xmin"),
391  TrackPtHistoPar.getParameter<double>("Xmax"),
392  0.0,
393  0.0,
394  "g");
395  if (!nHitsVsnVtxH_)
396  nHitsVsnVtxH_ = iBook.bookProfile("nHitsVsnVtx", "Number of Hits Vs Number of Vertex", 100, 0.0, 50, 0.0, 0.0, "g");
397  if (!nHitsVsEtaH_)
398  nHitsVsEtaH_ = iBook.bookProfile("nHitsVsEta",
399  "Number of Hits Vs Eta",
400  TrackEtaHistoPar.getParameter<int32_t>("Xbins"),
401  TrackEtaHistoPar.getParameter<double>("Xmin"),
402  TrackEtaHistoPar.getParameter<double>("Xmax"),
403  0.0,
404  0.0,
405  "g");
406  if (!nHitsVsCosThetaH_)
408  iBook.bookProfile("nHitsVsCosTheta", "Number of Hits Vs Cos(Theta)", 50, -1.0, 1.0, 0.0, 0.0, "g");
409  if (!nHitsVsPhiH_)
410  nHitsVsPhiH_ = iBook.bookProfile("nHitsVsPhi", "Number of Hits Vs Phi", 100, -3.5, 3.5, 0.0, 0.0, "g");
411 
412  if (!nLostHitsVspTH_)
413  nLostHitsVspTH_ = iBook.bookProfile("nLostHitsVspT",
414  "Number of Lost Hits Vs pT",
415  TrackPtHistoPar.getParameter<int32_t>("Xbins"),
416  TrackPtHistoPar.getParameter<double>("Xmin"),
417  TrackPtHistoPar.getParameter<double>("Xmax"),
418  0.0,
419  0.0,
420  "g");
421  if (!nLostHitsVsEtaH_)
422  nLostHitsVsEtaH_ = iBook.bookProfile("nLostHitsVsEta",
423  "Number of Lost Hits Vs Eta",
424  TrackEtaHistoPar.getParameter<int32_t>("Xbins"),
425  TrackEtaHistoPar.getParameter<double>("Xmin"),
426  TrackEtaHistoPar.getParameter<double>("Xmax"),
427  0.0,
428  0.0,
429  "g");
432  iBook.bookProfile("nLostHitsVsCosTheta", "Number of Lost Hits Vs Cos(Theta)", 50, -1.0, 1.0, 0.0, 0.0, "g");
433  if (!nLostHitsVsPhiH_)
434  nLostHitsVsPhiH_ = iBook.bookProfile("nLostHitsVsPhi", "Number of Lost Hits Vs Phi", 100, -3.5, 3.5, 0.0, 0.0, "g");
435 
436  // On and off-track cluster properties
439  iBook.book1D("hOnTrkClusChargeThin", "On-track Cluster Charge (Thin Sensor)", 100, 0, 1000);
441  hOnTrkClusWidthThinH_ = iBook.book1D("hOnTrkClusWidthThin", "On-track Cluster Width (Thin Sensor)", 20, -0.5, 19.5);
444  iBook.book1D("hOnTrkClusChargeThick", "On-track Cluster Charge (Thick Sensor)", 100, 0, 1000);
447  iBook.book1D("hOnTrkClusWidthThick", "On-track Cluster Width (Thick Sensor)", 20, -0.5, 19.5);
448 
451  iBook.book1D("hOffTrkClusChargeThin", "Off-track Cluster Charge (Thin Sensor)", 100, 0, 1000);
454  iBook.book1D("hOffTrkClusWidthThin", "Off-track Cluster Width (Thin Sensor)", 20, -0.5, 19.5);
457  iBook.book1D("hOffTrkClusChargeThick", "Off-track Cluster Charge (Thick Sensor)", 100, 0, 1000);
460  iBook.book1D("hOffTrkClusWidthThick", "Off-track Cluster Width (Thick Sensor)", 20, -0.5, 19.5);
461 }
MonitorElement * pixelLayerwithMeasurementH_
MonitorElement * hOnTrkClusChargeThickH_
MonitorElement * hOnTrkClusChargeThinH_
MonitorElement * trackPtOver10GeVH_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * trackChi2bynDOFH_
MonitorElement * hOffTrkClusWidthThickH_
MonitorElement * stripLayerwithMeasurementH_
MonitorElement * hOnTrkClusWidthThinH_
MonitorElement * hOffTrkClusWidthThinH_
MonitorElement * hOffTrkClusChargeThinH_
MonitorElement * hOnTrkClusWidthThickH_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
MonitorElement * nLostHitsVsCosThetaH_
MonitorElement * hOffTrkClusChargeThickH_
MonitorElement * nvalidTrackerHitsH_
MonitorElement * trkLayerwithMeasurementH_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * trackPtUpto2GeVH_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void StandaloneTrackMonitor::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 264 of file StandaloneTrackMonitor.cc.

References geomToken_, edm::EventSetup::getData(), and tkGeom_.

264  {
265  tkGeom_ = &(iSetup.getData(geomToken_));
266 }
const TrackerGeometry * tkGeom_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
void StandaloneTrackMonitor::processClusters ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
double  wfac = 1 
)
protected

Definition at line 659 of file StandaloneTrackMonitor.cc.

References Surface::bounds(), RecoTauCleanerPlugins::charge, SiStripClusterInfo::charge(), clusterMap_, clusterTag_, clusterToken_, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), hOffTrkClusChargeThickH_, hOffTrkClusChargeThinH_, hOffTrkClusWidthThickH_, hOffTrkClusWidthThinH_, TrackerGeometry::idToDetUnit(), edm::HandleBase::isValid(), alignCSCRings::s, SiStripClusterInfo::setCluster(), siStripClusterInfo_, GeomDet::surface(), Bounds::thickness(), TrackerMaterial_cfi::thickness, tkGeom_, and SiStripClusterInfo::width().

Referenced by analyze().

659  {
660  // SiStripClusters
662  iEvent.getByToken(clusterToken_, clusterHandle);
663 
664  if (clusterHandle.isValid()) {
665  // Loop on Dets
666  for (edmNew::DetSetVector<SiStripCluster>::const_iterator dsvit = clusterHandle->begin();
667  dsvit != clusterHandle->end();
668  ++dsvit) {
669  uint32_t detId = dsvit->id();
670  std::map<uint32_t, std::set<const SiStripCluster*> >::iterator jt = clusterMap_.find(detId);
671  bool detid_found = (jt != clusterMap_.end()) ? true : false;
672 
673  // Loop on Clusters
674  for (edmNew::DetSet<SiStripCluster>::const_iterator clusit = dsvit->begin(); clusit != dsvit->end(); ++clusit) {
675  if (detid_found) {
676  std::set<const SiStripCluster*>& s = jt->second;
677  if (s.find(&*clusit) != s.end())
678  continue;
679  }
680 
681  siStripClusterInfo_.setCluster(*clusit, detId);
683  float width = siStripClusterInfo_.width();
684 
685  const GeomDetUnit* detUnit = tkGeom_->idToDetUnit(detId);
686  float thickness = detUnit->surface().bounds().thickness(); // unit cm
687  if (thickness > 0.035) {
688  hOffTrkClusChargeThickH_->Fill(charge, wfac);
689  hOffTrkClusWidthThickH_->Fill(width, wfac);
690  } else {
691  hOffTrkClusChargeThinH_->Fill(charge, wfac);
692  hOffTrkClusWidthThinH_->Fill(width, wfac);
693  }
694  }
695  }
696  } else {
697  edm::LogError("StandaloneTrackMonitor") << "ClusterCollection " << clusterTag_ << " not valid!!" << std::endl;
698  }
699 }
const TrackerGeometry * tkGeom_
void setCluster(const SiStripCluster &cluster, int detId)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
MonitorElement * hOffTrkClusWidthThickH_
const Bounds & bounds() const
Definition: Surface.h:87
data_type const * const_iterator
Definition: DetSetNew.h:31
Log< level::Error, false > LogError
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
MonitorElement * hOffTrkClusWidthThinH_
MonitorElement * hOffTrkClusChargeThinH_
SiStripClusterInfo siStripClusterInfo_
void Fill(long long x)
virtual float thickness() const =0
int iEvent
Definition: GenABIO.cc:224
uint16_t charge() const
uint16_t width() const
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * hOffTrkClusChargeThickH_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const edm::InputTag clusterTag_
std::map< uint32_t, std::set< const SiStripCluster * > > clusterMap_
void StandaloneTrackMonitor::processHit ( const TrackingRecHit recHit,
edm::EventSetup const &  iSetup,
double  wfac = 1 
)
protected

Definition at line 700 of file StandaloneTrackMonitor.cc.

References addClusterToMap(), Surface::bounds(), SiStripClusterInfo::charge(), runTheMatrix::const, dqm::impl::MonitorElement::Fill(), TrackingRecHit::geographicalId(), hOnTrkClusChargeThickH_, hOnTrkClusChargeThinH_, hOnTrkClusWidthThickH_, hOnTrkClusWidthThinH_, TrackerGeometry::idToDetUnit(), SiStripMatchedRecHit2D::monoCluster(), SiStripClusterInfo::setCluster(), siStripClusterInfo_, SiStripMatchedRecHit2D::stereoCluster(), GeomDet::surface(), Bounds::thickness(), TrackerMaterial_cfi::thickness, tkGeom_, and SiStripClusterInfo::width().

Referenced by analyze().

700  {
701  uint32_t detid = recHit.geographicalId();
702  const GeomDetUnit* detUnit = tkGeom_->idToDetUnit(detid);
703  float thickness = detUnit->surface().bounds().thickness(); // unit cm
704 
705  auto const& thit = static_cast<BaseTrackerRecHit const&>(recHit);
706  if (!thit.isValid())
707  return;
708 
709  auto const& clus = thit.firstClusterRef();
710  if (!clus.isValid())
711  return;
712  if (!clus.isStrip())
713  return;
714 
715  if (thit.isMatched()) {
716  const SiStripMatchedRecHit2D& matchedHit = dynamic_cast<const SiStripMatchedRecHit2D&>(recHit);
717 
718  auto& clusterM = matchedHit.monoCluster();
719  siStripClusterInfo_.setCluster(clusterM, detid);
720  if (thickness > 0.035) {
723  } else {
726  }
727  addClusterToMap(detid, &clusterM);
728 
729  auto& clusterS = matchedHit.stereoCluster();
730  siStripClusterInfo_.setCluster(clusterS, detid);
731  if (thickness > 0.035) {
734  } else {
737  }
738  addClusterToMap(detid, &clusterS);
739  } else {
740  auto& cluster = clus.stripCluster();
741  siStripClusterInfo_.setCluster(cluster, detid);
742  if (thickness > 0.035) {
745  } else {
748  }
749  addClusterToMap(detid, &cluster);
750  }
751 }
const TrackerGeometry * tkGeom_
MonitorElement * hOnTrkClusChargeThickH_
MonitorElement * hOnTrkClusChargeThinH_
void setCluster(const SiStripCluster &cluster, int detId)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
SiStripCluster const & monoCluster() const
const Bounds & bounds() const
Definition: Surface.h:87
MonitorElement * hOnTrkClusWidthThinH_
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
SiStripClusterInfo siStripClusterInfo_
void Fill(long long x)
virtual float thickness() const =0
uint16_t charge() const
MonitorElement * hOnTrkClusWidthThickH_
uint16_t width() const
void addClusterToMap(uint32_t detid, const SiStripCluster *cluster)
SiStripCluster const & stereoCluster() const
DetId geographicalId() const

Member Data Documentation

MonitorElement* StandaloneTrackMonitor::beamSpotXYposerrH_
private

Definition at line 108 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::beamSpotXYposH_
private

Definition at line 107 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::beamSpotZposerrH_
private

Definition at line 110 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::beamSpotZposH_
private

Definition at line 109 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

const edm::InputTag StandaloneTrackMonitor::bsTag_
private

Definition at line 62 of file StandaloneTrackMonitor.cc.

const edm::EDGetTokenT<reco::BeamSpot> StandaloneTrackMonitor::bsToken_
private

Definition at line 67 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

MonitorElement* StandaloneTrackMonitor::bunchCrossingH_
private

Definition at line 126 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

std::map<uint32_t, std::set<const SiStripCluster*> > StandaloneTrackMonitor::clusterMap_
private

Definition at line 154 of file StandaloneTrackMonitor.cc.

Referenced by addClusterToMap(), and processClusters().

const edm::InputTag StandaloneTrackMonitor::clusterTag_
private

Definition at line 65 of file StandaloneTrackMonitor.cc.

Referenced by processClusters().

const edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > StandaloneTrackMonitor::clusterToken_
private

Definition at line 70 of file StandaloneTrackMonitor.cc.

Referenced by processClusters().

const bool StandaloneTrackMonitor::doPUCorrection_
private

Definition at line 74 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), and StandaloneTrackMonitor().

std::string StandaloneTrackMonitor::folderName_
private

Definition at line 60 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms().

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> StandaloneTrackMonitor::geomToken_
private

Definition at line 155 of file StandaloneTrackMonitor.cc.

Referenced by dqmBeginRun().

const bool StandaloneTrackMonitor::haveAllHistograms_
private

Definition at line 76 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* StandaloneTrackMonitor::hOffTrkClusChargeThickH_
private
MonitorElement* StandaloneTrackMonitor::hOffTrkClusChargeThinH_
private
MonitorElement* StandaloneTrackMonitor::hOffTrkClusWidthThickH_
private
MonitorElement* StandaloneTrackMonitor::hOffTrkClusWidthThinH_
private
MonitorElement* StandaloneTrackMonitor::hOnTrkClusChargeThickH_
private

Definition at line 143 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms(), processHit(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::hOnTrkClusChargeThinH_
private

Definition at line 141 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms(), processHit(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::hOnTrkClusWidthThickH_
private

Definition at line 144 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms(), processHit(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::hOnTrkClusWidthThinH_
private

Definition at line 142 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms(), processHit(), and StandaloneTrackMonitor().

const bool StandaloneTrackMonitor::isMC_
private

Definition at line 75 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms(), and StandaloneTrackMonitor().

unsigned long long StandaloneTrackMonitor::m_cacheID_
private

Definition at line 151 of file StandaloneTrackMonitor.cc.

std::string StandaloneTrackMonitor::moduleName_
private

Definition at line 59 of file StandaloneTrackMonitor.cc.

Referenced by bookHistograms().

MonitorElement* StandaloneTrackMonitor::nHitsVsCosThetaH_
private

Definition at line 134 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nHitsVsEtaH_
private

Definition at line 133 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nHitsVsnVtxH_
private

Definition at line 132 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nHitsVsPhiH_
private

Definition at line 135 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nHitsVspTH_
private

Definition at line 131 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nlostHitsH_
private

Definition at line 99 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nLostHitsVsCosThetaH_
private

Definition at line 138 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nLostHitsVsEtaH_
private

Definition at line 137 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nLostHitsVsPhiH_
private

Definition at line 139 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nLostHitsVspTH_
private

Definition at line 136 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nPixBarrelH_
private

Definition at line 117 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nPixEndcapH_
private

Definition at line 118 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nPUH_
private

Definition at line 127 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nStripTECH_
private

Definition at line 121 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nStripTIBH_
private

Definition at line 119 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nStripTIDH_
private

Definition at line 122 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nStripTOBH_
private

Definition at line 120 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nTracksH_
private

Definition at line 123 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nvalidPixelHitsH_
private

Definition at line 101 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nvalidStripHitsH_
private

Definition at line 102 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nvalidTrackerHitsH_
private

Definition at line 100 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::nVertexH_
private

Definition at line 115 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

edm::ParameterSet StandaloneTrackMonitor::parameters_
private
MonitorElement* StandaloneTrackMonitor::pixelLayerwithMeasurementH_
private

Definition at line 104 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

const std::string StandaloneTrackMonitor::puScaleFactorFile_
private

Definition at line 77 of file StandaloneTrackMonitor.cc.

Referenced by StandaloneTrackMonitor().

const edm::InputTag StandaloneTrackMonitor::puSummaryTag_
private

Definition at line 64 of file StandaloneTrackMonitor.cc.

const edm::EDGetTokenT<std::vector<PileupSummaryInfo> > StandaloneTrackMonitor::puSummaryToken_
private

Definition at line 69 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

SiStripClusterInfo StandaloneTrackMonitor::siStripClusterInfo_
private

Definition at line 73 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), processClusters(), and processHit().

MonitorElement* StandaloneTrackMonitor::stripLayerwithMeasurementH_
private

Definition at line 105 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

const TrackerGeometry* StandaloneTrackMonitor::tkGeom_ = nullptr
private

Definition at line 156 of file StandaloneTrackMonitor.cc.

Referenced by dqmBeginRun(), processClusters(), and processHit().

MonitorElement* StandaloneTrackMonitor::trackChargeH_
private

Definition at line 93 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackChi2bynDOFH_
private

Definition at line 97 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackChi2H_
private

Definition at line 94 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackCosThetaH_
private

Definition at line 82 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackd0H_
private

Definition at line 96 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackEtaerrH_
private

Definition at line 81 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackEtaH_
private

Definition at line 80 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::tracknDOFH_
private

Definition at line 95 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPH_
private

Definition at line 86 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPhierrH_
private

Definition at line 85 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPhiH_
private

Definition at line 84 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPterrH_
private

Definition at line 90 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPtH_
private

Definition at line 87 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPtOver10GeVH_
private

Definition at line 89 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackPtUpto2GeVH_
private

Definition at line 88 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackqOverperrH_
private

Definition at line 92 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trackqOverpH_
private

Definition at line 91 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

const std::string StandaloneTrackMonitor::trackQuality_
private

Definition at line 72 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

const edm::InputTag StandaloneTrackMonitor::trackTag_
private

Definition at line 61 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

MonitorElement* StandaloneTrackMonitor::trackThetaerrH_
private

Definition at line 83 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

const edm::EDGetTokenT<reco::TrackCollection> StandaloneTrackMonitor::trackToken_
private

Definition at line 66 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

MonitorElement* StandaloneTrackMonitor::trkLayerwithMeasurementH_
private

Definition at line 103 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::trueNIntH_
private

Definition at line 128 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

const bool StandaloneTrackMonitor::verbose_
private

Definition at line 78 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

const edm::InputTag StandaloneTrackMonitor::vertexTag_
private

Definition at line 63 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

const edm::EDGetTokenT<reco::VertexCollection> StandaloneTrackMonitor::vertexToken_
private

Definition at line 68 of file StandaloneTrackMonitor.cc.

Referenced by analyze().

MonitorElement* StandaloneTrackMonitor::vertexXposH_
private

Definition at line 112 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::vertexYposH_
private

Definition at line 113 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

MonitorElement* StandaloneTrackMonitor::vertexZposH_
private

Definition at line 114 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), bookHistograms(), and StandaloneTrackMonitor().

std::vector<float> StandaloneTrackMonitor::vpu_
private

Definition at line 153 of file StandaloneTrackMonitor.cc.

Referenced by analyze(), and StandaloneTrackMonitor().