14#include <b2bii/modules/B2BIIMCParticlesMonitor/B2BIIMCParticlesMonitorModule.h>
17#include <framework/core/HistoModule.h>
20#include <framework/datastore/StoreArray.h>
23#include <framework/gearbox/Const.h>
26#include <mdst/dataobjects/MCParticle.h>
43 setDescription(
"This module creates and fills B2BII MCParticles monitoring histograms.");
53 mcPDG =
new TH1F(
"mcPDG",
"PDG values of MCParticles", 100, -22500, 22500);
54 mcM =
new TH1F(
"mcM",
"M", 100, 0, 11.6);
55 mcPx =
new TH1F(
"mcPx",
"Px", 100, -5.8, 5.8);
56 mcPy =
new TH1F(
"mcPy",
"Py", 100, -5.8, 5.8);
57 mcPz =
new TH1F(
"mcPz",
"Pz", 100, -4.2, 8.6);
58 mcE =
new TH1F(
"mcE",
"E", 100, 0, 12.6);
59 mcVx =
new TH1F(
"mcVx",
"Vx", 100, -4500, 5100);
60 mcVy =
new TH1F(
"mcVy",
"Vy", 100, -5000, 4200);
61 mcVz =
new TH1F(
"mcVz",
"Vz", 100, -9000, 9800);
62 mcPiPlusMother =
new TH1F(
"mcPiPlusMother",
"Pi+ Mother PDG's", 102, -498000, 9498000);
63 mcPiMinusMother =
new TH1F(
"mcPiMinusMother",
"Pi- Mother PDG's", 102, -498000, 9498000);
64 mcPi0Mother =
new TH1F(
"mcPi0Mother",
"Pi0 Mother PDG's", 102, -498000, 9498000);
65 mcNDau =
new TH1F(
"mcNDau",
"Number of Daughters", 56, 0, 56);
80 if (!mc_particles) B2ERROR(
"Cannot find MCParticles array");
84 for (
int i = 0; i < nentries; i++) {
86 const MCParticle* mcparticle = mc_particles[i];
100 int mcparticle_pdg = mcparticle->
getPDG();
TH1F * mcPi0Mother
histogram PDG codes of mother particles of pi0's
TH1F * mcPx
histogram momentum_x
TH1F * mcPz
histogram momentum_z
TH1F * mcVz
histogram vertex_z
virtual void initialize() override
Initialize the module.
B2BIIMCParticlesMonitorModule()
Constructor.
TH1F * mcPDG
histogram PDG values of MC Particles
virtual void event() override
Called for each event.
TH1F * mcE
histogram energy
virtual void endRun() override
Called when the current run finished.
virtual void terminate() override
Terminates the module.
TH1F * mcVx
histogram vertex_x
virtual void beginRun() override
Called when a new run is started.
virtual ~B2BIIMCParticlesMonitorModule()
Destructor.
TH1F * mcPy
histogram momentum_y
TH1F * mcPiMinusMother
histogram PDG codes of mother particles of negative pions
TH1F * mcPiPlusMother
histogram PDG codes of mother particles of positive pions
TH1F * mcNDau
histogram number of daughter particles of all particles
TH1F * mcVy
histogram vertex_y
virtual void defineHisto() override
function to define histograms
static const ParticleType pi0
neutral pion particle
static const ChargedStable pion
charged pion particle
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
A Class to store the Monte Carlo particle information.
float getEnergy() const
Return particle energy in GeV.
float getMass() const
Return the particle mass in GeV.
ROOT::Math::XYZVector getProductionVertex() const
Return production vertex position.
int getNDaughters() const
Return number of daughter MCParticles.
int getPDG() const
Return PDG code of particle.
ROOT::Math::XYZVector getMomentum() const
Return momentum.
void setDescription(const std::string &description)
Sets the description of the module.
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
MCParticle * getMother() const
Returns a pointer to the mother particle.
Abstract base class for different kinds of events.