]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ZDC/AliZDCChMap.cxx
Coding conventions, simplifications
[u/mrichter/AliRoot.git] / ZDC / AliZDCChMap.cxx
CommitLineData
b1d0c8c5 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 -> ADC channels mapping //
19// author: Chiara Oppedisano //
20// //
21///////////////////////////////////////////////////////////////
22
23#include "AliZDCChMap.h"
24
25ClassImp(AliZDCChMap)
26
27//________________________________________________________________
28AliZDCChMap::AliZDCChMap():
29TNamed()
30{
31 Reset();
32}
33
34//________________________________________________________________
35AliZDCChMap::AliZDCChMap(const char* name):
36TNamed()
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<48; i++){
45 fADCModule[i] = 0;
46 fADCChannel[i] = 0;
47 fDetector[i] = 0;
48 fSector[i] = 0;
27afc0c8 49 fScalerChannel[i] = 0;
50 fScDetector[i] = 0;
51 fScSector[i] = 0;
b1d0c8c5 52 }
53
54
55}
56
57//________________________________________________________________
58AliZDCChMap::AliZDCChMap(const AliZDCChMap& calibda) :
59 TNamed(calibda)
60{
61 // Copy constructor
62 SetName(calibda.GetName());
63 SetTitle(calibda.GetName());
64 Reset();
65 for(int t=0; t<48; t++){
66 fADCModule[t] = calibda.GetADCModule(t);
67 fADCChannel[t] = calibda.GetADCChannel(t);
68 fDetector[t] = calibda.GetDetector(t);
69 fSector[t] = calibda.GetSector(t);
27afc0c8 70 if(t<32){
71 fScalerChannel[t] = calibda.GetScChannel(t);
72 fScDetector[t] = calibda.GetScDetector(t);
73 fScSector[t] = calibda.GetScSector(t);
74 }
b1d0c8c5 75 }
76}
77
78//________________________________________________________________
79AliZDCChMap &AliZDCChMap::operator =(const AliZDCChMap& calibda)
80{
81// assignment operator
82 SetName(calibda.GetName());
83 SetTitle(calibda.GetName());
84 Reset();
85 for(int t=0; t<48; t++){
86 fADCModule[t] = calibda.GetADCModule(t);
87 fADCChannel[t] = calibda.GetADCChannel(t);
88 fDetector[t] = calibda.GetDetector(t);
89 fSector[t] = calibda.GetSector(t);
27afc0c8 90 if(t<32){
91 fScalerChannel[t] = calibda.GetScChannel(t);
92 fScDetector[t] = calibda.GetScDetector(t);
93 fScSector[t] = calibda.GetScSector(t);
94 }
b1d0c8c5 95 }
96
97 return *this;
98}
99
100//________________________________________________________________
101AliZDCChMap::~AliZDCChMap()
102{
103}
104
105//________________________________________________________________
106void AliZDCChMap::Reset()
107{
108 // Reset
109 memset(fADCModule,0,48*sizeof(Int_t));
110 memset(fADCChannel,0,48*sizeof(Int_t));
111 memset(fDetector,0,48*sizeof(Int_t));
112 memset(fSector,0,48*sizeof(Int_t));
27afc0c8 113 memset(fScalerChannel,0,32*sizeof(Int_t));
114 memset(fScDetector,0,32*sizeof(Int_t));
115 memset(fScSector,0,32*sizeof(Int_t));
b1d0c8c5 116}
117
118
119//________________________________________________________________
120void AliZDCChMap::Print(Option_t *) const
121{
122 // Printing of calibration object
11b06725 123 printf("\n\n\t ******************* AliZDCChMap object *******************\n\n");
b1d0c8c5 124 for(Int_t i=0; i<48; i++)
27afc0c8 125 printf(" ADC - mod. %d ch. %d -> detector %d sector %d\n",
126 fADCModule[i], fADCChannel[i],fDetector[i], fSector[i]);
127 for(Int_t i=0; i<32; i++)
128 printf(" SCALER - ch. %d -> detector %d sector %d\n",
129 fScalerChannel[i],fScDetector[i], fScSector[i]);
11b06725 130 printf("\n\n\t **********************************************************\n\n");
b1d0c8c5 131
132}