17 m_currdir(0), m_maxLS(100), m_weightThreshold(0.5), m_trueOnly(
true),
18 m_runHisto(
true), m_runHistoProfile(
true), m_runHistoBXProfile(
true), m_runHistoBXProfile2D(
false), m_runHisto2D(
false),
19 m_bsConstrained(
false),
20 m_histoParameters() { }
24 m_maxLS(iConfig.getParameter<unsigned int>(
"maxLSBeforeRebin")),
25 m_weightThreshold(iConfig.getUntrackedParameter<double>(
"weightThreshold",0.5)),
26 m_trueOnly(iConfig.getUntrackedParameter<bool>(
"trueOnly",
true)),
27 m_runHisto(iConfig.getUntrackedParameter<bool>(
"runHisto",
true)),
28 m_runHistoProfile(iConfig.getUntrackedParameter<bool>(
"runHistoProfile",
true)),
29 m_runHistoBXProfile(iConfig.getUntrackedParameter<bool>(
"runHistoBXProfile",
true)),
30 m_runHistoBXProfile2D(iConfig.getUntrackedParameter<bool>(
"runHistoBXProfile2D",
false)),
31 m_runHisto2D(iConfig.getUntrackedParameter<bool>(
"runHisto2D",
false)),
32 m_bsConstrained(iConfig.getParameter<bool>(
"bsConstrained")),
55 edm::LogInfo(
"HistogramBooking") <<
"Vertex histogram booking in directory " << dirname;
57 m_hnvtx = currdir->
make<TH1F>(
"nvtx",
"Number of Vertices",60,-0.5,59.5);
58 m_hnvtx->GetXaxis()->SetTitle(
"vertices");
m_hnvtx->GetYaxis()->SetTitle(
"Events");
60 m_hntruevtx = currdir->
make<TH1F>(
"ntruevtx",
"Number of True Vertices",60,-0.5,59.5);
63 m_hntruevtxvslumi = currdir->
make<TProfile>(
"ntruevtxvslumi",
"Number of True Vertices vs BX lumi",250,0.,10.);
66 m_hntruevtxvslumi2D = currdir->
make<TH2D>(
"ntruevtxvslumi2D",
"Number of True Vertices vs BX lumi",250,0.,10.,100,-0.5,99.5);
69 m_hntracks = currdir->
make<TH1F>(
"ntracks",
"Number of Tracks",300,-0.5,299.5);
72 m_hsqsumptsq = currdir->
make<TH1F>(
"sqsumptsq",
"sqrt(sum pt**2)",1000,0.,1000.);
84 m_hndof = currdir->
make<TH1F>(
"ndof",
"Number of degree of freedom",250,-0.5,499.5);
85 m_hndof->GetXaxis()->SetTitle(
"ndof");
m_hndof->GetYaxis()->SetTitle(
"Vertices");
87 m_hndofvstracks = currdir->
make<TH2F>(
"ndofvstracks",
"Ndof vs Ntracks",300,-0.5,299.5,250,-0.5,499.5);
90 m_hndofvsvtxz = currdir->
make<TProfile>(
"ndofvsvtxz",
"Ndof vs Vertex Z position",200,
110 m_hweights = currdir->
make<TH1F>(
"weights",
"Tracks weights",51,0.,1.02);
113 m_haveweight = currdir->
make<TH1F>(
"aveweight",
"Tracks average weights sum",51,0.,1.02);
117 m_hvtxx = currdir->
make<TH1F>(
"vtxx",
"Vertex X position",
122 m_hvtxx->GetXaxis()->SetTitle(
"X [cm]");
m_hvtxx->GetYaxis()->SetTitle(
"Vertices");
124 m_hvtxy = currdir->
make<TH1F>(
"vtxy",
"Vertex Y position",
129 m_hvtxy->GetXaxis()->SetTitle(
"Y [cm]");
m_hvtxy->GetYaxis()->SetTitle(
"Vertices");
131 m_hvtxz = currdir->
make<TH1F>(
"vtxz",
"Vertex Z position",
136 m_hvtxz->GetXaxis()->SetTitle(
"Z [cm]");
m_hvtxz->GetYaxis()->SetTitle(
"Vertices");
203 currdir = &(*tfserv);
211 (*m_hvtxxrun)->GetXaxis()->SetTitle(
"X [cm]"); (*m_hvtxxrun)->GetYaxis()->SetTitle(
"Vertices");
212 (*m_hvtxyrun)->GetXaxis()->SetTitle(
"Y [cm]"); (*m_hvtxyrun)->GetYaxis()->SetTitle(
"Vertices");
213 (*m_hvtxzrun)->GetXaxis()->SetTitle(
"Z [cm]"); (*m_hvtxzrun)->GetYaxis()->SetTitle(
"Vertices");
216 (*m_hvtxxvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hvtxxvsorbrun)->GetYaxis()->SetTitle(
"X [cm]");
217 (*m_hvtxxvsorbrun)->SetBit(TH1::kCanRebin);
218 (*m_hvtxyvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hvtxyvsorbrun)->GetYaxis()->SetTitle(
"Y [cm]");
219 (*m_hvtxyvsorbrun)->SetBit(TH1::kCanRebin);
220 (*m_hvtxzvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hvtxzvsorbrun)->GetYaxis()->SetTitle(
"Z [cm]");
221 (*m_hvtxzvsorbrun)->SetBit(TH1::kCanRebin);
222 (*m_hnvtxvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hnvtxvsorbrun)->GetYaxis()->SetTitle(
"Nvertices");
223 (*m_hnvtxvsorbrun)->SetBit(TH1::kCanRebin);
227 (*m_hvtxxvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxxvsbxrun)->GetYaxis()->SetTitle(
"X [cm]");
228 (*m_hvtxyvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxyvsbxrun)->GetYaxis()->SetTitle(
"Y [cm]");
229 (*m_hvtxzvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxzvsbxrun)->GetYaxis()->SetTitle(
"Z [cm]");
230 (*m_hnvtxvsbxrun)->GetXaxis()->SetTitle(
"BX"); (*m_hnvtxvsbxrun)->GetYaxis()->SetTitle(
"Nvertices");
232 (*m_hnvtxvsbxvslumirun)->GetXaxis()->SetTitle(
"BX"); (*m_hnvtxvsbxvslumirun)->GetYaxis()->SetTitle(
"BX lumi [10^{30}cm^{-2}s^{-1}]");
235 (*m_hvtxxvsbx2drun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxxvsbx2drun)->GetYaxis()->SetTitle(
"X [cm]");
236 (*m_hvtxyvsbx2drun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxyvsbx2drun)->GetYaxis()->SetTitle(
"Y [cm]");
237 (*m_hvtxzvsbx2drun)->GetXaxis()->SetTitle(
"BX"); (*m_hvtxzvsbx2drun)->GetYaxis()->SetTitle(
"Z [cm]");
242 (*m_hnvtxvsbxvsorbrun)->GetXaxis()->SetTitle(
"BX#"); (*m_hnvtxvsbxvsorbrun)->GetYaxis()->SetTitle(
"time [orbit#]");
243 (*m_hnvtxvsbxvsorbrun)->SetBit(TH1::kCanRebin);
244 (*m_hnvtxvsorbrun2D)->GetXaxis()->SetTitle(
"time [orbit#]"); (*m_hnvtxvsorbrun2D)->GetYaxis()->SetTitle(
"Nvertices");
245 (*m_hnvtxvsorbrun2D)->SetBit(TH1::kCanRebin);
255 for(reco::VertexCollection::const_iterator vtx=vertices.begin();vtx!=vertices.end();++vtx) {
256 if(!vtx->isFake()) ntruevtx++;
260 double aveweight =
m_bsConstrained ? vtx->ndof()/(2.*vtx->tracksSize()) : (vtx->ndof()+3)/(2.*vtx->tracksSize());
295 int nheavytracks = 0;
297 double sumpt2heavy = 0.;
301 sumpt2 += (*trk)->pt()*(*trk)->pt();
305 sumpt2heavy += (*trk)->pt()*(*trk)->pt();
343 if(ntruevtx < (*m_hnvtxvsorbrun2D)->GetYaxis()->GetXmax() && ntruevtx > (*m_hnvtxvsorbrun2D)->GetYaxis()->GetXmin()) {
344 (*m_hnvtxvsorbrun2D)->Fill(orbit,ntruevtx,weight);
358 currdir = &(*tfserv);
TProfile ** m_hvtxyvsorbrun
T getUntrackedParameter(std::string const &, T const &) const
TFileDirectory * m_currdir
const bool m_runHistoProfile
const edm::ParameterSet m_histoParameters
TProfile2D ** m_hnvtxvsbxvsorbrun
RunHistogramManager m_rhm
int bunchCrossing() const
TProfile2D ** m_hnvtxvsbxvslumirun
std::vector< Vertex > VertexCollection
collection of Vertex objects
void fill(const edm::Event &iEvent, const reco::VertexCollection &vertices, const double weight=1.)
bool getByLabel(std::string const &label, Handle< PROD > &result) const
TProfile * m_haveweightvsvtxzchk
TProfile * m_hntruevtxvslumi
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
TProfile ** m_hnvtxvsbxrun
TProfile ** m_hvtxzvsbxrun
TH2D * m_hntruevtxvslumi2D
TProfile ** m_hvtxyvsbxrun
const bool m_bsConstrained
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
LuminosityBlock const & getLuminosityBlock() const
const bool m_runHistoBXProfile2D
TProfile ** m_hnvtxvsorbrun
void book(const std::string dirname="")
TProfile ** m_hvtxzvsorbrun
void beginRun(const edm::Run &iRun)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
TProfile2D ** makeTProfile2D(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
void beginRun(const edm::Run &iRun)
TH2F ** m_hnvtxvsorbrun2D
TProfile ** m_hvtxxvsorbrun
TProfile * m_hntracksvsvtxz
TProfile * m_haveweightvsvtxz
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
T * make() const
make new ROOT object
TH2F ** makeTH2F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
const double m_weightThreshold
TProfile ** m_hvtxxvsbxrun
const bool m_runHistoBXProfile
const unsigned int m_maxLS
RunHistogramManager m_fhm