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 monitoring of tracks stopping source #13659

Merged
merged 3 commits into from Apr 26, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions DQM/TrackingMonitor/interface/TrackAnalyzer.h
Expand Up @@ -324,6 +324,9 @@ class TrackAnalyzer
MonitorElement* zPointOfClosestApproachToPV;
MonitorElement* zPointOfClosestApproachVsPhi;
MonitorElement *algorithm, *oriAlgo;
MonitorElement *stoppingSource;
MonitorElement *stoppingSourceVSeta;
MonitorElement *stoppingSourceVSphi;
// TESTING MEs
MonitorElement* TESTDistanceOfClosestApproachToBS;
MonitorElement* TESTDistanceOfClosestApproachToBSVsPhi;
Expand Down
5 changes: 5 additions & 0 deletions DQM/TrackingMonitor/interface/TrackBuildingAnalyzer.h
Expand Up @@ -91,6 +91,10 @@ class TrackBuildingAnalyzer
MonitorElement* NumberOfRecHitsPerTrackCandVsPhiProfile;
MonitorElement* NumberOfRecHitsPerTrackCandVsEtaProfile;

MonitorElement* stoppingSource;
MonitorElement* stoppingSourceVSeta;
MonitorElement* stoppingSourceVSphi;

std::string histname; //for naming the histograms according to algorithm used

//to disable some plots
Expand All @@ -109,5 +113,6 @@ class TrackBuildingAnalyzer
bool doNRecHits;
bool doProfPHI;
bool doProfETA;
bool doStopSource;
};
#endif
1 change: 1 addition & 0 deletions DQM/TrackingMonitor/python/TrackingMonitorSeed_cfi.py
Expand Up @@ -32,3 +32,4 @@
TrackMonSeed.doSeedETAHisto = cms.bool(True)
TrackMonSeed.doSeedPHIHisto = cms.bool(True)
TrackMonSeed.doSeedPHIVsETAHisto = cms.bool(True)
TrackMonSeed.doStopSource = cms.bool(True)
1 change: 1 addition & 0 deletions DQM/TrackingMonitor/python/TrackingMonitor_cfi.py
Expand Up @@ -94,6 +94,7 @@
doSeedNRecHitsHisto= cms.bool(False),
doSeedNVsPhiProf= cms.bool(False),
doSeedNVsEtaProf= cms.bool(False),
doStopSource = cms.bool(False),

TTRHBuilder = cms.string('WithTrackAngle'),

Expand Down
37 changes: 37 additions & 0 deletions DQM/TrackingMonitor/src/TrackAnalyzer.cc
Expand Up @@ -103,6 +103,9 @@ void TrackAnalyzer::initHistos()
zPointOfClosestApproachVsPhi = nullptr;
algorithm = nullptr;
oriAlgo = nullptr;
stoppingSource = nullptr;
stoppingSourceVSeta = nullptr;
stoppingSourceVSphi = nullptr;
// TESTING
TESTDistanceOfClosestApproachToBS = nullptr;
TESTDistanceOfClosestApproachToBSVsPhi = nullptr;
Expand Down Expand Up @@ -236,6 +239,7 @@ void TrackAnalyzer::bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &iboo
}
}

#include "DataFormats/TrackReco/interface/TrajectoryStopReasons.h"
void TrackAnalyzer::bookHistosForHitProperties(DQMStore::IBooker & ibooker) {

// parameters from the configuration
Expand Down Expand Up @@ -508,6 +512,7 @@ void TrackAnalyzer::bookHistosForHitProperties(DQMStore::IBooker & ibooker) {
algorithm = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
algorithm->setAxisTitle("Tracking algorithm",1);
algorithm->setAxisTitle("Number of Tracks",2);

histname = "originalAlgorithm_";
oriAlgo = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
oriAlgo->setAxisTitle("Tracking algorithm",1);
Expand All @@ -517,6 +522,31 @@ void TrackAnalyzer::bookHistosForHitProperties(DQMStore::IBooker & ibooker) {
algorithm->setBinLabel(ibin+1,reco::TrackBase::algoNames[ibin]);
oriAlgo->setBinLabel(ibin+1,reco::TrackBase::algoNames[ibin]);
}

// DataFormats/TrackReco/interface/TrajectoryStopReasons.h
std::vector<std::string> StopReasonName = { "UNINITIALIZED", "MAX_HITS", "MAX_LOST_HITS", "MAX_CONSECUTIVE_LOST_HITS", "LOST_HIT_FRACTION", "MIN_PT", "CHARGE_SIGNIFICANCE", "LOOPER", "MAX_CCC_LOST_HITS", "NO_SEGMENTS_FOR_VALID_LAYERS", "NOT_STOPPED" };

histname = "stoppingSource_";
stoppingSource = ibooker.book1D(histname+CategoryName, histname+CategoryName, StopReasonName.size(), 0., double(StopReasonName.size()));
stoppingSource->setAxisTitle("stopping reason",1);
stoppingSource->setAxisTitle("Number of Tracks",2);

histname = "stoppingSourceVSeta_";
stoppingSourceVSeta = ibooker.book2D(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, StopReasonName.size(), 0., double(StopReasonName.size()));
stoppingSourceVSeta->setAxisTitle("track #eta",1);
stoppingSourceVSeta->setAxisTitle("stopping reason",2);

histname = "stoppingSourceVSphi_";
stoppingSourceVSphi = ibooker.book2D(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, StopReasonName.size(), 0., double(StopReasonName.size()));
stoppingSourceVSphi->setAxisTitle("track #phi",1);
stoppingSourceVSphi->setAxisTitle("stopping reason",2);

for (size_t ibin=0; ibin<StopReasonName.size(); ibin++) {
stoppingSource->setBinLabel(ibin+1,StopReasonName[ibin],1);
stoppingSourceVSeta->setBinLabel(ibin+1,StopReasonName[ibin],2);
stoppingSourceVSphi->setBinLabel(ibin+1,StopReasonName[ibin],2);
}

}

}
Expand Down Expand Up @@ -940,6 +970,13 @@ void TrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
// algorithm
algorithm->Fill(static_cast<double>(track.algo()));
oriAlgo->Fill(static_cast<double>(track.originalAlgo()));

