LCOV - code coverage report
Current view: top level - PMD/PMDbase - AliPMDddlinfoData.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 30 128 23.4 %
Date: 2016-06-14 17:26:59 Functions: 14 33 42.4 %

          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 : 
      17             : //
      18             : #include "TNamed.h"
      19             : #include "AliCDBEntry.h"
      20             : #include "AliPMDddlinfoData.h"
      21             : 
      22             : 
      23          12 : ClassImp(AliPMDddlinfoData)
      24             : 
      25           3 : AliPMDddlinfoData::AliPMDddlinfoData()
      26          15 : {
      27             :   // Default constructor
      28           3 :   Reset();
      29           6 : }
      30             : // ----------------------------------------------------------------- //
      31           0 : AliPMDddlinfoData::AliPMDddlinfoData(const char* name)
      32           0 : {
      33             :   //constructor
      34           0 :   TString namst = "Calib_";
      35           0 :   namst += name;
      36           0 :   SetName(namst.Data());
      37           0 :   SetTitle(namst.Data());
      38           0 :   Reset();
      39             :   
      40           0 : }
      41             : // ----------------------------------------------------------------- //
      42             : AliPMDddlinfoData::AliPMDddlinfoData(const AliPMDddlinfoData& ddlinfoda) :
      43           0 :   TNamed(ddlinfoda)
      44           0 : {
      45             :   // copy constructor
      46           0 :   SetName(ddlinfoda.GetName());
      47           0 :   SetTitle(ddlinfoda.GetName());
      48           0 :   Reset();
      49             : 
      50           0 :   for(Int_t iddl = 0; iddl < 6; iddl++)
      51             :     {
      52           0 :       fModules[iddl] = ddlinfoda.GetNoOfModulePerDdl(iddl);
      53           0 :       for(Int_t imod = 0; imod < 12; imod++)
      54             :         {
      55           0 :           fModuleNo[iddl][imod] = ddlinfoda.GetModulesPerDdl(iddl,imod);
      56             :         }
      57             :     }
      58           0 :   for(Int_t idet = 0; idet < 2; idet++)
      59             :     {
      60           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
      61             :         {
      62           0 :           fStartRowA[idet][ismn] = ddlinfoda.GetStartRowA(idet,ismn);
      63           0 :           fStartRowB[idet][ismn] = ddlinfoda.GetStartRowB(idet,ismn);
      64           0 :           fEndRowA[idet][ismn]   = ddlinfoda.GetEndRowA(idet,ismn);
      65           0 :           fEndRowB[idet][ismn]   = ddlinfoda.GetEndRowB(idet,ismn);
      66           0 :           fStartColA[idet][ismn] = ddlinfoda.GetStartColA(idet,ismn);
      67           0 :           fStartColB[idet][ismn] = ddlinfoda.GetStartColB(idet,ismn);
      68           0 :           fEndColA[idet][ismn]   = ddlinfoda.GetEndColA(idet,ismn);
      69           0 :           fEndColB[idet][ismn]   = ddlinfoda.GetEndColB(idet,ismn);
      70             :         }
      71             :     }
      72             : 
      73           0 : }
      74             : // ----------------------------------------------------------------- //
      75             : AliPMDddlinfoData &AliPMDddlinfoData::operator =(const AliPMDddlinfoData& ddlinfoda)
      76             : {
      77             :   //asignment operator
      78           0 :   SetName(ddlinfoda.GetName());
      79           0 :   SetTitle(ddlinfoda.GetName());
      80           0 :   Reset();
      81             : 
      82           0 :   for(Int_t iddl = 0; iddl < 6; iddl++)
      83             :     {
      84           0 :       fModules[iddl] = ddlinfoda.GetNoOfModulePerDdl(iddl);
      85           0 :       for(Int_t imod = 0; imod < 12; imod++)
      86             :         {
      87           0 :           fModuleNo[iddl][imod] = ddlinfoda.GetModulesPerDdl(iddl,imod);
      88             :         }
      89             :     }
      90           0 :   for(Int_t idet = 0; idet < 2; idet++)
      91             :     {
      92           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
      93             :         {
      94           0 :           fStartRowA[idet][ismn] = ddlinfoda.GetStartRowA(idet,ismn);
      95           0 :           fStartRowB[idet][ismn] = ddlinfoda.GetStartRowB(idet,ismn);
      96           0 :           fEndRowA[idet][ismn]   = ddlinfoda.GetEndRowA(idet,ismn);
      97           0 :           fEndRowB[idet][ismn]   = ddlinfoda.GetEndRowB(idet,ismn);
      98           0 :           fStartColA[idet][ismn] = ddlinfoda.GetStartColA(idet,ismn);
      99           0 :           fStartColB[idet][ismn] = ddlinfoda.GetStartColB(idet,ismn);
     100           0 :           fEndColA[idet][ismn]   = ddlinfoda.GetEndColA(idet,ismn);
     101           0 :           fEndColB[idet][ismn]   = ddlinfoda.GetEndColB(idet,ismn);
     102             :         }
     103             :     }
     104             : 
     105           0 :   return *this;
     106             : }
     107             : // ----------------------------------------------------------------- //
     108             : AliPMDddlinfoData::~AliPMDddlinfoData()
     109           0 : {
     110             :   //destructor
     111           0 : }
     112             : // ----------------------------------------------------------------- //
     113             : void AliPMDddlinfoData::Reset()
     114             : {
     115             : 
     116          45 :   for(Int_t iddl = 0; iddl < 6; iddl++)
     117             :     {
     118          18 :       fModules[iddl] = -1;
     119         468 :       for(Int_t imod = 0; imod < 12; imod++)
     120             :         {
     121         216 :           fModuleNo[iddl][imod] = -1;
     122             :         }
     123             :     }
     124          18 :   for(Int_t idet = 0; idet < 2; idet++)
     125             :     {
     126         300 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     127             :         {
     128         144 :           fStartRowA[idet][ismn] = -1;
     129         144 :           fStartRowB[idet][ismn] = -1;
     130         144 :           fEndRowA[idet][ismn]   = -1;
     131         144 :           fEndRowB[idet][ismn]   = -1;
     132         144 :           fStartColA[idet][ismn] = -1;
     133         144 :           fStartColB[idet][ismn] = -1;
     134         144 :           fEndColA[idet][ismn]   = -1;
     135         144 :           fEndColB[idet][ismn]   = -1;
     136             :         }
     137             :     }
     138             :   
     139           3 : }
     140             : // ----------------------------------------------------------------- //
     141             : Int_t AliPMDddlinfoData:: GetNoOfModulePerDdl(Int_t iddl) const
     142             : {
     143          96 :   return fModules[iddl];
     144             : }
     145             : // ----------------------------------------------------------------- //
     146             : Int_t AliPMDddlinfoData:: GetModulesPerDdl(Int_t iddl, Int_t imod) const
     147             : {
     148         384 :   return fModuleNo[iddl][imod];
     149             : }
     150             : // ----------------------------------------------------------------- //
     151             : Int_t AliPMDddlinfoData:: GetStartRowA(Int_t idet, Int_t ismn) const
     152             : {
     153       18432 :   return fStartRowA[idet][ismn];
     154             : }
     155             : // ----------------------------------------------------------------- //
     156             : Int_t AliPMDddlinfoData:: GetStartRowB(Int_t idet, Int_t ismn) const
     157             : {
     158       18432 :   return fStartRowB[idet][ismn];
     159             : }
     160             : // ----------------------------------------------------------------- //
     161             : Int_t AliPMDddlinfoData:: GetEndRowA(Int_t idet, Int_t ismn) const
     162             : {
     163       18432 :   return fEndRowA[idet][ismn];
     164             : }
     165             : // ----------------------------------------------------------------- //
     166             : Int_t AliPMDddlinfoData:: GetEndRowB(Int_t idet, Int_t ismn) const
     167             : {
     168       18432 :   return fEndRowB[idet][ismn];
     169             : }
     170             : // ----------------------------------------------------------------- //
     171             : Int_t AliPMDddlinfoData:: GetStartColA(Int_t idet, Int_t ismn) const
     172             : {
     173       18432 :   return fStartColA[idet][ismn];
     174             : }
     175             : // ----------------------------------------------------------------- //
     176             : Int_t AliPMDddlinfoData:: GetStartColB(Int_t idet, Int_t ismn) const
     177             : {
     178       18432 :   return fStartColB[idet][ismn];
     179             : }
     180             : // ----------------------------------------------------------------- //
     181             : Int_t AliPMDddlinfoData:: GetEndColA(Int_t idet, Int_t ismn) const
     182             : {
     183       18432 :   return fEndColA[idet][ismn];
     184             : }
     185             : // ----------------------------------------------------------------- //
     186             : Int_t AliPMDddlinfoData:: GetEndColB(Int_t idet, Int_t ismn) const
     187             : {
     188       18432 :   return fEndColB[idet][ismn];
     189             : }
     190             : // ----------------------------------------------------------------- //
     191             : void AliPMDddlinfoData:: SetNoOfModulePerDdl(Int_t iddl, Int_t nmod)
     192             : {
     193           0 :   fModules[iddl] = nmod;
     194           0 : }
     195             : // ----------------------------------------------------------------- //
     196             : void AliPMDddlinfoData:: SetModuleNoPerDdl(Int_t iddl, Int_t mod[])
     197             : {
     198           0 :   for(Int_t i = 0; i < 12; i++) fModuleNo[iddl][i] = mod[i];
     199           0 : }
     200             : // ----------------------------------------------------------------- //
     201             : void AliPMDddlinfoData:: SetStartRowA(Int_t srowa[][24])
     202             : {
     203           0 :   for(Int_t idet = 0; idet < 2; idet++)
     204             :     {
     205           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     206             :         {
     207           0 :           fStartRowA[idet][ismn] = srowa[idet][ismn];
     208             :         }
     209             :     }
     210           0 : }
     211             : // ----------------------------------------------------------------- //
     212             : void AliPMDddlinfoData:: SetStartRowB(Int_t srowb[][24])
     213             : {
     214           0 :   for(Int_t idet = 0; idet < 2; idet++)
     215             :     {
     216           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     217             :         {
     218           0 :           fStartRowB[idet][ismn] = srowb[idet][ismn];
     219             :         }
     220             :     }
     221           0 : }
     222             : // ----------------------------------------------------------------- //
     223             : void AliPMDddlinfoData:: SetEndRowA(Int_t erowa[][24])
     224             : {
     225           0 :   for(Int_t idet = 0; idet < 2; idet++)
     226             :     {
     227           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     228             :         {
     229           0 :           fEndRowA[idet][ismn] = erowa[idet][ismn];
     230             :         }
     231             :     }
     232           0 : }
     233             : // ----------------------------------------------------------------- //
     234             : void AliPMDddlinfoData:: SetEndRowB(Int_t erowb[][24])
     235             : {
     236           0 :   for(Int_t idet = 0; idet < 2; idet++)
     237             :     {
     238           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     239             :         {
     240           0 :           fEndRowB[idet][ismn] = erowb[idet][ismn];
     241             :         }
     242             :     }
     243           0 : }
     244             : // ----------------------------------------------------------------- //
     245             : void AliPMDddlinfoData:: SetStartColA(Int_t scola[][24])
     246             : {
     247           0 :   for(Int_t idet = 0; idet < 2; idet++)
     248             :     {
     249           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     250             :         {
     251           0 :           fStartColA[idet][ismn] = scola[idet][ismn];
     252             :         }
     253             :     }
     254           0 : }
     255             : // ----------------------------------------------------------------- //
     256             : void AliPMDddlinfoData:: SetStartColB(Int_t scolb[][24])
     257             : {
     258           0 :   for(Int_t idet = 0; idet < 2; idet++)
     259             :     {
     260           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     261             :         {
     262           0 :           fStartColB[idet][ismn] = scolb[idet][ismn];
     263             :         }
     264             :     }
     265           0 : }
     266             : // ----------------------------------------------------------------- //
     267             : void AliPMDddlinfoData:: SetEndColA(Int_t ecola[][24])
     268             : {
     269           0 :   for(Int_t idet = 0; idet < 2; idet++)
     270             :     {
     271           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     272             :         {
     273           0 :           fEndColA[idet][ismn] = ecola[idet][ismn];
     274             :         }
     275             :     }
     276           0 : }
     277             : // ----------------------------------------------------------------- //
     278             : void AliPMDddlinfoData:: SetEndColB(Int_t ecolb[][24])
     279             : {
     280           0 :   for(Int_t idet = 0; idet < 2; idet++)
     281             :     {
     282           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     283             :         {
     284           0 :           fEndColB[idet][ismn] = ecolb[idet][ismn];
     285             :         }
     286             :     }
     287           0 : }
     288             : // ----------------------------------------------------------------- //
     289             : 
     290             : void AliPMDddlinfoData::Print(Option_t *) const
     291             : {
     292           0 :   printf("\n ######ddlinfo File for each ddl and patchbus ####\n");
     293             : 
     294           0 :   for(Int_t iddl=0; iddl<6; iddl++)
     295             :     {
     296           0 :       printf("%d %d \n",iddl, fModules[iddl]);
     297           0 :       for(Int_t imod = 0; imod < 12; imod++)
     298             :         {
     299           0 :           printf("%d \n",fModuleNo[iddl][imod]);
     300             :         }
     301             :     }
     302             : 
     303           0 :   for(Int_t idet = 0; idet < 2; idet++)
     304             :     {
     305           0 :       for(Int_t ismn = 0; ismn < 24; ismn++)
     306             :         {
     307           0 :           printf("%d %d %d %d %d %d %d %d %d %d \n",idet, ismn,
     308           0 :                  fStartRowA[idet][ismn], fEndRowA[idet][ismn],
     309           0 :                  fStartColA[idet][ismn], fEndColA[idet][ismn],
     310           0 :                  fStartRowB[idet][ismn], fEndRowB[idet][ismn],
     311           0 :                  fStartColB[idet][ismn], fEndColB[idet][ismn]);
     312             :         }
     313           0 :       printf("\n");
     314             :     }
     315             : 
     316           0 : }

Generated by: LCOV version 1.11