Fixes for bug #52499: Field polarities inconsistiency
[u/mrichter/AliRoot.git] / STEER / AliGenPythiaEventHeader.cxx
CommitLineData
2ca8bd8b 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"
19ClassImp(AliGenPythiaEventHeader)
20
21
22AliGenPythiaEventHeader::AliGenPythiaEventHeader():
23 fProcessType(0),
24 fTrials(0),
25 fNJets(0),
26 fNUQJets(0),
27 fXJet(-1.),
28 fYJet(-1.),
8c755c03 29 fInMediumLength(0.),
e6fe9b82 30 fImpactParameter(-1),
2ca8bd8b 31 fPtHard(0.)
32{
33// Default Constructor
34 for (Int_t i = 0; i < 4; i++) fZquench[i] = 0.;
9b84f41c 35 for (Int_t i = 0; i < 4; i++)
36 for (Int_t j = 0; j < 10; j++) {
37 fJets[i][j] = 0.;
38 fUQJets[i][j] = 0.;
39 }
2ca8bd8b 40}
41
42AliGenPythiaEventHeader::AliGenPythiaEventHeader(const char* name):
43 AliGenEventHeader(name),
44 fProcessType(0),
45 fTrials(0),
46 fNJets(0),
47 fNUQJets(0),
48 fXJet(-1.),
49 fYJet(-1.),
8c755c03 50 fInMediumLength(0.),
e6fe9b82 51 fImpactParameter(-1),
2ca8bd8b 52 fPtHard(0.)
53{
54// Constructor
55 for (Int_t i = 0; i < 4; i++) fZquench[i] = 0.;
9b84f41c 56 for (Int_t i = 0; i < 4; i++)
57 for (Int_t j = 0; j < 10; j++) {
58 fJets[i][j] = 0.;
59 fUQJets[i][j] = 0.;
60 }
2ca8bd8b 61}
62
63void AliGenPythiaEventHeader::AddJet(Float_t px, Float_t py, Float_t pz, Float_t e)
64{
65//
66// Add a jet
67//
68 if (fNJets < 10) {
69 fJets[0][fNJets] = px;
70 fJets[1][fNJets] = py;
71 fJets[2][fNJets] = pz;
72 fJets[3][fNJets] = e;
73 fNJets++;
74 } else {
75 printf("\nWarning: More than 10 jets triggered !!\n");
76 }
77}
78
79void AliGenPythiaEventHeader::AddUQJet(Float_t px, Float_t py, Float_t pz, Float_t e)
80{
81//
82// Add a jet
83//
84 if (fNUQJets < 10) {
85 fUQJets[0][fNUQJets] = px;
86 fUQJets[1][fNUQJets] = py;
87 fUQJets[2][fNUQJets] = pz;
88 fUQJets[3][fNUQJets] = e;
89 fNUQJets++;
90 } else {
91 printf("\nWarning: More than 10 jets triggered !!\n");
92 }
93}
94
95void AliGenPythiaEventHeader::SetZQuench(Double_t z[4])
96{
97 //
98 // Set quenching fraction
99 //
100 for (Int_t i = 0; i < 4; i++) fZquench[i] = z[i];
101}
102
103void AliGenPythiaEventHeader::GetZQuench(Double_t z[4])
104{
105 //
106 // Get quenching fraction
107 //
108 for (Int_t i = 0; i < 4; i++) z[i] = fZquench[i];
109}
110
111void AliGenPythiaEventHeader::TriggerJet(Int_t i, Float_t p[4])
112{
113//
114// Give back jet #i
115//
116 if (i >= fNJets) {
117 printf("\nWarning: TriggerJet, index out of Range!!\n");
118 } else {
119 p[0] = fJets[0][i];
120 p[1] = fJets[1][i];
121 p[2] = fJets[2][i];
122 p[3] = fJets[3][i];
123 }
124}
125
126void AliGenPythiaEventHeader::UQJet(Int_t i, Float_t p[4])
127{
128//
129// Give back jet #i
130//
131 if (i >= fNUQJets) {
132 printf("\nWarning: Unquenched Jets, index out of Range!!\n");
133 } else {
134 p[0] = fUQJets[0][i];
135 p[1] = fUQJets[1][i];
136 p[2] = fUQJets[2][i];
137 p[3] = fUQJets[3][i];
138 }
139}
140
141void AliGenPythiaEventHeader::SetXYJet(Double_t x, Double_t y)
142{
143
144//
145// Add jet production point
146//
147 fXJet = x;
148 fYJet = y;
149}