10#include <arich/modules/arichBackground/ARICHBackgroundModule.h>
16#include <simulation/dataobjects/BeamBackHit.h>
17#include <arich/dataobjects/ARICHSimHit.h>
18#include <arich/dataobjects/ARICHDigit.h>
20#include <mdst/dataobjects/MCParticle.h>
23#include <framework/datastore/RelationIndex.h>
24#include <framework/datastore/RelationArray.h>
27#include <framework/logging/Logger.h>
28#include <framework/gearbox/Const.h>
29#include <framework/geometry/B2Vector3.h>
51 m_phVtx(TVector3()), m_phMmom(TVector3()), m_phMvtx(TVector3()), m_phPvtx(TVector3()), m_phPmom(TVector3()),
52 m_phGMvtx(TVector3()), m_phGMmom(TVector3()), m_modOrig(TVector3()), m_source(0), m_phPDG(0), m_phMPDG(0), m_phPPDG(0),
53 m_phGMPDG(0), m_type(0), m_edep(0.0), m_ttime(0.0), m_moduleID(0), m_phnw(0.0), m_trackLength(0.0), m_energy(0.0),
58 setDescription(
"ARICHBackground module. Used to extract information relevant for ARICH background from background files");
62 addParam(
"BkgTag",
m_bkgTag,
"background type tag (appended to hits in the output tree", 0);
75 m_outputTree =
new TTree(
"m_outputTree",
"tree of arich background hits");
105 B2INFO(
"ARICHBackground: Processing. ");
113 int subdet = arichBeamBkgHit.getSubDet();
114 if (subdet != 4)
continue;
116 if (arichBeamBkgHit.getIdentifier() == 1)
m_type = 1;
117 m_edep = arichBeamBkgHit.getEnergyDeposit();
118 m_ttime = arichBeamBkgHit.getTime();
119 m_phPDG = arichBeamBkgHit.getPDG();
120 m_phpos = arichBeamBkgHit.getPosition();
121 m_phmom = arichBeamBkgHit.getMomentum();
125 m_modOrig = TVector3(r * cos(phi), r * sin(phi), 0);
126 m_energy = arichBeamBkgHit.getEnergy();
129 m_phnw = arichBeamBkgHit.getNeutronWeight();
174 m_ttime = arichsimhit.getGlobalTime();
214 B2INFO(
"ARICHBackground finished.");
Class ARICHSimHit - Geant4 simulated hit for ARICH.
Class BeamBackHit - Stores hits from beam backgound simulation.
static const ParticleType neutron
neutron particle
A Class to store the Monte Carlo particle information.
ROOT::Math::XYZVector getVertex() const
Return production vertex position, shorthand for getProductionVertex().
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.
Provides access to fast ( O(log n) ) bi-directional lookups on a specified relation.
const Element * getFirstElementTo(const TO &to) const
Return a pointer to the first relation Element of the given object.
virtual void event()
Event processor.
ARICHBackgroundModule()
Constructor.
TFile * m_outputFile
Output root file.
ROOT::Math::XYZVector m_phPvtx
primary particle vertex
StoreArray< BeamBackHit > m_BeamBackHits
StoreArray for BeamBackHits.
virtual void initialize()
Initialize the Module.
virtual void beginRun()
Called when entering a new run.
int m_source
hit source (RBB_HER, ...)
DBObjPtr< ARICHGeometryConfig > m_arichgp
Geometry parametrization.
double m_phnw
neutron 1MeV equiv.
int m_phMPDG
hit particle mother PDG code
ROOT::Math::XYZVector m_phVtx
hit particle vertex position
ROOT::Math::XYZVector m_phPmom
primary particle momentum
StoreArray< ARICHSimHit > m_ARICHSimHits
StoreArray for ARICHSimHits.
int m_phGMPDG
hit particle grand mother PDG code
ROOT::Math::XYZVector m_phmom
hit momentum
int m_moduleID
hit module ID
virtual ~ARICHBackgroundModule()
Destructor.
virtual void terminate()
Termination action.
ROOT::Math::XYZVector m_phGMvtx
hit particle grand mother vertex
int m_phPDG
hit particle PDG code
ROOT::Math::XYZVector m_phpos
hit position
double m_edep
hit deposited energy
int m_type
hit particle type; 0 hit in board, 1 hit in HAPD bottom, 2 photon hit
double m_ttime
hit global time
int m_phPPDG
hit particle primary PDG code
double m_trackLength
particle track lenght in hit volume
TTree * m_outputTree
Output tree.
double m_energy
energy of particle
int m_bkgTag
background source.
ROOT::Math::XYZVector m_modOrig
HAPD module position.
std::string m_filename
Output file name.
ROOT::Math::XYZVector m_phGMmom
hit particle grand mother momentum
StoreArray< MCParticle > m_MCParticles
StoreArray for MCParticles.
ROOT::Math::XYZVector m_phMvtx
hit particle mother vertex
ROOT::Math::XYZVector m_phMmom
hit particle mother momentum
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.
B2Vector3< double > B2Vector3D
typedef for common usage with double
MCParticle * getMother() const
Returns a pointer to the mother particle.
Abstract base class for different kinds of events.
const FROM * from
pointer of the element from which the relation points.