]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliGenPythiaEventHeader.cxx
For embedding: use AliESDEvent instead of AliESD (obsolete)
[u/mrichter/AliRoot.git] / STEER / AliGenPythiaEventHeader.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 #include "AliGenPythiaEventHeader.h"
19 ClassImp(AliGenPythiaEventHeader)
20
21
22 AliGenPythiaEventHeader::AliGenPythiaEventHeader():
23     fProcessType(0),
24     fTrials(0),
25     fNJets(0),
26     fNUQJets(0), 
27     fXJet(-1.),
28     fYJet(-1.),
29     fInMediumLength(0.),
30     fPtHard(0.) 
31 {
32 // Default Constructor
33     for (Int_t i = 0; i < 4; i++) fZquench[i] = 0.;
34     for (Int_t i = 0; i < 4; i++)
35       for (Int_t j = 0; j < 10; j++) {
36         fJets[i][j] = 0.;
37         fUQJets[i][j] = 0.;
38       }
39 }
40
41 AliGenPythiaEventHeader::AliGenPythiaEventHeader(const char* name):
42     AliGenEventHeader(name),
43     fProcessType(0),
44     fTrials(0),
45     fNJets(0),
46     fNUQJets(0), 
47     fXJet(-1.),
48     fYJet(-1.),
49     fInMediumLength(0.),
50     fPtHard(0.) 
51 {
52 // Constructor
53     for (Int_t i = 0; i < 4; i++) fZquench[i] = 0.;
54     for (Int_t i = 0; i < 4; i++)
55       for (Int_t j = 0; j < 10; j++) {
56         fJets[i][j] = 0.;
57         fUQJets[i][j] = 0.;
58       }
59 }
60
61 void AliGenPythiaEventHeader::AddJet(Float_t px, Float_t py, Float_t pz, Float_t e)
62 {
63 //
64 //  Add a jet 
65 //
66     if (fNJets < 10) {
67         fJets[0][fNJets] = px;
68         fJets[1][fNJets] = py;
69         fJets[2][fNJets] = pz;
70         fJets[3][fNJets] = e;
71         fNJets++;
72     } else {
73         printf("\nWarning: More than 10 jets triggered !!\n");
74     }
75 }
76
77 void AliGenPythiaEventHeader::AddUQJet(Float_t px, Float_t py, Float_t pz, Float_t e)
78 {
79 //
80 //  Add a jet 
81 //
82     if (fNUQJets < 10) {
83         fUQJets[0][fNUQJets] = px;
84         fUQJets[1][fNUQJets] = py;
85         fUQJets[2][fNUQJets] = pz;
86         fUQJets[3][fNUQJets] = e;
87         fNUQJets++;
88     } else {
89         printf("\nWarning: More than 10 jets triggered !!\n");
90     }
91 }
92
93 void AliGenPythiaEventHeader::SetZQuench(Double_t z[4])
94 {
95     //
96     // Set quenching fraction
97     //
98     for (Int_t i = 0; i < 4; i++) fZquench[i] = z[i];
99 }
100
101 void AliGenPythiaEventHeader::GetZQuench(Double_t z[4])
102 {
103     //
104     // Get quenching fraction
105     //
106     for (Int_t i = 0; i < 4; i++) z[i] = fZquench[i];
107 }
108
109 void AliGenPythiaEventHeader::TriggerJet(Int_t i, Float_t p[4])
110 {
111 //
112 // Give back jet #i
113 //
114     if (i >= fNJets) {
115         printf("\nWarning: TriggerJet, index out of Range!!\n");
116     } else {
117         p[0] = fJets[0][i];
118         p[1] = fJets[1][i];
119         p[2] = fJets[2][i];
120         p[3] = fJets[3][i];
121     }
122 }
123
124 void AliGenPythiaEventHeader::UQJet(Int_t i, Float_t p[4])
125 {
126 //
127 // Give back jet #i
128 //
129     if (i >= fNUQJets) {
130         printf("\nWarning: Unquenched Jets, index out of Range!!\n");
131     } else {
132         p[0] = fUQJets[0][i];
133         p[1] = fUQJets[1][i];
134         p[2] = fUQJets[2][i];
135         p[3] = fUQJets[3][i];
136     }
137 }
138
139 void AliGenPythiaEventHeader::SetXYJet(Double_t x, Double_t y)
140 {
141
142 //
143 //  Add jet production point
144 //
145     fXJet = x; 
146     fYJet = y; 
147 }