ATLAS Offline Software
Loading...
Searching...
No Matches
VP1BPhysConvertor.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6
7
8#include <vector>
9#include <string>
10class TFile;
11class TTree;
12
13//vp1bphys tree branches
14class Br {
15
16 public:
17
19
20 //tree branches
21 //vertices
22 double vtx_x{}; //vtx position
23 double vtx_y{};
24 double vtx_z{};
25 double vtx_xx{}; //covariance matrix
26 double vtx_yy{};
27 double vtx_zz{};
28 double vtx_xy{};
29 double vtx_xz{};
30 double vtx_yz{};
31 int vtx_mother{}; //index of mother vertex
32 unsigned long vtx_color{}; //color of the vertex (for drawing)
33
34 //tracks
35 std::vector<double>* track_pt{}; //track parameters
36 std::vector<double>* track_eta{};
37 std::vector<double>* track_phi{};
38 std::vector<double>* track_d0{};
39 std::vector<double>* track_z0{};
40 std::vector<double>* track_charge{};
41 std::vector<double>* track_refitted_px{}; //refitted momentum
42 std::vector<double>* track_refitted_py{};
43 std::vector<double>* track_refitted_pz{};
44 std::vector<unsigned long>* track_color{}; //track color
45 std::vector<unsigned long>* track_refitted_color{}; //refitted momentum color
46
47 //neutral tracks
48 std::vector<double>* neutral_refitted_px{}; //neutral track momentum
49 std::vector<double>* neutral_refitted_py{};
50 std::vector<double>* neutral_refitted_pz{};
51 std::vector<double>* neutral_length{}; //length of the track
52 std::vector<int>* neutral_decay{}; //decay vertex
53 std::vector<unsigned long>* neutral_color{}; //track color
54
55 private:
56
57 void copy(Br* br); //copy branches
58
59};
60
61class VertexNode : public Br {
62
63 public:
66
69
70 void setVtxPosition(double x, double y, double z);
71 void setVtxError(double xx, double xy, double xz, double yy, double yz, double zz);
72 void setVtxColor(unsigned long color);
73 void addTrack(double px, double py, double pz, double d0, double z0, double charge, unsigned long color,
74 double refPx, double refPy, double refPz,
75 unsigned long refColor);
76 void addTrackPtEtaPhi(double pt, double eta, double phi, double d0, double z0, double charge, unsigned long color,
77 double refPx, double refPy, double refPz,
78 unsigned long refColor);
79 void addNeutralTrack(double px, double py, double pz, unsigned long color);
80
81 //inline methods
82 const std::vector<VertexNode*>& getDaughters() { return m_daughters; }
83
84 private:
85 void init();
86
88 std::vector<VertexNode*> m_daughters{};
89};
90
91class VP1BPhysConvertor : public Br {
92
93 public:
94 VP1BPhysConvertor(VertexNode* decayTopology, const std::string & outFile);
98 void fill(int run, int evt);
99 void save();
100
101 private:
102 void initBranches(); //initialize branches
103 void clear();
107
109 TFile* m_outFile{};
110 TTree* m_tree{};
111 int evtNum{};
112 int runNum{};
113 std::vector<int>* vtx_daughters{}; //daughter vertices
114 int m_entry{};
115};
116
117unsigned long getColor(unsigned int r, unsigned int g, unsigned int b);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double charge(const T &p)
Definition AtlasPID.h:997
#define y
#define x
#define z
unsigned long getColor(unsigned int r, unsigned int g, unsigned int b)
std::vector< double > * neutral_refitted_px
std::vector< double > * track_refitted_pz
std::vector< double > * neutral_refitted_pz
double vtx_xy
double vtx_x
std::vector< unsigned long > * neutral_color
double vtx_xz
void copy(Br *br)
double vtx_z
int vtx_mother
double vtx_xx
std::vector< double > * track_d0
unsigned long vtx_color
std::vector< double > * track_phi
double vtx_y
std::vector< double > * track_pt
std::vector< double > * track_refitted_px
std::vector< double > * neutral_refitted_py
std::vector< double > * track_refitted_py
std::vector< double > * track_charge
std::vector< double > * neutral_length
std::vector< double > * track_eta
double vtx_yz
std::vector< double > * track_z0
std::vector< unsigned long > * track_refitted_color
void clearBranches()
std::vector< int > * neutral_decay
std::vector< unsigned long > * track_color
double vtx_zz
double vtx_yy
std::vector< int > * vtx_daughters
void fill(int run, int evt)
void clear(VertexNode *node)
VP1BPhysConvertor(VertexNode *decayTopology, const std::string &outFile)
int count(VertexNode *node)
VP1BPhysConvertor(const VP1BPhysConvertor &)=delete
void fill(VertexNode *node)
VP1BPhysConvertor & operator=(const VP1BPhysConvertor &)=delete
VertexNode * m_decayTopology
void addTrack(double px, double py, double pz, double d0, double z0, double charge, unsigned long color, double refPx, double refPy, double refPz, unsigned long refColor)
void addTrackPtEtaPhi(double pt, double eta, double phi, double d0, double z0, double charge, unsigned long color, double refPx, double refPy, double refPz, unsigned long refColor)
VertexNode(VertexNode *mother)
void init()
void addNeutralTrack(double px, double py, double pz, unsigned long color)
const std::vector< VertexNode * > & getDaughters()
void setVtxError(double xx, double xy, double xz, double yy, double yz, double zz)
VertexNode * m_mother
std::vector< VertexNode * > m_daughters
VertexNode * addDaughter()
void setVtxPosition(double x, double y, double z)
void setVtxColor(unsigned long color)
Definition node.h:24
int r
Definition globals.cxx:22
Definition run.py:1