]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDMeanSm.cxx
Add new functionalities (Laurent)
[u/mrichter/AliRoot.git] / PMD / AliPMDMeanSm.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 // Author : Z. Ahmed
17 //
18 #include "TNamed.h"
19 #include "AliCDBEntry.h"
20 #include "AliPMDMeanSm.h"
21
22
23 ClassImp(AliPMDMeanSm)
24
25 AliPMDMeanSm::AliPMDMeanSm()
26 {
27   // Default constructor
28   Reset();
29 }
30 // ----------------------------------------------------------------- //
31 AliPMDMeanSm::AliPMDMeanSm(const char* name)
32 {
33   //constructor
34   TString namst = "Calib_";
35   namst += name;
36   SetName(namst.Data());
37   SetTitle(namst.Data());
38   Reset();
39   
40 }
41 // ----------------------------------------------------------------- //
42 AliPMDMeanSm::AliPMDMeanSm(const AliPMDMeanSm& meanda) :
43   TNamed(meanda)
44 {
45   // copy constructor
46   SetName(meanda.GetName());
47   SetTitle(meanda.GetName());
48   Reset();
49   for(Int_t det = 0; det < kDet; det++)
50     {
51       for(Int_t smn = 0; smn < kModule; smn++)
52         {
53           fMeanSm[det][smn] = meanda.GetMeanSm(det,smn);
54         }
55     }
56 }
57 // ----------------------------------------------------------------- //
58 AliPMDMeanSm &AliPMDMeanSm::operator =(const AliPMDMeanSm& meanda)
59 {
60   //asignment operator
61   SetName(meanda.GetName());
62   SetTitle(meanda.GetName());
63   Reset();
64   for(Int_t det = 0; det < kDet; det++)
65     {
66       for(Int_t smn = 0; smn < kModule; smn++)
67         {
68           fMeanSm[det][smn] = meanda.GetMeanSm(det,smn);
69         }
70     }
71   return *this;
72 }
73 // ----------------------------------------------------------------- //
74 AliPMDMeanSm::~AliPMDMeanSm()
75 {
76   //destructor
77 }
78 // ----------------------------------------------------------------- //
79 void AliPMDMeanSm::Reset()
80 {
81   //memset(fgainfact ,1,2*24*48*96*sizeof(Float_t));
82   
83   for(Int_t det = 0; det < kDet; det++)
84     {
85       for(Int_t smn = 0; smn < kModule; smn++)
86         {
87           fMeanSm[det][smn] = 1.;
88         }
89     }
90 }
91 // ----------------------------------------------------------------- //
92 Float_t AliPMDMeanSm:: GetMeanSm(Int_t det, Int_t smn) const
93 {
94   return fMeanSm[det][smn];
95 }
96 // ----------------------------------------------------------------- //
97 void AliPMDMeanSm::SetMeanSm(Int_t det, Int_t smn, Float_t smmean)
98 {
99   fMeanSm[det][smn]= smmean;
100 }
101
102 // ----------------------------------------------------------------- //
103 void AliPMDMeanSm::Print(Option_t *) const
104 {
105   printf("\n ######Mean Values of Super Modules are ####\n");
106   for(Int_t det = 0; det < kDet; det++)
107     {
108       for(Int_t smn = 0; smn < kModule; smn++)
109         {
110           {
111             printf("Gain[%d,%d]= %2.1f \n",det,smn,fMeanSm[det][smn]);
112           }
113           printf("\n");
114         }
115     }
116 }