]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/AliAODHeader.h
Add comment about fixing the dependencies
[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
c7d82ff7 13#include <TVector2.h>
14
9ae2e5e6 15#include "AliVHeader.h"
a87bdc43 16#include "AliVAODHeader.h"
df9db588 17#include "AliAODVertex.h"
a5f7aba4 18#include <TString.h>
4ccebdba 19#include <TBits.h>
f1c1d7c6 20#include "AliCentrality.h"
ce7adfe9 21#include "AliEventplane.h"
df9db588 22
1aa76f71 23class TGeoHMatrix;
27346f69 24class TString;
1aa76f71 25
f1c1d7c6 26
a87bdc43 27class AliAODHeader : public AliVAODHeader {
df9db588 28
29 public :
31fd97b2 30 AliAODHeader();
df9db588 31
abfce367 32 AliAODHeader(Int_t nRun, UShort_t nBunchX, UInt_t nOrbit, UInt_t nPeriod, const Char_t *title="");
31fd97b2 33 AliAODHeader(Int_t nRun,
34 UShort_t nBunchX,
35 UInt_t nOrbit,
89cf15db 36 UInt_t nPeriod,
31fd97b2 37 Int_t refMult,
38 Int_t refMultPos,
39 Int_t refMultNeg,
e9f4e33d 40 Int_t refMultComb05,
41 Int_t refMultComb08,
31fd97b2 42 Double_t magField,
6b6f8d32 43 Double_t muonMagFieldScale,
44 Double_t cent,
ce7adfe9 45 Double_t eventplane,
6b6f8d32 46 Double_t n1Energy,
47 Double_t p1Energy,
48 Double_t n2Energy,
49 Double_t p2Energy,
a85132e7 50 Double_t *emEnergy,
31fd97b2 51 ULong64_t fTriggerMask,
52 UChar_t fTriggerCluster,
53 UInt_t fEventType,
5e14e698 54 const Float_t *vzeroEqFactors,
fa8b0e56 55 const Char_t *title="",
56 Int_t nMuons=0,
f7cc8591 57 Int_t nDimuons=0,
58 Int_t nGlobalMuons=0, // AU
59 Int_t nGlobalDimuons=0); // AU
31fd97b2 60
df9db588 61 virtual ~AliAODHeader();
62 AliAODHeader(const AliAODHeader& evt);
63 AliAODHeader& operator=(const AliAODHeader& evt);
127be208 64 Bool_t InitMagneticField() const;
a5f7aba4 65
66 Int_t GetRunNumber() const { return fRunNumber;}
67 Int_t GetEventNumberESDFile() const { return fEventNumberESDFile;}
ef7661fd 68 Int_t GetNumberOfESDTracks() const { return fNumberESDTracks;}
31fd97b2 69 UShort_t GetBunchCrossNumber() const { return fBunchCrossNumber; }
70 UInt_t GetOrbitNumber() const { return fOrbitNumber; }
89cf15db 71 UInt_t GetPeriodNumber() const { return fPeriodNumber; }
df9db588 72 ULong64_t GetTriggerMask() const { return fTriggerMask; }
73 UChar_t GetTriggerCluster() const { return fTriggerCluster; }
27346f69 74 TString GetFiredTriggerClasses()const { return fFiredTriggers;}
df9db588 75 UInt_t GetEventType() const { return fEventType; }
76 Double_t GetMagneticField() const { return fMagneticField; }
6b6f8d32 77 Double_t GetMuonMagFieldScale() const { return fMuonMagFieldScale; }
78
df9db588 79 Double_t GetCentrality() const { return fCentrality; }
ce7adfe9 80 Double_t GetEventplane() const { return fEventplane; }
a52246de 81 Double_t GetEventplaneMag() const { return fEventplaneMag; }
5a3b31b5 82 Double_t GetEventplaneQx() const { return fEventplaneQx; }
83 Double_t GetEventplaneQy() const { return fEventplaneQy; }
6b6f8d32 84 Double_t GetZDCN1Energy() const { return fZDCN1Energy; }
85 Double_t GetZDCP1Energy() const { return fZDCP1Energy; }
86 Double_t GetZDCN2Energy() const { return fZDCN2Energy; }
87 Double_t GetZDCP2Energy() const { return fZDCP2Energy; }
a85132e7 88 Double_t GetZDCEMEnergy(Int_t i) const { return fZDCEMEnergy[i]; }
df9db588 89 Int_t GetRefMultiplicity() const { return fRefMult; }
90 Int_t GetRefMultiplicityPos() const { return fRefMultPos; }
91 Int_t GetRefMultiplicityNeg() const { return fRefMultNeg; }
fa8b0e56 92 Int_t GetNumberOfMuons() const { return fNMuons; }
93 Int_t GetNumberOfDimuons() const { return fNDimuons; }
f7cc8591 94 Int_t GetNumberOfGlobalMuons() const { return fNGlobalMuons; } // AU
95 Int_t GetNumberOfGlobalDimuons() const { return fNGlobalDimuons; } // AU
e9f4e33d 96 Int_t GetRefMultiplicityComb05() const { return fRefMultComb05; }
97 Int_t GetRefMultiplicityComb08() const { return fRefMultComb08; }
ff254193 98
99 Double_t GetQTheta(UInt_t i) const;
100 UInt_t GetNQTheta() const { return (UInt_t)fNQTheta; }
613fc341 101
102 Double_t GetDiamondX() const {return fDiamondXY[0];}
103 Double_t GetDiamondY() const {return fDiamondXY[1];}
49fc2e2c 104 Double_t GetDiamondZ() const {return fDiamondZ;}
613fc341 105 Double_t GetSigma2DiamondX() const {return fDiamondCovXY[0];}
106 Double_t GetSigma2DiamondY() const {return fDiamondCovXY[2];}
49fc2e2c 107 Double_t GetSigma2DiamondZ() const {return fDiamondSig2Z;}
613fc341 108 void GetDiamondCovXY(Float_t cov[3]) const {
109 for(Int_t i=0;i<3;i++) cov[i]=fDiamondCovXY[i]; return;
110 }
a5f7aba4 111 UInt_t GetL0TriggerInputs() const {return fL0TriggerInputs;}
112 UInt_t GetL1TriggerInputs() const {return fL1TriggerInputs;}
113 UShort_t GetL2TriggerInputs() const {return fL2TriggerInputs;}
f1c1d7c6 114 AliCentrality* GetCentralityP() const { return fCentralityP; }
ce7adfe9 115 AliEventplane* GetEventplaneP() const { return fEventplaneP; }
a5f7aba4 116
6b6f8d32 117
df9db588 118 void SetRunNumber(Int_t nRun) { fRunNumber = nRun; }
a5f7aba4 119 void SetEventNumberESDFile(Int_t n) { fEventNumberESDFile=n; }
ef7661fd 120 void SetNumberOfESDTracks(Int_t n) { fNumberESDTracks=n; }
31fd97b2 121 void SetBunchCrossNumber(UShort_t nBx) { fBunchCrossNumber = nBx; }
9ae2e5e6 122 void SetOrbitNumber(UInt_t nOr) { fOrbitNumber = nOr; }
123 void SetPeriodNumber(UInt_t nPer) { fPeriodNumber = nPer; }
df9db588 124 void SetTriggerMask(ULong64_t trigMsk) { fTriggerMask = trigMsk; }
27346f69 125 void SetFiredTriggerClasses(TString trig) { fFiredTriggers = trig;}
df9db588 126 void SetTriggerCluster(UChar_t trigClus) { fTriggerCluster = trigClus; }
127 void SetEventType(UInt_t evttype) { fEventType = evttype; }
128 void SetMagneticField(Double_t magFld) { fMagneticField = magFld; }
6b6f8d32 129 void SetMuonMagFieldScale(Double_t magFldScl){ fMuonMagFieldScale = magFldScl; }
77f43bb7 130 void SetCentrality(const AliCentrality* cent);
ce7adfe9 131 void SetEventplane(AliEventplane* eventplane);
6b6f8d32 132 void SetZDCN1Energy(Double_t n1Energy) { fZDCN1Energy = n1Energy; }
133 void SetZDCP1Energy(Double_t p1Energy) { fZDCP1Energy = p1Energy; }
134 void SetZDCN2Energy(Double_t n2Energy) { fZDCN2Energy = n2Energy; }
135 void SetZDCP2Energy(Double_t p2Energy) { fZDCP2Energy = p2Energy; }
a85132e7 136 void SetZDCEMEnergy(Double_t emEnergy1, Double_t emEnergy2)
137 { fZDCEMEnergy[0] = emEnergy1; fZDCEMEnergy[1] = emEnergy2;}
df9db588 138 void SetRefMultiplicity(Int_t refMult) { fRefMult = refMult; }
139 void SetRefMultiplicityPos(Int_t refMultPos) { fRefMultPos = refMultPos; }
140 void SetRefMultiplicityNeg(Int_t refMultNeg) { fRefMultNeg = refMultNeg; }
fa8b0e56 141 void SetNumberOfMuons(Int_t nMuons) { fNMuons = nMuons; }
142 void SetNumberOfDimuons(Int_t nDimuons) { fNDimuons = nDimuons; }
f7cc8591 143 void SetNumberOfGlobalMuons(Int_t nGlobalMuons) { fNGlobalMuons = nGlobalMuons; } // AU
144 void SetNumberOfGlobalDimuons(Int_t nGlobalDimuons) { fNGlobalDimuons = nGlobalDimuons; } // AU
e9f4e33d 145 void SetRefMultiplicityComb05(Int_t refMult) { fRefMultComb05 = refMult; }
146 void SetRefMultiplicityComb08(Int_t refMult) { fRefMultComb08 = refMult; }
147
ff254193 148 void SetQTheta(Double_t *QTheta, UInt_t size = 5);
149 void RemoveQTheta();
150
c7d82ff7 151 void ResetEventplanePointer();
152
613fc341 153 void SetDiamond(Float_t xy[2],Float_t cov[3]) {
11becff8 154 for(Int_t i=0;i<3;i++) {fDiamondCovXY[i] = cov[i];}
155 for(Int_t i=0;i<2;i++) {fDiamondXY[i] = xy[i] ;}
613fc341 156 }
49fc2e2c 157 void SetDiamondZ(Float_t z, Float_t sig2z){
158 fDiamondZ=z; fDiamondSig2Z=sig2z;
159 }
a5f7aba4 160 void SetL0TriggerInputs(UInt_t n) {fL0TriggerInputs=n;}
161 void SetL1TriggerInputs(UInt_t n) {fL1TriggerInputs=n;}
162 void SetL2TriggerInputs(UShort_t n) {fL2TriggerInputs=n;}
163 void SetESDFileName(TString name) {fESDFileName = name;}
df9db588 164 void Print(Option_t* option = "") const;
1aa76f71 165
166 void SetPHOSMatrix(TGeoHMatrix*matrix, Int_t i) {
167 if ((i >= 0) && (i < kNPHOSMatrix)) fPHOSMatrix[i] = matrix;
168 }
169 const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {
170 return ((i >= 0) && (i < kNPHOSMatrix)) ? fPHOSMatrix[i] : NULL;
171 }
6b6f8d32 172
1aa76f71 173 void SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {
174 if ((i >= 0) && (i < kNEMCALMatrix)) fEMCALMatrix[i] = matrix;
175 }
176 const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {
177 return ((i >= 0) && (i < kNEMCALMatrix)) ? fEMCALMatrix[i] : NULL;
178 }
179
0c6c629b 180 UInt_t GetOfflineTrigger() { return fOfflineTrigger; }
f7ce7a37 181 void SetOfflineTrigger(UInt_t trigger) { fOfflineTrigger = trigger; }
182 UInt_t GetNumberOfITSClusters(Int_t ilay) const {return fITSClusters[ilay];}
183 void SetITSClusters(Int_t ilay, UInt_t nclus);
184 Int_t GetTPConlyRefMultiplicity() const {return fTPConlyRefMult;}
185 void SetTPConlyRefMultiplicity(Int_t mult) {fTPConlyRefMult = mult;}
186
5e6a3170 187 TString GetESDFileName() const {return fESDFileName;}
99dbf027 188 void Clear(Option_t* = "");
1aa76f71 189 enum {kNPHOSMatrix = 5};
8cc543cb 190 enum {kNEMCALMatrix = 22};
949be341 191 enum {kT0SpreadSize = 4};
5e14e698 192
193 void SetVZEROEqFactors(const Float_t* factors) {
194 if (factors)
195 for (Int_t i = 0; i < 64; ++i) fVZEROEqFactors[i] = factors[i];}
196 const Float_t* GetVZEROEqFactors() const {return fVZEROEqFactors;}
197 Float_t GetVZEROEqFactors(Int_t i) const {return fVZEROEqFactors[i];}
949be341 198 Float_t GetT0spread(Int_t i) const {
199 return ((i >= 0) && (i<kT0SpreadSize)) ? fT0spread[i] : 0;}
200 void SetT0spread(Int_t i, Float_t t) {
201 if ((i>=0)&&(i<kT0SpreadSize)) fT0spread[i]=t;}
202
299994c6 203 Int_t FindIRIntInteractionsBXMap(Int_t difference) const;
4ccebdba 204 void SetIRInt2InteractionMap(TBits bits) { fIRInt2InteractionsMap = bits; }
205 void SetIRInt1InteractionMap(TBits bits) { fIRInt1InteractionsMap = bits; }
299994c6 206 TBits GetIRInt2InteractionMap() const { return fIRInt2InteractionsMap; }
207 TBits GetIRInt1InteractionMap() const { return fIRInt1InteractionsMap; }
208 Int_t GetIRInt2ClosestInteractionMap() const;
209 Int_t GetIRInt1ClosestInteractionMap(Int_t gap = 3) const;
210 Int_t GetIRInt2LastInteractionMap() const;
6b6f8d32 211
df9db588 212 private :
6b6f8d32 213
214 Double32_t fMagneticField; // Solenoid Magnetic Field in kG
215 Double32_t fMuonMagFieldScale; // magnetic field scale of muon arm magnet
216 Double32_t fCentrality; // Centrality
ce7adfe9 217 Double32_t fEventplane; // Event plane angle
c7d82ff7 218 Double32_t fEventplaneMag; // Length of Q vector from TPC event plance
5a3b31b5 219 Double32_t fEventplaneQx; // Q vector component x from TPC event plance
220 Double32_t fEventplaneQy; // Q vector component y from TPC event plance
6b6f8d32 221 Double32_t fZDCN1Energy; // reconstructed energy in the neutron1 ZDC
222 Double32_t fZDCP1Energy; // reconstructed energy in the proton1 ZDC
223 Double32_t fZDCN2Energy; // reconstructed energy in the neutron2 ZDC
224 Double32_t fZDCP2Energy; // reconstructed energy in the proton2 ZDC
a85132e7 225 Double32_t fZDCEMEnergy[2]; // reconstructed energy in the electromagnetic ZDCs
ff254193 226 Int_t fNQTheta; // number of QTheta elements
227 Double32_t *fQTheta; // [fNQTheta] values to store Lee-Yang-Zeros
6b6f8d32 228 ULong64_t fTriggerMask; // Trigger Type (mask)
27346f69 229 TString fFiredTriggers; // String with fired triggers
6b6f8d32 230 Int_t fRunNumber; // Run Number
231 Int_t fRefMult; // reference multiplicity
232 Int_t fRefMultPos; // reference multiplicity of positive particles
233 Int_t fRefMultNeg; // reference multiplicity of negative particles
fa8b0e56 234 Int_t fNMuons; // number of muons in the forward spectrometer
235 Int_t fNDimuons; // number of dimuons in the forward spectrometer
f7cc8591 236 Int_t fNGlobalMuons; // number of muons in the forward spectrometer + MFT // AU
237 Int_t fNGlobalDimuons; // number of dimuons in the forward spectrometer + MFT // AU
9333290e 238 UInt_t fEventType; // Type of Event
239 UInt_t fOrbitNumber; // Orbit Number
240 UInt_t fPeriodNumber; // Period Number
241 UShort_t fBunchCrossNumber; // BunchCrossingNumber
e9f4e33d 242 Short_t fRefMultComb05; // combined reference multiplicity (tracklets + ITSTPC) in |eta|<0.5
243 Short_t fRefMultComb08; // combined reference multiplicity (tracklets + ITSTPC) in |eta|<0.8
6b6f8d32 244 UChar_t fTriggerCluster; // Trigger cluster (mask)
613fc341 245 Double32_t fDiamondXY[2]; // Interaction diamond (x,y) in RUN
246 Double32_t fDiamondCovXY[3]; // Interaction diamond covariance (x,y) in RUN
49fc2e2c 247 Double32_t fDiamondZ; // Interaction diamond (z) in RUN
248 Double32_t fDiamondSig2Z; // Interaction diamond sigma^2 (z) in RUN
1aa76f71 249 TGeoHMatrix* fPHOSMatrix[kNPHOSMatrix]; //PHOS module position and orientation matrices
250 TGeoHMatrix* fEMCALMatrix[kNEMCALMatrix]; //EMCAL supermodule position and orientation matrices
0c6c629b 251 UInt_t fOfflineTrigger; // fired offline triggers for this event
a5f7aba4 252 TString fESDFileName; // ESD file name to which this event belongs
253 Int_t fEventNumberESDFile; // Event number in ESD file
ef7661fd 254 Int_t fNumberESDTracks; // Number of tracks in origingal ESD event
a5f7aba4 255 UInt_t fL0TriggerInputs; // L0 Trigger Inputs (mask)
256 UInt_t fL1TriggerInputs; // L1 Trigger Inputs (mask)
257 UShort_t fL2TriggerInputs; // L2 Trigger Inputs (mask)
f7ce7a37 258 UInt_t fITSClusters[6]; // Number of ITS cluster per layer
259 Int_t fTPConlyRefMult; // Reference multiplicty for standard TPC only tracks
f1c1d7c6 260 AliCentrality* fCentralityP; // Pointer to full centrality information
ce7adfe9 261 AliEventplane* fEventplaneP; // Pointer to full event plane information
5e14e698 262 Float_t fVZEROEqFactors[64]; // V0 channel equalization factors for event-plane reconstruction
949be341 263 Float_t fT0spread[kT0SpreadSize]; // spread of time distributions: (TOA+T0C/2), T0A, T0C, (T0A-T0C)/2
4ccebdba 264 TBits fIRInt2InteractionsMap; // map of the Int2 events (normally 0TVX) near the event, that's Int2Id-EventId in a -90 to 90 window
265 TBits fIRInt1InteractionsMap; // map of the Int1 events (normally V0A&V0C) near the event, that's Int1Id-EventId in a -90 to 90 window
ed67d937 266 ClassDef(AliAODHeader, 25);
df9db588 267};
5e6a3170 268inline
77f43bb7 269void AliAODHeader::SetCentrality(const AliCentrality* cent) {
5e6a3170 270 if(cent){
271 if(fCentralityP)*fCentralityP = *cent;
272 else fCentralityP = new AliCentrality(*cent);
273 fCentrality = cent->GetCentralityPercentile("V0M");
274 }
275 else{
276 fCentrality = -999;
277 }
278}
ce7adfe9 279inline
280void AliAODHeader::SetEventplane(AliEventplane* eventplane) {
281 if(eventplane){
282 if(fEventplaneP)*fEventplaneP = *eventplane;
283 else fEventplaneP = new AliEventplane(*eventplane);
284 fEventplane = eventplane->GetEventplane("Q");
c7d82ff7 285 const TVector2* qvect=eventplane->GetQVector();
286 fEventplaneMag = -999;
5a3b31b5 287 fEventplaneQx = -999;
288 fEventplaneQy = -999;
289 if (qvect) {
290 fEventplaneMag=qvect->Mod();
291 fEventplaneQx=qvect->X();
292 fEventplaneQy=qvect->Y();
293 }
ce7adfe9 294 }
295 else{
296 fEventplane = -999;
c7d82ff7 297 fEventplaneMag = -999;
5a3b31b5 298 fEventplaneQx = -999;
299 fEventplaneQy = -999;
ce7adfe9 300 }
301}
c7d82ff7 302inline
303void AliAODHeader::ResetEventplanePointer() {
304 delete fEventplaneP;
305 fEventplaneP = 0x0;
306}
f7ce7a37 307
308inline
309void AliAODHeader::SetITSClusters(Int_t ilay, UInt_t nclus)
310{
311 if (ilay >= 0 && ilay < 6) fITSClusters[ilay] = nclus;
312}
313
314
df9db588 315#endif