]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/Cal/AliTRDCalChamberStatus.cxx
AliTRDdigitizer.cxx -> For the new name of the Nodata status in AliTRDCalChamberStatus
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalChamberStatus.cxx
index 5b1664175996c40a9721eb83a0c411acce184ee6..23804d394ef4ce502b744af9f6add2ddd476719e 100644 (file)
@@ -52,6 +52,91 @@ AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t
     fStatus[idet] = 0;
   }
 
+}
+//_____________________________________________________________________________
+void AliTRDCalChamberStatus::SetStatus(Int_t det, Char_t status) 
+{
+
+  //
+  // set the chamber status
+  //
+  //
+
+  switch(status)
+    {
+    case AliTRDCalChamberStatus::kGood:
+      SETBIT(fStatus[det], kGood);
+      CLRBIT(fStatus[det], kNoData);
+      CLRBIT(fStatus[det], kBadCalibrated);
+      break;
+    case AliTRDCalChamberStatus::kNoData:
+      CLRBIT(fStatus[det], kGood);
+      SETBIT(fStatus[det], kNoData);
+      SETBIT(fStatus[det], kNoDataHalfChamberSideA);
+      SETBIT(fStatus[det], kNoDataHalfChamberSideB);
+      //      SETBIT(fStatus[det], kBadCalibrated);
+      break;
+    case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
+      SETBIT(fStatus[det], kNoDataHalfChamberSideA);
+      if(TESTBIT(fStatus[det], kNoDataHalfChamberSideB)){
+       SETBIT(fStatus[det], kNoData);
+       CLRBIT(fStatus[det], kGood);
+      }
+      break;
+    case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
+      SETBIT(fStatus[det], kNoDataHalfChamberSideB);
+      if(TESTBIT(fStatus[det], kNoDataHalfChamberSideA)) {
+       CLRBIT(fStatus[det], kGood);
+       SETBIT(fStatus[det], kNoData);
+      }
+      break;
+    case AliTRDCalChamberStatus::kBadCalibrated:
+      CLRBIT(fStatus[det], kGood);
+      SETBIT(fStatus[det], kBadCalibrated);
+      break;
+    default:
+      CLRBIT(fStatus[det], kGood);
+      CLRBIT(fStatus[det], kNoData);
+      CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
+      CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
+      CLRBIT(fStatus[det], kBadCalibrated);
+    }
+
+}
+//_____________________________________________________________________________
+void AliTRDCalChamberStatus::UnsetStatusBit(Int_t det, Char_t status) 
+{
+
+  //
+  // unset the chamber status bit
+  //
+  //
+
+  switch(status)
+    {
+    case AliTRDCalChamberStatus::kGood:
+      CLRBIT(fStatus[det], kGood);
+      break;
+    case AliTRDCalChamberStatus::kNoData:
+      CLRBIT(fStatus[det], kNoData);
+      break;
+    case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
+      CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
+      break;
+    case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
+      CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
+      break;
+    case AliTRDCalChamberStatus::kBadCalibrated:
+      CLRBIT(fStatus[det], kBadCalibrated);
+      break;
+    default:
+      CLRBIT(fStatus[det], kGood);
+      CLRBIT(fStatus[det], kNoData);
+      CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
+      CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
+      CLRBIT(fStatus[det], kBadCalibrated);
+    }
+
 }
 //_____________________________________________________________________________
 TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi) 
@@ -71,15 +156,77 @@ TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi)
   
   for(Int_t i=start; i<end; i++) {
     Int_t layer  = i%6;
-    Int_t stack  = static_cast<int>((i-start)/6.);
+    Int_t stackn  = static_cast<int>((i-start)/6.);
     Int_t status = GetStatus(i);
+    h2->Fill(stackn,layer,status);
+    if(rphi == 0) {    
+      if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,status);
+    }
+    else if(rphi == 1) {
+      if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,status);
+    }
+  }
+
+  return h2;
+
+}
+//_____________________________________________________________________________
+TH2D* AliTRDCalChamberStatus::PlotNoData(Int_t sm, Int_t rphi) 
+{
+  //
+  // Plot chamber data status for supermodule and halfchamberside 
+  // as a function of layer and stack
+  //
+
+  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);
+  
+  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 stackn  = static_cast<int>((i-start)/6.);
+    if(rphi == 0) {    
+      if(TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,1);
+      if(TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
+    }
+    else if(rphi == 1) {
+      if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,1);
+      if(!TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
+    }
+  }
+
+  return h2;
+
+}
+//_____________________________________________________________________________
+TH2D* AliTRDCalChamberStatus::PlotBadCalibrated(Int_t sm, Int_t rphi) 
+{
+  //
+  // Plot chamber calibration status for supermodule and halfchamberside 
+  // as a function of layer and stack
+  //
+
+  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);
+  
+  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 stackn  = static_cast<int>((i-start)/6.);
     if(rphi == 0) {    
-      if(status!=4) h2->Fill(stack,layer,status);
+      if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
     }
     else if(rphi == 1) {
-      if(status!=3) h2->Fill(stack,layer,status);
+      if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
     }
-    
   }
 
   return h2;
@@ -103,9 +250,9 @@ TH2D* AliTRDCalChamberStatus::Plot(Int_t sm)
   
   for(Int_t i=start; i<end; i++) {
     Int_t layer  = i%6;
-    Int_t stack  = static_cast<int>((i-start)/6.);
+    Int_t stackn  = static_cast<int>((i-start)/6.);
     Int_t status = GetStatus(i);
-    h2->Fill(stack,layer,status);
+    h2->Fill(stackn,layer,status);
   }
 
   return h2;