]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/Cal/AliTRDCalChamberStatus.cxx
Protection against non existing online gain table (Theo)
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalChamberStatus.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 status of chambers                             //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "TH2D.h"
25 #include "AliTRDCalChamberStatus.h"
26
27 ClassImp(AliTRDCalChamberStatus)
28
29 //_____________________________________________________________________________
30 AliTRDCalChamberStatus::AliTRDCalChamberStatus()
31   :TNamed()
32 {
33   //
34   // AliTRDCalChamberStatus default constructor
35   //
36
37   for (Int_t idet = 0; idet < kNdet; idet++) {
38     fStatus[idet] = 0;
39   }
40
41 }
42
43 //_____________________________________________________________________________
44 AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
45   :TNamed(name,title)
46 {
47   //
48   // AliTRDCalChamberStatus constructor
49   //
50
51   for (Int_t idet = 0; idet < kNdet; idet++) {
52     fStatus[idet] = 0;
53   }
54
55 }
56 //_____________________________________________________________________________
57 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi) 
58 {
59   //
60   // Plot chamber status for supermodule and halfchamberside 
61   // as a function of layer and stack
62   //
63
64   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);
65   
66   h2->SetXTitle("stack");
67   h2->SetYTitle("layer");
68
69   Int_t start = sm*30;
70   Int_t end = (sm+1)*30;
71   
72   for(Int_t i=start; i<end; i++) {
73     Int_t layer  = i%6;
74     Int_t stack  = static_cast<int>((i-start)/6.);
75     Int_t status = GetStatus(i);
76     if(rphi == 0) {    
77       if(status!=4) h2->Fill(stack,layer,status);
78     }
79     else if(rphi == 1) {
80       if(status!=3) h2->Fill(stack,layer,status);
81     }
82     
83   }
84
85   return h2;
86
87 }
88 //_____________________________________________________________________________
89 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm) 
90 {
91   //
92   // Plot chamber status for supermodule and halfchamberside 
93   // as a function of layer and stack
94   //
95
96   TH2D *h2 = new TH2D(Form("sm_%d",sm),Form("sm_%d",sm),5,0.0,5.0,6,0.0,6.0);
97   
98   h2->SetXTitle("stack");
99   h2->SetYTitle("layer");
100
101   Int_t start = sm*30;
102   Int_t end = (sm+1)*30;
103   
104   for(Int_t i=start; i<end; i++) {
105     Int_t layer  = i%6;
106     Int_t stack  = static_cast<int>((i-start)/6.);
107     Int_t status = GetStatus(i);
108     h2->Fill(stack,layer,status);
109   }
110
111   return h2;
112
113 }