1 |
#ifndef SimDataFormats_TrackingVertex_h
|
2 |
#define SimDataFormats_TrackingVertex_h
|
3 |
|
4 |
/** \class TrackingVertex
|
5 |
*
|
6 |
* A simulated Vertex with links to TrackingParticles
|
7 |
* for analysis of track and vertex reconstruction
|
8 |
*
|
9 |
* \version $Id: TrackingVertex.h,v 1.26 2008/12/11 23:03:08 bazterra Exp $
|
10 |
*
|
11 |
*/
|
12 |
|
13 |
#include "DataFormats/Common/interface/RefVector.h"
|
14 |
#include "DataFormats/Math/interface/LorentzVector.h"
|
15 |
#include "DataFormats/Math/interface/Point3D.h"
|
16 |
|
17 |
#include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
|
18 |
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
|
19 |
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
|
20 |
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
|
21 |
#include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
|
22 |
|
23 |
class TrackingVertex
|
24 |
{
|
25 |
|
26 |
friend std::ostream& operator<< (std::ostream& s, const TrackingVertex & tv);
|
27 |
|
28 |
public:
|
29 |
|
30 |
typedef edm::RefVector<edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector;
|
31 |
typedef edm::Ref<edm::HepMCProduct, HepMC::GenVertex > GenVertexRef;
|
32 |
typedef math::XYZTLorentzVectorD LorentzVector;
|
33 |
typedef GenVertexRefVector::iterator genv_iterator;
|
34 |
typedef std::vector<SimVertex>::const_iterator g4v_iterator;
|
35 |
typedef TrackingParticleRefVector::iterator tp_iterator;
|
36 |
|
37 |
// Default constructor and constructor from values
|
38 |
TrackingVertex();
|
39 |
TrackingVertex(const LorentzVector &position, const bool inVolume,
|
40 |
const EncodedEventId e = EncodedEventId(0));
|
41 |
|
42 |
// Setters
|
43 |
void setEventId(EncodedEventId e)
|
44 |
{
|
45 |
eId_=e;
|
46 |
};
|
47 |
|
48 |
// Track and vertex iterators
|
49 |
genv_iterator genVertices_begin() const; // Ref's to HepMC and Geant4
|
50 |
genv_iterator genVertices_end() const; // vertices associated with
|
51 |
g4v_iterator g4Vertices_begin() const; // this vertex, respectively
|
52 |
g4v_iterator g4Vertices_end() const; // ....
|
53 |
|
54 |
tp_iterator daughterTracks_begin() const; // Ref's to daughter and source
|
55 |
tp_iterator daughterTracks_end() const; // tracks associated with
|
56 |
tp_iterator sourceTracks_begin() const; // this vertex, respectively
|
57 |
tp_iterator sourceTracks_end() const; // ....
|
58 |
|
59 |
unsigned int nG4Vertices() const
|
60 |
{
|
61 |
return g4Vertices_.size();
|
62 |
};
|
63 |
unsigned int nGenVertices() const
|
64 |
{
|
65 |
return genVertices_.size();
|
66 |
};
|
67 |
unsigned int nDaughterTracks() const
|
68 |
{
|
69 |
return daughterTracks_.size();
|
70 |
};
|
71 |
unsigned int nSourceTracks() const
|
72 |
{
|
73 |
return sourceTracks_.size();
|
74 |
};
|
75 |
|
76 |
// Add references to TrackingParticles, Geant4, and HepMC vertices to containers
|
77 |
void addG4Vertex( const SimVertex& );
|
78 |
void addGenVertex( const GenVertexRef& );
|
79 |
void addDaughterTrack(const TrackingParticleRef&);
|
80 |
void addParentTrack( const TrackingParticleRef&);
|
81 |
void clearDaughterTracks();
|
82 |
void clearParentTracks();
|
83 |
|
84 |
// Getters for RefVectors
|
85 |
const std::vector<SimVertex>& g4Vertices() const;
|
86 |
const GenVertexRefVector& genVertices() const;
|
87 |
const TrackingParticleRefVector& sourceTracks() const;
|
88 |
const TrackingParticleRefVector& daughterTracks() const;
|
89 |
|
90 |
// Getters for other info
|
91 |
const LorentzVector& position() const
|
92 |
{
|
93 |
return position_;
|
94 |
};
|
95 |
const EncodedEventId& eventId() const
|
96 |
{
|
97 |
return eId_;
|
98 |
};
|
99 |
const bool inVolume() const
|
100 |
{
|
101 |
return inVolume_;
|
102 |
};
|
103 |
|
104 |
private:
|
105 |
|
106 |
LorentzVector position_; // Vertex position and time
|
107 |
bool inVolume_; // Is it inside tracker volume?
|
108 |
EncodedEventId eId_;
|
109 |
|
110 |
// References to G4 and generator vertices and TrackingParticles
|
111 |
|
112 |
std::vector<SimVertex> g4Vertices_;
|
113 |
GenVertexRefVector genVertices_;
|
114 |
TrackingParticleRefVector daughterTracks_;
|
115 |
TrackingParticleRefVector sourceTracks_;
|
116 |
};
|
117 |
|
118 |
#endif
|