10#include <dqm/modules/PhysicsObjectsDQM/IPDQMModule.h>
13#include <analysis/dataobjects/ParticleList.h>
14#include <analysis/utility/ReferenceFrame.h>
15#include <framework/logging/Logger.h>
18#include <TDirectory.h>
29 setDescription(
"Monitor the position and the size of the interaction point using mu+mu- events");
31 addParam(
"Y4SPListName",
m_Y4SPListName,
"Name of the Y4S particle list", std::string(
"Upsilon(4S):IPDQM"));
32 addParam(
"onlineMode",
m_onlineMode,
"Mode of the online processing ('hlt' or 'expressreco')", std::string(
"expressreco"));
37 TDirectory* newDirectory{gDirectory->mkdir(
"IPMonitoring")};
38 TDirectory::TContext context{gDirectory, newDirectory};
41 std::string suffix = (
m_onlineMode ==
"hlt") ?
"_hlt" :
"";
42 m_h_x =
new TH1F(std::string{
"Y4S_Vertex.X" + suffix}.c_str(),
"IP position - coord. X", 1000, -0.5, 0.5);
43 m_h_x->SetXTitle(
"IP_coord. X [cm]");
44 m_h_y =
new TH1F(std::string{
"Y4S_Vertex.Y" + suffix}.c_str(),
"IP position - coord. Y", 1000, -0.5, 0.5);
45 m_h_y->SetXTitle(
"IP_coord. Y [cm]");
46 m_h_z =
new TH1F(std::string{
"Y4S_Vertex.Z" + suffix}.c_str(),
"IP position - coord. Z", 2000, -2.0, 2.0);
47 m_h_z->SetXTitle(
"IP_coord. Z [cm]");
49 m_h_px =
new TH1F(
"Y4S_Vertex.pX",
"Total momentum in lab. frame - coord. X", 100, -2, 2);
50 m_h_px->SetXTitle(
"pX [GeV/c]");
51 m_h_py =
new TH1F(
"Y4S_Vertex.pY",
"Total momentum in lab. frame - coord. Y", 100, -2, 2);
52 m_h_py->SetXTitle(
"pY [GeV/c]");
53 m_h_pz =
new TH1F(
"Y4S_Vertex.pZ",
"Total momentum in lab. frame - coord. Z", 100, 1, 5);
54 m_h_pz->SetXTitle(
"pZ [GeV/c]");
55 m_h_E =
new TH1F(
"Y4S_Vertex.E",
"Energy in lab. frame", 100, 8, 13);
56 m_h_E->SetXTitle(
"E [GeV]");
57 m_h_cov_x_x =
new TH1F(
"Var.X",
"X Variance", 500, 0., 0.005);
59 m_h_cov_y_y =
new TH1F(
"Var.Y",
"Y Variance", 500, 0., 0.005);
61 m_h_cov_z_z =
new TH1F(
"Var.Z",
"Z Variance", 500, 0., 0.005);
63 m_h_cov_x_y =
new TH1F(
"Covar.XY",
"XY Covariance", 1000, -0.005, 0.005);
65 m_h_cov_x_z =
new TH1F(
"Covar.XZ",
"XZ Covariance", 1000, -0.005, 0.005);
67 m_h_cov_y_z =
new TH1F(
"Covar.YZ",
"YZ Covariance", 1000, -0.005, 0.005);
103 if (Y4SParticles.
isValid() && abs(Y4SParticles->getPDGCode()) == 300553) {
105 for (
unsigned int i = 0; i < Y4SParticles->getListSize(); i++) {
106 Particle* Y4S = Y4SParticles->getParticle(i);
108 double IPX{IPVertex.
X()};
109 double IPY{IPVertex.
Y()};
110 double IPZ{IPVertex.
Z()};
111 if (std::abs(IPX) < 0.5 and std::abs(IPY) < 0.5 and std::abs(IPZ) < 2.0) {
112 m_h_x->Fill(IPVertex.
X());
113 m_h_y->Fill(IPVertex.
Y());
114 m_h_z->Fill(IPVertex.
Z());
123 m_h_px->Fill(frame.getMomentum(Y4S).Px());
124 m_h_py->Fill(frame.getMomentum(Y4S).Py());
125 m_h_pz->Fill(frame.getMomentum(Y4S).Pz());
126 m_h_E->Fill(frame.getMomentum(Y4S).E());
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
TH1F * m_h_cov_x_y
Cov xy.
TH1F * m_h_cov_y_z
Cov yz.
IPDQMModule()
Constructor.
TH1F * m_h_px
x coord momentum in LAB frame
void initialize() override
Initialize the module.
void event() override
Event processor The main analysis happens here.
std::string m_Y4SPListName
Name of the Y4S particle list.
TH1F * m_h_E
Energy in LAB frame.
TH1F * m_h_py
y coord momentum in LAB frame
std::string m_onlineMode
Mode of online processing ("HLT" or "ExpressReco")
void beginRun() override
Called when entering a new run Reset the histograms.
TH1F * m_h_pz
z coord momentum in LAB frame
TH1F * m_h_cov_x_z
Cov xz.
void defineHisto() override
Defining the histograms.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to store reconstructed particles.
TMatrixFSym getVertexErrorMatrix() const
Returns the 3x3 position error sub-matrix.
static const ReferenceFrame & GetCurrent()
Get current rest frame.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Class to store variables with their name which were sent to the logging service.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.