-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from venturia/my-pv-code
New Validation/RecoVertex Analyzers added to the package
- Loading branch information
Showing
31 changed files
with
3,446 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#ifndef Validation_RecoVertex_BSvsPVHistogramMaker_H | ||
#define Validation_RecoVertex_BSvsPVHistogramMaker_H | ||
|
||
#include <string> | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DPGAnalysis/SiStripTools/interface/RunHistogramManager.h" | ||
|
||
namespace edm { | ||
class ParameterSet; | ||
class Event; | ||
} | ||
|
||
namespace reco { | ||
class BeamSpot; | ||
} | ||
|
||
|
||
class TH1F; | ||
class TH2F; | ||
class TProfile; | ||
class TFileDirectory; | ||
|
||
class BSvsPVHistogramMaker { | ||
|
||
public: | ||
BSvsPVHistogramMaker(); | ||
BSvsPVHistogramMaker(const edm::ParameterSet& iConfig); | ||
|
||
~BSvsPVHistogramMaker(); | ||
|
||
void book(const std::string dirname=""); | ||
void beginRun(const unsigned int nrun); | ||
void fill(const unsigned int orbit, const int bx, const reco::VertexCollection& vertices, const reco::BeamSpot& bs); | ||
void fill(const edm::Event& iEvent, const reco::VertexCollection& vertices, const reco::BeamSpot& bs); | ||
|
||
double x(const reco::BeamSpot& bs, const double z) const; | ||
double y(const reco::BeamSpot& bs, const double z) const; | ||
|
||
private: | ||
|
||
TFileDirectory* _currdir; | ||
const unsigned int m_maxLS; | ||
const bool useSlope_; | ||
const bool _trueOnly; | ||
const bool _runHisto; | ||
const bool _runHistoProfile; | ||
const bool _runHistoBXProfile; | ||
const bool _runHistoBX2D; | ||
const edm::ParameterSet _histoParameters; | ||
|
||
RunHistogramManager _rhm; | ||
TH1F* _hdeltax; | ||
TH1F* _hdeltay; | ||
TH1F* _hdeltaz; | ||
TProfile* _hdeltaxvsz; | ||
TProfile* _hdeltayvsz; | ||
TH1F** _hdeltaxrun; | ||
TH1F** _hdeltayrun; | ||
TH1F** _hdeltazrun; | ||
TProfile** _hdeltaxvszrun; | ||
TProfile** _hdeltayvszrun; | ||
TProfile** _hdeltaxvsorbrun; | ||
TProfile** _hdeltayvsorbrun; | ||
TProfile** _hdeltazvsorbrun; | ||
|
||
TProfile** _hdeltaxvsbxrun; | ||
TProfile** _hdeltayvsbxrun; | ||
TProfile** _hdeltazvsbxrun; | ||
|
||
TH2F** _hdeltaxvsbx2drun; | ||
TH2F** _hdeltayvsbx2drun; | ||
TH2F** _hdeltazvsbx2drun; | ||
|
||
}; | ||
|
||
|
||
#endif // Validation_RecoVertex_BSvsPVHistogramMaker_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef Validation_RecoVertex_BeamSpotHistogramMaker_H | ||
#define Validation_RecoVertex_BeamSpotHistogramMaker_H | ||
|
||
#include <string> | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DPGAnalysis/SiStripTools/interface/RunHistogramManager.h" | ||
|
||
namespace edm { | ||
class ParameterSet; | ||
} | ||
|
||
namespace reco { | ||
class BeamSpot; | ||
} | ||
|
||
class TH1F; | ||
class TProfile; | ||
class TFileDirectory; | ||
|
||
class BeamSpotHistogramMaker { | ||
|
||
public: | ||
BeamSpotHistogramMaker(); | ||
BeamSpotHistogramMaker(const edm::ParameterSet& iConfig); | ||
|
||
~BeamSpotHistogramMaker(); | ||
|
||
void book(const std::string dirname=""); | ||
void beginRun(const unsigned int nrun); | ||
void fill(const unsigned int orbit, const reco::BeamSpot& bs); | ||
|
||
private: | ||
|
||
TFileDirectory* _currdir; | ||
const edm::ParameterSet _histoParameters; | ||
|
||
RunHistogramManager _rhm; | ||
TH1F** _hbsxrun; | ||
TH1F** _hbsyrun; | ||
TH1F** _hbszrun; | ||
TH1F** _hbssigmaxrun; | ||
TH1F** _hbssigmayrun; | ||
TH1F** _hbssigmazrun; | ||
TProfile** _hbsxvsorbrun; | ||
TProfile** _hbsyvsorbrun; | ||
TProfile** _hbszvsorbrun; | ||
TProfile** _hbssigmaxvsorbrun; | ||
TProfile** _hbssigmayvsorbrun; | ||
TProfile** _hbssigmazvsorbrun; | ||
|
||
|
||
}; | ||
|
||
|
||
#endif // Validation_RecoVertex_BeamSpotHistogramMaker_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#ifndef Validation_RecoVertex_VertexHistogramMaker_H | ||
#define Validation_RecoVertex_VertexHistogramMaker_H | ||
|
||
#include <string> | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DPGAnalysis/SiStripTools/interface/RunHistogramManager.h" | ||
|
||
namespace edm { | ||
class ParameterSet; | ||
class Event; | ||
class Run; | ||
} | ||
|
||
class TH1F; | ||
class TH2F; | ||
class TProfile; | ||
class TFileDirectory; | ||
|
||
class VertexHistogramMaker { | ||
|
||
public: | ||
VertexHistogramMaker(); | ||
VertexHistogramMaker(const edm::ParameterSet& iConfig); | ||
|
||
~VertexHistogramMaker(); | ||
|
||
void book(const std::string dirname=""); | ||
void beginRun(const edm::Run& iRun); | ||
void fill(const edm::Event& iEvent, const reco::VertexCollection& vertices, const double weight=1.); | ||
|
||
private: | ||
|
||
void fill(const unsigned int orbit, const int bx, const float bxlumi, const reco::VertexCollection& vertices, const double weight=1.); | ||
|
||
TFileDirectory* m_currdir; | ||
const unsigned int m_maxLS; | ||
const double m_weightThreshold; | ||
const bool m_trueOnly; | ||
const bool m_runHisto; | ||
const bool m_runHistoProfile; | ||
const bool m_runHistoBXProfile; | ||
const bool m_runHistoBXProfile2D; | ||
const bool m_runHisto2D; | ||
const bool m_bsConstrained; | ||
const edm::ParameterSet m_histoParameters; | ||
|
||
RunHistogramManager m_rhm; | ||
RunHistogramManager m_fhm; | ||
TH1F* m_hnvtx; | ||
TH1F* m_hntruevtx; | ||
TProfile* m_hntruevtxvslumi; | ||
TH2D* m_hntruevtxvslumi2D; | ||
TH1F* m_hntracks; | ||
TH1F* m_hsqsumptsq; | ||
TH1F* m_hsqsumptsqheavy; | ||
TH1F* m_hnheavytracks; | ||
TH1F* m_hndof; | ||
TH1F* m_haveweight; | ||
TH2F* m_hndofvstracks; | ||
TProfile* m_hndofvsvtxz; | ||
TProfile* m_hntracksvsvtxz; | ||
TProfile* m_haveweightvsvtxz; | ||
TProfile* m_haveweightvsvtxzchk; | ||
TH1F* m_hweights; | ||
TH1F* m_hvtxx; | ||
TH1F* m_hvtxy; | ||
TH1F* m_hvtxz; | ||
TH1F** m_hvtxxrun; | ||
TH1F** m_hvtxyrun; | ||
TH1F** m_hvtxzrun; | ||
TProfile** m_hvtxxvsorbrun; | ||
TProfile** m_hvtxyvsorbrun; | ||
TProfile** m_hvtxzvsorbrun; | ||
TProfile** m_hnvtxvsorbrun; | ||
TProfile2D** m_hnvtxvsbxvsorbrun; | ||
TH2F** m_hnvtxvsorbrun2D; | ||
|
||
TProfile** m_hvtxxvsbxrun; | ||
TProfile** m_hvtxyvsbxrun; | ||
TProfile** m_hvtxzvsbxrun; | ||
TProfile** m_hnvtxvsbxrun; | ||
|
||
TProfile2D** m_hnvtxvsbxvslumirun; | ||
|
||
TH2F** m_hvtxxvsbx2drun; | ||
TH2F** m_hvtxyvsbx2drun; | ||
TH2F** m_hvtxzvsbx2drun; | ||
|
||
}; | ||
|
||
|
||
#endif // Validation_RecoVertex_VertexHistogramMaker_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef TRACKINGPFG_PILEUP_VERTEXWEIGHTER_H | ||
#define TRACKINGPFG_PILEUP_VERTEXWEIGHTER_H | ||
|
||
#include <vector> | ||
|
||
namespace edm { class ParameterSet; } | ||
|
||
class VertexWeighter{ | ||
|
||
public: | ||
|
||
VertexWeighter(); | ||
VertexWeighter(const double& sigma_init, const double& mean_init, const double& sigma_final, const bool& usemainvtx); | ||
VertexWeighter(const edm::ParameterSet& iConfig); | ||
|
||
const double weight(const std::vector<float>& zpositions, const float& zmain) const; | ||
|
||
private: | ||
|
||
const double m_sigma_init; | ||
const double m_mean_init; | ||
const double m_sigma_final; | ||
const bool m_usemain; | ||
const bool m_dummy; | ||
|
||
|
||
}; | ||
|
||
|
||
#endif // TRACKINGPFG_PILEUP_VERTEXWEIGHTER_H |
25 changes: 25 additions & 0 deletions
25
Validation/RecoVertex/python/anotherprimaryvertexanalyzer_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
primaryvertexanalyzer = cms.EDAnalyzer('AnotherPrimaryVertexAnalyzer', | ||
pvCollection = cms.InputTag("offlinePrimaryVertices"), | ||
firstOnly = cms.untracked.bool(False), | ||
vHistogramMakerPSet = cms.PSet( | ||
trueOnly = cms.untracked.bool(True), | ||
maxLSBeforeRebin = cms.uint32(100), | ||
weightThreshold = cms.untracked.double(0.5), | ||
bsConstrained = cms.bool(False), | ||
histoParameters = cms.untracked.PSet( | ||
nBinX = cms.untracked.uint32(200), xMin=cms.untracked.double(-1.), xMax=cms.untracked.double(1.), | ||
nBinY = cms.untracked.uint32(200), yMin=cms.untracked.double(-1.), yMax=cms.untracked.double(1.), | ||
nBinZ = cms.untracked.uint32(200), zMin=cms.untracked.double(-20.), zMax=cms.untracked.double(20.) | ||
) | ||
), | ||
usePrescaleWeight = cms.bool(False), | ||
prescaleWeightProviderPSet = cms.PSet( | ||
prescaleWeightVerbosityLevel = cms.uint32( 0 ), | ||
prescaleWeightTriggerResults = cms.InputTag( "TriggerResults::HLT" ), | ||
prescaleWeightL1GtTriggerMenuLite = cms.InputTag( "l1GtTriggerMenuLite" ), | ||
prescaleWeightHltPaths = cms.vstring() | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
beamspotanalyzer = cms.EDAnalyzer('AnotherBeamSpotAnalyzer', | ||
bsCollection = cms.InputTag("offlineBeamSpot"), | ||
bsHistogramMakerPSet = cms.PSet( | ||
histoParameters = cms.untracked.PSet( | ||
nBinX = cms.untracked.uint32(200), xMin=cms.untracked.double(-1.), xMax=cms.untracked.double(1.), | ||
nBinY = cms.untracked.uint32(200), yMin=cms.untracked.double(-1.), yMax=cms.untracked.double(1.), | ||
nBinZ = cms.untracked.uint32(200), zMin=cms.untracked.double(-20.), zMax=cms.untracked.double(20.), | ||
nBinSigmaX = cms.untracked.uint32(200), sigmaXMin=cms.untracked.double(0.), sigmaXMax=cms.untracked.double(0.025), | ||
nBinSigmaY = cms.untracked.uint32(200), sigmaYMin=cms.untracked.double(0.), sigmaYMax=cms.untracked.double(0.025), | ||
nBinSigmaZ = cms.untracked.uint32(200), sigmaZMin=cms.untracked.double(0.), sigmaZMax=cms.untracked.double(15.) | ||
) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
bspvanalyzer = cms.EDAnalyzer('BSvsPVAnalyzer', | ||
pvCollection = cms.InputTag("offlinePrimaryVertices"), | ||
bsCollection = cms.InputTag("offlineBeamSpot"), | ||
firstOnly = cms.untracked.bool(False), | ||
bspvHistogramMakerPSet = cms.PSet( | ||
useSlope = cms.bool(True), | ||
trueOnly = cms.untracked.bool(True), | ||
maxLSBeforeRebin = cms.uint32(100), | ||
histoParameters = cms.untracked.PSet( | ||
nBinX = cms.untracked.uint32(200), xMin=cms.untracked.double(-0.1), xMax=cms.untracked.double(0.1), | ||
nBinY = cms.untracked.uint32(200), yMin=cms.untracked.double(-0.1), yMax=cms.untracked.double(0.1), | ||
nBinZ = cms.untracked.uint32(200), zMin=cms.untracked.double(-30.), zMax=cms.untracked.double(30.), | ||
nBinZProfile = cms.untracked.uint32(60), zMinProfile=cms.untracked.double(-30.), zMaxProfile=cms.untracked.double(30.) | ||
) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
mcvertexweight = cms.EDFilter("MCVerticesWeight", | ||
pileupSummaryCollection = cms.InputTag("addPileupInfo"), | ||
mcTruthCollection = cms.InputTag("generator"), | ||
weighterConfig = cms.PSet( | ||
initSigma = cms.double(6.26), | ||
initMean = cms.double(0.4145), | ||
finalSigma = cms.double(5.2), | ||
useMainVertex = cms.bool(True) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
mcverticesanalyzer = cms.EDAnalyzer("MCVerticesAnalyzer", | ||
pileupSummaryCollection = cms.InputTag("addPileupInfo"), | ||
mcTruthCollection = cms.InputTag("generator"), | ||
useWeight = cms.bool(False), | ||
weightProduct = cms.InputTag("mcvertexweight") | ||
) | ||
|
11 changes: 11 additions & 0 deletions
11
Validation/RecoVertex/python/mcvsrecoverticesanalyzer_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
mcvsrecoverticesanalyzer = cms.EDAnalyzer("MCvsRecoVerticesAnalyzer", | ||
pileupSummaryCollection = cms.InputTag("addPileupInfo"), | ||
mcTruthCollection = cms.InputTag("generator"), | ||
pvCollection = cms.InputTag("offlinePrimaryVertices"), | ||
useWeight = cms.bool(False), | ||
useVisibleVertices = cms.bool(False), | ||
weightProduct = cms.InputTag("mcvertexweight") | ||
) | ||
|
Oops, something went wrong.