9#include <beast/analysis/modules/ReprocessorModule.h>
11#include <mdst/dataobjects/MCParticle.h>
12#include <framework/logging/Logger.h>
14#include <Math/Vector3D.h>
49 B2INFO(
"Reprocessor: Initializing");
79 for (
const auto& MetaHit :
MetaHits) {
80 rate = MetaHit.getrate();
96 const int PDG = mcpart.getPDG();
97 const double energy = mcpart.getEnergy();
98 ROOT::Math::XYZVector Momentum = mcpart.getMomentum();
99 ROOT::Math::XYZVector ProductionVertex = mcpart.getProductionVertex();
105 particle->setPDG(PDG);
106 particle->setMassFromPDG();
107 particle->setMomentum(ROOT::Math::XYZVector(Momentum));
108 particle->setProductionVertex(ROOT::Math::XYZVector(ProductionVertex));
109 particle->setProductionTime(0.0);
110 particle->setEnergy(energy);
111 particle->setValidVertex(
true);
119 const int PDG = mcpart.getPDG();
120 const double energy = mcpart.getEnergy();
121 ROOT::Math::XYZVector Momentum = mcpart.getMomentum();
122 ROOT::Math::XYZVector ProductionVertex = mcpart.getProductionVertex();
128 particle->setPDG(PDG);
129 particle->setMassFromPDG();
130 particle->setMomentum(ROOT::Math::XYZVector(Momentum));
131 particle->setProductionVertex(ROOT::Math::XYZVector(ProductionVertex));
132 particle->setProductionTime(0.0);
133 particle->setEnergy(energy);
134 particle->setValidVertex(
true);
140 evtMetaData->setGeneratedWeight(rate);
A Class to store the Monte Carlo particle information.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
void setDescription(const std::string &description)
Sets the description of the module.
StoreArray< MCParticle > m_mcParticle
mc Particle Array
int m_input_TPC_PDG
Set PDG.
virtual ~ReprocessorModule()
Destructor.
int m_input_TPC_Ntimes
Set N times.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual void endRun() override
End-of-run action.
virtual void terminate() override
Termination action.
ReprocessorModule()
Constructor: Sets the description, the properties and the parameters of the module.
StoreObjPtr< EventMetaData > m_evtMetaData
event meta data Object pointer
virtual void beginRun() override
Called when entering a new run.
StoreArray< SADMetaHit > MetaHits
Array of SAD particles.
int m_input_HE3_PDG
Set PDG.
StoreArray< HE3G4TrackInfo > mc_he3_parts
Array of G4 particles crossing the He3 tubes.
StoreArray< TPCG4TrackInfo > mc_tpc_parts
Array of G4 particles crossing the uTPCs.
int m_input_HE3_Ntimes
Set N times.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
bool create(bool replace=false)
Create a default object in the data store.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
void clear() override
Delete all entries in this array.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
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.