10 #include <arich/modules/arichRelate/ARICHRelateModule.h>
13 #include <framework/datastore/DataStore.h>
16 #include <framework/gearbox/Const.h>
17 #include <framework/logging/Logger.h>
40 setDescription(
"Creates relations between ARICHAeroHits and ExtHits. Allows to store simulation output without MCParticles");
42 setPropertyFlags(c_ParallelProcessingCertified);
46 ARICHRelateModule::~ARICHRelateModule()
50 void ARICHRelateModule::initialize()
54 m_mcParticles.isRequired();
55 m_mdstTracks.isRequired();
56 m_aeroHits.isRequired();
57 m_extHits.isRequired();
58 m_extHits.registerRelationTo(m_aeroHits);
61 void ARICHRelateModule::beginRun()
65 void ARICHRelateModule::event()
67 int nHits = m_aeroHits.getEntries();
68 B2DEBUG(50,
"No. of hits " << nHits);
70 for (
int iHit = 0; iHit < nHits; ++iHit) {
72 const MCParticle* particle = DataStore::getRelated<MCParticle>(aeroHit);
74 B2DEBUG(50,
"No MCParticle for AeroHit!");
79 const Track* track = DataStore::getRelated<Track>(particle);
82 const TrackFitResult* fitResult = track->getTrackFitResultWithClosestMass(Const::pion);
83 if (!fitResult)
continue;
87 for (
unsigned i = 0; i < extHits.
size(); i++) {
88 const ExtHit* extHit = extHits[i];
89 if (abs(extHit->
getPdgCode()) != Const::pion.getPDGCode())
continue;
91 if (extHit->
getCopyID() != 6789)
continue;
92 if (extHit->
getStatus() != EXT_EXIT)
continue;
100 void ARICHRelateModule::endRun()
104 void ARICHRelateModule::terminate()
108 void ARICHRelateModule::printModuleParams()
const
Datastore class that holds information on track parameters at the entrance in aerogel.
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.
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.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
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.