]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGenBase/EvtStdHep.cxx
New plots for trending injector efficiencies (Melinda)
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtStdHep.cxx
CommitLineData
da0e9ce3 1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtStdHep.cc
12//
13// Description: Class produce the StdHep representation of the decay.
14//
15// Modification history:
16//
17// RYD March 11, 1998 Module created
18//
19//------------------------------------------------------------------------
20#include "EvtGenBase/EvtPatches.hh"
21
22#include <iostream>
23#include <iomanip>
24#include "EvtGenBase/EvtVector4R.hh"
25#include "EvtGenBase/EvtStdHep.hh"
26using namespace std;
27
28
29void EvtStdHep::init(){
30 _npart=0;
31}
32
33int EvtStdHep::getNPart(){
34 return _npart;
35}
36
37void EvtStdHep::createParticle(EvtVector4R p4,EvtVector4R x,int prntfirst,
38 int prntlast, int id){
39
40 _p4[_npart]=p4;
41 _x[_npart]=x;
42 _prntfirst[_npart]=prntfirst;
43 _prntlast[_npart]=prntlast;
44 _daugfirst[_npart]=-1;
45 _dauglast[_npart]=-1;
46 _id[_npart]=id;
47 _istat[_npart]=1;
48
49 //we also need to fix up the parents pointer to the daughter!
50
51 if (prntfirst>=0) {
52 int i;
53 for (i=prntfirst;i<=prntlast;i++){
54 _istat[i]=2;
55 if (_daugfirst[i]==-1) _daugfirst[i]=_npart;
56 if (_dauglast[i]<_npart) _dauglast[i]=_npart;
57 }
58
59 }
60
61 _npart++;
62
63}
64
65void EvtStdHep::translate(EvtVector4R d){
66
67 int i;
68 for(i=0;i<_npart;i++){
69 _x[i]+=d;
70 }
71
72}
73
74
75/*
76ostream& operator<<(ostream& s, const EvtStdHep& stdhep){
77
78 int w=s.width();
79 int p=s.precision();
80 std::ios::fmtflags f=s.flags();
81
82
83 s <<endl;
84 s << " N Id Ist M1 M2 DF DL px py pz E t x y z"<<endl;
85 int i;
86 for(i=0;i<stdhep._npart;i++){
87
88 s.width(3);
89 s<<i<<" ";
90 s.width(7);
91 s<<stdhep._id[i]<<" ";
92 s.width(3);
93 s<<stdhep._istat[i]<<" ";
94 s.width(4);
95 s<<stdhep._prntfirst[i]<<" ";
96 s.width(4);
97 s<<stdhep._prntlast[i]<<" ";
98 s.width(4);
99 s<<stdhep._daugfirst[i]<<" ";
100 s.width(4);
101 s<<stdhep._dauglast[i]<<" ";
102 s.width(7);
103 s.precision(4);
104 s<<setiosflags( ios::right|ios::fixed );
105 s<<stdhep._p4[i].get(1)<<" ";
106 s.width(7);
107 s.precision(4);
108 s<<setiosflags( ios::right|ios::fixed );
109 s<<stdhep._p4[i].get(2)<<" ";
110 s.width(7);
111 s.precision(4);
112 s<<setiosflags( ios::right|ios::fixed );
113 s<<stdhep._p4[i].get(3)<<" ";
114 s.width(7);
115 s.precision(4);
116 s<<setiosflags( ios::right|ios::fixed );
117 s<<stdhep._p4[i].get(0)<<" ";
118 s.width(7);
119 s.precision(4);
120 s<<setiosflags( ios::right|ios::fixed );
121 s<<stdhep._x[i].get(0)<<" ";
122 s.width(7);
123 s.precision(4);
124 s<<setiosflags( ios::right|ios::fixed );
125 s<<stdhep._x[i].get(1)<<" ";
126 s.width(7);
127 s.precision(4);
128 s<<setiosflags( ios::right|ios::fixed );
129 s<<stdhep._x[i].get(2)<<" ";
130 s.width(7);
131 s.precision(4);
132 s<<setiosflags( ios::right|ios::fixed );
133 s<<stdhep._x[i].get(3)<<endl;
134 s.width(0);
135 }
136
137 s<<endl;
138
139 s.width(w);
140 s.precision(p);
141 s.flags((std::ios::fmtflags)f);
142
143 return s;
144
145}
146
147*/