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