Switch to the new raw reader (Julian, Raphaelle)
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalChamberStatus.cxx
index 805306091b808553c00660d8e02fe4921d2d64c0..5b1664175996c40a9721eb83a0c411acce184ee6 100644 (file)
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include "TH2D.h"
 #include "AliTRDCalChamberStatus.h"
 
 ClassImp(AliTRDCalChamberStatus)
 
 //_____________________________________________________________________________
-AliTRDCalChamberStatus::AliTRDCalChamberStatus():TNamed()
+AliTRDCalChamberStatus::AliTRDCalChamberStatus()
+  :TNamed()
 {
   //
   // AliTRDCalChamberStatus default constructor
@@ -35,11 +37,12 @@ AliTRDCalChamberStatus::AliTRDCalChamberStatus():TNamed()
   for (Int_t idet = 0; idet < kNdet; idet++) {
     fStatus[idet] = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
-                :TNamed(name,title)
+  :TNamed(name,title)
 {
   //
   // AliTRDCalChamberStatus constructor
@@ -48,5 +51,63 @@ AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t
   for (Int_t idet = 0; idet < kNdet; idet++) {
     fStatus[idet] = 0;
   }
+
 }
+//_____________________________________________________________________________
+TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi) 
+{
+  //
+  // Plot chamber status for supermodule and halfchamberside 
+  // as a function of layer and stack
+  //
 
+  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);
+  
+  h2->SetXTitle("stack");
+  h2->SetYTitle("layer");
+
+  Int_t start = sm*30;
+  Int_t end = (sm+1)*30;
+  
+  for(Int_t i=start; i<end; i++) {
+    Int_t layer  = i%6;
+    Int_t stack  = static_cast<int>((i-start)/6.);
+    Int_t status = GetStatus(i);
+    if(rphi == 0) {    
+      if(status!=4) h2->Fill(stack,layer,status);
+    }
+    else if(rphi == 1) {
+      if(status!=3) h2->Fill(stack,layer,status);
+    }
+    
+  }
+
+  return h2;
+
+}
+//_____________________________________________________________________________
+TH2D* AliTRDCalChamberStatus::Plot(Int_t sm) 
+{
+  //
+  // Plot chamber status for supermodule and halfchamberside 
+  // as a function of layer and stack
+  //
+
+  TH2D *h2 = new TH2D(Form("sm_%d",sm),Form("sm_%d",sm),5,0.0,5.0,6,0.0,6.0);
+  
+  h2->SetXTitle("stack");
+  h2->SetYTitle("layer");
+
+  Int_t start = sm*30;
+  Int_t end = (sm+1)*30;
+  
+  for(Int_t i=start; i<end; i++) {
+    Int_t layer  = i%6;
+    Int_t stack  = static_cast<int>((i-start)/6.);
+    Int_t status = GetStatus(i);
+    h2->Fill(stack,layer,status);
+  }
+
+  return h2;
+
+}