9 #include <b2bii/modules/B2BIIMCParticlesMonitor/B2BIIMCParticlesMonitorModule.h>
12 #include <framework/core/HistoModule.h>
15 #include <framework/datastore/StoreArray.h>
18 #include <mdst/dataobjects/MCParticle.h>
35 setDescription(
"This module creates and fills B2BII MCParticles monitoring histograms.");
39 B2BIIMCParticlesMonitorModule::~B2BIIMCParticlesMonitorModule()
43 void B2BIIMCParticlesMonitorModule::defineHisto()
45 mcPDG =
new TH1F(
"mcPDG",
"PDG values of MCParticles", 100, -22500, 22500);
46 mcM =
new TH1F(
"mcM",
"M", 100, 0, 11.6);
47 mcPx =
new TH1F(
"mcPx",
"Px", 100, -5.8, 5.8);
48 mcPy =
new TH1F(
"mcPy",
"Py", 100, -5.8, 5.8);
49 mcPz =
new TH1F(
"mcPz",
"Pz", 100, -4.2, 8.6);
50 mcE =
new TH1F(
"mcE",
"E", 100, 0, 12.6);
51 mcVx =
new TH1F(
"mcVx",
"Vx", 100, -4500, 5100);
52 mcVy =
new TH1F(
"mcVy",
"Vy", 100, -5000, 4200);
53 mcVz =
new TH1F(
"mcVz",
"Vz", 100, -9000, 9800);
54 mcPiPlusMother =
new TH1F(
"mcPiPlusMother",
"Pi+ Mother PDG's", 102, -498000, 9498000);
55 mcPiMinusMother =
new TH1F(
"mcPiMinusMother",
"Pi- Mother PDG's", 102, -498000, 9498000);
56 mcPi0Mother =
new TH1F(
"mcPi0Mother",
"Pi0 Mother PDG's", 102, -498000, 9498000);
57 mcNDau =
new TH1F(
"mcNDau",
"Number of Daughters", 56, 0, 56);
60 void B2BIIMCParticlesMonitorModule::initialize()
65 void B2BIIMCParticlesMonitorModule::beginRun()
69 void B2BIIMCParticlesMonitorModule::event()
72 if (!mc_particles) B2ERROR(
"Cannot find MCParticles array");
76 for (
int i = 0; i < nentries; i++) {
78 const MCParticle* mcparticle = mc_particles[i];
80 mcPDG->Fill(mcparticle->
getPDG());
82 mcM->Fill(mcparticle->
getMass());
92 int mcparticle_pdg = mcparticle->
getPDG();
95 if (mcparticle_pdg == 211) mcPiPlusMother->Fill(mcparticle->
getMother()->
getPDG());
96 if (mcparticle_pdg == -211) mcPiMinusMother->Fill(mcparticle->
getMother()->
getPDG());
97 if (mcparticle_pdg == 111) mcPi0Mother->Fill(mcparticle->
getMother()->
getPDG());
104 void B2BIIMCParticlesMonitorModule::endRun()
108 void B2BIIMCParticlesMonitorModule::terminate()