10 #include <arich/modules/arichMCParticles/ARICHMCParticlesModule.h>
13 #include <framework/datastore/DataStore.h>
16 #include <framework/gearbox/Const.h>
17 #include <framework/logging/Logger.h>
41 setDescription(
"Creates collection of MCParticles related to tracks that hit ARICH.");
43 setPropertyFlags(c_ParallelProcessingCertified);
47 ARICHMCParticlesModule::~ARICHMCParticlesModule()
51 void ARICHMCParticlesModule::initialize()
55 m_tracks.isRequired();
56 m_extHits.isRequired();
58 m_arichMCPs.registerInDataStore();
59 m_tracks.registerRelationTo(m_arichMCPs);
63 void ARICHMCParticlesModule::beginRun()
67 void ARICHMCParticlesModule::event()
73 for (
int itrk = 0; itrk < m_tracks.getEntries(); ++itrk) {
75 const Track* track = m_tracks[itrk];
76 const TrackFitResult* fitResult = track->getTrackFitResultWithClosestMass(hypothesis);
78 B2ERROR(
"No TrackFitResult for " << hypothesis.
getPDGCode());
83 if (!particle)
continue;
87 for (
unsigned i = 0; i < extHits.
size(); i++) {
88 const ExtHit* extHit = extHits[i];
89 if (abs(extHit->
getPdgCode()) != pdgCode)
continue;
91 if (extHit->
getStatus() != EXT_EXIT)
continue;
95 MCParticle* arichP = m_arichMCPs.appendNew(*particle);
96 track->addRelationTo(arichP);
106 void ARICHMCParticlesModule::endRun()
110 void ARICHMCParticlesModule::terminate()
114 void ARICHMCParticlesModule::printModuleParams()
const
Provides a type-safe way to pass members of the chargedStableSet set.
int getPDGCode() const
PDG code.
EDetector
Enum for identifying the detector components (detector and subdetector).
Store one Ext hit as a ROOT object.
int getPdgCode() const
Get PDG code of this extrapolation's hypothesis.
ExtHitStatus getStatus() const
Get state of extrapolation at this hit.
TVector3 getMomentum() const
Get momentum at this extrapolation hit.
int getCopyID() const
Get detector-element ID of sensitive element within detector.
Const::EDetector getDetectorID() const
Get detector ID of this extrapolation hit.
A Class to store the Monte Carlo particle information.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.