]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDZDC.h
update matching updates in centrality framework
[u/mrichter/AliRoot.git] / STEER / AliESDZDC.h
1 // -*- mode: C++ -*- 
2 #ifndef ALIESDZDC_H
3 #define ALIESDZDC_H
4
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 //-------------------------------------------------------------------------
9 //                      Implementation of   Class AliESDZDC
10 //   This is a class that summarizes the ZDC data for the ESD   
11 //   Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch 
12 //   *** 15/10/2009 Scaler added to AliESDZDC class ***
13 //   *** Scaler format:  32 floats from VME scaler  ***
14 //-------------------------------------------------------------------------
15
16 #include <TObject.h>
17
18 class AliESDZDC: public TObject {
19 public:
20  
21   enum {
22     kCorrectedTDCFilled = BIT(14)
23   };
24  
25   AliESDZDC();
26   AliESDZDC(const AliESDZDC& zdc);
27   AliESDZDC& operator=(const AliESDZDC& zdc);
28   virtual void Copy(TObject &obj) const;
29
30   UInt_t   GetESDQuality()  const {return fESDQuality;}
31   Double_t GetZDCN1Energy() const {return fZDCN1Energy;}
32   Double_t GetZDCP1Energy() const {return fZDCP1Energy;}
33   Double_t GetZDCN2Energy() const {return fZDCN2Energy;}
34   Double_t GetZDCP2Energy() const {return fZDCP2Energy;}
35   Double_t GetZDCEMEnergy(Int_t i) const 
36            {if(i==0){return fZDCEMEnergy;} else if(i==1){return fZDCEMEnergy1;}
37            return 0;}
38   Short_t  GetZDCParticipants() const {return fZDCParticipants;}
39   Short_t  GetZDCPartSideA() const {return fZDCPartSideA;}
40   Short_t  GetZDCPartSideC() const {return fZDCPartSideC;}
41   Double_t GetImpactParameter() const {return fImpactParameter;}
42   Double_t GetImpactParamSideA() const {return fImpactParamSideA;}
43   Double_t GetImpactParamSideC() const {return fImpactParamSideC;}
44   const Double_t * GetZN1TowerEnergy() const {return fZN1TowerEnergy;}
45   const Double_t * GetZN2TowerEnergy() const {return fZN2TowerEnergy;}
46   const Double_t * GetZP1TowerEnergy() const {return fZP1TowerEnergy;}
47   const Double_t * GetZP2TowerEnergy() const {return fZP2TowerEnergy;}
48   const Double_t * GetZN1TowerEnergyLR() const {return fZN1TowerEnergyLR;}
49   const Double_t * GetZN2TowerEnergyLR() const {return fZN2TowerEnergyLR;}
50   const Double_t * GetZP1TowerEnergyLR() const {return fZP1TowerEnergyLR;}
51   const Double_t * GetZP2TowerEnergyLR() const {return fZP2TowerEnergyLR;}
52   //
53   Bool_t GetZNCentroidInPbPb(Float_t beamEne, Double_t centrZNC[2], Double_t centrZNA[2]);
54   Bool_t GetZNCentroidInpp(Double_t centrZNC[2], Double_t centrZNA[2]);
55   //
56
57   UInt_t GetZDCScaler(Int_t i)  const {return fVMEScaler[i];}
58   const UInt_t* GetZDCScaler()  const {return fVMEScaler;}
59
60   Int_t GetZDCTDCData(Int_t i, Int_t j) const {return fZDCTDCData[i][j];}
61   Float_t GetZDCTDCCorrected(Int_t i, Int_t j) const {return fZDCTDCCorrected[i][j];}
62   Float_t GetZNTDCSum(Int_t ihit) const 
63           {if(ihit<4) return (Float_t) (fZDCTDCCorrected[10][ihit]+fZDCTDCCorrected[12][ihit]);
64            else return 0.;}
65   Float_t GetZNTDCDiff(Int_t ihit) const 
66           {if(ihit<4) return (Float_t) (fZDCTDCCorrected[12][ihit]-fZDCTDCCorrected[10][ihit]);
67            else return 0.;}
68   
69   void  SetZDC(Double_t n1Energy, Double_t p1Energy, 
70                Double_t emEnergy0, Double_t emEnergy1,
71                Double_t n2Energy, Double_t p2Energy, 
72                Short_t participants, Short_t nPartA, Short_t nPartC,
73                Double_t b, Double_t bA, Double_t bC, UInt_t recoFlag) 
74         {fZDCN1Energy=n1Energy; fZDCP1Energy=p1Energy; 
75          fZDCEMEnergy=emEnergy0; fZDCEMEnergy1=emEnergy1;
76          fZDCN2Energy=n2Energy; fZDCP2Energy=p2Energy; 
77          fZDCParticipants=participants; fZDCPartSideA=nPartA; fZDCPartSideC=nPartC;
78          fImpactParameter=b; fImpactParamSideA=bA, fImpactParamSideC=bC,
79          fESDQuality=recoFlag;}
80   //
81   void  SetZN1TowerEnergy(const Float_t tow1[5])
82           {for(Int_t i=0; i<5; i++) fZN1TowerEnergy[i] = tow1[i];}
83   void  SetZN2TowerEnergy(const Float_t tow2[5])
84           {for(Int_t i=0; i<5; i++) fZN2TowerEnergy[i] = tow2[i];}
85   void  SetZP1TowerEnergy(const Float_t tow1[5])
86           {for(Int_t i=0; i<5; i++) fZP1TowerEnergy[i] = tow1[i];}
87   void  SetZP2TowerEnergy(const Float_t tow2[5])
88           {for(Int_t i=0; i<5; i++) fZP2TowerEnergy[i] = tow2[i];}
89   void  SetZN1TowerEnergyLR(const Float_t tow1[5])
90           {for(Int_t i=0; i<5; i++) fZN1TowerEnergyLR[i] = tow1[i];}
91   void  SetZN2TowerEnergyLR(const Float_t tow2[5])
92           {for(Int_t i=0; i<5; i++) fZN2TowerEnergyLR[i] = tow2[i];}
93   void  SetZP1TowerEnergyLR(const Float_t tow1[5])
94           {for(Int_t i=0; i<5; i++) fZP1TowerEnergyLR[i] = tow1[i];}
95   void  SetZP2TowerEnergyLR(const Float_t tow2[5])
96           {for(Int_t i=0; i<5; i++) fZP2TowerEnergyLR[i] = tow2[i];}
97   void  SetZNACentroid(const Float_t centrCoord[2])
98            {for(Int_t i=0; i<2; i++) fZNACentrCoord[i] = centrCoord[i];}
99   void  SetZNCCentroid(const Float_t centrCoord[2])
100            {for(Int_t i=0; i<2; i++) fZNCCentrCoord[i] = centrCoord[i];}
101   
102   void SetZDCScaler(const UInt_t count[32]) 
103        {for(Int_t k=0; k<32; k++) fVMEScaler[k] = count[k];}
104   
105   void SetZDCTDCData(const Int_t values[32][4]) 
106        {for(Int_t k=0; k<32; k++)
107            for(Int_t j=0; j<4; j++) fZDCTDCData[k][j] = values[k][j];}
108   
109   void SetZDCTDCCorrected(const Float_t values[32][4]) 
110        {for(Int_t k=0; k<32; k++)
111            for(Int_t j=0; j<4; j++) fZDCTDCCorrected[k][j] = values[k][j];}
112
113   void    Reset();
114   void    Print(const Option_t *opt=0) const;
115
116 private:
117
118   Double32_t   fZDCN1Energy;  // reconstructed energy in the neutron ZDC
119   Double32_t   fZDCP1Energy;  // reconstructed energy in the proton ZDC
120   Double32_t   fZDCN2Energy;  // reconstructed energy in the neutron ZDC
121   Double32_t   fZDCP2Energy;  // reconstructed energy in the proton ZDC
122   Double32_t   fZDCEMEnergy;  // signal in the electromagnetic ZDCs
123   Double32_t   fZDCEMEnergy1; // second EM signal,cannot change fZDCEMEnergy to array (not backward compatible)
124   Double32_t   fZN1TowerEnergy[5];// reco E in 5 ZN1 sectors - high gain chain
125   Double32_t   fZN2TowerEnergy[5];// reco E in 5 ZN2 sectors - high gain chain
126   Double32_t   fZP1TowerEnergy[5];// reco E in 5 ZP1 sectors - high gain chain
127   Double32_t   fZP2TowerEnergy[5];// reco E in 5 ZP2 sectors - high gain chain
128   Double32_t   fZN1TowerEnergyLR[5];// reco E in 5 ZN1 sectors - low gain chain
129   Double32_t   fZN2TowerEnergyLR[5];// reco E in 5 ZN2 sectors - low gain chain
130   Double32_t   fZP1TowerEnergyLR[5];// reco E in 5 ZP1 sectors - low gain chain
131   Double32_t   fZP2TowerEnergyLR[5];// reco E in 5 ZP2 sectors - low gain chain
132   Short_t      fZDCParticipants;    // number of participants estimated by the ZDC (ONLY in A-A)
133   Short_t      fZDCPartSideA;     // number of participants estimated by the ZDC (ONLY in A-A)
134   Short_t      fZDCPartSideC;     // number of participants estimated by the ZDC (ONLY in A-A)
135   Double32_t   fImpactParameter;  // impact parameter estimated by the ZDC (ONLY in A-A)
136   Double32_t   fImpactParamSideA; // impact parameter estimated by the ZDC (ONLY in A-A)
137   Double32_t   fImpactParamSideC; // impact parameter estimated by the ZDC (ONLY in A-A)
138   Double32_t   fZNACentrCoord[2]; // Coordinates of the centroid over ZNC
139   Double32_t   fZNCCentrCoord[2]; // Coordinates of the centroid over ZNA
140   UInt_t       fESDQuality;       // flags from reconstruction
141   UInt_t       fVMEScaler[32];    // counts from VME scaler
142   Int_t        fZDCTDCData[32][4];     // ZDC TDC data
143   Float_t      fZDCTDCCorrected[32][4];// ZDC TDC data in ns corrected 4 phase shift
144   
145   ClassDef(AliESDZDC,16)
146 };
147
148 #endif
149