9 #include <dqm/modules/PhysicsObjectsDQM/IPDQMExpressRecoModule.h>
10 #include <analysis/dataobjects/ParticleList.h>
11 #include <analysis/utility/ReferenceFrame.h>
12 #include <TLorentzVector.h>
13 #include <TDirectory.h>
30 setDescription(
"Monitor the position of the beamspot using mu+mu- events");
31 setPropertyFlags(c_ParallelProcessingCertified);
33 addParam(
"Y4SPListName", m_Y4SPListName,
"Name of the Y4S particle list", std::string(
"Upsilon(4S):IPDQM"));
38 TDirectory* oldDir = gDirectory;
39 oldDir->mkdir(
"IPMonitoring")->cd();
41 m_h_x =
new TH1F(
"Y4S_Vertex.X",
"IP position - coord. X", 1000, -0.5, 0.5);
42 m_h_x->SetXTitle(
"IP_coord. X [cm]");
43 m_h_y =
new TH1F(
"Y4S_Vertex.Y",
"IP position - coord. Y", 1000, -0.5, 0.5);
44 m_h_y->SetXTitle(
"IP_coord. Y [cm]");
45 m_h_z =
new TH1F(
"Y4S_Vertex.Z",
"IP position - coord. Z", 2000, -2, 2);
46 m_h_z->SetXTitle(
"IP_coord. Z [cm]");
47 m_h_px =
new TH1F(
"Y4S_Vertex.pX",
"Total momentum in lab. frame - coord. X", 100, -2, 2);
48 m_h_px->SetXTitle(
"pX [GeV/c]");
49 m_h_py =
new TH1F(
"Y4S_Vertex.pY",
"Total momentum in lab. frame - coord. Y", 100, -2, 2);
50 m_h_py->SetXTitle(
"pY [GeV/c]");
51 m_h_pz =
new TH1F(
"Y4S_Vertex.pZ",
"Total momentum in lab. frame - coord. Z", 100, 1, 5);
52 m_h_pz->SetXTitle(
"pZ [GeV/c]");
53 m_h_E =
new TH1F(
"Y4S_Vertex.E",
"Energy in lab. frame", 100, 8, 13);
54 m_h_E->SetXTitle(
"E [GeV]");
55 m_h_pull =
new TH1F(
"Y4S_pull.Y",
"Pull - coord. Y", 100, -10, 10);
56 m_h_pull->SetXTitle(
"(y_{reco}- y_{med})/#sigma_{y}^{reco}");
57 m_h_pull->GetXaxis()->SetTitleOffset(1.2);
58 m_h_pull->GetXaxis()->SetTitleSize(.04);
59 m_h_y_risol =
new TH1F(
"Y4S_Res.Y",
"Resolution - coord. Y", 1000, -1, 1);
62 m_h_temp =
new TH1F(
"Y4S_temp.Y",
"temp - coord. Y", 2000, -2, 2);
63 m_h_temp->SetXTitle(
"IP_coord. Y [cm]");
64 m_h_xx =
new TH1F(
"Y4S_Prod.XX",
"IP position - prod. XX", 1000, 0, 0.5);
65 m_h_xx->SetXTitle(
"IP_prod. XX [cm^{2} ]");
66 m_h_yy =
new TH1F(
"Y4S_Prod.YY",
"IP position - prod. YY", 1000, 0, 0.5);
67 m_h_yy->SetXTitle(
"IP_prod. YY [cm^{2} ]");
68 m_h_zz =
new TH1F(
"Y4S_Prod.ZZ",
"IP position - prod. ZZ", 2000, 0, 4);
69 m_h_zz->SetXTitle(
"IP_prod. ZZ [cm^{2} ]");
70 m_h_xy =
new TH1F(
"Y4S_Prod.XY",
"IP position - prod. XY", 1000, -1, 1);
71 m_h_xy->SetXTitle(
"IP_prod. XY [cm^{2} ]");
72 m_h_yz =
new TH1F(
"Y4S_Prod.YZ",
"IP position - prod. YZ", 1000, -1, 1);
73 m_h_yz->SetXTitle(
"IP_prod. YZ [cm^{2} ]");
74 m_h_xz =
new TH1F(
"Y4S_Prod.XZ",
"IP position - prod. XZ", 1000, -1, 1);
75 m_h_xz->SetXTitle(
"IP_prod. XZ [cm^{2} ]");
76 m_h_cov_x_x =
new TH1F(
"Var.X",
"X Variance", 500, 0., 0.005);
78 m_h_cov_y_y =
new TH1F(
"Var.Y",
"Y Variance", 500, 0., 0.005);
80 m_h_cov_z_z =
new TH1F(
"Var.Z",
"Z Variance", 500, 0., 0.005);
82 m_h_cov_x_y =
new TH1F(
"Covar.XY",
"XY Covariance", 1000, -0.005, 0.005);
84 m_h_cov_x_z =
new TH1F(
"Covar.XZ",
"XZ Covariance", 1000, -0.005, 0.005);
86 m_h_cov_y_z =
new TH1F(
"Covar.YZ",
"YZ Covariance", 1000, -0.005, 0.005);
168 if (Y4SParticles.
isValid() && abs(Y4SParticles->getPDGCode()) == 300553) {
170 for (
unsigned int i = 0; i < Y4SParticles->getListSize(); i++) {
172 Particle* Y4S = Y4SParticles->getParticle(i);
173 TVector3 IPVertex = frame.getVertex(Y4S);
175 m_h_x->Fill(IPVertex.X());
176 m_h_y->Fill(IPVertex.Y());
177 m_h_z->Fill(IPVertex.Z());
178 m_h_xy->Fill(IPVertex.X()*IPVertex.Y());
179 m_h_xz->Fill(IPVertex.X()*IPVertex.Z());
180 m_h_yz->Fill(IPVertex.Y()*IPVertex.Z());
181 m_h_xx->Fill(IPVertex.X()*IPVertex.X());
182 m_h_yy->Fill(IPVertex.Y()*IPVertex.Y());
183 m_h_zz->Fill(IPVertex.Z()*IPVertex.Z());
191 m_h_px->Fill(frame.getMomentum(Y4S).Px());
192 m_h_py->Fill(frame.getMomentum(Y4S).Py());
193 m_h_pz->Fill(frame.getMomentum(Y4S).Pz());
194 m_h_E->Fill(frame.getMomentum(Y4S).E());
195 m_err_y.push_back(std::sqrt(errMatrix(1, 1)));
196 m_v_y.push_back(IPVertex.Y());
200 for (
unsigned int u = 0; u <
m_v_y.size(); u++) {
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
This Module, made for ExpressReco, monitors the position and the dimension of the beamspot using mu+m...
TH1F * m_h_temp
initial histogram for median calculation
TH1F * m_h_cov_x_y
Cov xy.
TH1F * m_h_cov_y_z
Cov yz.
TH1F * m_h_px
x coord momentum in LAB frame
void initialize() override
Initialize the module.
Double_t m_median
The median of y coord.
void event() override
Event processor The main analysis happens here.
std::string m_Y4SPListName
Name of the Y4S particle list.
void endRun() override
End-of-run action.
Int_t m_size_per_unit
Size for sampling per each unit.
TH1F * m_h_E
Energy in LAB frame.
TH1F * m_h_py
y coord momentum in LAB frame
void terminate() override
Termination action.
TH1F * m_h_y_risol
y resolution
Int_t m_r
Counter for sampling.
void beginRun() override
Called when entering a new run Reset the histograms and counter m_r and clear the vectors.
TH1F * m_h_pz
z coord momentum in LAB frame
std::vector< float > m_v_y
store the y coordinates for the pull
std::vector< float > m_err_y
store the y errors for the pull
Double_t m_quantile
The 0.5 quantile for the median.
TH1F * m_h_cov_x_z
Cov xz.
void defineHisto() override
Defining the histograms.
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.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.