Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracking hit-finding efficiency from HitPattern #11290

Merged
merged 1 commit into from
Sep 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions DQM/TrackingMonitor/interface/TrackAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Monitoring source for general quantities related to tracks.

#include <memory>
#include <fstream>
#include <unordered_map>
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand All @@ -34,14 +35,21 @@ class TrackAnalyzer
TrackAnalyzer(const edm::ParameterSet&);
TrackAnalyzer(const edm::ParameterSet&, edm::ConsumesCollector& iC);
virtual ~TrackAnalyzer();
virtual void initHisto(DQMStore::IBooker & ibooker);
virtual void initHisto(DQMStore::IBooker & ibooker, const edm::EventSetup &);

virtual void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track);

void doSoftReset (DQMStore * dqmStore_);
void doReset ();
void undoSoftReset(DQMStore * dqmStore_);
void setLumiFlag();
// Compute and locally store the number of Good vertices found
// in the event. This information is used as X-axis value in
// the hit-efficiency plots derived from the hit patter. This
// ugly design to avoid comuting this very same quantity for
// each and every track while in the analyze method. A
// redesign of the class is needed in the future.
void setNumberOfGoodVertices(const edm::Event &);

private:
void initHistos();
Expand All @@ -51,6 +59,7 @@ class TrackAnalyzer
void bookHistosForLScertification(DQMStore::IBooker & ibooker);
void bookHistosForBeamSpot(DQMStore::IBooker & ibooker);
void bookHistosForTrackerSpecific(DQMStore::IBooker & ibooker);
void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &ibooker, const edm::EventSetup & iSetup);
void fillHistosForHitProperties(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
void fillHistosForLScertification(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
void fillHistosForTrackerSpecific(const reco::Track & track);
Expand Down Expand Up @@ -98,6 +107,9 @@ class TrackAnalyzer
// IP significance plots
bool doSIPPlots_;

// Compute the hit-finding efficiency using the HitPattern of
// the reconstructed tracks
bool doEffFromHitPattern_;
std::string qualityString_;

struct TkParameterMEs {
Expand Down Expand Up @@ -345,7 +357,29 @@ class TrackAnalyzer
};
std::map<std::string, TkRecHitsPerSubDetMEs> TkRecHitsPerSubDetMEMap;


struct Key {
int det;
int subdet;
explicit Key(int det, int subdet):det(det),subdet(subdet){};
bool operator==(const Key & other) const {
return (det == other.det && subdet == other.subdet);
}
};

// Trivial hasher function: warning, it only works if det has less than 99 subdets.
struct KeyHasher {
std::size_t operator()(const Key& k) const {
return k.det*100+k.subdet;
}
};

std::unordered_map<Key, MonitorElement *, KeyHasher> hits_valid_;
std::unordered_map<Key, MonitorElement *, KeyHasher> hits_missing_;
std::unordered_map<Key, MonitorElement *, KeyHasher> hits_inactive_;
std::unordered_map<Key, MonitorElement *, KeyHasher> hits_bad_;
std::unordered_map<Key, MonitorElement *, KeyHasher> hits_total_;
unsigned int good_vertices_;


std::string histname; //for naming the histograms according to algorithm used
};
Expand Down
87 changes: 44 additions & 43 deletions DQM/TrackingMonitor/python/MonitorTrackSTAMuons_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

# determines where to evaluate track parameters
# options: 'default' --> straight up track parametes
# 'ImpactPoint' --> evalutate at impact point
# 'InnerSurface' --> evalutate at innermost measurement state
# 'OuterSurface' --> evalutate at outermost measurement state
# 'ImpactPoint' --> evalutate at impact point
# 'InnerSurface' --> evalutate at innermost measurement state
# 'OuterSurface' --> evalutate at outermost measurement state
MonitorTrackSTAMuons.MeasurementState = cms.string('default')

# which plots to do
Expand All @@ -34,12 +34,13 @@
MonitorTrackSTAMuons.doTrackCandHistos = cms.bool(False)
MonitorTrackSTAMuons.doDCAPlots = cms.bool(False)
MonitorTrackSTAMuons.doGeneralPropertiesPlots = cms.bool(True)
MonitorTrackSTAMuons.doHitPropertiesPlots = cms.bool(True)
MonitorTrackSTAMuons.doHitPropertiesPlots = cms.bool(True)
MonitorTrackSTAMuons.doEffFromHitPattern = cms.bool(False)
#MonitorTrackSTAMuons.doGoodTrackPlots = cms.bool(False)
MonitorTrackSTAMuons.doMeasurementStatePlots = cms.bool(True)
MonitorTrackSTAMuons.doProfilesVsLS = cms.bool(False)
MonitorTrackSTAMuons.doRecHitVsPhiVsEtaPerTrack = cms.bool(False)
#MonitorTrackSTAMuons.doGoodTrackRecHitVsPhiVsEtaPerTrack = cms.bool(False)
#MonitorTrackSTAMuons.doGoodTrackRecHitVsPhiVsEtaPerTrack = cms.bool(False)

#which seed plots to do
MonitorTrackSTAMuons.doSeedNumberHisto = cms.bool(False)
Expand All @@ -58,7 +59,7 @@


# paramters of the Track
# ============================================================
# ============================================================

# chi2
MonitorTrackSTAMuons.Chi2Bin = cms.int32(250)
Expand All @@ -80,29 +81,29 @@
MonitorTrackSTAMuons.TkSizeMax = cms.double(10.5)
MonitorTrackSTAMuons.TkSizeMin = cms.double(-0.5)

# Number of seeds per Event
# Number of seeds per Event
MonitorTrackSTAMuons.TkSeedSizeBin = cms.int32(20)
MonitorTrackSTAMuons.TkSeedSizeMax = cms.double(19.5)
MonitorTrackSTAMuons.TkSeedSizeMax = cms.double(19.5)
MonitorTrackSTAMuons.TkSeedSizeMin = cms.double(-0.5)

# Number of Track Cadidates per Event
MonitorTrackSTAMuons.TCSizeBin = cms.int32(150)
MonitorTrackSTAMuons.TCSizeMax = cms.double(149.5)
MonitorTrackSTAMuons.TCSizeMax = cms.double(149.5)
MonitorTrackSTAMuons.TCSizeMin = cms.double(-0.5)

# num rec hits
# num rec hits
MonitorTrackSTAMuons.TrackQBin = cms.int32(8)
MonitorTrackSTAMuons.TrackQMax = cms.double(2.5)
MonitorTrackSTAMuons.TrackQMax = cms.double(2.5)
MonitorTrackSTAMuons.TrackQMin = cms.double(-2.5)

# num rec hits in seed
# num rec hits in seed
MonitorTrackSTAMuons.SeedHitBin = cms.int32(6)
MonitorTrackSTAMuons.SeedHitMax = cms.double(5.5)
MonitorTrackSTAMuons.SeedHitMin = cms.double(-0.5)

# num rec hits per track candidate
MonitorTrackSTAMuons.TCHitBin = cms.int32(40)
MonitorTrackSTAMuons.TCHitMax = cms.double(39.5)
MonitorTrackSTAMuons.TCHitMax = cms.double(39.5)
MonitorTrackSTAMuons.TCHitMin = cms.double(-0.5)

# num rec hits
Expand All @@ -112,7 +113,7 @@

# mean rec hits
MonitorTrackSTAMuons.MeanHitBin = cms.int32(30)
MonitorTrackSTAMuons.MeanHitMax = cms.double(29.5)
MonitorTrackSTAMuons.MeanHitMax = cms.double(29.5)
MonitorTrackSTAMuons.MeanHitMin = cms.double(-0.5)

# num TOB rec hits
Expand Down Expand Up @@ -147,60 +148,60 @@

# num rec hits lost
MonitorTrackSTAMuons.RecLostBin = cms.int32(120)
MonitorTrackSTAMuons.RecLostMax = cms.double(20)
MonitorTrackSTAMuons.RecLostMax = cms.double(20)
MonitorTrackSTAMuons.RecLostMin = cms.double(0.0)

# num layers
MonitorTrackSTAMuons.RecLayBin = cms.int32(120)
MonitorTrackSTAMuons.RecLayMax = cms.double(120.0)
MonitorTrackSTAMuons.RecLayMin = cms.double(0.0)

# mean layers
# mean layers
MonitorTrackSTAMuons.MeanLayBin = cms.int32(20)
MonitorTrackSTAMuons.MeanLayMax = cms.double(19.5)
MonitorTrackSTAMuons.MeanLayMax = cms.double(19.5)
MonitorTrackSTAMuons.MeanLayMin = cms.double(-0.5)

# num TOB layers
MonitorTrackSTAMuons.TOBLayBin = cms.int32(10)
MonitorTrackSTAMuons.TOBLayMax = cms.double(9.5)
MonitorTrackSTAMuons.TOBLayMax = cms.double(9.5)
MonitorTrackSTAMuons.TOBLayMin = cms.double(-0.5)

# num TIB layers
MonitorTrackSTAMuons.TIBLayBin = cms.int32(6)
MonitorTrackSTAMuons.TIBLayMax = cms.double(5.5)
MonitorTrackSTAMuons.TIBLayMax = cms.double(5.5)
MonitorTrackSTAMuons.TIBLayMin = cms.double(-0.5)

# num TID layers
MonitorTrackSTAMuons.TIDLayBin = cms.int32(6)
MonitorTrackSTAMuons.TIDLayMax = cms.double(5.5)
MonitorTrackSTAMuons.TIDLayMax = cms.double(5.5)
MonitorTrackSTAMuons.TIDLayMin = cms.double(-0.5)

# num TEC layers
MonitorTrackSTAMuons.TECLayBin = cms.int32(15)
MonitorTrackSTAMuons.TECLayMax = cms.double(14.5)
MonitorTrackSTAMuons.TECLayMax = cms.double(14.5)
MonitorTrackSTAMuons.TECLayMin = cms.double(-0.5)

# num PXB layers
MonitorTrackSTAMuons.PXBLayBin = cms.int32(6)
MonitorTrackSTAMuons.PXBLayMax = cms.double(5.5)
MonitorTrackSTAMuons.PXBLayMax = cms.double(5.5)
MonitorTrackSTAMuons.PXBLayMin = cms.double(-0.5)

# num PXF layers
MonitorTrackSTAMuons.PXFLayBin = cms.int32(6)
MonitorTrackSTAMuons.PXFLayMax = cms.double(5.5)
MonitorTrackSTAMuons.PXFLayMax = cms.double(5.5)
MonitorTrackSTAMuons.PXFLayMin = cms.double(-0.5)

# Track |p|
# Track |p|
MonitorTrackSTAMuons.TrackPBin = cms.int32(1000)
MonitorTrackSTAMuons.TrackPMax = cms.double(1000)
MonitorTrackSTAMuons.TrackPMax = cms.double(1000)
MonitorTrackSTAMuons.TrackPMin = cms.double(0)

# Track pT
MonitorTrackSTAMuons.TrackPtBin = cms.int32(1000)
MonitorTrackSTAMuons.TrackPtMax = cms.double(1000)
MonitorTrackSTAMuons.TrackPtMin = cms.double(0)

# Track px
# Track px
MonitorTrackSTAMuons.TrackPxBin = cms.int32(1000)
MonitorTrackSTAMuons.TrackPxMax = cms.double(500.0)
MonitorTrackSTAMuons.TrackPxMin = cms.double(-500.0)
Expand Down Expand Up @@ -261,7 +262,7 @@
MonitorTrackSTAMuons.etaErrMin = cms.double(0.0)

# track phi Error
MonitorTrackSTAMuons.phiErrBin = cms.int32(100)
MonitorTrackSTAMuons.phiErrBin = cms.int32(100)
MonitorTrackSTAMuons.phiErrMax = cms.double(1.0)
MonitorTrackSTAMuons.phiErrMin = cms.double(0.0)

Expand All @@ -270,7 +271,7 @@
MonitorTrackSTAMuons.VXMax = cms.double(20.0)
MonitorTrackSTAMuons.VXMin = cms.double(-20.0)

# PCA y position
# PCA y position
MonitorTrackSTAMuons.VYBin = cms.int32(20)
MonitorTrackSTAMuons.VYMax = cms.double(20.0)
MonitorTrackSTAMuons.VYMin = cms.double(-20.0)
Expand All @@ -282,12 +283,12 @@

# PCA x position for 2D plot
MonitorTrackSTAMuons.X0Bin = cms.int32(100)
MonitorTrackSTAMuons.X0Max = cms.double(3.0)
MonitorTrackSTAMuons.X0Max = cms.double(3.0)
MonitorTrackSTAMuons.X0Min = cms.double(-3.0)

# PCA y position for 2D plot
MonitorTrackSTAMuons.Y0Bin = cms.int32(100)
MonitorTrackSTAMuons.Y0Max = cms.double(3.0)
MonitorTrackSTAMuons.Y0Max = cms.double(3.0)
MonitorTrackSTAMuons.Y0Min = cms.double(-3.0)

# PCA z position for 2D plot
Expand All @@ -297,53 +298,53 @@

# Track dxy (transverse impact parameter)
MonitorTrackSTAMuons.DxyBin = cms.int32(100)
MonitorTrackSTAMuons.DxyMax = cms.double(0.5)
MonitorTrackSTAMuons.DxyMin = cms.double(-0.5)
MonitorTrackSTAMuons.DxyMax = cms.double(0.5)
MonitorTrackSTAMuons.DxyMin = cms.double(-0.5)

# Seed dxy (transverse impact parameter)
MonitorTrackSTAMuons.SeedDxyBin = cms.int32(100)
MonitorTrackSTAMuons.SeedDxyMax = cms.double(0.5)
MonitorTrackSTAMuons.SeedDxyMin = cms.double(-0.5)
MonitorTrackSTAMuons.SeedDxyMin = cms.double(-0.5)

# Seed dz (longitudinal impact parameter)
MonitorTrackSTAMuons.SeedDzBin = cms.int32(200)
MonitorTrackSTAMuons.SeedDzMax = cms.double(30.0)
MonitorTrackSTAMuons.SeedDzMin = cms.double(-30.0)
MonitorTrackSTAMuons.SeedDzMin = cms.double(-30.0)

# Track Candidate dxy (transverse impact parameter)
MonitorTrackSTAMuons.TCDxyBin = cms.int32(200)
MonitorTrackSTAMuons.TCDxyMax = cms.double(100.0)
MonitorTrackSTAMuons.TCDxyMin = cms.double(-100.0)
MonitorTrackSTAMuons.TCDxyMin = cms.double(-100.0)

# Track Candidate dz (transverse impact parameter)
MonitorTrackSTAMuons.TCDzBin = cms.int32(200)
MonitorTrackSTAMuons.TCDzMax = cms.double(400.0)
MonitorTrackSTAMuons.TCDzMin = cms.double(-400.0)
MonitorTrackSTAMuons.TCDzMin = cms.double(-400.0)

# NCluster Pixel
MonitorTrackSTAMuons.NClusPxBin = cms.int32(50)
MonitorTrackSTAMuons.NClusPxMax = cms.double(1999.5)
MonitorTrackSTAMuons.NClusPxMax = cms.double(1999.5)
MonitorTrackSTAMuons.NClusPxMin = cms.double(-0.5)

# NCluster Strip
MonitorTrackSTAMuons.NClusStrBin = cms.int32(150)
MonitorTrackSTAMuons.NClusStrMax = cms.double(14999.5)
MonitorTrackSTAMuons.NClusStrMax = cms.double(14999.5)
MonitorTrackSTAMuons.NClusStrMin = cms.double(-0.5)

# NCluster 2D
MonitorTrackSTAMuons.NClus2DPxBin = cms.int32(20)
MonitorTrackSTAMuons.NClus2DPxMax = cms.double(1999.5)
MonitorTrackSTAMuons.NClus2DPxMax = cms.double(1999.5)
MonitorTrackSTAMuons.NClus2DPxMin = cms.double(-0.5)
MonitorTrackSTAMuons.NClus2DStrBin = cms.int32(50)
MonitorTrackSTAMuons.NClus2DStrMax = cms.double(14999.5)
MonitorTrackSTAMuons.NClus2DStrMax = cms.double(14999.5)
MonitorTrackSTAMuons.NClus2DStrMin = cms.double(-0.5)

# NCluster Vs Tracks
MonitorTrackSTAMuons.NClus2DTotBin = cms.int32(50)
MonitorTrackSTAMuons.NClus2DTotMax = cms.double(14999.5)
MonitorTrackSTAMuons.NClus2DTotMax = cms.double(14999.5)
MonitorTrackSTAMuons.NClus2DTotMin = cms.double(-0.5)
MonitorTrackSTAMuons.NTrk2DBin = cms.int32(20)
MonitorTrackSTAMuons.NTrk2DMax = cms.double(199.5)
MonitorTrackSTAMuons.NTrk2DMax = cms.double(199.5)
MonitorTrackSTAMuons.NTrk2DMin = cms.double(-0.5)

MonitorTrackSTAMuons.TTRHBuilder = cms.string('WithTrackAngle')
Expand All @@ -354,5 +355,5 @@
MonitorTrackSTAMuons.LSMax = cms.double(2000.)

# Luminosity based analysis
MonitorTrackSTAMuons.doLumiAnalysis = cms.bool(False)
MonitorTrackSTAMuons.doLumiAnalysis = cms.bool(False)

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
TrackerCollisionTrackMon.doPUmonitoring = cms.bool(False)
TrackerCollisionTrackMon.doPlotsVsBXlumi = cms.bool(False)
TrackerCollisionTrackMon.doPlotsVsGoodPVtx = cms.bool(True)
TrackerCollisionTrackMon.doEffFromHitPattern = cms.bool(True)

# LS analysis
TrackerCollisionTrackMon.doLumiAnalysis = cms.bool(True)
Expand Down
1 change: 1 addition & 0 deletions DQM/TrackingMonitor/python/TrackingMonitor_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
doDCAwrtPVPlots = cms.bool(False),
doDCAwrt000Plots = cms.bool(False),
doSIPPlots = cms.bool(False),
doEffFromHitPattern = cms.bool(False),
doGeneralPropertiesPlots = cms.bool(False),
doHitPropertiesPlots = cms.bool(False),
# doGoodTrackPlots = cms.bool(False),
Expand Down
Loading