Procedures for half chamber status (Julian)
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalChamberStatus.cxx
index bf9192116c94a11b225c47a0ea75d016a97e9504..2850c988ee11f82c7710923ef85160c39729f949 100644 (file)
@@ -21,6 +21,7 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include "TH2D.h"
 #include "AliTRDCalChamberStatus.h"
 
 ClassImp(AliTRDCalChamberStatus)
@@ -52,4 +53,37 @@ AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t
   }
 
 }
+//_____________________________________________________________________________
+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;
+
+}
+