Skip to content

Commit

Permalink
Merge pull request #109 from venturia/my-pv-code
Browse files Browse the repository at this point in the history
New Validation/RecoVertex Analyzers added to the package
  • Loading branch information
ktf committed Jul 22, 2013
2 parents 6bf2a69 + 0c9d45a commit 0d8f82f
Show file tree
Hide file tree
Showing 31 changed files with 3,446 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Validation/RecoVertex/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/PluginManager"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/Version"/>
<use name="DataFormats/BeamSpot"/>
<use name="DataFormats/Candidate"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/Luminosity"/>
<use name="DataFormats/RecoCandidate"/>
<use name="DataFormats/TrackReco"/>
<use name="DataFormats/VertexReco"/>
<use name="DQMServices/Core"/>
<use name="SimDataFormats/Track"/>
<use name="SimDataFormats/GeneratorProducts"/>
<use name="SimDataFormats/TrackerDigiSimLink"/>
<use name="SimDataFormats/PileupSummaryInfo"/>
<use name="DataFormats/SiStripDetId"/>
<use name="RecoTracker/TkSeedGenerator"/>
<use name="TrackingTools/TrackFitters"/>
Expand All @@ -26,6 +32,8 @@
<use name="SimTracker/TrackerHitAssociation"/>
<use name="SimTracker/TrackHistory"/>
<use name="CommonTools/Statistics"/>
<use name="CommonTools/TriggerUtils"/>
<use name="CommonTools/UtilAlgos"/>
<use name="clhep"/>
<use name="boost"/>
<use name="hepmc"/>
Expand All @@ -34,4 +42,5 @@
<use name="root"/>
<use name="gsl"/>
<use name="SimGeneral/HepPDTRecord"/>
<use name="DPGAnalysis/SiStripTools"/>
<flags EDM_PLUGIN="1"/>
78 changes: 78 additions & 0 deletions Validation/RecoVertex/interface/BSvsPVHistogramMaker.h
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
55 changes: 55 additions & 0 deletions Validation/RecoVertex/interface/BeamSpotHistogramMaker.h
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
93 changes: 93 additions & 0 deletions Validation/RecoVertex/interface/VertexHistogramMaker.h
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
30 changes: 30 additions & 0 deletions Validation/RecoVertex/interface/VertexWeighter.h
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 Validation/RecoVertex/python/anotherprimaryvertexanalyzer_cfi.py
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()
)
)

16 changes: 16 additions & 0 deletions Validation/RecoVertex/python/beamspotanalyzer_cfi.py
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.)
)
)
)

19 changes: 19 additions & 0 deletions Validation/RecoVertex/python/bspvanalyzer_cfi.py
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.)
)
)
)

13 changes: 13 additions & 0 deletions Validation/RecoVertex/python/mcvertexweight_cfi.py
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)
)
)

9 changes: 9 additions & 0 deletions Validation/RecoVertex/python/mcverticesanalyzer_cfi.py
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 Validation/RecoVertex/python/mcvsrecoverticesanalyzer_cfi.py
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")
)

Loading

0 comments on commit 0d8f82f

Please sign in to comment.