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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // TRD calibration class for MCM status //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliTRDCalMCMStatus.h"
25 #include "AliTRDgeometry.h"
26 #include "AliTRDCalSingleChamberStatus.h"
28 ClassImp(AliTRDCalMCMStatus)
30 //_____________________________________________________________________________
31 AliTRDCalMCMStatus::AliTRDCalMCMStatus()
35 // AliTRDCalMCMStatus default constructor
38 for (Int_t idet = 0; idet < kNdet; idet++) {
44 //_____________________________________________________________________________
45 AliTRDCalMCMStatus::AliTRDCalMCMStatus(const Text_t *name, const Text_t *title)
49 // AliTRDCalMCMStatus constructor
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,8);
63 //_____________________________________________________________________________
64 AliTRDCalMCMStatus::AliTRDCalMCMStatus(const AliTRDCalMCMStatus &c)
68 // AliTRDCalMCMStatus copy constructor
71 ((AliTRDCalMCMStatus &) c).Copy(*this);
75 ///_____________________________________________________________________________
76 AliTRDCalMCMStatus::~AliTRDCalMCMStatus()
79 // AliTRDCalMCMStatus destructor
82 for (Int_t idet = 0; idet < kNdet; idet++) {
91 //_____________________________________________________________________________
92 AliTRDCalMCMStatus &AliTRDCalMCMStatus::operator=(const AliTRDCalMCMStatus &c)
95 // Assignment operator
99 ((AliTRDCalMCMStatus &) c).Copy(*this);
106 //_____________________________________________________________________________
107 void AliTRDCalMCMStatus::Copy(TObject &c) const
113 for (Int_t idet = 0; idet < kNdet; idet++) {
115 fROC[idet]->Copy(*((AliTRDCalMCMStatus &) c).fROC[idet]);
123 //_____________________________________________________________________________
124 Bool_t AliTRDCalMCMStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
127 // Checks the MCM status byte
130 // To translate pad column number into MCM number
131 Int_t mcm = ((Int_t) col / 18);
133 AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
139 return (roc->GetStatus(mcm,row) & bitMask) ? kTRUE : kFALSE;
144 //_____________________________________________________________________________
145 Char_t AliTRDCalMCMStatus::GetStatus(Int_t d, Int_t col, Int_t row) const
148 // Gets the MCM status byte
151 // To translate pad column number into MCM number
152 Int_t mcm = ((Int_t) col / 18);
154 AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
160 return roc->GetStatus(mcm,row);
165 //_____________________________________________________________________________
166 AliTRDCalSingleChamberStatus *AliTRDCalMCMStatus::GetCalROC(Int_t p, Int_t c, Int_t s) const
169 // Returns the readout chamber of this MCM
172 return GetCalROC(AliTRDgeometry::GetDetector(p,c,s));