]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ZDC/AliZDCLaserCalib.cxx
da2507db66b3d5fd8234b43eb3398831fe731924
[u/mrichter/AliRoot.git] / ZDC / AliZDCLaserCalib.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 calibration -> LASER signal monitoring      //
19 // author: Chiara Oppedisano                                 //
20 //                                                           //
21 ///////////////////////////////////////////////////////////////
22
23 #include "AliZDCLaserCalib.h"
24
25 ClassImp(AliZDCLaserCalib)
26
27 //________________________________________________________________
28 AliZDCLaserCalib::AliZDCLaserCalib():
29 TNamed()
30 {
31   Reset();
32 }
33
34 //________________________________________________________________
35 AliZDCLaserCalib::AliZDCLaserCalib(const char* name):
36 TNamed()
37 {
38   // Constructor
39   TString namst = "Calib_";
40   namst += name;
41   SetName(namst.Data());
42   SetTitle(namst.Data());
43   Reset();
44   for(Int_t i=0; i<4; i++){
45     fSector[i] = 0;
46     fGain[i] = 0;
47     fPMRefValue[i] = 0.;
48     fPMRefWidth[i] = 0.;
49   }
50   
51   
52 }
53
54 //________________________________________________________________
55 AliZDCLaserCalib::AliZDCLaserCalib(const AliZDCLaserCalib& calibda) :
56   TNamed(calibda)
57 {
58   // Copy constructor
59   SetName(calibda.GetName());
60   SetTitle(calibda.GetName());
61   Reset();
62   for(int t=0; t<2; t++){
63      fSector[t] = calibda.GetSector(t);
64      fGain[t] = calibda.GetGain(t);
65      fPMRefValue[t] = calibda.GetPMRefValue(t);
66      fPMRefWidth[t] = calibda.GetPMRefWidth(t);
67   }
68 }
69
70 //________________________________________________________________
71 AliZDCLaserCalib &AliZDCLaserCalib::operator =(const AliZDCLaserCalib& calibda) 
72 {
73 // assignment operator
74   SetName(calibda.GetName());
75   SetTitle(calibda.GetName());
76   Reset();
77   for(int t=0; t<4; t++){
78      fSector[t]     = calibda.GetSector(t);
79      fGain[t] = calibda.GetGain(t);
80      fPMRefValue[t] = calibda.GetPMRefValue(t);
81      fPMRefWidth[t] = calibda.GetPMRefWidth(t);
82   }
83
84   return *this;
85 }
86
87 //________________________________________________________________
88 AliZDCLaserCalib::~AliZDCLaserCalib()
89 {
90 }
91
92 //________________________________________________________________
93 void AliZDCLaserCalib::Reset()
94 {
95   // Reset
96   memset(fSector,0,4*sizeof(Float_t));
97   memset(fGain,0,4*sizeof(Float_t));
98   memset(fPMRefValue,0,4*sizeof(Float_t));
99   memset(fPMRefWidth,0,4*sizeof(Float_t));
100 }                                                                                       
101
102
103 //________________________________________________________________
104 void  AliZDCLaserCalib::Print(Option_t *) const
105 {
106    // Printing of calibration object
107    printf("\n\n ******************* AliZDCLaserCalib object *******************\n");
108    for(Int_t i=0; i<4; i++){
109      if(fSector[i]==1.) printf("  side C ->");
110      else if(fSector[i]==4.) printf("  side A->");
111      printf("  Gain chain %1.0f",fGain[i]);
112      printf(" PMRefValue = %1.0f  PMRefWidth = %1.0f\n",fPMRefValue[i],fPMRefWidth[i]);
113    }
114    printf(" ***************************************************************\n\n");
115