]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ZDC/AliZDCChMap.cxx
Fixing a compilation problem
[u/mrichter/AliRoot.git] / ZDC / AliZDCChMap.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 -> ADC channels mapping         //
19 // author: Chiara Oppedisano                                 //
20 //                                                           //
21 ///////////////////////////////////////////////////////////////
22
23 #include "AliZDCChMap.h"
24
25 ClassImp(AliZDCChMap)
26
27 //________________________________________________________________
28 AliZDCChMap::AliZDCChMap():
29 TNamed()
30 {
31   Reset();
32 }
33
34 //________________________________________________________________
35 AliZDCChMap::AliZDCChMap(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   int const kNModules = 10;
45   int const kNChannels = 48;
46   int const kNScChannels = 32;
47   for(Int_t i=0; i<kNModules; i++){
48     for(Int_t j=0; j<3; j++) fModuleMap[i][j] = 0;
49   }
50   for(Int_t i=0; i<kNChannels; i++){
51     fADCModule[i] = -1;
52     fADCChannel[i] = -1;
53     fDetector[i] = -1;
54     fSector[i] = -1;
55   }
56   for(Int_t i=0; i<kNScChannels; i++){
57     fScalerChannel[i] = -1;
58     fScDetector[i] = -1;
59     fScSector[i] = -1;
60   }
61   
62   
63 }
64
65 //________________________________________________________________
66 AliZDCChMap::AliZDCChMap(const AliZDCChMap& calibda) :
67   TNamed(calibda)
68 {
69   // Copy constructor
70   SetName(calibda.GetName());
71   SetTitle(calibda.GetName());
72   Reset();
73   int const kNModules = 10;
74   int const kNChannels = 48;
75   int const kNScChannels = 32;
76   for(Int_t i=0; i<kNModules; i++){
77      for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j);
78   }
79   for(int t=0; t<kNChannels; t++){
80      fADCModule[t]  = calibda.GetADCModule(t);
81      fADCChannel[t] = calibda.GetADCChannel(t);
82      fDetector[t]   = calibda.GetDetector(t);
83      fSector[t]     = calibda.GetSector(t);
84      if(t<kNScChannels){
85        fScalerChannel[t] = calibda.GetScChannel(t);
86        fScDetector[t]    = calibda.GetScDetector(t);
87        fScSector[t]      = calibda.GetScSector(t);
88      }
89   }
90 }
91
92 //________________________________________________________________
93 AliZDCChMap &AliZDCChMap::operator =(const AliZDCChMap& calibda)
94 {
95 // assignment operator
96   SetName(calibda.GetName());
97   SetTitle(calibda.GetName());
98   Reset();
99   int const kNModules = 10;
100   int const kNChannels = 48;
101   int const kNScChannels = 32;
102   for(Int_t i=0; i<kNModules; i++){
103      for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j);
104   }
105   for(int t=0; t<kNChannels; t++){
106      fADCModule[t]  = calibda.GetADCModule(t);
107      fADCChannel[t] = calibda.GetADCChannel(t);
108      fDetector[t]   = calibda.GetDetector(t);
109      fSector[t]     = calibda.GetSector(t);
110      if(t<kNScChannels){
111        fScalerChannel[t] = calibda.GetScChannel(t);
112        fScDetector[t]    = calibda.GetScDetector(t);
113        fScSector[t]      = calibda.GetScSector(t);
114      }
115   }
116
117   return *this;
118 }
119
120 //________________________________________________________________
121 AliZDCChMap::~AliZDCChMap()
122 {
123 }
124
125 //________________________________________________________________
126 void AliZDCChMap::Reset()
127 {
128   // Reset
129   memset(fADCModule,0,48*sizeof(Int_t));
130   memset(fADCChannel,0,48*sizeof(Int_t));
131   memset(fDetector,0,48*sizeof(Int_t));
132   memset(fSector,0,48*sizeof(Int_t));
133   memset(fScalerChannel,0,32*sizeof(Int_t));
134   memset(fScDetector,0,32*sizeof(Int_t));
135   memset(fScSector,0,32*sizeof(Int_t));
136 }                                                                                       
137
138
139 //________________________________________________________________
140 void  AliZDCChMap::Print(Option_t *) const
141 {
142    // Printing of calibration object
143    printf("\n\n\t ******************* AliZDCChMap object *******************\n\n");
144    for(Int_t i=0; i<9; i++){
145      printf("  ******** GEO %d mod. type %d #ch. %d\n",
146       fModuleMap[i][0],fModuleMap[i][1],fModuleMap[i][2]);     
147    } 
148    for(Int_t i=0; i<48; i++) 
149      printf(" ADC - mod. %d ch. %d -> detector %d sector %d\n",
150       fADCModule[i], fADCChannel[i],fDetector[i], fSector[i]);
151    for(Int_t i=0; i<32; i++) 
152      if(fScalerChannel[i]!=-1)
153        printf(" SCALER - ch. %d -> detector %d sector %d\n",
154         fScalerChannel[i],fScDetector[i], fScSector[i]);
155    printf("\n\n\t **********************************************************\n\n");
156  
157