Line data Source code
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 : /* $Id: AliZDCTDCCalib.cxx 46092 2010-12-16 13:18:21Z coppedis $ */
17 :
18 : ///////////////////////////////////////////////////////////////////////////////
19 : // //
20 : // class for ZDC calibration -> values for TDC offset calibration //
21 : // //
22 : ///////////////////////////////////////////////////////////////////////////////
23 :
24 : #include "AliZDCTDCCalib.h"
25 :
26 12 : ClassImp(AliZDCTDCCalib)
27 :
28 : //________________________________________________________________
29 : AliZDCTDCCalib::AliZDCTDCCalib():
30 2 : TNamed()
31 10 : {
32 2 : Reset();
33 4 : }
34 :
35 : //________________________________________________________________
36 : AliZDCTDCCalib::AliZDCTDCCalib(const char* name):
37 0 : TNamed()
38 0 : {
39 : // Constructor
40 0 : TString namst = "Calib_";
41 0 : namst += name;
42 0 : SetName(namst.Data());
43 0 : SetTitle(namst.Data());
44 0 : Reset();
45 0 : for(Int_t i=0; i<6; i++){
46 0 : fMeanTDC[i] = 0.;
47 0 : fWidthTDC[i] = 0.;
48 : }
49 :
50 :
51 0 : }
52 :
53 : //________________________________________________________________
54 : AliZDCTDCCalib::AliZDCTDCCalib(const AliZDCTDCCalib& calibda) :
55 0 : TNamed(calibda)
56 0 : {
57 : // Copy constructor
58 0 : SetName(calibda.GetName());
59 0 : SetTitle(calibda.GetName());
60 0 : Reset();
61 0 : for(int t=0; t<6; t++){
62 0 : fMeanTDC[t] = calibda.GetMeanTDC(t);
63 0 : fWidthTDC[t] = calibda.GetWidthTDC(t);
64 : }
65 0 : }
66 :
67 : //________________________________________________________________
68 : AliZDCTDCCalib &AliZDCTDCCalib::operator =(const AliZDCTDCCalib& calibda)
69 : {
70 : // assignment operator
71 0 : SetName(calibda.GetName());
72 0 : SetTitle(calibda.GetName());
73 0 : Reset();
74 0 : for(int t=0; t<6; t++){
75 0 : fMeanTDC[t] = calibda.GetMeanTDC(t);
76 0 : fWidthTDC[t] = calibda.GetWidthTDC(t);
77 : }
78 :
79 0 : return *this;
80 : }
81 :
82 : //________________________________________________________________
83 : AliZDCTDCCalib::~AliZDCTDCCalib()
84 0 : {
85 0 : }
86 :
87 : //________________________________________________________________
88 : void AliZDCTDCCalib::Reset()
89 : {
90 : // Reset
91 4 : memset(fMeanTDC,0,6*sizeof(Float_t));
92 2 : memset(fWidthTDC,0,6*sizeof(Float_t));
93 2 : }
94 :
95 :
96 : //________________________________________________________________
97 : void AliZDCTDCCalib::Print(Option_t *) const
98 : {
99 : // Printing of calibration object
100 0 : printf("\n ####### TDC calibration values ####### \n");
101 0 : printf(" ch. order: ZEM1 ZEM2 ZNC ZPC ZNA ZPA \n");
102 0 : for(int t=0; t<6; t++)
103 0 : printf("\t ch.%d (%f, %f)\n",t,fMeanTDC[t],fWidthTDC[t]);
104 :
105 0 : }
106 :
107 : //________________________________________________________________
108 : void AliZDCTDCCalib::SetMeanTDC(Float_t* mean)
109 : {
110 0 : if(mean) for(int t=0; t<6; t++) fMeanTDC[t] = mean[t];
111 0 : else for(int t=0; t<6; t++) fMeanTDC[t] = 0.;
112 0 : }
113 : //________________________________________________________________
114 : void AliZDCTDCCalib::SetWidthTDC(Float_t* width)
115 : {
116 0 : if(width) for(int t=0; t<6; t++) fWidthTDC[t] = width[t];
117 0 : else for(int t=0; t<6; t++) fWidthTDC[t] = 0.;
118 0 : }
|