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