 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/findlets/minimal/AxialTrackCreatorMCTruth.h>
12 #include <tracking/trackFindingCDC/mclookup/CDCMCManager.h>
13 #include <tracking/trackFindingCDC/mclookup/CDCMCTrackStore.h>
14 #include <tracking/trackFindingCDC/mclookup/CDCSimHitLookUp.h>
15 #include <tracking/trackFindingCDC/mclookup/CDCMCTrackLookUp.h>
17 #include <tracking/trackFindingCDC/processing/AxialTrackUtil.h>
18 #include <tracking/trackFindingCDC/fitting/CDCKarimakiFitter.h>
20 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
21 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
22 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
23 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
24 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
25 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
27 #include <tracking/trackFindingCDC/eventdata/utils/FlightTimeEstimator.h>
29 #include <tracking/trackFindingCDC/topology/CDCWire.h>
31 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
33 #include <cdc/translators/RealisticTDCCountTranslator.h>
34 #include <cdc/dataobjects/CDCHit.h>
36 #include <framework/core/ModuleParamList.templateDetails.h>
41 using namespace TrackFindingCDC;
45 moduleParamList->
addParameter(prefixed(prefix,
"reconstructedDriftLength"),
47 "Switch to assign the reconstructed drift length to each hit, "
48 "as it can be estimated from two dimensional information only.",
51 moduleParamList->
addParameter(prefixed(prefix,
"reconstructedPositions"),
53 "Switch to reconstruct the positions in the tracks "
54 "immitating the legendre finder.",
59 "Fit the track instead of forwarding the mc truth fit information",
62 moduleParamList->
addParameter(prefixed(prefix,
"useOnlyBeforeTOP"),
64 "Cut tracks after the last layer of the CDC has been reached, "
65 "assuming the tracks left the CDC.",
71 return "Constructs tracks from wire hits using the mc truth information.";
89 std::vector<CDCTrack>& outputAxialTracks)
96 const std::map<ITrackType, CDCHitVector>& mcTracksByMCParticleIdx =
99 std::size_t nAxialTracks = mcTracksByMCParticleIdx.size();
100 outputAxialTracks.reserve(outputAxialTracks.size() + nAxialTracks);
102 for (
const std::pair<ITrackType, CDCHitVector>& mcTracksAndMCParticleIdx : mcTracksByMCParticleIdx) {
104 const CDCHitVector& mcTrack = mcTracksAndMCParticleIdx.second;
106 outputAxialTracks.push_back(
CDCTrack());
107 CDCTrack& axialTrack = outputAxialTracks.back();
108 bool reachedOuterMostLayer =
false;
109 for (
const CDCHit* ptrHit : mcTrack) {
115 if (ptrHit->getISuperLayer() == 8 and ptrHit->getILayer() == 5) {
116 reachedOuterMostLayer =
true;
118 if (reachedOuterMostLayer and ptrHit->getILayer() != 5) {
124 if (not wireHit)
continue;
127 if (not recoHit2D.
isAxial())
continue;
130 axialTrack.push_back(recoHit3D);
134 if (axialTrack.size() < 5) outputAxialTracks.pop_back();
139 for (
CDCTrack& track : outputAxialTracks) {
141 Vector2D recoPos2D = recoHit3D.getRecoPos2D();
142 Vector2D flightDirection = recoHit3D.getFlightDirection2D();
143 double alpha = recoPos2D.
angleWith(flightDirection);
145 const CDCWire& wire = recoHit3D.getWire();
146 const bool rl = recoHit3D.getRLInfo() == ERightLeft::c_Right;
148 double driftLength = std::fabs(recoHit3D.getSignedRecoDriftLength());
152 const double beta = 1;
171 driftLength = recoHit3D.getWireHit().getRefDriftLength();
181 driftLength += gRandom->Gaus(0, std::sqrt(driftLengthVariance));
183 bool snapRecoPos =
true;
184 recoHit3D.setRecoDriftLength(driftLength, snapRecoPos);
190 for (
CDCTrack& track : outputAxialTracks) {
197 for (
CDCTrack& track : outputAxialTracks) {
205 for (
CDCTrack& track : outputAxialTracks) {
void beginEvent() final
Start processing the current event.
std::vector< const CDCHit * > CDCHitVector
Type for an ordered sequence of pointers to the CDCHit.
double getDriftLengthResolution(double driftLength, const WireID &wireID=WireID(), bool leftRight=false, double z=0, double alpha=0, double=static_cast< double >(TMath::Pi()/2.)) override
Get position resolution^2 corresponding to the drift length from getDriftLength of this class.
static const CDCSimHitLookUp & getInstance()
Getter for the singletone instance.
Class representing a three dimensional reconstructed hit.
Class representing a sequence of three dimensional reconstructed hits.
std::string getDescription() final
Short description of the findlet.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
virtual double getFlightTime2D(const Vector2D &, double, double=1) const
Default estimator for the flight time.
Translator mirroring the realistic Digitization.
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
double getRefZ() const
Getter for the wire reference z coordinate Gives the wire's reference z coordinate.
const CDCRLWireHit & getRLWireHit() const
Getter for the oriented wire hit assoziated with the reconstructed hit.
Class implementing the fitter using Karimakis method.
double setLocalOrigin(const Vector2D &localOrigin)
Setter for the origin of the local coordinate system.
static CDCTrajectorySZ basicAssumption()
Constucts a basic assumption, what the z0 start position and the sz slope are, including some broad v...
Class to organize and present the monte carlo hit information.
bool m_param_reconstructedDriftLength
Parameter : Setup the drift length as it can be estimated from two dimensional information.
Helper struct to provide consistent flight time estimation throughout the CDC track finding.
Particle trajectory as it is seen in xy projection represented as a circle.
void initialize() override
Receive and dispatch signal before the start of the event processing.
void requireTruthInformation()
Require the mc information store arrays.
void fill()
Fill Monte Carlo look up maps from the DataStore.
CDCRecoHit2D getClosestPrimaryRecoHit2D(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Construct an CDCRecoHit2D from the closest primary CDCSimHit information related to the CDCHit.
bool m_param_fit
Parameter : Fit the track instead of forwarding the mc truth information.
void initialize() final
Initialize the Module before event processing.
static const CDCMCTrackLookUp & getInstance()
Getter for the singletone instance.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Abstract base class for different kinds of events.
static const CDCMCTrackStore & getInstance()
Getter for the singletone instance.
static CDCMCManager & getInstance()
Getter for the singletone instance.
Singletone class to gather local information about the hits.
const std::map< ITrackType, Belle2::TrackFindingCDC::CDCMCTrackStore::CDCHitVector > & getMCTracksByMCParticleIdx() const
Getter for the stored Monte Carlo tracks ordered by their Monte Carlo Id.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
void beginEvent() override
Receive and dispatch signal for the start of a new event.
bool isAxial() const
Indicator if the underlying wire is axial.
const WireID & getWireID() const
Getter for the wire id.
static const FlightTimeEstimator & instance(std::unique_ptr< FlightTimeEstimator > replacement=nullptr)
Getter for the instance.
Class representing a sense wire in the central drift chamber.
bool m_param_useOnlyBeforeTOP
Parameter : Cut tracks after the last layer of the CDC has been reached, assuming the tracks left the...
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
const CDCWireHit * getWireHit(const CDCHit *ptrHit, const std::vector< CDCWireHit > &wireHits) const
Retrieve the wire hit the given CDCHit form the given wire hits.
void apply(const std::vector< CDCWireHit > &inputWireHits, std::vector< CDCTrack > &outputAxialTracks) final
Main function of the track finding by the cellular automaton.
Class representing a hit wire in the central drift chamber.
The Module parameter list class.
static void normalizeTrack(CDCTrack &track)
Refit and resort the track. Unmask all hits.
Particle full three dimensional trajectory.
bool m_param_reconstructedPositions
Parameter : Switch to reconstruct the positions in the tracks immitating the legendre finder.
Specialisation of the lookup for the truth values of reconstructed tracks.
CDCTrajectory3D getTrajectory3D(const ACDCHitCollection *ptrHits) const
Returns the trajectory of the collection of hits.