9#include <beast/analysis/modules/ReprocessorModule.h>
11#include <mdst/dataobjects/MCParticle.h>
12#include <framework/logging/Logger.h>
14#include <Math/Vector3D.h>
17#include <boost/foreach.hpp>
51 B2INFO(
"Reprocessor: Initializing");
81 for (
const auto& MetaHit :
MetaHits) {
82 rate = MetaHit.getrate();
98 const int PDG = mcpart.getPDG();
99 const double energy = mcpart.getEnergy();
100 ROOT::Math::XYZVector Momentum = mcpart.getMomentum();
101 ROOT::Math::XYZVector ProductionVertex = mcpart.getProductionVertex();
107 particle->setPDG(PDG);
108 particle->setMassFromPDG();
109 particle->setMomentum(ROOT::Math::XYZVector(Momentum));
110 particle->setProductionVertex(ROOT::Math::XYZVector(ProductionVertex));
111 particle->setProductionTime(0.0);
112 particle->setEnergy(energy);
113 particle->setValidVertex(
true);
121 const int PDG = mcpart.getPDG();
122 const double energy = mcpart.getEnergy();
123 ROOT::Math::XYZVector Momentum = mcpart.getMomentum();
124 ROOT::Math::XYZVector ProductionVertex = mcpart.getProductionVertex();
130 particle->setPDG(PDG);
131 particle->setMassFromPDG();
132 particle->setMomentum(ROOT::Math::XYZVector(Momentum));
133 particle->setProductionVertex(ROOT::Math::XYZVector(ProductionVertex));
134 particle->setProductionTime(0.0);
135 particle->setEnergy(energy);
136 particle->setValidVertex(
true);
142 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.