]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/AliAODHeader.h
Fixing leak
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODHeader.h
CommitLineData
77f43bb7 1#ifndef ALIAODHEADER_H
2#define ALIAODHEADER_H
df9db588 3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//-------------------------------------------------------------------------
9ae2e5e6 9// AOD event header class
df9db588 10// Author: Markus Oldenburg, CERN
11//-------------------------------------------------------------------------
12
9ae2e5e6 13#include "AliVHeader.h"
df9db588 14#include "AliAODVertex.h"
a5f7aba4 15#include <TString.h>
f1c1d7c6 16#include "AliCentrality.h"
ce7adfe9 17#include "AliEventplane.h"
df9db588 18
1aa76f71 19class TGeoHMatrix;
27346f69 20class TString;
1aa76f71 21
f1c1d7c6 22
9ae2e5e6 23class AliAODHeader : public AliVHeader {
df9db588 24
25 public :
31fd97b2 26 AliAODHeader();
df9db588 27
abfce367 28 AliAODHeader(Int_t nRun, UShort_t nBunchX, UInt_t nOrbit, UInt_t nPeriod, const Char_t *title="");
31fd97b2 29 AliAODHeader(Int_t nRun,
30 UShort_t nBunchX,
31 UInt_t nOrbit,
89cf15db 32 UInt_t nPeriod,
31fd97b2 33 Int_t refMult,
34 Int_t refMultPos,
35 Int_t refMultNeg,
36 Double_t magField,
6b6f8d32 37 Double_t muonMagFieldScale,
38 Double_t cent,
ce7adfe9 39 Double_t eventplane,
6b6f8d32 40 Double_t n1Energy,
41 Double_t p1Energy,
42 Double_t n2Energy,
43 Double_t p2Energy,
a85132e7 44 Double_t *emEnergy,
31fd97b2 45 ULong64_t fTriggerMask,
46 UChar_t fTriggerCluster,
47 UInt_t fEventType,
5e14e698 48 const Float_t *vzeroEqFactors,
fa8b0e56 49 const Char_t *title="",
50 Int_t nMuons=0,
51 Int_t nDimuons=0);
31fd97b2 52
df9db588 53 virtual ~AliAODHeader();
54 AliAODHeader(const AliAODHeader& evt);
55 AliAODHeader& operator=(const AliAODHeader& evt);
a5f7aba4 56
57 Int_t GetRunNumber() const { return fRunNumber;}
58 Int_t GetEventNumberESDFile() const { return fEventNumberESDFile;}
31fd97b2 59 UShort_t GetBunchCrossNumber() const { return fBunchCrossNumber; }
60 UInt_t GetOrbitNumber() const { return fOrbitNumber; }
89cf15db 61 UInt_t GetPeriodNumber() const { return fPeriodNumber; }
df9db588 62 ULong64_t GetTriggerMask() const { return fTriggerMask; }
63 UChar_t GetTriggerCluster() const { return fTriggerCluster; }
27346f69 64 TString GetFiredTriggerClasses()const { return fFiredTriggers;}
df9db588 65 UInt_t GetEventType() const { return fEventType; }
66 Double_t GetMagneticField() const { return fMagneticField; }
6b6f8d32 67 Double_t GetMuonMagFieldScale() const { return fMuonMagFieldScale; }
68
df9db588 69 Double_t GetCentrality() const { return fCentrality; }
ce7adfe9 70 Double_t GetEventplane() const { return fEventplane; }
6b6f8d32 71 Double_t GetZDCN1Energy() const { return fZDCN1Energy; }
72 Double_t GetZDCP1Energy() const { return fZDCP1Energy; }
73 Double_t GetZDCN2Energy() const { return fZDCN2Energy; }
74 Double_t GetZDCP2Energy() const { return fZDCP2Energy; }
a85132e7 75 Double_t GetZDCEMEnergy(Int_t i) const { return fZDCEMEnergy[i]; }
df9db588 76 Int_t GetRefMultiplicity() const { return fRefMult; }
77 Int_t GetRefMultiplicityPos() const { return fRefMultPos; }
78 Int_t GetRefMultiplicityNeg() const { return fRefMultNeg; }
fa8b0e56 79 Int_t GetNumberOfMuons() const { return fNMuons; }
80 Int_t GetNumberOfDimuons() const { return fNDimuons; }
ff254193 81
82 Double_t GetQTheta(UInt_t i) const;
83 UInt_t GetNQTheta() const { return (UInt_t)fNQTheta; }
613fc341 84
85 Double_t GetDiamondX() const {return fDiamondXY[0];}
86 Double_t GetDiamondY() const {return fDiamondXY[1];}
49fc2e2c 87 Double_t GetDiamondZ() const {return fDiamondZ;}
613fc341 88 Double_t GetSigma2DiamondX() const {return fDiamondCovXY[0];}
89 Double_t GetSigma2DiamondY() const {return fDiamondCovXY[2];}
49fc2e2c 90 Double_t GetSigma2DiamondZ() const {return fDiamondSig2Z;}
613fc341 91 void GetDiamondCovXY(Float_t cov[3]) const {
92 for(Int_t i=0;i<3;i++) cov[i]=fDiamondCovXY[i]; return;
93 }
a5f7aba4 94 UInt_t GetL0TriggerInputs() const {return fL0TriggerInputs;}
95 UInt_t GetL1TriggerInputs() const {return fL1TriggerInputs;}
96 UShort_t GetL2TriggerInputs() const {return fL2TriggerInputs;}
f1c1d7c6 97 AliCentrality* GetCentralityP() const { return fCentralityP; }
ce7adfe9 98 AliEventplane* GetEventplaneP() const { return fEventplaneP; }
a5f7aba4 99
6b6f8d32 100
df9db588 101 void SetRunNumber(Int_t nRun) { fRunNumber = nRun; }
a5f7aba4 102 void SetEventNumberESDFile(Int_t n) { fEventNumberESDFile=n; }
31fd97b2 103 void SetBunchCrossNumber(UShort_t nBx) { fBunchCrossNumber = nBx; }
9ae2e5e6 104 void SetOrbitNumber(UInt_t nOr) { fOrbitNumber = nOr; }
105 void SetPeriodNumber(UInt_t nPer) { fPeriodNumber = nPer; }
df9db588 106 void SetTriggerMask(ULong64_t trigMsk) { fTriggerMask = trigMsk; }
27346f69 107 void SetFiredTriggerClasses(TString trig) { fFiredTriggers = trig;}
df9db588 108 void SetTriggerCluster(UChar_t trigClus) { fTriggerCluster = trigClus; }
109 void SetEventType(UInt_t evttype) { fEventType = evttype; }
110 void SetMagneticField(Double_t magFld) { fMagneticField = magFld; }
6b6f8d32 111 void SetMuonMagFieldScale(Double_t magFldScl){ fMuonMagFieldScale = magFldScl; }
77f43bb7 112 void SetCentrality(const AliCentrality* cent);
ce7adfe9 113 void SetEventplane(AliEventplane* eventplane);
6b6f8d32 114 void SetZDCN1Energy(Double_t n1Energy) { fZDCN1Energy = n1Energy; }
115 void SetZDCP1Energy(Double_t p1Energy) { fZDCP1Energy = p1Energy; }
116 void SetZDCN2Energy(Double_t n2Energy) { fZDCN2Energy = n2Energy; }
117 void SetZDCP2Energy(Double_t p2Energy) { fZDCP2Energy = p2Energy; }
a85132e7 118 void SetZDCEMEnergy(Double_t emEnergy1, Double_t emEnergy2)
119 { fZDCEMEnergy[0] = emEnergy1; fZDCEMEnergy[1] = emEnergy2;}
df9db588 120 void SetRefMultiplicity(Int_t refMult) { fRefMult = refMult; }
121 void SetRefMultiplicityPos(Int_t refMultPos) { fRefMultPos = refMultPos; }
122 void SetRefMultiplicityNeg(Int_t refMultNeg) { fRefMultNeg = refMultNeg; }
fa8b0e56 123 void SetNumberOfMuons(Int_t nMuons) { fNMuons = nMuons; }
124 void SetNumberOfDimuons(Int_t nDimuons) { fNDimuons = nDimuons; }
6b6f8d32 125
ff254193 126 void SetQTheta(Double_t *QTheta, UInt_t size = 5);
127 void RemoveQTheta();
128
613fc341 129 void SetDiamond(Float_t xy[2],Float_t cov[3]) {
11becff8 130 for(Int_t i=0;i<3;i++) {fDiamondCovXY[i] = cov[i];}
131 for(Int_t i=0;i<2;i++) {fDiamondXY[i] = xy[i] ;}
613fc341 132 }
49fc2e2c 133 void SetDiamondZ(Float_t z, Float_t sig2z){
134 fDiamondZ=z; fDiamondSig2Z=sig2z;
135 }
a5f7aba4 136 void SetL0TriggerInputs(UInt_t n) {fL0TriggerInputs=n;}
137 void SetL1TriggerInputs(UInt_t n) {fL1TriggerInputs=n;}
138 void SetL2TriggerInputs(UShort_t n) {fL2TriggerInputs=n;}
139 void SetESDFileName(TString name) {fESDFileName = name;}
df9db588 140 void Print(Option_t* option = "") const;
1aa76f71 141
142 void SetPHOSMatrix(TGeoHMatrix*matrix, Int_t i) {
143 if ((i >= 0) && (i < kNPHOSMatrix)) fPHOSMatrix[i] = matrix;
144 }
145 const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {
146 return ((i >= 0) && (i < kNPHOSMatrix)) ? fPHOSMatrix[i] : NULL;
147 }
6b6f8d32 148
1aa76f71 149 void SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {
150 if ((i >= 0) && (i < kNEMCALMatrix)) fEMCALMatrix[i] = matrix;
151 }
152 const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {
153 return ((i >= 0) && (i < kNEMCALMatrix)) ? fEMCALMatrix[i] : NULL;
154 }
155
0c6c629b 156 UInt_t GetOfflineTrigger() { return fOfflineTrigger; }
f7ce7a37 157 void SetOfflineTrigger(UInt_t trigger) { fOfflineTrigger = trigger; }
158 UInt_t GetNumberOfITSClusters(Int_t ilay) const {return fITSClusters[ilay];}
159 void SetITSClusters(Int_t ilay, UInt_t nclus);
160 Int_t GetTPConlyRefMultiplicity() const {return fTPConlyRefMult;}
161 void SetTPConlyRefMultiplicity(Int_t mult) {fTPConlyRefMult = mult;}
162
5e6a3170 163 TString GetESDFileName() const {return fESDFileName;}
99dbf027 164 void Clear(Option_t* = "");
1aa76f71 165 enum {kNPHOSMatrix = 5};
166 enum {kNEMCALMatrix = 12};
5e14e698 167
168 void SetVZEROEqFactors(const Float_t* factors) {
169 if (factors)
170 for (Int_t i = 0; i < 64; ++i) fVZEROEqFactors[i] = factors[i];}
171 const Float_t* GetVZEROEqFactors() const {return fVZEROEqFactors;}
172 Float_t GetVZEROEqFactors(Int_t i) const {return fVZEROEqFactors[i];}
6b6f8d32 173
df9db588 174 private :
6b6f8d32 175
176 Double32_t fMagneticField; // Solenoid Magnetic Field in kG
177 Double32_t fMuonMagFieldScale; // magnetic field scale of muon arm magnet
178 Double32_t fCentrality; // Centrality
ce7adfe9 179 Double32_t fEventplane; // Event plane angle
6b6f8d32 180 Double32_t fZDCN1Energy; // reconstructed energy in the neutron1 ZDC
181 Double32_t fZDCP1Energy; // reconstructed energy in the proton1 ZDC
182 Double32_t fZDCN2Energy; // reconstructed energy in the neutron2 ZDC
183 Double32_t fZDCP2Energy; // reconstructed energy in the proton2 ZDC
a85132e7 184 Double32_t fZDCEMEnergy[2]; // reconstructed energy in the electromagnetic ZDCs
ff254193 185 Int_t fNQTheta; // number of QTheta elements
186 Double32_t *fQTheta; // [fNQTheta] values to store Lee-Yang-Zeros
6b6f8d32 187 ULong64_t fTriggerMask; // Trigger Type (mask)
27346f69 188 TString fFiredTriggers; // String with fired triggers
6b6f8d32 189 Int_t fRunNumber; // Run Number
190 Int_t fRefMult; // reference multiplicity
191 Int_t fRefMultPos; // reference multiplicity of positive particles
192 Int_t fRefMultNeg; // reference multiplicity of negative particles
fa8b0e56 193 Int_t fNMuons; // number of muons in the forward spectrometer
194 Int_t fNDimuons; // number of dimuons in the forward spectrometer
9333290e 195 UInt_t fEventType; // Type of Event
196 UInt_t fOrbitNumber; // Orbit Number
197 UInt_t fPeriodNumber; // Period Number
198 UShort_t fBunchCrossNumber; // BunchCrossingNumber
6b6f8d32 199 UChar_t fTriggerCluster; // Trigger cluster (mask)
613fc341 200 Double32_t fDiamondXY[2]; // Interaction diamond (x,y) in RUN
201 Double32_t fDiamondCovXY[3]; // Interaction diamond covariance (x,y) in RUN
49fc2e2c 202 Double32_t fDiamondZ; // Interaction diamond (z) in RUN
203 Double32_t fDiamondSig2Z; // Interaction diamond sigma^2 (z) in RUN
1aa76f71 204 TGeoHMatrix* fPHOSMatrix[kNPHOSMatrix]; //PHOS module position and orientation matrices
205 TGeoHMatrix* fEMCALMatrix[kNEMCALMatrix]; //EMCAL supermodule position and orientation matrices
0c6c629b 206 UInt_t fOfflineTrigger; // fired offline triggers for this event
a5f7aba4 207 TString fESDFileName; // ESD file name to which this event belongs
208 Int_t fEventNumberESDFile; // Event number in ESD file
209 UInt_t fL0TriggerInputs; // L0 Trigger Inputs (mask)
210 UInt_t fL1TriggerInputs; // L1 Trigger Inputs (mask)
211 UShort_t fL2TriggerInputs; // L2 Trigger Inputs (mask)
f7ce7a37 212 UInt_t fITSClusters[6]; // Number of ITS cluster per layer
213 Int_t fTPConlyRefMult; // Reference multiplicty for standard TPC only tracks
f1c1d7c6 214 AliCentrality* fCentralityP; // Pointer to full centrality information
ce7adfe9 215 AliEventplane* fEventplaneP; // Pointer to full event plane information
5e14e698 216 Float_t fVZEROEqFactors[64]; // V0 channel equalization factors for event-plane reconstruction
217 ClassDef(AliAODHeader, 17);
df9db588 218};
5e6a3170 219inline
77f43bb7 220void AliAODHeader::SetCentrality(const AliCentrality* cent) {
5e6a3170 221 if(cent){
222 if(fCentralityP)*fCentralityP = *cent;
223 else fCentralityP = new AliCentrality(*cent);
224 fCentrality = cent->GetCentralityPercentile("V0M");
225 }
226 else{
227 fCentrality = -999;
228 }
229}
ce7adfe9 230inline
231void AliAODHeader::SetEventplane(AliEventplane* eventplane) {
232 if(eventplane){
233 if(fEventplaneP)*fEventplaneP = *eventplane;
234 else fEventplaneP = new AliEventplane(*eventplane);
235 fEventplane = eventplane->GetEventplane("Q");
236 }
237 else{
238 fEventplane = -999;
239 }
240}
f7ce7a37 241
242inline
243void AliAODHeader::SetITSClusters(Int_t ilay, UInt_t nclus)
244{
245 if (ilay >= 0 && ilay < 6) fITSClusters[ilay] = nclus;
246}
247
248
df9db588 249#endif