BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/McTruth/include/McTruth/EmcMcHit.h
Go to the documentation of this file.
1#ifndef EmcMcHit_H
2#define EmcMcHit_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 <map>
9
10using namespace EventModel;
11extern const CLID& CLID_EmcMcHit;
12
13namespace Event { // NameSpace
14
15 class EmcMcHit : virtual public ContainedObject {
16 public:
17 virtual const CLID& clID() const { return EmcMcHit::classID(); }
18
19 static const CLID& classID() { return CLID_EmcMcHit; }
20 // Constructor
22 EmcMcHit( const Identifier& id, unsigned int trackIndex, double xPosition,
23 double yPosition, double zPosition, double px, double py, double pz,
24 double depositEnergy );
25
26 // Get
27 // Get associated id
28 Identifier identify() const;
29
30 // Get the associated track id
31 unsigned int getTrackIndex() const;
32
33 // Whether hit Emc
34 int getHitEmc() const;
35
36 // Get PDG code
37 int getPDGCode() const;
38
39 // Get PDG charge
40 double getPDGCharge() const;
41
42 // Get time
43 double getTime() const;
44
45 // Get the position x
46 double getPositionX() const;
47
48 // Get the position y
49 double getPositionY() const;
50
51 // Get the position z
52 double getPositionZ() const;
53
54 // Get momentum Px
55 double getPx() const;
56
57 // Get momentum Py
58 double getPy() const;
59
60 // Get momentum Pz
61 double getPz() const;
62
63 // Get the total deposited energy
64 double getDepositEnergy() const;
65
66 // Set
67 void setIdentifier( Identifier& id ) { m_id = id; }
68 void setHitEmc( int is ) { m_hitEmc = is; }
69 void setPDGCode( int code ) { m_PDGCode = code; }
70 void setPDGCharge( double charge ) { m_PDGCharge = charge; }
71 void setTime( double time ) { m_time = time; }
72 void setTrackIndex( unsigned int trackIndex ) { m_trackIndex = trackIndex; }
73 void setPositionX( double positionX ) { m_xPosition = positionX; }
74 void setPositionY( double positionY ) { m_yPosition = positionY; }
75 void setPositionZ( double positionZ ) { m_zPosition = positionZ; }
76 void setPx( double px ) { m_px = px; }
77 void setPy( double py ) { m_py = py; }
78 void setPz( double pz ) { m_pz = pz; }
79 void setDepositEnergy( double depositEnergy ) { m_depositEnergy = depositEnergy; }
80
81 // About hit map
82 std::map<Identifier, double>::const_iterator begin() const;
83 std::map<Identifier, double>::const_iterator end() const;
84 std::map<Identifier, double>::const_iterator find( Identifier& ) const;
85
86 unsigned int size() const;
87 std::map<Identifier, double> getHitMap() const;
88 void setHitMap( std::map<Identifier, double>& hitMap ) { m_hitMap = hitMap; }
89
90 private:
91 EmcMcHit( const EmcMcHit& );
92
93 EmcMcHit& operator=( const EmcMcHit& );
94
95 // const Identifier m_id; //2005/12/29 wensp modified
96
97 Identifier m_id;
98
99 unsigned int m_trackIndex;
100 // whether hit Emc
101 int m_hitEmc;
102 // particle ID
103 int m_PDGCode;
104 // particle charge;
105 double m_PDGCharge;
106 // hit crystal time or dead time
107 double m_time;
108
109 double m_xPosition;
110
111 double m_yPosition;
112
113 double m_zPosition;
114
115 double m_px;
116
117 double m_py;
118
119 double m_pz;
120
121 double m_depositEnergy;
122
123 std::map<Identifier, double> m_hitMap;
124 };
125
126 typedef ObjectVector<EmcMcHit> EmcMcHitCol;
127
128} // NameSpace Event
129
130#endif
Double_t time
const CLID & CLID_EmcMcHit
NTuple::Item< double > m_pz
Identifier identify() const
Definition EmcMcHit.cxx:23
std::map< Identifier, double > getHitMap() const
Definition EmcMcHit.cxx:75
double getPositionZ() const
Definition EmcMcHit.cxx:47
unsigned int size() const
Definition EmcMcHit.cxx:73
int getPDGCode() const
Definition EmcMcHit.cxx:32
void setDepositEnergy(double depositEnergy)
int getHitEmc() const
Definition EmcMcHit.cxx:29
std::map< Identifier, double >::const_iterator end() const
Definition EmcMcHit.cxx:65
void setHitMap(std::map< Identifier, double > &hitMap)
double getTime() const
Definition EmcMcHit.cxx:38
double getPx() const
Definition EmcMcHit.cxx:50
double getPDGCharge() const
Definition EmcMcHit.cxx:35
double getDepositEnergy() const
Definition EmcMcHit.cxx:59
void setTrackIndex(unsigned int trackIndex)
virtual const CLID & clID() const
double getPy() const
Definition EmcMcHit.cxx:53
std::map< Identifier, double >::const_iterator find(Identifier &) const
Definition EmcMcHit.cxx:69
double getPositionY() const
Definition EmcMcHit.cxx:44
double getPz() const
Definition EmcMcHit.cxx:56
std::map< Identifier, double >::const_iterator begin() const
Definition EmcMcHit.cxx:61
unsigned int getTrackIndex() const
Definition EmcMcHit.cxx:26
double getPositionX() const
Definition EmcMcHit.cxx:41
ObjectVector< EmcMcHit > EmcMcHitCol