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>
34 using namespace boost;
52 ARICHReconstructorModule::ARICHReconstructorModule() :
56 setDescription(
"This module calculates the ARICHLikelihood values for all particle id. hypotheses, for all tracks that enter ARICH in the event.");
63 "Resolution of track position on aerogel plane (for additional smearing of MC tracks)", 1.0 *
Unit::mm);
65 "Resolution of track direction angle on aerogel plane (for additional smearing of MC tracks)", 2.0 *
Unit::mrad);
67 addParam(
"storePhotons",
m_storePhot,
"Set to 1 to store reconstructed photon information (Ch. angle,...)", 0);
68 addParam(
"useAlignment", m_align,
"Use ARICH global position alignment constants",
true);
87 m_ARICHHits.isRequired();
89 m_Tracks.isOptional();
90 m_ExtHits.isOptional();
91 m_aeroHits.isOptional();
93 if (!m_aeroHits.isOptional()) {
94 m_Tracks.isRequired();
95 m_ExtHits.isRequired();
102 m_ARICHLikelihoods.registerInDataStore();
104 m_ARICHTracks.registerInDataStore();
108 m_ARICHTracks.registerRelationTo(m_ExtHits);
109 m_Tracks.registerRelationTo(m_ARICHLikelihoods);
113 m_ARICHTracks.registerRelationTo(m_aeroHits);
131 for (
const Track& track : m_Tracks) {
132 const TrackFitResult* fitResult = track.getTrackFitResultWithClosestMass(hypothesis);
134 B2ERROR(
"No TrackFitResult for " << hypothesis.
getPDGCode());
147 const ExtHit* arich2ndHit = NULL;
148 const ExtHit* arichWinHit = NULL;
150 for (
unsigned i = 0; i < extHits.size(); i++) {
151 const ExtHit* extHit = extHits[i];
156 extHit->
getCopyID() == 12345) {
continue;}
157 if (extHit->
getCopyID() == 6789) { arich2ndHit = extHit;
continue;}
158 arichWinHit = extHit;
166 arichTrack = m_ARICHTracks.appendNew(arich2ndHit);
167 if (arichWinHit) arichTrack->setHapdWindowHit(arichWinHit);
171 if (!arichTrack)
continue;
179 track.addRelationTo(like);
194 ARICHTrack* arichTrack = m_ARICHTracks.appendNew(&aeroHit);
213 if (
m_inputTrackType == 0) { B2DEBUG(100,
"ARICHReconstructorModule: track infromation is taken from mdst Tracks.");}
214 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.
void useMirrorAlignment(bool align)
use mirror alignment or not
ARICHReconstruction * m_ana
Class with reconstruction tools.
bool m_alignMirrors
If==1 alignment constants are used for global->local track transformation.
int m_inputTrackType
Input tracks from the tracking (0) or from MCParticles>AeroHits (1).
double m_trackAngleResolution
Track direction resolution; simulation smearing.
int m_storePhot
If == 1 individual reconstruced photon information (cherenkov angle,...) is stored in ARICHTrack.
double m_trackPositionResolution
Track position resolution; simulation smearing.
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).
static const ChargedStable pion
charged pion particle
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.
ROOT::Math::XYZVector getMomentum() const
Get momentum at this extrapolation hit.
A Class to store the Monte Carlo particle information.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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 isOptional(const std::string &name="")
Tell the DataStore about an optional input.
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
static const double mm
[millimeters]
static const double mrad
[millirad]
void setTrackPositionResolution(double pRes)
Sets track position resolution (from tracking)
int likelihood2(ARICHTrack &arichTrack, const StoreArray< ARICHHit > &arichHits, ARICHLikelihood &arichLikelihood)
Computes the value of identity likelihood function for different particle hypotheses.
void initialize()
read geomerty parameters from xml and initialize class memebers
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
void setTrackAngleResolution(double aRes)
Sets track direction resolution (from tracking)
virtual ~ARICHReconstructorModule()
Destructor.
virtual void beginRun() override
Called when entering a new run.
void printModuleParams()
Print module parameters.
void transformTrackToLocal(ARICHTrack &arichTrack, bool align)
Transforms track parameters from global Belle2 to ARICH local frame.
int smearTrack(ARICHTrack &arichTrack)
Smeares track parameters ("simulate" the uncertainties of tracking).
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.