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