Belle II Software development
V0ObjectsDQMModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8//+
9// File : V0ObjectsDQMModule.cc
10// Description : Module to monitor displaced vertices on HLT
11//-
12
13#include <dqm/modules/V0ObjectsDQM/V0ObjectsDQMModule.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <analysis/dataobjects/ParticleList.h>
16#include <TDirectory.h>
17
18using namespace Belle2;
19
20//-----------------------------------------------------------------
21// Register the Module
22//-----------------------------------------------------------------
23REG_MODULE(V0ObjectsDQM);
24
25//-----------------------------------------------------------------
26// Implementation
27//-----------------------------------------------------------------
28
30{
31 //Set module properties
32
33 setDescription("Monitor displaced vertices");
35
36 addParam("V0PListName", m_V0PListName, "Name of the vertexed particle list", std::string("K_S0:V0DQM"));
37}
38
40{
41 TDirectory* oldDir = gDirectory;
42 oldDir->mkdir("V0Objects");
43 oldDir->cd("V0Objects");
44
45 for (int j = 0; j < 32; j++) {
46 m_h_xvsy[j] = new TH2F(Form("xvsy[%i]", j), Form("xvsy[%i]", j), 200, -10, 10, 200, -10, 10);
47 m_h_xvsy[j]->SetXTitle("x [cm]");
48 m_h_xvsy[j]->SetYTitle("y [cm]");
49 m_h_xvsy[j]->SetStats(kFALSE);
50 }
51 m_h_xvsz = new TH2F("xvsz", "xvsz", 1500, -75, 75, 400, -10, 10);
52 m_h_xvsz->SetXTitle("z [cm]");
53 m_h_xvsz->SetYTitle("x [cm]");
54 m_h_xvsz->SetStats(kFALSE);
55
56 oldDir->cd();
57}
58
59
61{
62 REG_HISTOGRAM
63
64}
65
66
68{
69 for (int j = 0; j < 32; j++) {
70 m_h_xvsy[j]->Reset();
71 }
72 m_h_xvsz->Reset();
73}
74
75
77{
78
80
81 if (V0Particles.isValid()) {
82 for (unsigned int i = 0; i < V0Particles->getListSize(); i++) {
83 Particle* V0 = V0Particles->getParticle(i);
84 //Get the vertex position, fill accordingly
85 float vtxx = V0->getX();
86 float vtxy = V0->getY();
87 float vtxz = V0->getZ();
88 if (fabs(vtxz) < 75 && fabs(vtxx) < 10 && fabs(vtxy) < 10) {
89 m_h_xvsy[int(floor((vtxz + 75) / 5))]->Fill(vtxx, vtxy);
90 if (vtxz <= -5. || vtxz >= 8.) m_h_xvsz->Fill(vtxz, vtxx);
91 }
92 }
93 }
94
95}
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
Class to store reconstructed particles.
Definition: Particle.h:75
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
bool isValid() const
Check whether the object was created.
Definition: StoreObjPtr.h:111
void initialize() override final
Initializer.
void defineHisto() override final
Definition of the histograms.
void event() override final
This method is called for each event.
void beginRun() override final
Called when entering a new run.
std::string m_V0PListName
Name of the V0 particle list.
Object holding information for V0s.
Definition: V0.h:34
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.