// stopping source
int max = stoppingSource->getNbinsX();
double stop = track.stopReason() > max ? double(max-1) : static_cast<double>(track.stopReason());
stoppingSource->Fill(stop);
stoppingSourceVSeta->Fill(track.eta(),stop);
stoppingSourceVSphi->Fill(track.phi(),stop);
}

if ( doLumiAnalysis_ ) {
Expand Down
45 changes: 43 additions & 2 deletions DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc
Expand Up @@ -31,6 +31,9 @@ TrackBuildingAnalyzer::TrackBuildingAnalyzer(const edm::ParameterSet& iConfig)
, NumberOfRecHitsPerSeed(NULL)
, NumberOfRecHitsPerSeedVsPhiProfile(NULL)
, NumberOfRecHitsPerSeedVsEtaProfile(NULL)
, stoppingSource(NULL)
, stoppingSourceVSeta(NULL)
, stoppingSourceVSphi(NULL)
{
}

Expand Down Expand Up @@ -114,6 +117,7 @@ void TrackBuildingAnalyzer::initHisto(DQMStore::IBooker & ibooker)
doNRecHits = conf_.getParameter<bool>("doSeedNRecHitsHisto");
doProfPHI = conf_.getParameter<bool>("doSeedNVsPhiProf");
doProfETA = conf_.getParameter<bool>("doSeedNVsEtaProf");
doStopSource = conf_.getParameter<bool>("doStopSource");

// if (doAllPlots){doAllSeedPlots=true; doTCPlots=true;}

Expand All @@ -123,7 +127,7 @@ void TrackBuildingAnalyzer::initHisto(DQMStore::IBooker & ibooker)
// ---------------------------------------------------------------------------------//
// std::cout << "[TrackBuildingAnalyzer::beginRun] MEFolderName: " << MEFolderName << std::endl;
ibooker.setCurrentFolder(MEFolderName+"/TrackBuilding");

if (doAllSeedPlots || doPT) {
histname = "SeedPt_"+seedProducer.label() + "_";
SeedPt = ibooker.book1D(histname+CatagoryName, histname+CatagoryName, TrackPtBin, TrackPtMin, TrackPtMax);
Expand Down Expand Up @@ -200,6 +204,34 @@ void TrackBuildingAnalyzer::initHisto(DQMStore::IBooker & ibooker)
NumberOfRecHitsPerSeedVsEtaProfile->setAxisTitle("Seed #eta",1);
NumberOfRecHitsPerSeedVsEtaProfile->setAxisTitle("Number of RecHits of each Seed",2);
}

if (doAllTCPlots || doStopSource) {
// DataFormats/TrackReco/interface/TrajectoryStopReasons.h
std::vector<std::string> StopReasonName = { "UNINITIALIZED", "MAX_HITS", "MAX_LOST_HITS", "MAX_CONSECUTIVE_LOST_HITS", "LOST_HIT_FRACTION", "MIN_PT", "CHARGE_SIGNIFICANCE", "LOOPER", "MAX_CCC_LOST_HITS", "NO_SEGMENTS_FOR_VALID_LAYERS", "NOT_STOPPED" };

histname = "StoppingSource_"+seedProducer.label() + "_";
stoppingSource = ibooker.book1D(histname+CatagoryName, histname+CatagoryName,StopReasonName.size(), 0., double(StopReasonName.size()));
stoppingSource->setAxisTitle("stopping reason",1);
stoppingSource->setAxisTitle("Number of Tracks",2);

histname = "StoppingSourceVSeta_"+seedProducer.label() + "_";
stoppingSourceVSeta = ibooker.book2D(histname+CatagoryName, histname+CatagoryName,EtaBin, EtaMin, EtaMax, StopReasonName.size(), 0., double(StopReasonName.size()));
stoppingSourceVSeta->setAxisTitle("track #eta",1);
stoppingSourceVSeta->setAxisTitle("stopping reason",2);

histname = "StoppingSourceVSphi_"+seedProducer.label() + "_";
stoppingSourceVSphi = ibooker.book2D(histname+CatagoryName, histname+CatagoryName,PhiBin, PhiMax, PhiMax, StopReasonName.size(), 0., double(StopReasonName.size()));
stoppingSourceVSphi->setAxisTitle("track #phi",1);
stoppingSourceVSphi->setAxisTitle("stopping reason",2);

for (size_t ibin=0; ibin<StopReasonName.size(); ibin++) {
stoppingSource->setBinLabel(ibin+1,StopReasonName[ibin],1);
stoppingSourceVSeta->setBinLabel(ibin+1,StopReasonName[ibin],2);
stoppingSourceVSphi->setBinLabel(ibin+1,StopReasonName[ibin],2);
}
}



// book the TrackCandidate histograms
// ---------------------------------------------------------------------------------//
Expand Down Expand Up @@ -365,7 +397,16 @@ void TrackBuildingAnalyzer::analyze
double dxy = (-v.x()*sin(p.phi())+v.y()*cos(p.phi()));

double dz = v.z() - (v.x()*p.x()+v.y()*p.y())/p.perp() * p.z()/p.perp();


if (doAllTCPlots || doStopSource) {
// stopping source
int max = stoppingSource->getNbinsX();
double stop = candidate.stopReason() > max ? double(max-1) : static_cast<double>(candidate.stopReason());
stoppingSource ->Fill(stop);
stoppingSourceVSeta ->Fill(eta,stop);
stoppingSourceVSphi ->Fill(phi,stop);
}

if (doTCPlots){
// fill the ME's
if (doAllTCPlots) TrackCandQ->Fill( state.charge() );
Expand Down
Expand Up @@ -23,6 +23,7 @@
doPlotsVsBXlumi = {}
doPlotsVsGoodPVtx = {}
doEffFromHitPattern = {}
doStopSource = {}

selectedTracks = []

Expand All @@ -48,6 +49,7 @@
doPlotsVsBXlumi ['generalTracks'] = cms.bool(False)
doPlotsVsGoodPVtx ['generalTracks'] = cms.bool(True)
doEffFromHitPattern ['generalTracks'] = cms.bool(True)
doStopSource ['generalTracks'] = cms.bool(True)

trackSelector = cms.EDFilter('TrackSelector',
src = cms.InputTag('generalTracks'),
Expand Down Expand Up @@ -81,6 +83,7 @@
doPlotsVsBXlumi ['highPurityPtRange0to1'] = cms.bool(False)
doPlotsVsGoodPVtx ['highPurityPtRange0to1'] = cms.bool(True)
doEffFromHitPattern ['highPurityPtRange0to1'] = cms.bool(False)
doStopSource ['highPurityPtRange0to1'] = cms.bool(True)

highPurityPtRange1to10 = trackSelector.clone()
highPurityPtRange1to10.cut = cms.string("quality('highPurity') & pt >= 1 & pt < 10 ")
Expand All @@ -107,6 +110,7 @@
doPlotsVsBXlumi ['highPurityPtRange1to10'] = cms.bool(False)
doPlotsVsGoodPVtx ['highPurityPtRange1to10'] = cms.bool(True)
doEffFromHitPattern ['highPurityPtRange1to10'] = cms.bool(True)
doStopSource ['highPurityPtRange1to10'] = cms.bool(True)

highPurityPt10 = trackSelector.clone()
highPurityPt10.cut = cms.string("quality('highPurity') & pt >= 10")
Expand All @@ -133,7 +137,7 @@
doPlotsVsBXlumi ['highPurityPt10'] = cms.bool(False)
doPlotsVsGoodPVtx ['highPurityPt10'] = cms.bool(True)
doEffFromHitPattern ['highPurityPt10'] = cms.bool(True)

doStopSource ['highPurityPt10'] = cms.bool(True)

###### old monitored track collections
highPurityPt1 = trackSelector.clone()
Expand Down Expand Up @@ -162,6 +166,7 @@
doPlotsVsBXlumi ['highPurityPt1'] = cms.bool(False)
doPlotsVsGoodPVtx ['highPurityPt1'] = cms.bool(True)
doEffFromHitPattern ['highPurityPt1'] = cms.bool(True)
doStopSource ['highPurityPt1'] = cms.bool(True)

selectedTracks.extend( ['generalTracks'] )
#selectedTracks.extend( ['highPurityPtRange0to1'] )
Expand Down
Expand Up @@ -42,6 +42,7 @@
locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]
locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]
locals()[label].doEffFromHitPattern = doEffFromHitPattern [tracks]
# locals()[label].doStopSource = doStopSource [tracks]
locals()[label].setLabel(label)


Expand Down Expand Up @@ -76,6 +77,7 @@
locals()[label].doPlotsVsBXlumi = doPlotsVsBXlumi [tracks]
locals()[label].doPlotsVsGoodPVtx = doPlotsVsGoodPVtx [tracks]
locals()[label].doEffFromHitPattern = doEffFromHitPattern [tracks]
# locals()[label].doStopSource = doStopSource [tracks]
locals()[label].setLabel(label)


Expand Down