10 #include <arich/modules/arichReconstruction/ARICHReconstructorModule.h>
14 #include <mdst/dataobjects/Track.h>
15 #include <tracking/dataobjects/ExtHit.h>
16 #include <mdst/dataobjects/MCParticle.h>
17 #include <arich/dataobjects/ARICHAeroHit.h>
18 #include <arich/dataobjects/ARICHLikelihood.h>
19 #include <arich/dataobjects/ARICHTrack.h>
20 #include <arich/dataobjects/ARICHHit.h>
23 #include <framework/datastore/DataStore.h>
24 #include <framework/datastore/StoreArray.h>
27 #include <framework/gearbox/Unit.h>
28 #include <framework/gearbox/Const.h>
29 #include <framework/logging/Logger.h>
35 using namespace boost;
57 setDescription(
"This module calculates the ARICHLikelihood values for all particle id. hypotheses, for all tracks that enter ARICH in the event.");
60 setPropertyFlags(c_ParallelProcessingCertified);
63 addParam(
"trackPositionResolution", m_trackPositionResolution,
64 "Resolution of track position on aerogel plane (for additional smearing of MC tracks)", 1.0 * Unit::mm);
65 addParam(
"trackAngleResolution", m_trackAngleResolution,
66 "Resolution of track direction angle on aerogel plane (for additional smearing of MC tracks)", 2.0 * Unit::mrad);
67 addParam(
"inputTrackType", m_inputTrackType,
"Input tracks switch: tracking (0), from AeroHits - MC info (1)", 0);
68 addParam(
"storePhotons", m_storePhot,
"Set to 1 to store reconstructed photon information (Ch. angle,...)", 0);
69 addParam(
"useAlignment", m_align,
"Use ARICH global position alignment constants",
true);
70 addParam(
"useMirrorAlignment", m_alignMirrors,
"Use ARICH mirror alignment constants",
true);
73 ARICHReconstructorModule::~ARICHReconstructorModule()
75 if (m_ana)
delete m_ana;
78 void ARICHReconstructorModule::initialize()
81 if (m_ana)
delete m_ana;
83 m_ana->setTrackPositionResolution(m_trackPositionResolution);
84 m_ana->setTrackAngleResolution(m_trackAngleResolution);
85 m_ana->useMirrorAlignment(m_alignMirrors);
88 arichHits.isRequired();
114 tracks.registerRelationTo(likelihoods);
122 void ARICHReconstructorModule::beginRun()
127 void ARICHReconstructorModule::event()
140 if (m_inputTrackType == 0) {
148 for (
int itrk = 0; itrk < Tracks.
getEntries(); ++itrk) {
150 const Track* track = Tracks[itrk];
151 const TrackFitResult* fitResult = track->getTrackFitResultWithClosestMass(hypothesis);
153 B2ERROR(
"No TrackFitResult for " << hypothesis.
getPDGCode());
160 if (particle) aeroHit = particle->getRelated<
ARICHAeroHit>();
166 const ExtHit* arich2ndHit = NULL;
167 const ExtHit* arichWinHit = NULL;
169 for (
unsigned i = 0; i < extHits.size(); i++) {
170 const ExtHit* extHit = extHits[i];
171 if (abs(extHit->
getPdgCode()) != pdgCode)
continue;
173 if (extHit->
getStatus() != EXT_EXIT)
continue;
175 if (extHit->
getCopyID() == 12345) {
continue;}
176 if (extHit->
getCopyID() == 6789) { arich2ndHit = extHit;
continue;}
177 arichWinHit = extHit;
185 arichTrack = arichTracks.
appendNew(arich2ndHit);
186 if (arichWinHit) arichTrack->setHapdWindowHit(arichWinHit);
190 if (!arichTrack)
continue;
192 m_ana->transformTrackToLocal(*arichTrack, m_align);
196 m_ana->likelihood2(*arichTrack, arichHits, *like);
198 track->addRelationTo(like);
213 for (
int iTrack = 0; iTrack < nTracks; ++iTrack) {
219 m_ana->smearTrack(*arichTrack);
221 m_ana->transformTrackToLocal(*arichTrack, m_align);
225 m_ana->likelihood2(*arichTrack, arichHits, *like);
234 void ARICHReconstructorModule::endRun()
238 void ARICHReconstructorModule::terminate()
242 void ARICHReconstructorModule::printModuleParams()
244 if (m_inputTrackType == 0) { B2DEBUG(100,
"ARICHReconstructorModule: track infromation is taken from mdst Tracks.");}
245 else B2DEBUG(100,
"ARICHReconstructorModule: track information is taken from MC (ARICHAeroHit).");
Datastore class that holds information on track parameters at the entrance in aerogel.
This is a class to store ARICH likelihoods in the datastore.
Internal ARICH track reconstruction.
ARICH subdetector main module.
Datastore class that holds position and momentum information of tracks that hit ARICH.
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.
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).
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
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.