1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////
18 // Class for ZDC calibration -> ADC channels mapping //
19 // author: Chiara Oppedisano //
21 ///////////////////////////////////////////////////////////////
23 #include "AliZDCChMap.h"
27 //________________________________________________________________
28 AliZDCChMap::AliZDCChMap():
34 //________________________________________________________________
35 AliZDCChMap::AliZDCChMap(const char* name):
39 TString namst = "Calib_";
41 SetName(namst.Data());
42 SetTitle(namst.Data());
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;
50 for(Int_t i=0; i<kNChannels; i++){
55 fADCSignalCode[i] = -1;
57 for(Int_t i=0; i<kNScChannels; i++){
58 fScalerChannel[i] = -1;
61 fScSignalCode[i] = -1;
64 fTDCSignalCode[i] = -1;
70 //________________________________________________________________
71 AliZDCChMap::AliZDCChMap(const AliZDCChMap& calibda) :
75 SetName(calibda.GetName());
76 SetTitle(calibda.GetName());
78 int const kNModules = 10;
79 int const kNChannels = 48;
80 int const kNScChannels = 32;
81 for(Int_t i=0; i<kNModules; i++){
82 for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j);
84 for(int t=0; t<kNChannels; t++){
85 fADCModule[t] = calibda.GetADCModule(t);
86 fADCChannel[t] = calibda.GetADCChannel(t);
87 fDetector[t] = calibda.GetDetector(t);
88 fSector[t] = calibda.GetSector(t);
89 fADCSignalCode[t] = calibda.GetADCSignalCode(t);
91 fScalerChannel[t] = calibda.GetScChannel(t);
92 fScDetector[t] = calibda.GetScDetector(t);
93 fScSector[t] = calibda.GetScSector(t);
94 fScSignalCode[t] = calibda.GetScSignalCode(t);
96 fTDCChannel[t] = calibda.GetTDCChannel(t);
97 fTDCSignalCode[t] = calibda.GetTDCChannel(t);
102 //________________________________________________________________
103 AliZDCChMap &AliZDCChMap::operator =(const AliZDCChMap& calibda)
105 // assignment operator
106 SetName(calibda.GetName());
107 SetTitle(calibda.GetName());
109 int const kNModules = 10;
110 int const kNChannels = 48;
111 int const kNScChannels = 32;
112 for(Int_t i=0; i<kNModules; i++){
113 for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j);
115 for(int t=0; t<kNChannels; t++){
116 fADCModule[t] = calibda.GetADCModule(t);
117 fADCChannel[t] = calibda.GetADCChannel(t);
118 fDetector[t] = calibda.GetDetector(t);
119 fSector[t] = calibda.GetSector(t);
120 fADCSignalCode[t] = calibda.GetADCSignalCode(t);
122 fScalerChannel[t] = calibda.GetScChannel(t);
123 fScDetector[t] = calibda.GetScDetector(t);
124 fScSector[t] = calibda.GetScSector(t);
125 fScSignalCode[t] = calibda.GetScSignalCode(t);
127 fTDCChannel[t] = calibda.GetTDCChannel(t);
128 fTDCSignalCode[t] = calibda.GetTDCChannel(t);
135 //________________________________________________________________
136 AliZDCChMap::~AliZDCChMap()
140 //________________________________________________________________
141 void AliZDCChMap::Reset()
144 memset(fADCModule,0,48*sizeof(Int_t));
145 memset(fADCChannel,0,48*sizeof(Int_t));
146 memset(fDetector,0,48*sizeof(Int_t));
147 memset(fSector,0,48*sizeof(Int_t));
148 memset(fADCSignalCode,0,48*sizeof(Int_t));
149 memset(fScalerChannel,0,32*sizeof(Int_t));
150 memset(fScDetector,0,32*sizeof(Int_t));
151 memset(fScSector,0,32*sizeof(Int_t));
152 memset(fScSignalCode,0,32*sizeof(Int_t));
153 memset(fTDCChannel,0,32*sizeof(Int_t));
154 memset(fTDCSignalCode,0,32*sizeof(Int_t));
158 //________________________________________________________________
159 void AliZDCChMap::Print(Option_t *) const
161 // Printing of calibration object
162 printf("\n\n\t ******************* AliZDCChMap object *******************\n\n");
163 for(Int_t i=0; i<10; i++){
164 printf(" ******** GEO %d mod. type %d #ch. %d\n",
165 fModuleMap[i][0],fModuleMap[i][1],fModuleMap[i][2]);
168 for(Int_t i=0; i<48; i++)
169 printf(" ADC - mod. %d ch. %d signal %d -> detector %d sector %d\n",
170 fADCModule[i], fADCChannel[i], fADCSignalCode[i], fDetector[i], fSector[i]);
172 for(Int_t i=0; i<32; i++)
173 if(fScalerChannel[i]!=-1)
174 printf(" SCALER - ch. %d signal %d\n",
175 fScalerChannel[i], fScSignalCode[i]);
177 for(Int_t i=0; i<32; i++)
178 if(fTDCChannel[i]!=-1)
179 printf(" TDC - ch. %d signal %d\n",
180 fTDCChannel[i], fTDCSignalCode[i]);
181 printf("\n\t **********************************************************\n\n");