8#include <tracking/trackFindingCDC/eventdata/utils/DriftLengthEstimator.h>
10#include <tracking/trackFindingCDC/eventdata/utils/FlightTimeEstimator.h>
12#include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
14#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment3D.h>
15#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
17#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
18#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
19#include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
20#include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
21#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
23#include <tracking/trackFindingCDC/topology/CDCWire.h>
25#include <tracking/trackFindingCDC/geometry/UncertainParameterLine2D.h>
26#include <tracking/trackFindingCDC/geometry/ParameterLine2D.h>
27#include <tracking/trackFindingCDC/geometry/Vector2D.h>
28#include <tracking/trackFindingCDC/geometry/Vector3D.h>
30#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
31#include <tracking/trackFindingCDC/numerics/Quadratic.h>
33#include <framework/core/ModuleParamList.templateDetails.h>
34#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
36#include <cdc/translators/RealisticTDCCountTranslator.h>
37#include <cdc/dataobjects/CDCHit.h>
40using namespace TrackFindingCDC;
45 moduleParamList->
addParameter(prefixed(prefix,
"useAlphaInDriftLength"),
47 "Switch to serve the alpha angle to the drift length translator",
50 moduleParamList->
addParameter(prefixed(prefix,
"tofMassScale"),
52 "Mass to estimate the velocity in the flight time to the hit",
62 double alpha = recoPos2D.
angleWith(flightDirection);
63 const double beta = 1;
68 const bool rl = recoHit2D.
getRLInfo() == ERightLeft::c_Right;
74 double driftLength = tdcCountTranslator.
getDriftLength(hit->getTDCCount(),
80 if (driftLength > -2 and driftLength < 16) {
81 bool snapRecoPos =
true;
92 Vector2D flightDirection = line->tangential();
94 double alpha = centralPos2D.
angleWith(flightDirection);
102 const bool rl = rlWireHit.
getRLInfo() == ERightLeft::c_Right;
103 const double beta = 1;
105 double driftLength = tdcCountTranslator.
getDriftLength(hit->getTDCCount(),
144 double alpha = recoPos2D.
angleWith(flightDirection);
145 const double beta = 1;
148 if (std::isnan(tanLambda)) {
151 const double theta = M_PI / 2 - std::atan(tanLambda);
152 flightTimeEstimate *= hypot2(1, tanLambda);
156 const bool rl = recoHit3D.
getRLInfo() == ERightLeft::c_Right;
166 if (driftLength > -2 and driftLength < 16) {
167 bool snapRecoPos =
true;
175 const double tanLambda)
183 const double tanLambda)
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Translator mirroring the realistic Digitization.
double getDriftLength(unsigned short tdcCount, const WireID &wireID=WireID(), double timeOfFlightEstimator=0, bool leftRight=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0) override
Get Drift length.
The Module parameter list class.
Class representing a triple of neighboring oriented wire with additional trajectory information.
Vector2D getEndRecoPos2D() const
Getter for the reconstructed position at the third hit on the fit line.
const UncertainParameterLine2D & getFitLine() const
Getter for the contained line fit information.
Vector2D getMiddleRecoPos2D() const
Getter for the reconstructed position at the second hit on the fit line.
Vector2D getStartRecoPos2D() const
Getter for the reconstructed position at the first hit on the fit line.
const CDCWire & getMiddleWire() const
Getter for the wire the second oriented wire hit is based on.
CDCRLWireHit & getStartRLWireHit()
Getter for the first oriented wire hit.
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
void setRefDriftLength(double driftLength)
Setter for the drift length at the reference position of the wire.
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
ERightLeft getRLInfo() const
Getter for the right left passage information.
Class representing a two dimensional reconstructed hit in the central drift chamber.
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the reconstructed hit.
void setRefDriftLength(double driftLength, bool snapRecoPos)
Setter for the drift length at the wire reference position.
const CDCWire & getWire() const
Getter for the wire the reconstructed hit associated to.
Vector2D getFlightDirection2D() const
Getter for the direction of flight.
Vector2D getRecoPos2D() const
Getter for the position in the reference plane.
ERightLeft getRLInfo() const
Getter for the right left passage information.
Class representing a three dimensional reconstructed hit.
const CDCWireHit & getWireHit() const
Getter for the wire hit.
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
const CDCWire & getWire() const
Getter for the wire.
Vector2D getFlightDirection2D() const
Getter for the direction of flight.
void setRecoDriftLength(double driftLength, bool snapRecoPos)
Setter to update the drift length of the hit.
ERightLeft getRLInfo() const
Getter for the right left passage information.
A reconstructed sequence of two dimensional hits in one super layer.
A segment consisting of three dimensional reconstructed hits.
Class representing a sequence of three dimensional reconstructed hits.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
Class representing a sense wire in the central drift chamber.
const WireID & getWireID() const
Getter for the wire id.
const Vector2D & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
double getRefZ() const
Getter for the wire reference z coordinate Gives the wire's reference z coordinate.
static const FlightTimeEstimator & instance(std::unique_ptr< FlightTimeEstimator > replacement=nullptr)
Getter for the instance.
virtual double getFlightTime2D(const Vector2D &, double, double=1) const
Default estimator for the flight time.
A parameter line including including an line covariance matrix which is interpreted as located in the...
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
A three dimensional vector.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
double cylindricalR() const
Getter for the cylindrical radius ( xy projected norm )
double z() const
Getter for the z coordinate.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.
double m_param_tofMassScale
Parameter : Mass to estimate the velocity in the flight time to the hit.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Add the parameters of the estimator to the module.
bool m_param_useAlphaInDriftLength
Parameter : Switch to serve the alpha angle to the drift length translator.
double updateDriftLength(CDCRecoHit2D &recoHit2D)
Update the drift length of the reconstructed hit in place.