LCOV - code coverage report
Current view: top level - EMCAL/EMCALbase - AliEMCALTriggerSTUDCSConfig.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 20 47 42.6 %
Date: 2016-06-14 17:26:59 Functions: 5 12 41.7 %

          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             :  
      19             :  
      20             :  
      21             :  
      22             : Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
      23             : */
      24             : 
      25             : #include "AliEMCALTriggerSTUDCSConfig.h"
      26             : #include "TClonesArray.h"
      27             : #include "TVector2.h"
      28             : 
      29             : #include <iostream>
      30             : 
      31          42 : ClassImp(AliEMCALTriggerSTUDCSConfig)
      32          42 : ClassImp(AliEMCALTriggerSTUDCSConfig::AliEMCALTriggerSTUTRUErrorCount)
      33             :   
      34             : //_____________________________________________________________________________
      35           2 : AliEMCALTriggerSTUDCSConfig::AliEMCALTriggerSTUDCSConfig() : TObject(),
      36           2 : fGetRawData(1),
      37           2 : fRegion(0xFFFFFFFF),
      38           2 : fFw(0x2A012)
      39          10 : {
      40             :         //
      41             :         // AliEMCALTriggerSTUDCSConfig default constructor
      42             :         //
      43          16 :         for (int i = 0; i < 3; i++) {
      44          36 :                 for (int j = 0; j < 2; j++) {
      45          12 :                         fG[i][j] = 0;
      46          12 :                         fJ[i][j] = 0;
      47             :                 }
      48             :         }
      49           2 :         memset(fPHOSScale, 0, sizeof(Int_t) * 4);
      50           2 :         memset(fTRUErrorCounts, 0, sizeof(TClonesArray *) * 32);
      51           4 : }
      52             : 
      53             : //_____________________________________________________________________________
      54           0 : AliEMCALTriggerSTUDCSConfig::~AliEMCALTriggerSTUDCSConfig(){
      55             :   //
      56             :   // Destructor
      57             :   //
      58           0 :   for(int itru = 0; itru < 32; itru++){
      59           0 :     if(fTRUErrorCounts[itru]) delete fTRUErrorCounts[itru];
      60             :   }
      61           0 : }
      62             : 
      63             : //_____________________________________________________________________________
      64             : void AliEMCALTriggerSTUDCSConfig::GetSegmentation(TVector2& v1, TVector2& v2, TVector2& v3, TVector2& v4) const
      65             : {
      66             :         // Get Segmentation
      67             :         
      68          64 :         v1.Set(1., 1.);
      69          32 :         v2.Set(2., 2.);
      70          32 :         v3.Set(4., 4.);
      71             :         
      72          32 :         Double_t js = 2 + (fFw >> 16);
      73          32 :         v4.Set(js, js);
      74          32 : }
      75             : 
      76             : //_____________________________________________________________________________
      77             : void  AliEMCALTriggerSTUDCSConfig::SetTRUErrorCounts(Int_t itru, Int_t itime, ULong64_t errorcounts){
      78             :   //
      79             :   // Set TRU error counts
      80             :   //
      81           0 :   if(itru >= 32) return;
      82           0 :   if(!fTRUErrorCounts[itru])
      83           0 :     fTRUErrorCounts[itru] = new TClonesArray("AliEMCALTriggerSTUDCSConfig::AliEMCALTriggerSTUTRUErrorCount");
      84           0 :   AliEMCALTriggerSTUTRUErrorCount test(itime, errorcounts), *found(NULL);
      85           0 :   if((found = dynamic_cast<AliEMCALTriggerSTUTRUErrorCount *>(fTRUErrorCounts[itru]->FindObject(&test)))){
      86           0 :     found->SetValue(itime, errorcounts);
      87           0 :   } else {
      88           0 :     Int_t nErrorCountsTRU = fTRUErrorCounts[itru]->GetEntries();
      89           0 :     new((*(fTRUErrorCounts[itru]))[nErrorCountsTRU]) AliEMCALTriggerSTUTRUErrorCount(itime, errorcounts);
      90             :   }
      91           0 : }
      92             : 
      93             : //_____________________________________________________________________________
      94             : TClonesArray *AliEMCALTriggerSTUDCSConfig::GetErrorCountsForTRU(Int_t itru) const{
      95             :   //
      96             :   // Return time-dependent error counts for a given TRU
      97             :   //
      98           0 :   if(itru >= 32) return NULL;
      99           0 :   return fTRUErrorCounts[itru];
     100           0 : }
     101             : 
     102             : //_____________________________________________________________________________
     103             : Bool_t AliEMCALTriggerSTUDCSConfig::AliEMCALTriggerSTUTRUErrorCount::IsEqual(const TObject *o) const{
     104             :   //
     105             :   // Checks for equalness according to the time stamp
     106             :   //
     107           0 :   const AliEMCALTriggerSTUTRUErrorCount *test = dynamic_cast<const AliEMCALTriggerSTUTRUErrorCount *>(o);
     108           0 :   if(!test) return false;
     109           0 :   return test->fTime == fTime;
     110           0 : }
     111             : 
     112             : //_____________________________________________________________________________
     113             : Int_t AliEMCALTriggerSTUDCSConfig::AliEMCALTriggerSTUTRUErrorCount::Compare(const TObject *o) const{
     114             :   //
     115             :   // Compares time-dependent error counts based on the time information
     116             :   //
     117           0 :   const AliEMCALTriggerSTUTRUErrorCount *test = dynamic_cast<const AliEMCALTriggerSTUTRUErrorCount *>(o);
     118           0 :   if(!test) return 1;
     119           0 :   if(fTime > test->fTime) return 1;
     120           0 :   if(fTime < test->fTime) return -1;
     121           0 :   return 0;
     122           0 : }
     123             : 

Generated by: LCOV version 1.11