BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/McTruth/include/McTruth/McPrimaryParticle.h
Go to the documentation of this file.
1/**
2 * @class McPrimaryParticle
3 *
4 *
5 */
6
7#ifndef McPrimaryParticle_h
8#define McPrimaryParticle_h
9
10#include "EventModel/EventModel.h"
11#include "GaudiKernel/ContainedObject.h"
12#include "GaudiKernel/SmartRefVector.h"
13#include "McTruth/McParticle.h"
14
15using namespace EventModel;
16extern const CLID& CLID_McPrimaryParticle;
17
18namespace Event {
19
20 typedef SmartRefVector<Event::McParticle> McParticleRefVec;
21 typedef SmartRef<Event::McParticle> McParticleRef;
22
23 class McPrimaryParticle : public ContainedObject {
24 public:
25 //! Define bits to help classify the event
27 NOPRIMARY = 1, //! No primary particle found (can't happen?)
28 CHARGED = 1 << 1, //! Primary particle is charged
29 NEUTRAL = 1 << 2, //! Primary particle is neutral
30 GAMMA = 1 << 3, //! Primary is a gamma
31 CONVERT = 1 << 4, //! Secondaries from gamma conversion
32 BREM = 1 << 5, //! Secondaries from Bremstrahlung
33 COMPT = 1 << 6, //! Secondaries from Compton scatter
34 PHOT = 1 << 7, //! Secondaries from Photoelectric effect (?)
35 OTHER = 1 << 8, //! Secondaries from some other process
36 TRKCONVERT = 1 << 12, //! Secondaries from gamma conversion in tracker
37 TRKBREM = 1 << 13, //! Secondaries from Bremstrahlung in tracker
38 TRKCOMPT = 1 << 14, //! Secondaries from Compton scatter in tracker
39 TRKPHOT = 1 << 15, //! Secondaries from Photoelectric effect in tracker
40 TRKOTHER = 1 << 16, //! Secondaries from some other process in tracker
41 RUNBIT = 1 << 24 //! Indicates code was called (does nothing)
42 };
43
44 //! Dataobject compliant constructor
45 McPrimaryParticle() : ContainedObject() {
46 m_classification = 0;
47 m_primary = 0;
48 m_secondaries.clear();
49 m_associated.clear();
50 }
51
52 // McPrimaryParticle(Event::McParticle* mcPart, unsigned long classBits);
54
55 virtual const CLID& clID() const { return McPrimaryParticle::classID(); }
56 static const CLID& classID() { return CLID_McPrimaryParticle; }
57
58 //! Retrieve classification bits (see above definitions)
59 const unsigned long getClassificationBits() const { return m_classification; }
60
61 //! Retrieve reference to the primary particle
62 const Event::McParticleRef getPrimaryParticle() const { return m_primary; }
63
64 //! Retrieve number and iterators to the daughters of the primary with hits in tracker
65 const int getNumSecondaries() const { return m_secondaries.size(); }
66 Event::McParticleRefVec::const_iterator beginSecondaries() const {
67 return m_secondaries.begin();
68 }
69 Event::McParticleRefVec::const_iterator endSecondaries() const {
70 return m_secondaries.end();
71 }
72
73 //! Retrieve number and iterators to the particles associated with primary
74 const int getNumAssociated() const { return m_associated.size(); }
75 Event::McParticleRefVec::const_iterator beginAssociated() const {
76 return m_associated.begin();
77 }
78 Event::McParticleRefVec::const_iterator endAssociated() const {
79 return m_associated.end();
80 }
81
82 //! Return an McParticle reference vector of all McParticles which leave hits in tracker
83 // inline Event::McParticleRefVec getTrackVector();
84
85 //! For building
86 void setPrimaryParticle( const Event::McParticleRef mcPart ) { m_primary = mcPart; }
87 void addSecondary( const Event::McParticleRef mcPart ) {
88 m_secondaries.push_back( mcPart );
89 }
90 void addAssociated( const Event::McParticleRef mcPart ) {
91 m_associated.push_back( mcPart );
92 }
93 void setClassificationBits( const unsigned long bits ) { m_classification |= bits; }
94
95 private:
96 /// Bit-field for classification
97 unsigned long m_classification;
98
99 Event::McParticleRef m_primary;
100 Event::McParticleRefVec m_secondaries;
101 Event::McParticleRefVec m_associated;
102 };
103
104 typedef ObjectVector<McPrimaryParticle> McPrimaryParticleCol;
105
106} // NameSpace Event
107
108#endif
const CLID & CLID_McPrimaryParticle
void addSecondary(const Event::McParticleRef mcPart)
const Event::McParticleRef getPrimaryParticle() const
Retrieve reference to the primary particle.
Event::McParticleRefVec::const_iterator endSecondaries() const
void addAssociated(const Event::McParticleRef mcPart)
const int getNumSecondaries() const
Retrieve number and iterators to the daughters of the primary with hits in tracker.
ClassificationBits
Define bits to help classify the event.
@ RUNBIT
Secondaries from some other process in tracker.
@ TRKCONVERT
Secondaries from some other process.
@ TRKOTHER
Secondaries from Photoelectric effect in tracker.
@ TRKCOMPT
Secondaries from Bremstrahlung in tracker.
@ TRKPHOT
Secondaries from Compton scatter in tracker.
@ TRKBREM
Secondaries from gamma conversion in tracker.
@ OTHER
Secondaries from Photoelectric effect (?).
@ CHARGED
No primary particle found (can't happen?).
Event::McParticleRefVec::const_iterator endAssociated() const
const int getNumAssociated() const
Retrieve number and iterators to the particles associated with primary.
void setPrimaryParticle(const Event::McParticleRef mcPart)
Return an McParticle reference vector of all McParticles which leave hits in tracker.
const unsigned long getClassificationBits() const
Retrieve classification bits (see above definitions).
Event::McParticleRefVec::const_iterator beginSecondaries() const
Event::McParticleRefVec::const_iterator beginAssociated() const
SmartRef< Event::McParticle > McParticleRef
ObjectVector< McPrimaryParticle > McPrimaryParticleCol
SmartRefVector< Event::McParticle > McParticleRefVec