LCOV - code coverage report
Current view: top level - VZERO/VZERObase - AliVZERODataFEE.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 103 1.0 %
Date: 2016-06-14 17:26:59 Functions: 1 12 8.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             : // Class AliVZERODataFEE
      17             : // ---------------------
      18             : // Used to process the TMap of DCS values comming from the shuttle.
      19             : // It stores into a TMap the FEE parameters for the given run number
      20             : //
      21             : 
      22             : #include <TTimeStamp.h>
      23             : #include <TObjString.h>
      24             : #include <TMap.h>
      25             : 
      26             : #include "AliDCSValue.h"
      27             : #include "AliLog.h"
      28             : #include "AliVZERODataFEE.h"
      29             : 
      30          44 : ClassImp(AliVZERODataFEE)
      31             : 
      32             : //_____________________________________________________________________________
      33           0 : AliVZERODataFEE::AliVZERODataFEE() :
      34           0 :         TObject(),
      35           0 :         fRun(0),
      36           0 :         fStartTime(0),
      37           0 :         fEndTime(0),
      38           0 :         fIsProcessed(kFALSE),
      39           0 :         fParameters(NULL)
      40           0 : {
      41             :         // Default constructor
      42           0 : }
      43             : 
      44             : //_____________________________________________________________________________
      45           0 : AliVZERODataFEE::AliVZERODataFEE(Int_t nRun, UInt_t startTime, UInt_t endTime) : 
      46           0 :         TObject(),
      47           0 :         fRun(nRun),
      48           0 :         fStartTime(startTime),
      49           0 :         fEndTime(endTime),
      50           0 :         fIsProcessed(kFALSE),
      51           0 :         fParameters(new TMap())
      52           0 : {
      53             :         // Constructor
      54           0 :         AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", nRun,
      55             :                                  TTimeStamp(startTime).AsString(),
      56             :                                  TTimeStamp(endTime).AsString()));
      57           0 :         fParameters->SetOwnerValue();
      58           0 :         Init();
      59           0 : }
      60             : 
      61             : //_____________________________________________________________________________
      62             : AliVZERODataFEE::~AliVZERODataFEE()
      63           0 : {
      64           0 :         delete fParameters;
      65           0 : }
      66             : 
      67             : //_____________________________________________________________________________
      68             : void AliVZERODataFEE::Init(){
      69             :         // Initialization of DCS aliases
      70             :         int iAlias = 0;
      71             : 
      72             :         // CCIU Parameters
      73             :         
      74           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/BBAThreshold";
      75           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/BBCThreshold";
      76           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/BGAThreshold";
      77           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/BGCThreshold";
      78           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/BBAForBGThreshold";
      79           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/BBCForBGThreshold";
      80           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0AThrLow";
      81           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0AThrHigh";
      82           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0CThrLow";
      83           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0CThrHigh";
      84           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0AThrLow";
      85           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0AThrHigh";
      86           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0CThrLow";
      87           0 :         fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0CThrHigh";
      88           0 :         for(int i=1;i<=5;i++) {
      89           0 :                 fAliasNames[iAlias] = "V00/FEE/CCIU/TriggerSelect";
      90           0 :                 fAliasNames[iAlias++] += Form("%d",i);
      91             :         }
      92             :         
      93             :         // CIU  Parameters
      94             :         
      95           0 :         for(int iCIU = 0; iCIU<8 ; iCIU++){
      96           0 :                 for(int iParam=0; iParam<kNCIUParam;iParam++){
      97           0 :                         fAliasNames[iAlias] = "V00/FEE/";
      98           0 :                         fAliasNames[iAlias] += Form("CIU%d/",iCIU);
      99             :                         
     100           0 :                         fAliasNames[iAlias] += GetFEEParamName(iParam);
     101           0 :                         iAlias++;
     102             :                 }
     103           0 :                 for(int iParam=kNCIUParam; iParam<kNCIUParam+kNChannelParam;iParam++){
     104           0 :                         for(int iCh=1;iCh<=8;iCh++){
     105           0 :                                 fAliasNames[iAlias] = "V00/FEE/";
     106           0 :                                 fAliasNames[iAlias] += Form("CIU%d/",iCIU);
     107             :                         
     108           0 :                                 fAliasNames[iAlias] += GetFEEParamName(iParam);
     109           0 :                                 fAliasNames[iAlias] += Form("%d",iCh);
     110             :                         
     111           0 :                                 iAlias++;
     112             :                         }
     113             :                 }
     114             :                 
     115             :         }
     116             : 
     117           0 :         if(iAlias!=kNAliases) 
     118           0 :                 AliError(Form("Number of FEE Aliases defined not correct"));
     119             :         
     120           0 : }
     121             : //_____________________________________________________________________________
     122             : void AliVZERODataFEE::ProcessData(TMap& aliasMap){
     123             : // Process the TMap of DCS data
     124             :         
     125           0 :         if(!(fAliasNames[0])) Init();
     126             :         
     127             :         TObjArray *aliasArr;
     128             :         AliDCSValue* aValue;
     129             : 
     130             :         // starting loop on aliases
     131           0 :         for(int iAlias=0; iAlias<kNAliases; iAlias++){
     132             :                 
     133           0 :                 aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[iAlias].Data());
     134           0 :                 if(!aliasArr){
     135           0 :                         AliError(Form("Alias %s not found!", fAliasNames[iAlias].Data()));
     136           0 :                         return;
     137             :                 }
     138             :                                 
     139           0 :                 if(aliasArr->GetEntries()<1){
     140           0 :                         AliError(Form("Alias %s has no entries!", fAliasNames[iAlias].Data()));
     141           0 :                         continue;
     142             :                 }
     143             :                 
     144           0 :                 TIter iterarray(aliasArr);
     145             :                                 
     146             :                 AliDCSValue * lastVal = NULL;
     147           0 :                 while((aValue = (AliDCSValue*) iterarray.Next())) lastVal = aValue; // Take only the last value
     148             :                 
     149           0 :                 fParameters->Add(new TObjString(fAliasNames[iAlias].Data()),lastVal);
     150             :                 
     151           0 :         }
     152             :         
     153           0 :         fIsProcessed=kTRUE;
     154             :         
     155           0 : }
     156             : //_____________________________________________________________________________
     157             : 
     158             : TString AliVZERODataFEE::GetFEEParamName(Int_t iParam){
     159             : // Return the name of the FEE Parameter iParam
     160           0 :         TString result;
     161           0 :         if(iParam>kNCIUParam + kNChannelParam -1) {
     162           0 :                 AliError(Form("Requesting FEE parameter number %d. Max parameter number is : %d",iParam,kNCIUParam + kNChannelParam-1));
     163           0 :                 return result;
     164             :         }
     165           0 :         switch (iParam) {
     166           0 :                 case 0: result = "Clk1Win1"; break;
     167           0 :                 case 1: result = "Clk2Win1"; break;
     168           0 :                 case 2: result = "Clk1Win2"; break;
     169           0 :                 case 3: result = "Clk2Win2"; break;
     170           0 :                 case 4: result = "DelayClk1Win1"; break;
     171           0 :                 case 5: result = "DelayClk2Win1"; break;
     172           0 :                 case 6: result = "DelayClk1Win2"; break;
     173           0 :                 case 7: result = "DelayClk2Win2"; break;
     174           0 :                 case 8: result = "LatchWin1"; break;
     175           0 :                 case 9: result = "LatchWin2"; break;
     176           0 :                 case 10: result = "ResetWin1"; break;
     177           0 :                 case 11: result = "ResetWin2"; break;
     178           0 :                 case 12: result = "PedestalSubtraction"; break;
     179           0 :                 case 13: result = "EnableCharge"; break;
     180           0 :                 case 14: result = "EnableTiming"; break;
     181           0 :                 case 15: result = "PedEven"; break;
     182           0 :                 case 16: result = "PedOdd"; break;
     183           0 :                 case 17: result = "PedCutEven"; break;
     184           0 :                 case 18: result = "PedCutOdd"; break;
     185           0 :                 case 19: result = "DelayHit"; break;
     186           0 :                 case 20: result = "DiscriThr"; break;
     187             :         }
     188           0 :         return result;
     189           0 : }
     190             : 
     191             : void AliVZERODataFEE::PrintAliases(){
     192           0 :         for(int i=0;i<kNAliases;i++) AliInfo(Form("%s",fAliasNames[i].Data()));
     193           0 : }
     194             : 

Generated by: LCOV version 1.11