LCOV - code coverage report
Current view: top level - ZDC/ZDCbase - AliZDCChMap.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 17 104 16.3 %
Date: 2016-06-14 17:26:59 Functions: 4 13 30.8 %

          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             : ///////////////////////////////////////////////////////////////
      17             : //                                                           //
      18             : // Class for ZDC calibration -> ADC channels mapping         //
      19             : // author: Chiara Oppedisano                                 //
      20             : //                                                           //
      21             : ///////////////////////////////////////////////////////////////
      22             : 
      23             : #include "AliZDCChMap.h"
      24             : 
      25          12 : ClassImp(AliZDCChMap)
      26             : 
      27             : //________________________________________________________________
      28             : AliZDCChMap::AliZDCChMap():
      29           3 : TNamed()
      30          15 : {
      31           3 :   Reset();
      32           6 : }
      33             : 
      34             : //________________________________________________________________
      35             : AliZDCChMap::AliZDCChMap(const char* name):
      36           0 : TNamed()
      37           0 : {
      38             :   // Constructor
      39           0 :   TString namst = "Calib_";
      40           0 :   namst += name;
      41           0 :   SetName(namst.Data());
      42           0 :   SetTitle(namst.Data());
      43           0 :   Reset();
      44             :   int const kNModules = 10;
      45             :   int const kNChannels = 48;
      46             :   int const kNScChannels = 32;
      47           0 :   for(Int_t i=0; i<kNModules; i++){
      48           0 :     for(Int_t j=0; j<3; j++) fModuleMap[i][j] = 0;
      49             :   }
      50           0 :   for(Int_t i=0; i<kNChannels; i++){
      51           0 :     fADCModule[i] = -1;
      52           0 :     fADCChannel[i] = -1;
      53           0 :     fDetector[i] = -1;
      54           0 :     fSector[i] = -1;
      55           0 :     fADCSignalCode[i] = -1;
      56             :   }
      57           0 :   for(Int_t i=0; i<kNScChannels; i++){
      58           0 :     fScalerChannel[i] = -1;
      59           0 :     fScDetector[i] = -1;
      60           0 :     fScSector[i] = -1;
      61           0 :     fScSignalCode[i] = -1;
      62             :     //
      63           0 :     fTDCChannel[i] = -1;
      64           0 :     fTDCSignalCode[i] = -1;
      65             :   }
      66             :   
      67             :   
      68           0 : }
      69             : 
      70             : //________________________________________________________________
      71             : AliZDCChMap::AliZDCChMap(const AliZDCChMap& calibda) :
      72           0 :   TNamed(calibda)
      73           0 : {
      74             :   // Copy constructor
      75           0 :   SetName(calibda.GetName());
      76           0 :   SetTitle(calibda.GetName());
      77           0 :   Reset();
      78             :   int const kNModules = 10;
      79             :   int const kNChannels = 48;
      80             :   int const kNScChannels = 32;
      81           0 :   for(Int_t i=0; i<kNModules; i++){
      82           0 :      for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j);
      83             :   }
      84           0 :   for(int t=0; t<kNChannels; t++){
      85           0 :      fADCModule[t]  = calibda.GetADCModule(t);
      86           0 :      fADCChannel[t] = calibda.GetADCChannel(t);
      87           0 :      fDetector[t]   = calibda.GetDetector(t);
      88           0 :      fSector[t]     = calibda.GetSector(t);
      89           0 :      fADCSignalCode[t]  = calibda.GetADCSignalCode(t);
      90           0 :      if(t<kNScChannels){
      91           0 :        fScalerChannel[t] = calibda.GetScChannel(t);
      92           0 :        fScDetector[t]    = calibda.GetScDetector(t);
      93           0 :        fScSector[t]      = calibda.GetScSector(t);
      94           0 :        fScSignalCode[t]  = calibda.GetScSignalCode(t);
      95             :        //
      96           0 :        fTDCChannel[t] = calibda.GetTDCChannel(t);
      97           0 :        fTDCSignalCode[t] = calibda.GetTDCChannel(t);
      98           0 :      }
      99             :   }
     100           0 : }
     101             : 
     102             : //________________________________________________________________
     103             : AliZDCChMap &AliZDCChMap::operator =(const AliZDCChMap& calibda)
     104             : {
     105             : // assignment operator
     106           0 :   SetName(calibda.GetName());
     107           0 :   SetTitle(calibda.GetName());
     108           0 :   Reset();
     109             :   int const kNModules = 10;
     110             :   int const kNChannels = 48;
     111             :   int const kNScChannels = 32;
     112           0 :   for(Int_t i=0; i<kNModules; i++){
     113           0 :      for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j);
     114             :   }
     115           0 :   for(int t=0; t<kNChannels; t++){
     116           0 :      fADCModule[t]  = calibda.GetADCModule(t);
     117           0 :      fADCChannel[t] = calibda.GetADCChannel(t);
     118           0 :      fDetector[t]   = calibda.GetDetector(t);
     119           0 :      fSector[t]     = calibda.GetSector(t);
     120           0 :      fADCSignalCode[t]  = calibda.GetADCSignalCode(t);
     121           0 :      if(t<kNScChannels){
     122           0 :        fScalerChannel[t] = calibda.GetScChannel(t);
     123           0 :        fScDetector[t]    = calibda.GetScDetector(t);
     124           0 :        fScSector[t]      = calibda.GetScSector(t);
     125           0 :        fScSignalCode[t]  = calibda.GetScSignalCode(t);
     126             :        //
     127           0 :        fTDCChannel[t] = calibda.GetTDCChannel(t);
     128           0 :        fTDCSignalCode[t] = calibda.GetTDCChannel(t);
     129           0 :      }
     130             :   }
     131             : 
     132           0 :   return *this;
     133             : }
     134             : 
     135             : //________________________________________________________________
     136             : AliZDCChMap::~AliZDCChMap()
     137           0 : {
     138           0 : }
     139             : 
     140             : //________________________________________________________________
     141             : void AliZDCChMap::Reset()
     142             : {
     143             :   // Reset
     144           6 :   memset(fADCModule,0,48*sizeof(Int_t));
     145           3 :   memset(fADCChannel,0,48*sizeof(Int_t));
     146           3 :   memset(fDetector,0,48*sizeof(Int_t));
     147           3 :   memset(fSector,0,48*sizeof(Int_t));
     148           3 :   memset(fADCSignalCode,0,48*sizeof(Int_t));
     149           3 :   memset(fScalerChannel,0,32*sizeof(Int_t));
     150           3 :   memset(fScDetector,0,32*sizeof(Int_t));
     151           3 :   memset(fScSector,0,32*sizeof(Int_t));
     152           3 :   memset(fScSignalCode,0,32*sizeof(Int_t));
     153           3 :   memset(fTDCChannel,0,32*sizeof(Int_t));
     154           3 :   memset(fTDCSignalCode,0,32*sizeof(Int_t));
     155           3 : }                                                                                       
     156             : 
     157             : 
     158             : //________________________________________________________________
     159             : void  AliZDCChMap::Print(Option_t *) const
     160             : {
     161             :    // Printing of calibration object
     162           0 :    printf("\n\n\t ******************* AliZDCChMap object *******************\n\n");
     163           0 :    for(Int_t i=0; i<10; i++){
     164           0 :      printf("  ******** GEO %d mod. type %d #ch. %d\n",
     165           0 :       fModuleMap[i][0],fModuleMap[i][1],fModuleMap[i][2]);     
     166             :    } 
     167           0 :    printf("\n");
     168           0 :    for(Int_t i=0; i<48; i++) 
     169           0 :      printf(" ADC - mod. %d ch. %d signal %d -> detector %d sector %d\n",
     170           0 :       fADCModule[i], fADCChannel[i], fADCSignalCode[i], fDetector[i], fSector[i]);
     171           0 :    printf("\n");
     172           0 :    for(Int_t i=0; i<32; i++)
     173           0 :      if(fScalerChannel[i]!=-1)
     174           0 :        printf(" SCALER - ch. %d signal %d\n",
     175           0 :         fScalerChannel[i], fScSignalCode[i]);
     176           0 :    printf("\n");
     177           0 :    for(Int_t i=0; i<32; i++) 
     178           0 :      if(fTDCChannel[i]!=-1)
     179           0 :        printf(" TDC - ch. %d signal %d\n",
     180           0 :         fTDCChannel[i], fTDCSignalCode[i]);
     181           0 :    printf("\n\t **********************************************************\n\n");
     182             :  
     183           0 : } 

Generated by: LCOV version 1.11