18 m_weightThreshold(0.5),
21 m_runHistoProfile(
true),
22 m_runHistoBXProfile(
true),
23 m_runHistoBXProfile2D(
false),
25 m_bsConstrained(
false),
32 m_maxLS(iConfig.getParameter<unsigned int>(
"maxLSBeforeRebin")),
33 m_weightThreshold(iConfig.getUntrackedParameter<double>(
"weightThreshold", 0.5)),
34 m_trueOnly(iConfig.getUntrackedParameter<bool>(
"trueOnly",
true)),
35 m_runHisto(iConfig.getUntrackedParameter<bool>(
"runHisto",
true)),
36 m_runHistoProfile(iConfig.getUntrackedParameter<bool>(
"runHistoProfile",
true)),
37 m_runHistoBXProfile(iConfig.getUntrackedParameter<bool>(
"runHistoBXProfile",
true)),
38 m_runHistoBXProfile2D(iConfig.getUntrackedParameter<bool>(
"runHistoBXProfile2D",
false)),
39 m_runHisto2D(iConfig.getUntrackedParameter<bool>(
"runHisto2D",
false)),
40 m_bsConstrained(iConfig.getParameter<bool>(
"bsConstrained")),
52 if (!dirname.empty()) {
59 m_hnvtx = currdir->
make<TH1F>(
"nvtx",
"Number of Vertices", 60, -0.5, 59.5);
60 m_hnvtx->GetXaxis()->SetTitle(
"vertices");
61 m_hnvtx->GetYaxis()->SetTitle(
"Events");
63 m_hntruevtx = currdir->
make<TH1F>(
"ntruevtx",
"Number of True Vertices", 60, -0.5, 59.5);
67 m_hntruevtxvslumi = currdir->
make<TProfile>(
"ntruevtxvslumi",
"Number of True Vertices vs BX lumi", 250, 0., 10.);
72 currdir->
make<TH2D>(
"ntruevtxvslumi2D",
"Number of True Vertices vs BX lumi", 250, 0., 10., 100, -0.5, 99.5);
76 m_hntracks = currdir->
make<TH1F>(
"ntracks",
"Number of Tracks", 300, -0.5, 299.5);
80 m_hsqsumptsq = currdir->
make<TH1F>(
"sqsumptsq",
"sqrt(sum pt**2)", 1000, 0., 1000.);
81 m_hsqsumptsq->GetXaxis()->SetTitle(
"sqrt(#Sigma pt^{2}) (GeV)");
95 m_hndof = currdir->
make<TH1F>(
"ndof",
"Number of degree of freedom", 250, -0.5, 499.5);
96 m_hndof->GetXaxis()->SetTitle(
"ndof");
97 m_hndof->GetYaxis()->SetTitle(
"Vertices");
99 m_hndofvstracks = currdir->
make<TH2F>(
"ndofvstracks",
"Ndof vs Ntracks", 300, -0.5, 299.5, 250, -0.5, 499.5);
104 "Ndof vs Vertex Z position",
112 "Ntracks vs Vertex Z position",
120 "Average weight vs Vertex Z position",
128 "Average weight vs Vertex Z position (check)",
135 m_hweights = currdir->
make<TH1F>(
"weights",
"Tracks weights", 51, 0., 1.02);
139 m_haveweight = currdir->
make<TH1F>(
"aveweight",
"Tracks average weights sum", 51, 0., 1.02);
148 m_hvtxx->GetXaxis()->SetTitle(
"X [cm]");
149 m_hvtxx->GetYaxis()->SetTitle(
"Vertices");
156 m_hvtxy->GetXaxis()->SetTitle(
"Y [cm]");
157 m_hvtxy->GetYaxis()->SetTitle(
"Vertices");
164 m_hvtxz->GetXaxis()->SetTitle(
"Z [cm]");
165 m_hvtxz->GetYaxis()->SetTitle(
"Vertices");
188 "vtxxvsorbrun",
"Vertex X position vs orbit number", 4 *
m_maxLS, 0.5,
m_maxLS * 262144 + 0.5);
190 "vtxyvsorbrun",
"Vertex Y position vs orbit number", 4 *
m_maxLS, 0.5,
m_maxLS * 262144 + 0.5);
192 "vtxzvsorbrun",
"Vertex Z position vs orbit number", 4 *
m_maxLS, 0.5,
m_maxLS * 262144 + 0.5);
194 "nvtxvsorbrun",
"Number of true vertices vs orbit number",
m_maxLS, 0.5,
m_maxLS * 262144 + 0.5);
199 "Number of true vertices vs BX vs orbit number",
207 "Number of true vertices vs orbit number",
225 "nvtxvsbxvslumirun",
"Number of vertices vs BX and BX lumi", 3564, -0.5, 3563.5, 250, 0., 10.);
229 "Vertex X position vs BX number",
237 "Vertex Y position vs BX number",
245 "Vertex Z position vs BX number",
259 if (currdir ==
nullptr) {
268 (*m_hvtxxrun)->GetXaxis()->SetTitle(
"X [cm]");
269 (*m_hvtxxrun)->GetYaxis()->SetTitle(
"Vertices");
270 (*m_hvtxyrun)->GetXaxis()->SetTitle(
"Y [cm]");
271 (*m_hvtxyrun)->GetYaxis()->SetTitle(
"Vertices");
272 (*m_hvtxzrun)->GetXaxis()->SetTitle(
"Z [cm]");
273 (*m_hvtxzrun)->GetYaxis()->SetTitle(
"Vertices");
276 (*m_hvtxxvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]");
277 (*m_hvtxxvsorbrun)->GetYaxis()->SetTitle(
"X [cm]");
278 (*m_hvtxxvsorbrun)->SetCanExtend(TH1::kAllAxes);
279 (*m_hvtxyvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]");
280 (*m_hvtxyvsorbrun)->GetYaxis()->SetTitle(
"Y [cm]");
281 (*m_hvtxyvsorbrun)->SetCanExtend(TH1::kAllAxes);
282 (*m_hvtxzvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]");
283 (*m_hvtxzvsorbrun)->GetYaxis()->SetTitle(
"Z [cm]");
284 (*m_hvtxzvsorbrun)->SetCanExtend(TH1::kAllAxes);
285 (*m_hnvtxvsorbrun)->GetXaxis()->SetTitle(
"time [orbit#]");
286 (*m_hnvtxvsorbrun)->GetYaxis()->SetTitle(
"Nvertices");
287 (*m_hnvtxvsorbrun)->SetCanExtend(TH1::kAllAxes);
291 (*m_hvtxxvsbxrun)->GetXaxis()->SetTitle(
"BX");
292 (*m_hvtxxvsbxrun)->GetYaxis()->SetTitle(
"X [cm]");
293 (*m_hvtxyvsbxrun)->GetXaxis()->SetTitle(
"BX");
294 (*m_hvtxyvsbxrun)->GetYaxis()->SetTitle(
"Y [cm]");
295 (*m_hvtxzvsbxrun)->GetXaxis()->SetTitle(
"BX");
296 (*m_hvtxzvsbxrun)->GetYaxis()->SetTitle(
"Z [cm]");
297 (*m_hnvtxvsbxrun)->GetXaxis()->SetTitle(
"BX");
298 (*m_hnvtxvsbxrun)->GetYaxis()->SetTitle(
"Nvertices");
300 (*m_hnvtxvsbxvslumirun)->GetXaxis()->SetTitle(
"BX");
301 (*m_hnvtxvsbxvslumirun)->GetYaxis()->SetTitle(
"BX lumi [10^{30}cm^{-2}s^{-1}]");
304 (*m_hvtxxvsbx2drun)->GetXaxis()->SetTitle(
"BX");
305 (*m_hvtxxvsbx2drun)->GetYaxis()->SetTitle(
"X [cm]");
306 (*m_hvtxyvsbx2drun)->GetXaxis()->SetTitle(
"BX");
307 (*m_hvtxyvsbx2drun)->GetYaxis()->SetTitle(
"Y [cm]");
308 (*m_hvtxzvsbx2drun)->GetXaxis()->SetTitle(
"BX");
309 (*m_hvtxzvsbx2drun)->GetYaxis()->SetTitle(
"Z [cm]");
314 (*m_hnvtxvsbxvsorbrun)->GetXaxis()->SetTitle(
"BX#");
315 (*m_hnvtxvsbxvsorbrun)->GetYaxis()->SetTitle(
"time [orbit#]");
316 (*m_hnvtxvsbxvsorbrun)->SetCanExtend(TH1::kAllAxes);
317 (*m_hnvtxvsorbrun2D)->GetXaxis()->SetTitle(
"time [orbit#]");
318 (*m_hnvtxvsorbrun2D)->GetYaxis()->SetTitle(
"Nvertices");
319 (*m_hnvtxvsorbrun2D)->SetCanExtend(TH1::kAllAxes);
332 for (reco::VertexCollection::const_iterator vtx = vertices.begin(); vtx != vertices.end(); ++vtx) {
338 m_bsConstrained ? vtx->ndof() / (2. * vtx->tracksSize()) : (vtx->ndof() + 3) / (2. * vtx->tracksSize());
354 (*m_hvtxxrun)->Fill(vtx->x(),
weight);
356 (*m_hvtxyrun)->Fill(vtx->y(),
weight);
358 (*m_hvtxzrun)->Fill(vtx->z(),
weight);
361 (*m_hvtxxvsorbrun)->Fill(orbit, vtx->x(),
weight);
363 (*m_hvtxyvsorbrun)->Fill(orbit, vtx->y(),
weight);
365 (*m_hvtxzvsorbrun)->Fill(orbit, vtx->z(),
weight);
369 (*m_hvtxxvsbxrun)->Fill(bx % 3564, vtx->x(),
weight);
371 (*m_hvtxyvsbxrun)->Fill(bx % 3564, vtx->y(),
weight);
373 (*m_hvtxzvsbxrun)->Fill(bx % 3564, vtx->z(),
weight);
376 (*m_hvtxxvsbx2drun)->Fill(bx % 3564, vtx->x(),
weight);
378 (*m_hvtxyvsbx2drun)->Fill(bx % 3564, vtx->y(),
weight);
380 (*m_hvtxzvsbx2drun)->Fill(bx % 3564, vtx->z(),
weight);
385 int nheavytracks = 0;
387 double sumpt2heavy = 0.;
390 sumpt2 += (*trk)->pt() * (*trk)->pt();
394 sumpt2heavy += (*trk)->pt() * (*trk)->pt();
417 (*m_hnvtxvsorbrun)->Fill(orbit, ntruevtx, weight);
421 (*m_hnvtxvsbxrun)->Fill(bx % 3564, ntruevtx, weight);
424 (*m_hnvtxvsbxvslumirun)->Fill(bx % 3564, bxlumi, ntruevtx, weight);
429 (*m_hnvtxvsbxvsorbrun)->Fill(bx % 3564, orbit, ntruevtx, weight);
431 if (ntruevtx < (*m_hnvtxvsorbrun2D)->GetYaxis()->GetXmax() &&
432 ntruevtx > (*m_hnvtxvsorbrun2D)->GetYaxis()->GetXmin()) {
433 (*m_hnvtxvsorbrun2D)->Fill(orbit, ntruevtx, weight);
TProfile ** m_hvtxyvsorbrun
VertexHistogramMaker(edm::ConsumesCollector &&iC)
T getUntrackedParameter(std::string const &, T const &) const
TFileDirectory * m_currdir
const bool m_runHistoProfile
const edm::ParameterSet m_histoParameters
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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.)
TProfile * m_haveweightvsvtxzchk
edm::EDGetTokenT< LumiDetails > m_lumiDetailsToken
TProfile * m_hntruevtxvslumi
TFileDirectory & tFileDirectory()
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
m_rhm(consumesCollector())
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
T * make(const Args &...args) const
make new ROOT object
TProfile ** m_hnvtxvsorbrun
void book(const std::string dirname="")
Log< level::Info, false > LogInfo
TProfile ** m_hvtxzvsorbrun
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
void beginRun(const edm::Run &iRun)
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
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
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
RunHistogramManager m_fhm