LCOV - code coverage report
Current view: top level - PMD/PMDbase - AliPMDCalibData.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 12 55 21.8 %
Date: 2016-06-14 17:26:59 Functions: 5 15 33.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             : // Author : Z. Ahmed
      17             : //
      18             : #include "TNamed.h"
      19             : #include "AliCDBEntry.h"
      20             : //#include "AliPMD.h"
      21             : #include "AliPMDCalibData.h"
      22             : 
      23             : 
      24          12 : ClassImp(AliPMDCalibData)
      25             : 
      26           3 : AliPMDCalibData::AliPMDCalibData()
      27          15 : {
      28             :   // Default constructor
      29           3 :   Reset();
      30           6 : }
      31             : // ----------------------------------------------------------------- //
      32           0 : AliPMDCalibData::AliPMDCalibData(const char* name)
      33           0 : {
      34             :   //constructor
      35           0 :   TString namst = "Calib_";
      36           0 :   namst += name;
      37           0 :   SetName(namst.Data());
      38           0 :   SetTitle(namst.Data());
      39           0 :   Reset();
      40             :   
      41           0 : }
      42             : // ----------------------------------------------------------------- //
      43             : AliPMDCalibData::AliPMDCalibData(const AliPMDCalibData& calibda) :
      44           0 :   TNamed(calibda)
      45           0 : {
      46             :   // copy constructor
      47           0 :   SetName(calibda.GetName());
      48           0 :   SetTitle(calibda.GetName());
      49           0 :   Reset();
      50           0 :   for(Int_t det = 0; det < kDet; det++)
      51             :   {
      52           0 :       for(Int_t smn = 0; smn < kModule; smn++)
      53             :       {
      54           0 :           for(Int_t row = 0; row < kRow; row++)
      55             :           {
      56           0 :               for(Int_t col = 0; col < kCol; col++)
      57             :               {
      58           0 :                   fGainFact[det][smn][row][col] = 
      59           0 :                       calibda.GetGainFact(det,smn,row,col);
      60             :               }
      61             :           }
      62             :       }
      63             :   }
      64           0 : }
      65             : // ----------------------------------------------------------------- //
      66             : AliPMDCalibData &AliPMDCalibData::operator =(const AliPMDCalibData& calibda)
      67             : {
      68             :   //asignment operator
      69           0 :   SetName(calibda.GetName());
      70           0 :   SetTitle(calibda.GetName());
      71           0 :   Reset();
      72           0 :   for(Int_t det = 0; det < kDet; det++)
      73             :   {
      74           0 :       for(Int_t smn = 0; smn < kModule; smn++)
      75             :       {
      76           0 :           for(Int_t row = 0; row < kRow; row++)
      77             :           {
      78           0 :               for(Int_t col = 0; col < kCol; col++)
      79             :               {
      80           0 :                   fGainFact[det][smn][row][col] = 
      81           0 :                       calibda.GetGainFact(det,smn,row,col);
      82             :               }
      83             :           }
      84             :       }
      85             :   }
      86           0 :   return *this;
      87             : }
      88             : // ----------------------------------------------------------------- //
      89             : AliPMDCalibData::~AliPMDCalibData()
      90           0 : {
      91             :   //destructor
      92           0 : }
      93             : // ----------------------------------------------------------------- //
      94             : void AliPMDCalibData::Reset()
      95             : {
      96             :   //memset(fgainfact ,1,2*24*48*96*sizeof(Float_t));
      97             : 
      98          21 :   for(Int_t det = 0; det < kDet; det++)
      99             :   {
     100         300 :       for(Int_t smn = 0; smn < kModule; smn++)
     101             :       {
     102       14112 :           for(Int_t row = 0; row < kRow; row++)
     103             :           {
     104     1340928 :               for(Int_t col = 0; col < kCol; col++)
     105             :               {
     106      663552 :                   fGainFact[det][smn][row][col] = 1.0;
     107             :               }
     108             :           }
     109             :       }
     110             :   }
     111           3 : }
     112             : // ----------------------------------------------------------------- //
     113             : Float_t AliPMDCalibData:: GetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col) const
     114             : {
     115        1162 :   return fGainFact[det][smn][row][col];
     116             : }
     117             : // ----------------------------------------------------------------- //
     118             : void AliPMDCalibData::SetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col, Float_t gain)
     119             : {
     120           0 :   fGainFact[det][smn][row][col]= gain;
     121           0 : }
     122             : 
     123             : // ----------------------------------------------------------------- //
     124             : void AliPMDCalibData::Print(Option_t *) const
     125             : {
     126           0 :   printf("\n ######gain factors for each cells are ####\n");
     127           0 :   for(Int_t det = 0; det < kDet; det++)
     128             :     {
     129           0 :       for(Int_t smn = 0; smn < kModule; smn++)
     130             :         {
     131           0 :           for(Int_t row = 0; row < kRow; row++)
     132             :             {
     133           0 :               for(Int_t col = 0; col < kCol; col++)
     134             :                 {
     135           0 :                   printf("Gain[%d,%d,%d,%d]= %4.1f \n",det,smn,row,col,
     136           0 :                          fGainFact[det][smn][row][col]);
     137             :                 }
     138           0 :               printf("\n");
     139             :             }
     140             :         }
     141             :     }
     142           0 : }

Generated by: LCOV version 1.11