Added methods for finding a given module in the DDL map (F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliESDZDC.cxx
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
17 //-------------------------------------------------------------------------
18 //                      Implementation of   Class AliESDZDC
19 //   This is a class that summarizes the ZDC data
20 //   for the ESD   
21 //   Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch 
22 //-------------------------------------------------------------------------
23
24
25
26 #include "AliESDZDC.h"
27
28 ClassImp(AliESDZDC)
29
30 //______________________________________________________________________________
31 AliESDZDC::AliESDZDC() :
32   TObject(),
33   fZDCN1Energy(0),
34   fZDCP1Energy(0),
35   fZDCN2Energy(0),
36   fZDCP2Energy(0),
37   fZDCEMEnergy(0),
38   fZDCEMEnergy1(0),
39   fZDCParticipants(0)
40 {
41   for(int i=0; i<5; i++){
42     fZN1TowerEnergy[i] = fZN2TowerEnergy[i] = 0.;
43     fZP1TowerEnergy[i] = fZP2TowerEnergy[i] = 0.;
44     fZN1TowerEnergyLR[i] = fZN2TowerEnergyLR[i] = 0.;
45     fZP1TowerEnergyLR[i] = fZP2TowerEnergyLR[i] = 0.;
46   }
47 }
48
49 AliESDZDC::AliESDZDC(const AliESDZDC& zdc) :
50   TObject(zdc),
51   fZDCN1Energy(zdc.fZDCN1Energy),
52   fZDCP1Energy(zdc.fZDCP1Energy),
53   fZDCN2Energy(zdc.fZDCN2Energy),
54   fZDCP2Energy(zdc.fZDCP2Energy),
55   fZDCEMEnergy(zdc.fZDCEMEnergy),
56   fZDCEMEnergy1(zdc.fZDCEMEnergy1),
57   fZDCParticipants(zdc.fZDCParticipants)
58 {
59   // copy constructor
60   for(int i=0; i<5; i++){
61      fZN1TowerEnergy[i] = zdc.fZN1TowerEnergy[i];
62      fZN2TowerEnergy[i] = zdc.fZN2TowerEnergy[i];
63      fZP1TowerEnergy[i] = zdc.fZP1TowerEnergy[i];
64      fZP2TowerEnergy[i] = zdc.fZP2TowerEnergy[i];
65      fZN1TowerEnergyLR[i] = zdc.fZN1TowerEnergyLR[i];
66      fZN2TowerEnergyLR[i] = zdc.fZN2TowerEnergyLR[i];
67      fZP1TowerEnergyLR[i] = zdc.fZP1TowerEnergyLR[i];
68      fZP2TowerEnergyLR[i] = zdc.fZP2TowerEnergyLR[i];
69   }
70 }
71
72 AliESDZDC& AliESDZDC::operator=(const AliESDZDC&zdc)
73 {
74   // assigment operator
75   if(this!=&zdc) {
76     TObject::operator=(zdc);
77     fZDCN1Energy = zdc.fZDCN1Energy;
78     fZDCP1Energy = zdc.fZDCP1Energy;
79     fZDCN2Energy = zdc.fZDCN2Energy;
80     fZDCP2Energy = zdc.fZDCP2Energy;
81     fZDCParticipants = zdc.fZDCParticipants;
82     fZDCEMEnergy = zdc.fZDCEMEnergy;
83     fZDCEMEnergy1 = zdc.fZDCEMEnergy1;
84     for(Int_t i=0; i<5; i++){
85        fZN1TowerEnergy[i] = zdc.fZN1TowerEnergy[i];
86        fZN2TowerEnergy[i] = zdc.fZN2TowerEnergy[i];
87        fZP1TowerEnergy[i] = zdc.fZP1TowerEnergy[i];
88        fZP2TowerEnergy[i] = zdc.fZP2TowerEnergy[i];
89        fZN1TowerEnergyLR[i] = zdc.fZN1TowerEnergyLR[i];
90        fZN2TowerEnergyLR[i] = zdc.fZN2TowerEnergyLR[i];
91        fZP1TowerEnergyLR[i] = zdc.fZP1TowerEnergyLR[i];
92        fZP2TowerEnergyLR[i] = zdc.fZP2TowerEnergyLR[i];
93     }
94   } 
95   return *this;
96 }
97
98
99 //______________________________________________________________________________
100 void AliESDZDC::Reset()
101 {
102   // reset all data members
103   fZDCN1Energy=0;
104   fZDCP1Energy=0;
105   fZDCN2Energy=0;
106   fZDCP2Energy=0;
107   fZDCParticipants=0;  
108   fZDCEMEnergy=0;
109   fZDCEMEnergy1=0;
110   for(int i=0; i<5; i++){
111     fZN1TowerEnergy[i] = fZN2TowerEnergy[i] = 0.;
112     fZP1TowerEnergy[i] = fZP2TowerEnergy[i] = 0.;
113     fZN1TowerEnergyLR[i] = fZN2TowerEnergyLR[i] = 0.;
114     fZP1TowerEnergyLR[i] = fZP2TowerEnergyLR[i] = 0.;
115   }
116 }
117
118 //______________________________________________________________________________
119 void AliESDZDC::Print(const Option_t *) const
120 {
121   //  Print ESD for the ZDC
122   printf("\n \t ZN1Energy = %f TeV, ZP1Energy = %f TeV, ZN2Energy = %f TeV,"
123   " ZP2Energy = %f, Nparticipants = %d\n",
124   fZDCN1Energy,fZDCP1Energy,fZDCN2Energy,fZDCP2Energy,fZDCParticipants);
125 }
126
127