]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/Cal/AliTRDCalPadStatus.cxx
First round of effc++ changes
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalPadStatus.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 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  TRD calibration class for the single pad status                          //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "AliTRDCalPadStatus.h"
25 #include "AliTRDgeometry.h"
26 #include "AliTRDCalSingleChamberStatus.h"
27
28 ClassImp(AliTRDCalPadStatus)
29
30 //_____________________________________________________________________________
31 AliTRDCalPadStatus::AliTRDCalPadStatus()
32   :TNamed()
33 {
34   //
35   // AliTRDCalPadStatus default constructor
36   //
37
38   for (Int_t idet = 0; idet < kNdet; idet++) {
39     fROC[idet] = 0;
40   }
41
42 }
43
44 //_____________________________________________________________________________
45 AliTRDCalPadStatus::AliTRDCalPadStatus(const Text_t *name, const Text_t *title)
46   :TNamed(name,title)
47 {
48   //
49   // AliTRDCalPadStatus constructor
50   //
51
52   for (Int_t isec = 0; isec < kNsect; isec++) {
53     for (Int_t ipla = 0; ipla < kNplan; ipla++) {
54       for (Int_t icha = 0; icha < kNcham; icha++) {
55         Int_t idet = AliTRDgeometry::GetDetector(ipla,icha,isec);
56         fROC[idet] = new AliTRDCalSingleChamberStatus(ipla,icha,144);
57       }
58     }
59   }
60
61 }
62
63 //_____________________________________________________________________________
64 AliTRDCalPadStatus::AliTRDCalPadStatus(const AliTRDCalPadStatus &c)
65   :TNamed(c)
66 {
67   //
68   // AliTRDCalPadStatus copy constructor
69   //
70
71   ((AliTRDCalPadStatus &) c).Copy(*this);
72
73 }
74
75 ///_____________________________________________________________________________
76 AliTRDCalPadStatus::~AliTRDCalPadStatus()
77 {
78   //
79   // AliTRDCalPadStatus destructor
80   //
81
82   for (Int_t idet = 0; idet < kNdet; idet++) {
83     if (fROC[idet]) {
84       delete fROC[idet];
85       fROC[idet] = 0;
86     }
87   }
88
89 }
90
91 //_____________________________________________________________________________
92 AliTRDCalPadStatus &AliTRDCalPadStatus::operator=(const AliTRDCalPadStatus &c)
93 {
94   //
95   // Assignment operator
96   //
97
98   if (this != &c) ((AliTRDCalPadStatus &) c).Copy(*this);
99   return *this;
100
101 }
102
103 //_____________________________________________________________________________
104 void AliTRDCalPadStatus::Copy(TObject &c) const
105 {
106   //
107   // Copy function
108   //
109
110   for (Int_t idet = 0; idet < kNdet; idet++) {
111     if (fROC[idet]) {
112       fROC[idet]->Copy(*((AliTRDCalPadStatus &) c).fROC[idet]);
113     }
114   }
115
116   TObject::Copy(c);
117
118 }
119
120 //_____________________________________________________________________________
121 Bool_t AliTRDCalPadStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
122 {
123   //
124   // Checks the pad status
125   //
126
127   AliTRDCalSingleChamberStatus *roc = GetCalROC(d);
128   if (!roc) {
129     return kFALSE;
130   }
131   else {
132     return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
133   }
134
135 }
136
137 //_____________________________________________________________________________
138 AliTRDCalSingleChamberStatus* AliTRDCalPadStatus::GetCalROC(Int_t p, Int_t c, Int_t s) const
139
140   //
141   // Returns the readout chamber of this pad
142   //
143
144   return fROC[AliTRDgeometry::GetDetector(p,c,s)];   
145
146 }