BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/McTruth/include/McTruth/MdcMcHit.h
Go to the documentation of this file.
1#ifndef MdcMcHit_H
2#define MdcMcHit_H
3#include "EventModel/EventModel.h"
4#include "GaudiKernel/ContainedObject.h"
5#include "GaudiKernel/ObjectVector.h"
6#include "Identifier/Identifier.h"
7#include <algorithm>
8#include <string>
9
10using namespace EventModel;
11extern const CLID& CLID_MdcMcHit;
12
13namespace Event { // NameSpace
14
15 class MdcMcHit : virtual public ContainedObject {
16 public:
17 virtual const CLID& clID() const { return MdcMcHit::classID(); }
18
19 static const CLID& classID() { return CLID_MdcMcHit; }
20 // Constructor
22 MdcMcHit( const Identifier& id, unsigned int trackIndex, double xPosition,
23 double yPosition, double zPosition, double driftDistance, double depositEnergy,
24 int posFlag = -1 );
25 MdcMcHit( const Identifier& id, unsigned int trackIndex, int currentTrackPID,
26 double xPosition, double yPosition, double zPosition, double xMomentum,
27 double yMomentum, double zMomentum, double driftDistance, double depositEnergy,
28 double flightLength, int posFlag = -1 );
29
30 // Get associated id
31 Identifier identify() const;
32
33 // Get the associated track id
34 unsigned int getTrackIndex() const;
35
36 // Get the associated current track PID
37 int getCurrentTrackPID() const { return m_currentTrackPID; }
38
39 // Get if a secondary
40 int getIsSecondary() const { return m_isSecondary; };
41
42 // Get the position x
43 double getPositionX() const;
44
45 // Get the position y
46 double getPositionY() const;
47
48 // Get the position z
49 double getPositionZ() const;
50
51 // Get the momentum x
52 double getMomentumX() const { return m_xMomentum; }
53
54 // Get the momentum y
55 double getMomentumY() const { return m_yMomentum; }
56
57 // Get the momentum z
58 double getMomentumZ() const { return m_zMomentum; }
59
60 // Get Drift Distance
61 double getDriftDistance() const;
62
63 // Get deposited energy
64 double getDepositEnergy() const;
65
66 // Get the position flag
67 int getPositionFlag() const;
68
69 // Get the flight length
70 double getFlightLength() const { return m_flightLength; }
71
72 std::string getCreatorProcess() const { return m_creatorProcess; }
73
74 int getDigiIdx() const {
75 return m_digi_id;
76 } // positve: contribute to both time and charge, negative: only charge
77
78 // Set
79 void setIdentifier( unsigned int id ) { m_id = id; }
80 void setTrackIndex( unsigned int trackIndex ) { m_trackIndex = trackIndex; }
81 void setCurrentTrackPID( int currentTrackPID ) { m_currentTrackPID = currentTrackPID; }
82 void setIsSecondary( int isSec ) { m_isSecondary = isSec; };
83 void setPositionX( double positionX ) { m_xPosition = positionX; }
84 void setPositionY( double positionY ) { m_yPosition = positionY; }
85 void setPositionZ( double positionZ ) { m_zPosition = positionZ; }
86 void setMomentumX( double momentumX ) { m_xMomentum = momentumX; }
87 void setMomentumY( double momentumY ) { m_yMomentum = momentumY; }
88 void setMomentumZ( double momentumZ ) { m_zMomentum = momentumZ; }
89 void setDriftDistance( double driftDistance ) { m_driftDistance = driftDistance; }
90 void setDepositEnergy( double depositEnergy ) { m_depositEnergy = depositEnergy; }
91 void setPositionFlag( int posFlag ) { m_posFlag = posFlag; }
92 void setFlightLength( double flightLength ) { m_flightLength = flightLength; }
93 void setCreatorProcess( std::string creatorProcess ) {
94 m_creatorProcess = creatorProcess;
95 };
96 void setDigiIdx( int id ) { m_digi_id = id; };
97
98 private:
99 MdcMcHit( const MdcMcHit& );
100
101 MdcMcHit& operator=( const MdcMcHit& );
102
103 // const Identifier m_id;
104 Identifier m_id;
105
106 unsigned int m_trackIndex{ 0 };
107
108 int m_currentTrackPID{ 0 };
109
110 int m_isSecondary{ 0 };
111
112 // poca position on track
113 double m_xPosition{ 0 };
114
115 double m_yPosition{ 0 };
116
117 double m_zPosition{ 0 };
118
119 // poca momenutm on track
120 double m_xMomentum{ 0 };
121
122 double m_yMomentum{ 0 };
123
124 double m_zMomentum{ 0 };
125
126 double m_driftDistance{ 0 }; // doca
127
128 double m_depositEnergy{ 0 };
129
130 int m_posFlag{ 0 }; // left right ambiguity flag
131
132 double m_flightLength{ 0 }; // from vertex
133
134 std::string m_creatorProcess{ "" }; /* Name of the generation process */
135 int m_digi_id{ 0 }; // positve: contribute to both time and charge, negative: only charge
136 };
137
138 typedef ObjectVector<MdcMcHit> MdcMcHitCol;
139
140} // NameSpace Event
141
142#endif
const CLID & CLID_MdcMcHit
double getPositionZ() const
Definition MdcMcHit.cxx:47
int getPositionFlag() const
Definition MdcMcHit.cxx:56
double getDepositEnergy() const
Definition MdcMcHit.cxx:53
virtual const CLID & clID() const
unsigned int getTrackIndex() const
Definition MdcMcHit.cxx:38
void setFlightLength(double flightLength)
void setDepositEnergy(double depositEnergy)
double getDriftDistance() const
Definition MdcMcHit.cxx:50
double getPositionX() const
Definition MdcMcHit.cxx:41
void setTrackIndex(unsigned int trackIndex)
void setCurrentTrackPID(int currentTrackPID)
Identifier identify() const
Definition MdcMcHit.cxx:35
void setCreatorProcess(std::string creatorProcess)
void setDriftDistance(double driftDistance)
double getPositionY() const
Definition MdcMcHit.cxx:44
ObjectVector< MdcMcHit > MdcMcHitCol