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 status of chambers //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliTRDCalChamberStatus.h"
27 ClassImp(AliTRDCalChamberStatus)
29 //_____________________________________________________________________________
30 AliTRDCalChamberStatus::AliTRDCalChamberStatus()
34 // AliTRDCalChamberStatus default constructor
37 for (Int_t idet = 0; idet < kNdet; idet++) {
43 //_____________________________________________________________________________
44 AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
48 // AliTRDCalChamberStatus constructor
51 for (Int_t idet = 0; idet < kNdet; idet++) {
56 //_____________________________________________________________________________
57 void AliTRDCalChamberStatus::SetStatus(Int_t det, Char_t status)
61 // set the chamber status
67 case AliTRDCalChamberStatus::kGood:
68 SETBIT(fStatus[det], kGood);
69 CLRBIT(fStatus[det], kNoData);
70 CLRBIT(fStatus[det], kBadCalibrated);
72 case AliTRDCalChamberStatus::kNoData:
73 CLRBIT(fStatus[det], kGood);
74 SETBIT(fStatus[det], kNoData);
75 SETBIT(fStatus[det], kNoDataHalfChamberSideA);
76 SETBIT(fStatus[det], kNoDataHalfChamberSideB);
77 // SETBIT(fStatus[det], kBadCalibrated);
79 case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
80 SETBIT(fStatus[det], kNoDataHalfChamberSideA);
81 if(TESTBIT(fStatus[det], kNoDataHalfChamberSideB)){
82 SETBIT(fStatus[det], kNoData);
83 CLRBIT(fStatus[det], kGood);
86 case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
87 SETBIT(fStatus[det], kNoDataHalfChamberSideB);
88 if(TESTBIT(fStatus[det], kNoDataHalfChamberSideA)) {
89 CLRBIT(fStatus[det], kGood);
90 SETBIT(fStatus[det], kNoData);
93 case AliTRDCalChamberStatus::kBadCalibrated:
94 CLRBIT(fStatus[det], kGood);
95 SETBIT(fStatus[det], kBadCalibrated);
97 case AliTRDCalChamberStatus::kNotCalibrated:
98 SETBIT(fStatus[det], kNotCalibrated);
99 //CLRBIT(fStatus[det], kBadCalibrated);
102 CLRBIT(fStatus[det], kGood);
103 CLRBIT(fStatus[det], kNoData);
104 CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
105 CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
106 CLRBIT(fStatus[det], kBadCalibrated);
107 CLRBIT(fStatus[det], kNotCalibrated);
111 //_____________________________________________________________________________
112 void AliTRDCalChamberStatus::UnsetStatusBit(Int_t det, Char_t status)
116 // unset the chamber status bit
122 case AliTRDCalChamberStatus::kGood:
123 CLRBIT(fStatus[det], kGood);
125 case AliTRDCalChamberStatus::kNoData:
126 CLRBIT(fStatus[det], kNoData);
128 case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
129 CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
131 case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
132 CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
134 case AliTRDCalChamberStatus::kBadCalibrated:
135 CLRBIT(fStatus[det], kBadCalibrated);
137 case AliTRDCalChamberStatus::kNotCalibrated:
138 CLRBIT(fStatus[det], kNotCalibrated);
141 CLRBIT(fStatus[det], kGood);
142 CLRBIT(fStatus[det], kNoData);
143 CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
144 CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
145 CLRBIT(fStatus[det], kBadCalibrated);
146 CLRBIT(fStatus[det], kNotCalibrated);
150 //_____________________________________________________________________________
151 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi)
154 // Plot chamber status for supermodule and halfchamberside
155 // as a function of layer and stack
158 TH2D *h2 = new TH2D(Form("sm_%d_rphi_%d",sm,rphi),Form("sm_%d_rphi_%d",sm,rphi),5,0.0,5.0,6,0.0,6.0);
160 h2->SetXTitle("stack");
161 h2->SetYTitle("layer");
164 Int_t end = (sm+1)*30;
166 for(Int_t i=start; i<end; i++) {
168 Int_t stackn = static_cast<int>((i-start)/6.);
169 Int_t status = GetStatus(i);
170 h2->Fill(stackn,layer,status);
172 if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,status);
175 if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,status);
182 //_____________________________________________________________________________
183 TH2D* AliTRDCalChamberStatus::PlotNoData(Int_t sm, Int_t rphi)
186 // Plot chamber data status for supermodule and halfchamberside
187 // as a function of layer and stack
190 TH2D *h2 = new TH2D(Form("sm_%d_rphi_%d_data",sm,rphi),Form("sm_%d_rphi_%d_data",sm,rphi),5,0.0,5.0,6,0.0,6.0);
192 h2->SetXTitle("stack");
193 h2->SetYTitle("layer");
196 Int_t end = (sm+1)*30;
198 for(Int_t i=start; i<end; i++) {
200 Int_t stackn = static_cast<int>((i-start)/6.);
202 if(TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,1);
203 if(TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
206 if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,1);
207 if(!TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
214 //_____________________________________________________________________________
215 TH2D* AliTRDCalChamberStatus::PlotBadCalibrated(Int_t sm, Int_t rphi)
218 // Plot chamber calibration status for supermodule and halfchamberside
219 // as a function of layer and stack
222 TH2D *h2 = new TH2D(Form("sm_%d_rphi_%d_calib",sm,rphi),Form("sm_%d_rphi_%d_calib",sm,rphi),5,0.0,5.0,6,0.0,6.0);
224 h2->SetXTitle("stack");
225 h2->SetYTitle("layer");
228 Int_t end = (sm+1)*30;
230 for(Int_t i=start; i<end; i++) {
232 Int_t stackn = static_cast<int>((i-start)/6.);
234 if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
237 if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
244 //_____________________________________________________________________________
245 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm)
248 // Plot chamber status for supermodule and halfchamberside
249 // as a function of layer and stack
252 TH2D *h2 = new TH2D(Form("sm_%d",sm),Form("sm_%d",sm),5,0.0,5.0,6,0.0,6.0);
254 h2->SetXTitle("stack");
255 h2->SetYTitle("layer");
258 Int_t end = (sm+1)*30;
260 for(Int_t i=start; i<end; i++) {
262 Int_t stackn = static_cast<int>((i-start)/6.);
263 Int_t status = GetStatus(i);
264 h2->Fill(stackn,layer,status);