ATLAS Offline Software
VP1BPhysConvertor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 
7 
8 #include <vector>
9 #include <string>
10 class TFile;
11 class TTree;
12 
13 //vp1bphys tree branches
14 class Br {
15 
16  public:
17 
18  void clearBranches();
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 
61 class 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  std::vector<VertexNode*> getDaughters() { return m_daughters; }
83 
84  private:
85  void init();
86 
88  std::vector<VertexNode*> m_daughters{};
89 };
90 
91 class 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 
117 unsigned long getColor(unsigned int r, unsigned int g, unsigned int b);
Br::vtx_x
double vtx_x
Definition: VP1BPhysConvertor.h:22
Br::neutral_refitted_pz
std::vector< double > * neutral_refitted_pz
Definition: VP1BPhysConvertor.h:50
Br::vtx_xy
double vtx_xy
Definition: VP1BPhysConvertor.h:28
beamspotman.r
def r
Definition: beamspotman.py:676
VertexNode
Definition: VP1BPhysConvertor.h:61
Br::track_refitted_py
std::vector< double > * track_refitted_py
Definition: VP1BPhysConvertor.h:42
color
Definition: jFexInputByteStreamTool.cxx:25
VP1BPhysConvertor::operator=
VP1BPhysConvertor & operator=(const VP1BPhysConvertor &)=delete
VP1BPhysConvertor::save
void save()
test_pyathena.px
px
Definition: test_pyathena.py:18
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
Br::vtx_yz
double vtx_yz
Definition: VP1BPhysConvertor.h:30
PlotCalibFromCool.yy
yy
Definition: PlotCalibFromCool.py:714
Br::track_charge
std::vector< double > * track_charge
Definition: VP1BPhysConvertor.h:40
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Br::vtx_color
unsigned long vtx_color
Definition: VP1BPhysConvertor.h:32
Br::vtx_y
double vtx_y
Definition: VP1BPhysConvertor.h:23
VP1BPhysConvertor::fill
void fill(int run, int evt)
test_pyathena.pt
pt
Definition: test_pyathena.py:11
VP1BPhysConvertor::m_decayTopology
VertexNode * m_decayTopology
Definition: VP1BPhysConvertor.h:108
Br::track_z0
std::vector< double > * track_z0
Definition: VP1BPhysConvertor.h:39
Br::track_color
std::vector< unsigned long > * track_color
Definition: VP1BPhysConvertor.h:44
Br::track_refitted_pz
std::vector< double > * track_refitted_pz
Definition: VP1BPhysConvertor.h:43
VertexNode::m_mother
VertexNode * m_mother
Definition: VP1BPhysConvertor.h:87
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
Br::vtx_z
double vtx_z
Definition: VP1BPhysConvertor.h:24
VP1BPhysConvertor::m_outFile
TFile * m_outFile
Definition: VP1BPhysConvertor.h:109
VertexNode::addTrack
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)
VP1BPhysConvertor::fill
void fill(VertexNode *node)
VP1BPhysConvertor::VP1BPhysConvertor
VP1BPhysConvertor(const VP1BPhysConvertor &)=delete
x
#define x
VertexNode::m_daughters
std::vector< VertexNode * > m_daughters
Definition: VP1BPhysConvertor.h:88
Br::track_refitted_px
std::vector< double > * track_refitted_px
Definition: VP1BPhysConvertor.h:41
VP1BPhysConvertor::vtx_daughters
std::vector< int > * vtx_daughters
Definition: VP1BPhysConvertor.h:113
VP1BPhysConvertor::clear
void clear()
VertexNode::VertexNode
VertexNode()
VP1BPhysConvertor::VP1BPhysConvertor
VP1BPhysConvertor(VertexNode *decayTopology, const std::string &outFile)
Br
Definition: VP1BPhysConvertor.h:14
Br::vtx_mother
int vtx_mother
Definition: VP1BPhysConvertor.h:31
getColor
unsigned long getColor(unsigned int r, unsigned int g, unsigned int b)
Br::neutral_refitted_py
std::vector< double > * neutral_refitted_py
Definition: VP1BPhysConvertor.h:49
VP1BPhysConvertor
Definition: VP1BPhysConvertor.h:91
VertexNode::addDaughter
VertexNode * addDaughter()
VP1BPhysConvertor::count
int count(VertexNode *node)
Br::vtx_xz
double vtx_xz
Definition: VP1BPhysConvertor.h:29
z
#define z
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
Br::track_refitted_color
std::vector< unsigned long > * track_refitted_color
Definition: VP1BPhysConvertor.h:45
Br::neutral_decay
std::vector< int > * neutral_decay
Definition: VP1BPhysConvertor.h:52
VertexNode::init
void init()
Br::track_pt
std::vector< double > * track_pt
Definition: VP1BPhysConvertor.h:35
VertexNode::addTrackPtEtaPhi
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)
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
Br::vtx_zz
double vtx_zz
Definition: VP1BPhysConvertor.h:27
run
Definition: run.py:1
VertexNode::setVtxColor
void setVtxColor(unsigned long color)
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
VP1BPhysConvertor::runNum
int runNum
Definition: VP1BPhysConvertor.h:112
Br::neutral_refitted_px
std::vector< double > * neutral_refitted_px
Definition: VP1BPhysConvertor.h:48
DQPostProcessTest.outFile
outFile
Comment Out Those You do not wish to run.
Definition: DQPostProcessTest.py:37
Amg::py
@ py
Definition: GeoPrimitives.h:39
Br::clearBranches
void clearBranches()
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Br::track_phi
std::vector< double > * track_phi
Definition: VP1BPhysConvertor.h:37
Br::track_eta
std::vector< double > * track_eta
Definition: VP1BPhysConvertor.h:36
charge
double charge(const T &p)
Definition: AtlasPID.h:494
VertexNode::addNeutralTrack
void addNeutralTrack(double px, double py, double pz, unsigned long color)
VP1BPhysConvertor::m_tree
TTree * m_tree
Definition: VP1BPhysConvertor.h:110
Br::vtx_yy
double vtx_yy
Definition: VP1BPhysConvertor.h:26
Br::neutral_color
std::vector< unsigned long > * neutral_color
Definition: VP1BPhysConvertor.h:53
VP1BPhysConvertor::initBranches
void initBranches()
VertexNode::setVtxError
void setVtxError(double xx, double xy, double xz, double yy, double yz, double zz)
Br::track_d0
std::vector< double > * track_d0
Definition: VP1BPhysConvertor.h:38
VP1BPhysConvertor::m_entry
int m_entry
Definition: VP1BPhysConvertor.h:114
VertexNode::~VertexNode
~VertexNode()
y
#define y
VP1BPhysConvertor::evtNum
int evtNum
Definition: VP1BPhysConvertor.h:111
Br::vtx_xx
double vtx_xx
Definition: VP1BPhysConvertor.h:25
VP1BPhysConvertor::clear
void clear(VertexNode *node)
VertexNode::getDaughters
std::vector< VertexNode * > getDaughters()
Definition: VP1BPhysConvertor.h:82
VP1BPhysConvertor::~VP1BPhysConvertor
~VP1BPhysConvertor()
Definition: VP1BPhysConvertor.h:95
VertexNode::setVtxPosition
void setVtxPosition(double x, double y, double z)
VertexNode::VertexNode
VertexNode(VertexNode *mother)
node
Definition: memory_hooks-stdcmalloc.h:74
Br::neutral_length
std::vector< double > * neutral_length
Definition: VP1BPhysConvertor.h:51
Br::copy
void copy(Br *br)
PlotCalibFromCool.br
br
Definition: PlotCalibFromCool.py:355