LCOV - code coverage report
Current view: top level - TRD/TRDbase - AliTRDCalChamberStatus.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 6 124 4.8 %
Date: 2016-06-14 17:26:59 Functions: 3 11 27.3 %

          Line data    Source code
       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          48 : ClassImp(AliTRDCalChamberStatus)
      28             : 
      29             : //_____________________________________________________________________________
      30             : AliTRDCalChamberStatus::AliTRDCalChamberStatus()
      31           3 :   :TNamed()
      32          15 : {
      33             :   //
      34             :   // AliTRDCalChamberStatus default constructor
      35             :   //
      36             : 
      37        3246 :   for (Int_t idet = 0; idet < kNdet; idet++) {
      38        1620 :     fStatus[idet] = 0;
      39             :   }
      40             : 
      41           6 : }
      42             : 
      43             : //_____________________________________________________________________________
      44             : AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
      45           0 :   :TNamed(name,title)
      46           0 : {
      47             :   //
      48             :   // AliTRDCalChamberStatus constructor
      49             :   //
      50             : 
      51           0 :   for (Int_t idet = 0; idet < kNdet; idet++) {
      52           0 :     fStatus[idet] = 0;
      53             :   }
      54             : 
      55           0 : }
      56             : //_____________________________________________________________________________
      57             : void AliTRDCalChamberStatus::SetStatus(Int_t det, Char_t status) 
      58             : {
      59             : 
      60             :   //
      61             :   // set the chamber status
      62             :   //
      63             :   //
      64             : 
      65           0 :   switch(status)
      66             :     {
      67             :     case AliTRDCalChamberStatus::kGood:
      68           0 :       SETBIT(fStatus[det], kGood);
      69           0 :       CLRBIT(fStatus[det], kNoData);
      70           0 :       CLRBIT(fStatus[det], kBadCalibrated);
      71           0 :       break;
      72             :     case AliTRDCalChamberStatus::kNoData:
      73           0 :       CLRBIT(fStatus[det], kGood);
      74           0 :       SETBIT(fStatus[det], kNoData);
      75           0 :       SETBIT(fStatus[det], kNoDataHalfChamberSideA);
      76           0 :       SETBIT(fStatus[det], kNoDataHalfChamberSideB);
      77             :       //      SETBIT(fStatus[det], kBadCalibrated);
      78           0 :       break;
      79             :     case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
      80           0 :       SETBIT(fStatus[det], kNoDataHalfChamberSideA);
      81           0 :       if(TESTBIT(fStatus[det], kNoDataHalfChamberSideB)){
      82           0 :         SETBIT(fStatus[det], kNoData);
      83           0 :         CLRBIT(fStatus[det], kGood);
      84           0 :       }
      85             :       break;
      86             :     case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
      87           0 :       SETBIT(fStatus[det], kNoDataHalfChamberSideB);
      88           0 :       if(TESTBIT(fStatus[det], kNoDataHalfChamberSideA)) {
      89           0 :         CLRBIT(fStatus[det], kGood);
      90           0 :         SETBIT(fStatus[det], kNoData);
      91           0 :       }
      92             :       break;
      93             :     case AliTRDCalChamberStatus::kBadCalibrated:
      94           0 :       CLRBIT(fStatus[det], kGood);
      95           0 :       SETBIT(fStatus[det], kBadCalibrated);
      96           0 :       break;
      97             :     case AliTRDCalChamberStatus::kNotCalibrated:
      98           0 :       CLRBIT(fStatus[det], kGood);
      99           0 :       SETBIT(fStatus[det], kNotCalibrated);
     100             :       //CLRBIT(fStatus[det], kBadCalibrated);
     101           0 :       break;
     102             :     default:
     103           0 :       CLRBIT(fStatus[det], kGood);
     104           0 :       CLRBIT(fStatus[det], kNoData);
     105           0 :       CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
     106           0 :       CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
     107           0 :       CLRBIT(fStatus[det], kBadCalibrated);
     108           0 :       CLRBIT(fStatus[det], kNotCalibrated);
     109           0 :     }
     110             : 
     111           0 : }
     112             : //_____________________________________________________________________________
     113             : void AliTRDCalChamberStatus::UnsetStatusBit(Int_t det, Char_t status) 
     114             : {
     115             : 
     116             :   //
     117             :   // unset the chamber status bit
     118             :   //
     119             :   //
     120             : 
     121           0 :   switch(status)
     122             :     {
     123             :     case AliTRDCalChamberStatus::kGood:
     124           0 :       CLRBIT(fStatus[det], kGood);
     125           0 :       break;
     126             :     case AliTRDCalChamberStatus::kNoData:
     127           0 :       CLRBIT(fStatus[det], kNoData);
     128           0 :       break;
     129             :     case AliTRDCalChamberStatus::kNoDataHalfChamberSideA:
     130           0 :       CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
     131           0 :       break;
     132             :     case AliTRDCalChamberStatus::kNoDataHalfChamberSideB:
     133           0 :       CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
     134           0 :       break;
     135             :     case AliTRDCalChamberStatus::kBadCalibrated:
     136           0 :       CLRBIT(fStatus[det], kBadCalibrated);
     137           0 :       break;
     138             :     case AliTRDCalChamberStatus::kNotCalibrated:
     139           0 :       CLRBIT(fStatus[det], kNotCalibrated);
     140           0 :       break;
     141             :     default:
     142           0 :       CLRBIT(fStatus[det], kGood);
     143           0 :       CLRBIT(fStatus[det], kNoData);
     144           0 :       CLRBIT(fStatus[det], kNoDataHalfChamberSideA);
     145           0 :       CLRBIT(fStatus[det], kNoDataHalfChamberSideB);
     146           0 :       CLRBIT(fStatus[det], kBadCalibrated);
     147           0 :       CLRBIT(fStatus[det], kNotCalibrated);
     148           0 :     }
     149             : 
     150           0 : }
     151             : //_____________________________________________________________________________
     152             : TH2D* AliTRDCalChamberStatus::Plot(Int_t sm, Int_t rphi) 
     153             : {
     154             :   //
     155             :   // Plot chamber status for supermodule and halfchamberside 
     156             :   // as a function of layer and stack
     157             :   //
     158             : 
     159           0 :   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             :   
     161           0 :   h2->SetXTitle("stack");
     162           0 :   h2->SetYTitle("layer");
     163             : 
     164           0 :   Int_t start = sm*30;
     165           0 :   Int_t end = (sm+1)*30;
     166             :   
     167           0 :   for(Int_t i=start; i<end; i++) {
     168           0 :     Int_t layer  = i%6;
     169           0 :     Int_t stackn  = static_cast<int>((i-start)/6.);
     170           0 :     Int_t status = GetStatus(i);
     171           0 :     h2->Fill(stackn,layer,status);
     172           0 :     if(rphi == 0) {    
     173           0 :       if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,status);
     174             :     }
     175           0 :     else if(rphi == 1) {
     176           0 :       if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,status);
     177             :     }
     178             :   }
     179             : 
     180           0 :   return h2;
     181             : 
     182           0 : }
     183             : //_____________________________________________________________________________
     184             : TH2D* AliTRDCalChamberStatus::PlotNoData(Int_t sm, Int_t rphi) 
     185             : {
     186             :   //
     187             :   // Plot chamber data status for supermodule and halfchamberside 
     188             :   // as a function of layer and stack
     189             :   //
     190             : 
     191           0 :   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             :   
     193           0 :   h2->SetXTitle("stack");
     194           0 :   h2->SetYTitle("layer");
     195             : 
     196           0 :   Int_t start = sm*30;
     197           0 :   Int_t end = (sm+1)*30;
     198             :   
     199           0 :   for(Int_t i=start; i<end; i++) {
     200           0 :     Int_t layer  = i%6;
     201           0 :     Int_t stackn  = static_cast<int>((i-start)/6.);
     202           0 :     if(rphi == 0) {    
     203           0 :       if(TESTBIT(fStatus[i], kNoDataHalfChamberSideB)) h2->Fill(stackn,layer,1);
     204           0 :       if(TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
     205             :     }
     206           0 :     else if(rphi == 1) {
     207           0 :       if(!TESTBIT(fStatus[i], kNoDataHalfChamberSideA)) h2->Fill(stackn,layer,1);
     208           0 :       if(!TESTBIT(fStatus[i], kNoData)) h2->Fill(stackn,layer,1);
     209             :     }
     210             :   }
     211             : 
     212           0 :   return h2;
     213             : 
     214           0 : }
     215             : //_____________________________________________________________________________
     216             : TH2D* AliTRDCalChamberStatus::PlotBadCalibrated(Int_t sm, Int_t rphi) 
     217             : {
     218             :   //
     219             :   // Plot chamber calibration status for supermodule and halfchamberside 
     220             :   // as a function of layer and stack
     221             :   //
     222             : 
     223           0 :   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             :   
     225           0 :   h2->SetXTitle("stack");
     226           0 :   h2->SetYTitle("layer");
     227             : 
     228           0 :   Int_t start = sm*30;
     229           0 :   Int_t end = (sm+1)*30;
     230             :   
     231           0 :   for(Int_t i=start; i<end; i++) {
     232           0 :     Int_t layer  = i%6;
     233           0 :     Int_t stackn  = static_cast<int>((i-start)/6.);
     234           0 :     if(rphi == 0) {    
     235           0 :       if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
     236             :     }
     237           0 :     else if(rphi == 1) {
     238           0 :       if(TESTBIT(fStatus[i], kBadCalibrated)) h2->Fill(stackn,layer,1);
     239             :     }
     240             :   }
     241             : 
     242           0 :   return h2;
     243             : 
     244           0 : }
     245             : //_____________________________________________________________________________
     246             : TH2D* AliTRDCalChamberStatus::Plot(Int_t sm) 
     247             : {
     248             :   //
     249             :   // Plot chamber status for supermodule and halfchamberside 
     250             :   // as a function of layer and stack
     251             :   //
     252             : 
     253           0 :   TH2D *h2 = new TH2D(Form("sm_%d",sm),Form("sm_%d",sm),5,0.0,5.0,6,0.0,6.0);
     254             :   
     255           0 :   h2->SetXTitle("stack");
     256           0 :   h2->SetYTitle("layer");
     257             : 
     258           0 :   Int_t start = sm*30;
     259           0 :   Int_t end = (sm+1)*30;
     260             :   
     261           0 :   for(Int_t i=start; i<end; i++) {
     262           0 :     Int_t layer  = i%6;
     263           0 :     Int_t stackn  = static_cast<int>((i-start)/6.);
     264           0 :     Int_t status = GetStatus(i);
     265           0 :     h2->Fill(stackn,layer,status);
     266             :   }
     267             : 
     268           0 :   return h2;
     269             : 
     270           0 : }

Generated by: LCOV version 1.11