]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ZDC/AliZDCEnCalib.cxx
Install a new script
[u/mrichter/AliRoot.git] / ZDC / AliZDCEnCalib.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 //              class for ZDC ENERGY calibration                             //
19 //              -> values for energy calibration                             //
20 //                                                                           //
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #include "AliZDCEnCalib.h"
24
25 ClassImp(AliZDCEnCalib)
26
27 //________________________________________________________________
28 AliZDCEnCalib::AliZDCEnCalib():
29 TNamed()
30 {
31   Reset();
32   for(Int_t i=0; i<6; i++) fEnCalibration[i] = 0.;
33 }
34
35 //________________________________________________________________
36 AliZDCEnCalib::AliZDCEnCalib(const char* name):
37 TNamed()
38 {
39   // Constructor
40   TString namst = "Calib_";
41   namst += name;
42   SetName(namst.Data());
43   SetTitle(namst.Data());
44   Reset();
45   for(Int_t i=0; i<6; i++){
46     fEnCalibration[i] = 0.;
47   }
48 }
49
50 //________________________________________________________________
51 AliZDCEnCalib::AliZDCEnCalib(const AliZDCEnCalib& calibda) :
52   TNamed(calibda)
53 {
54   // Copy constructor
55   SetName(calibda.GetName());
56   SetTitle(calibda.GetName());
57   Reset();
58   for(int i=0; i<6; i++){
59     fEnCalibration[i] = calibda.GetEnCalib(i);
60   }
61 }
62
63 //________________________________________________________________
64 AliZDCEnCalib &AliZDCEnCalib::operator =(const AliZDCEnCalib& calibda)
65 {
66 // assignment operator
67   SetName(calibda.GetName());
68   SetTitle(calibda.GetName());
69   Reset();
70   for(int i=0; i<6; i++){
71      fEnCalibration[i] = calibda.GetEnCalib(i);
72   }
73   
74   return *this;
75 }
76
77 //________________________________________________________________
78 AliZDCEnCalib::~AliZDCEnCalib()
79 {
80 }
81
82 //________________________________________________________________
83 void AliZDCEnCalib::Reset()
84 {
85   // Reset
86 }                                                                                       
87
88
89 //________________________________________________________________
90 void  AliZDCEnCalib::Print(Option_t *) const
91 {
92    // Printing of calibration object
93    printf("\n\n ####### Energy calibration coefficients ####### \n");
94    printf("  ZN1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[0]);
95    printf("  ZP1 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[1]);
96    printf("  ZN2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[2]);
97    printf("  ZP2 = %.4f (E[TeV]/ADCch.) \n",fEnCalibration[3]);
98    printf("  ZEM1 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[4]);
99    printf("  ZEM2 = %.2f (E[TeV]/ADCch.) \n",fEnCalibration[5]);
100
101
102
103 //________________________________________________________________
104 void AliZDCEnCalib::SetEnCalib(Float_t* EnCalib) 
105 {
106   // Set energy calibration coefficients
107   if(EnCalib) for(int t=0; t<6; t++) fEnCalibration[t] = EnCalib[t];
108   else for(int t=0; t<6; t++) fEnCalibration[t] = 0.;
109 }