LCOV - code coverage report
Current view: top level - ITS/ITSbase - AliITSDCSAnalyzerSDD.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 185 0.5 %
Date: 2016-06-14 17:26:59 Functions: 1 10 10.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 2007-2009, 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             : /* $Id$ */
      17             : 
      18             : ///////////////////////////////////////////////////////////////////
      19             : // Implementation of the class for SDD DCS data analysis         //
      20             : // Origin: F.Prino, Torino, prino@to.infn.it                     //
      21             : //         V.Pospisil, CTU Prague, gdermog@seznam.cz             //
      22             : ///////////////////////////////////////////////////////////////////
      23             : 
      24             : 
      25             : #include "AliITSDCSAnalyzerSDD.h"
      26             : #include "AliDCSValue.h"
      27             : #include "AliLog.h"
      28             : #include "AliITSgeomTGeo.h"
      29             : 
      30         118 : ClassImp(AliITSDCSAnalyzerSDD)
      31             : 
      32             : //---------------------------------------------------------------
      33           0 :   AliITSDCSAnalyzerSDD::AliITSDCSAnalyzerSDD(): TObject(),
      34           0 : fHVDelay(0),fMVDelay(0),fTLDelay(0),fTRDelay(0),fStTLDelay(0),fStTRDelay(0),fOKDelay(0),
      35           0 : fHVThresholdFrac(0), fMVThresholdFrac(0), fTLThresholdFrac(0), fTRThresholdFrac(0)
      36           0 : {
      37             : // Default constructor
      38           0 :   Init();
      39           0 :   SetHVThreshold();
      40           0 :   SetMVThreshold();
      41           0 :   SetTLThreshold();
      42           0 :   SetTRThreshold();
      43           0 :   for( Int_t moduleLoop = 0; moduleLoop < kNmodules; moduleLoop++ ) fDCSData[moduleLoop] = NULL;
      44           0 : } /*AliITSDCSAnalyzerSDD::AliITSDCSAnalyzerSDD*/
      45             : 
      46             : //---------------------------------------------------------------
      47             : 
      48             : AliITSDCSAnalyzerSDD::~AliITSDCSAnalyzerSDD()
      49           0 : { 
      50             : // Destructor
      51           0 :   for(int j=0; j<kNmodules; j++)
      52             :   {
      53           0 :     if( fDCSData[j] ) delete fDCSData[j];
      54             :   } /*for( j )*/
      55           0 : } /*AliITSDCSAnalyzerSDD::~AliITSDCSAnalyzerSDD*/
      56             : 
      57             : //---------------------------------------------------------------
      58             : 
      59             : void AliITSDCSAnalyzerSDD::AnalyzeData(TMap* dcsMap)
      60             : {
      61             : // Data processing. Takes DCS points from alias map and sorts them into AliITSDCSDataSDD objects.
      62             : 
      63             :    Int_t   counter = 0; // Counter of stored DCS records
      64             : 
      65             :    Float_t lastTLValUpper;
      66             :    Float_t lastTLValLower;
      67             :    Float_t lastTRValUpper;
      68             :    Float_t lastTRValLower;
      69             :    Float_t lastHVValUpper;
      70             :    Float_t lastHVValLower;
      71             :    Float_t lastMVValUpper;
      72             :    Float_t lastMVValLower;
      73             :                         // Thresholds for float DCS variables
      74             : 
      75             :    Int_t nEntries=0;      // Number of entries in each TObjArray, that contains DCS variable values
      76             :    AliDCSValue *valToProcess;
      77             :                         // Pointer to currently processed DCS variable value
      78             :    Float_t valToProcessFloat;
      79             :                         // Value of currently processed DCS variable
      80             : 
      81             : 
      82           0 :    for( Int_t iLay = 3; iLay < 5; iLay++ )
      83             :    {
      84             : 
      85           0 :       Int_t maxLad = ( iLay == 3) ? kNladders3 : kNladders4;
      86           0 :       Int_t maxMod = ( iLay == 3) ? kNmodLad3 : kNmodLad4;
      87             : 
      88           0 :       for(Int_t iLad = 0; iLad < maxLad; iLad++)
      89             :       {
      90           0 :          for(Int_t iMod = 0; iMod < maxMod; iMod++)
      91             :          {
      92             :                         // Loads arrays of DCS variables from map. Variables are 
      93             :                         //  searched by names (for ex. SDD_LAYER3_LADDER5_MODULE4_HV)
      94             : 
      95           0 :             Int_t moduleLoop = AliITSgeomTGeo::GetModuleIndex( iLay, iLad + 1, iMod + 1 ) - 240;
      96             : 
      97           0 :             fDCSData[moduleLoop] = new AliITSDCSDataSDD();
      98             :                         // DCS data for specific SDD module will be stored in this class
      99             : 
     100           0 :             TObjArray* arrHV = (TObjArray*) dcsMap->GetValue( fHVDPNames[moduleLoop].Data() );
     101           0 :             if(!arrHV) AliWarning( Form("DCS HV alias %s not found!\n", fHVDPNames[moduleLoop].Data()) );
     102             : 
     103           0 :             TObjArray* arrMV = (TObjArray*) dcsMap->GetValue( fMVDPNames[moduleLoop].Data() );
     104           0 :             if(!arrMV) AliWarning( Form("DCS MV alias %s not found!\n", fMVDPNames[moduleLoop].Data()));
     105             : 
     106           0 :             TObjArray* arrOK = (TObjArray*) dcsMap->GetValue( fOKDPNames[moduleLoop].Data() );
     107           0 :             if(!arrOK)  AliWarning( Form("DCS MOD_OK alias %s not found!\n", fOKDPNames[moduleLoop].Data()));
     108             : 
     109           0 :             TObjArray* arrTL = (TObjArray*) dcsMap->GetValue( fTLDPNames[moduleLoop].Data() );
     110           0 :             if(!arrTL) AliWarning( Form("DCS TEMP_L alias %s not found!\n", fTLDPNames[moduleLoop].Data()));
     111             : 
     112           0 :             TObjArray* arrTR = (TObjArray*) dcsMap->GetValue( fTRDPNames[moduleLoop].Data() );
     113           0 :             if(!arrTR) AliWarning( Form("DCS TEMP_R alias %s not found!\n", fTRDPNames[moduleLoop].Data()));
     114             : 
     115           0 :             TObjArray* arrStTL = (TObjArray*) dcsMap->GetValue( fTLStDPNames[moduleLoop].Data() );
     116           0 :             if(!arrStTL) AliWarning( Form("DCS TEMP_L_STATE alias %s not found!\n", fTLStDPNames[moduleLoop].Data()));
     117             : 
     118           0 :             TObjArray* arrStTR = (TObjArray*) dcsMap->GetValue( fTRStDPNames[moduleLoop].Data() );
     119           0 :             if(!arrStTR) AliWarning( Form("DCS TEMP_R_STATE alias %s not found!\n", fTRStDPNames[moduleLoop].Data()));
     120             : 
     121             :             lastTLValUpper = -1e-10;
     122             :             lastTLValLower = +1e+10;
     123             :             lastTRValUpper = -1e-10;
     124             :             lastTRValLower = +1e+10;
     125             :             lastHVValUpper = -1e-10;
     126             :             lastHVValLower = +1e+10;
     127             :             lastMVValUpper = -1e-10;
     128             :             lastMVValLower = +1e+10;
     129             :                         // First value of any DCS variable must be written
     130             : 
     131             : 
     132           0 :             if( arrTL )
     133             :             {
     134           0 :                nEntries = arrTL->GetEntries();
     135           0 :                fDCSData[moduleLoop]->SetNPointsTempLeft( nEntries );
     136             :                         // Left temperature array size is set
     137             : 
     138           0 :                for( Int_t tlLoop = 0; tlLoop < nEntries; tlLoop++ )
     139             :                {        // Left temerature values are copied into the AliITSDCSDataSDD TempLeft array
     140           0 :                   valToProcess = (AliDCSValue *)(arrTL->At(tlLoop));
     141           0 :                   valToProcessFloat = valToProcess->GetFloat();
     142             :                         // Value is readed from the input array
     143             : 
     144           0 :                   if( lastTLValLower <= valToProcessFloat && valToProcessFloat <= lastTLValUpper ) continue;
     145             :                         // Value did not cross the treshold (upper neither lower),
     146             :                         //  it is not necessary to store it.
     147           0 :                   fDCSData[moduleLoop]->SetValueTempLeft( valToProcess->GetTimeStamp() - fTLDelay, valToProcessFloat );
     148             :                         // Value is stored
     149           0 :                   lastTLValLower = valToProcessFloat * ( 1.0 - fTLThresholdFrac );
     150           0 :                   lastTLValUpper = valToProcessFloat * ( 1.0 + fTLThresholdFrac );
     151             :                         // New tresholds are set
     152           0 :                   counter ++;
     153           0 :                } /*for( tlLoop )*/
     154           0 :             } /*if*/
     155             : 
     156             : 
     157           0 :             if( arrTR )
     158             :             {
     159           0 :                nEntries = arrTR->GetEntries();
     160           0 :                fDCSData[moduleLoop]->SetNPointsTempRight( nEntries );
     161             :                         // Right temperature array size is set 
     162             : 
     163           0 :                for( Int_t trLoop = 0; trLoop < nEntries; trLoop++ )
     164             :                {           // Right temerature values are copied into the AliITSDCSDataSDD TempRight array
     165           0 :                   valToProcess = (AliDCSValue *)(arrTR->At(trLoop));
     166           0 :                   valToProcessFloat = valToProcess->GetFloat();
     167             :                          // Value is readed from the input array
     168             : 
     169           0 :                   if( lastTRValLower <= valToProcessFloat && valToProcessFloat <= lastTRValUpper ) continue;
     170             :                          // Value did not cross the treshold (upper neither lower),
     171             :                          //  it is not necessary to store it.
     172           0 :                   fDCSData[moduleLoop]->SetValueTempRight( valToProcess->GetTimeStamp() - fTRDelay, valToProcessFloat );
     173             :                          // Value is stored
     174           0 :                   lastTRValLower = valToProcessFloat * ( 1.0 - fTRThresholdFrac );
     175           0 :                   lastTRValUpper = valToProcessFloat * ( 1.0 + fTRThresholdFrac );
     176             :                          // New tresholds are set
     177           0 :                   counter ++;
     178           0 :                } /*for( trLoop )*/
     179           0 :             } /*if*/
     180             : 
     181             : 
     182           0 :             if( arrHV )
     183             :             {
     184           0 :                nEntries = arrHV->GetEntries();
     185           0 :                fDCSData[moduleLoop]->SetNPointsHV( nEntries );
     186             :                         // HV array size is set 
     187             : 
     188           0 :                for( Int_t hvLoop = 0; hvLoop < nEntries; hvLoop++ )
     189             :                {        // HV values are copied into the AliITSDCSDataSDD HV array
     190           0 :                   valToProcess = (AliDCSValue *)(arrHV->At(hvLoop));
     191           0 :                   valToProcessFloat = valToProcess->GetFloat();
     192             :                         // Value is readed from the input array
     193           0 :                   if( lastHVValLower <= valToProcessFloat && valToProcessFloat <= lastHVValUpper ) continue;
     194             :                         // Value did not cross the treshold (upper neither lower),
     195             :                         //  it is not necessary to store it.
     196           0 :                   fDCSData[moduleLoop]->SetValueHV( valToProcess->GetTimeStamp() - fHVDelay, valToProcessFloat );
     197             :                         // Value is stored
     198           0 :                   lastHVValLower = valToProcessFloat * ( 1.0 - fHVThresholdFrac );
     199           0 :                   lastHVValUpper = valToProcessFloat * ( 1.0 + fHVThresholdFrac );
     200             :                         // New tresholds are set
     201           0 :                   counter ++;
     202           0 :                } /*for( hvLoop )*/
     203             : 
     204           0 :             } /*if*/
     205             : 
     206             : 
     207             : 
     208           0 :             if( arrMV )
     209             :             {
     210           0 :                nEntries = arrMV->GetEntries();
     211           0 :                fDCSData[moduleLoop]->SetNPointsMV( nEntries );
     212             :                         // MV array size is set 
     213             : 
     214           0 :                for( Int_t mvLoop = 0; mvLoop < nEntries; mvLoop++ )
     215             :                {        // MV values are copied into the AliITSDCSDataSDD MV array
     216           0 :                   valToProcess = (AliDCSValue *)(arrMV->At(mvLoop));
     217           0 :                   valToProcessFloat = valToProcess->GetFloat();
     218             :                         // Value is readed from the input array
     219           0 :                   if( lastMVValLower <= valToProcessFloat && valToProcessFloat <= lastMVValUpper ) continue;
     220             :                         // Value did not cross the treshold (upper neither lower),
     221             :                         //  it is not necessary to store it.
     222           0 :                   fDCSData[moduleLoop]->SetValueMV( valToProcess->GetTimeStamp() - fMVDelay, valToProcessFloat );
     223             :                         // Value is stored
     224           0 :                   lastMVValLower = valToProcessFloat * ( 1.0 - fMVThresholdFrac );
     225           0 :                   lastMVValUpper = valToProcessFloat * ( 1.0 + fMVThresholdFrac );
     226             :                         // New treshold is ser
     227           0 :                   counter ++;
     228           0 :                } /*for( mvLoop )*/
     229             : 
     230           0 :             } /*if*/
     231             : 
     232             : 
     233             : /* Following part of the code is responsibile for the condensing of all status information given by DCS
     234             :    into one array of Char_t. Each record of this array is in principle a bit map : 
     235             : 
     236             :       0. bit ... _OK
     237             :       1. bit ... _TEMP_L_STATE
     238             :       2. bit ... _TEMP_R_STATE 
     239             : 
     240             :    Each record have its own time stamp. Because there are three inputs with independent time stamp,
     241             :    some algorithm which assigns new time stamp to bitmap according to three input time stamps is
     242             :    necessary.
     243             : 
     244             :    Let's vizualize time stamps of the three input arrays. There is time on x-axis :
     245             : 
     246             :             +------------+---------------------+------
     247             :             |            |                     |          _OK
     248             :       +-----++------+----+--------+------------+------
     249             :       |      |      |             |            |          _TEMP_L_STATE
     250             :    +--+------+---+--+-------+-----+--------+---+------
     251             :    |             |          |     |        |   |          _TEMP_R_STATE
     252             :    +-------------+----------+-----+--------+---+------
     253             : 
     254             :    |   |    | |  |   |   |  |     |        |   |
     255             :    V   V    V V  V   V   V  V     V        V   V
     256             : 
     257             :    +---+----+-+--+---+---+--+-----+--------+---+------
     258             :    |   |    | |  |   |   |  |     |        |   |           Status bitmap
     259             :    +---+----+-+--+---+---+--+-----+--------+---+------
     260             : 
     261             : 
     262             :    Principle of combining three status records into one is visible from the picture.
     263             :    If there are two sequent records with the same status bitmap, they are joined into
     264             :    one (with the time stamp of the earliest one).
     265             : 
     266             : */
     267             :             Int_t nStTLEntries = 0;
     268             :             Int_t nStTREntries = 0;
     269             :             Int_t nOKEntries = 0;
     270             : 
     271             :             bool arrStTLcreated = false;
     272             :             bool arrStTRcreated = false;
     273             :             bool arrOKcreated = false;
     274             : 
     275           0 :             if( arrStTL ) 
     276           0 :              nStTLEntries = arrStTL->GetEntries();
     277             :             else
     278           0 :              { arrStTL = new TObjArray; arrStTLcreated = true; }
     279             : 
     280           0 :             if( arrStTR ) 
     281           0 :              nStTREntries = arrStTR->GetEntries();
     282             :             else
     283           0 :              { arrStTR = new TObjArray; arrStTRcreated = true; }
     284             : 
     285           0 :             if( arrOK ) 
     286           0 :              nOKEntries = arrOK->GetEntries();
     287             :             else
     288           0 :              { arrOK = new TObjArray; arrOKcreated = true; }
     289             :                         // Gets number of _STAT_L, _STAT_R and _OK values stored in dcsMap. If any array does
     290             :                         //  not exist, it must be created (and it will be filled by 0 status later)
     291             : 
     292           0 :             if( nStTLEntries < 1 )
     293             :             {           // TObjArray arrStTL is empty. This would cause segmentation violation during
     294             :                         //  the condensing, so this case must be handled before algorithm starts
     295           0 :                AliWarning( Form( "%s contains no data!\n", fTLStDPNames[moduleLoop].Data() ) );
     296             :                nStTLEntries = 1;
     297           0 :                arrStTL->Add( new AliDCSValue(  (Int_t)0, 0x7FFFFFFF ) );
     298             :                         // 0x7FFFFFFF = 2147483647, maximal signed Int_t number. Left temperature
     299             :                         //  sensor will be regarded as switched-off during whole run.
     300           0 :             } /*if*/
     301             :  
     302           0 :             if( nStTREntries < 1 )
     303             :             {           // TObjArray arrStTR is empty. This would cause segmentation violation during
     304             :                         //  the condensing, so this case must be handled before algorithm starts
     305           0 :                AliWarning( Form( "%s contains no data!\n", fTRStDPNames[moduleLoop].Data() ) );
     306             :                nStTREntries = 1;
     307           0 :                arrStTR->Add( new AliDCSValue(  (Int_t)0, 0x7FFFFFFF ) );
     308             :                         // 0x7FFFFFFF = 2147483647, maximal signed Int_t number. Right temperature
     309             :                         //  sensor will be regarded as switched-off during whole run.
     310           0 :             } /*if*/
     311             : 
     312           0 :             if( nOKEntries < 1 )
     313             :             {           // TObjArray arrOK is empty. This would cause segmentation violation during
     314             :                         //  the condensing, so this case must be handled before algorithm starts
     315           0 :                AliWarning( Form( "%s contains no data!\n", fOKDPNames[moduleLoop].Data() ) );
     316             :                nOKEntries = 1;
     317           0 :                arrOK->Add( new AliDCSValue(  (Bool_t)0, 0x7FFFFFFF ) );
     318             :                         // 0x7FFFFFFF = 2147483647, maximal signed Int_t number.
     319             :                         //  Module will be regarded as switched-off during whole run.
     320           0 :             } /*if*/
     321             : 
     322           0 :             arrStTL->Sort();
     323           0 :             arrStTR->Sort();
     324           0 :             arrOK->Sort();
     325             :                         // Condensing would work properly only in the case that
     326             :                         //  the input arrays are sorted by time
     327             : 
     328           0 :             Int_t nEntriesMax = nStTLEntries + nStTREntries + nOKEntries;
     329           0 :             fDCSData[moduleLoop]->SetNPointsStatus( nEntriesMax );
     330             :                         // Determines necessary length of new array and sets its size 
     331             :                         //  Lot of space in such defined array will be probably 
     332             :                         //  vacant after the analysis, but this will be corrected
     333             :                         //  by Compress() method
     334             : 
     335             :             Int_t idxStTL = 0;
     336             :             Int_t idxStTR = 0;
     337             :             Int_t idxOK = 0;
     338             :                         // Input arrays indexes
     339             : 
     340             :             Int_t tsStTL, tsStTR, tsOK;
     341             :                         // Time stamps ofinput arrays
     342             :             Int_t tsNew;// New time stamp (output array)
     343             : 
     344             :             Char_t bitStatus;   
     345             :                         // New status record :
     346             :                         // 0. bit ... _OK
     347             :                         // 1. bit ... _TEMP_L_STATE
     348             :                         // 2. bit ... _TEMP_R_STATE 
     349             :             Char_t lastBitStatus = 100;
     350             : 
     351             :             AliDCSValue *valStTL, *valStTR, *valOK;
     352             :                         // Pointers to input arrays records (input arrays are TObjArrays
     353             :                         //  containing objects of type AliDCSValue
     354             : 
     355           0 :             tsStTR = ( (AliDCSValue *)arrStTR->At(0) )->GetTimeStamp() - fStTLDelay;
     356           0 :             tsStTL = ( (AliDCSValue *)arrStTL->At(0) )->GetTimeStamp() - fStTRDelay;
     357           0 :             tsOK = ( (AliDCSValue *)arrOK->At(0) )->GetTimeStamp() - fOKDelay;
     358             :                         // Time stamps of first records in input filea are readed (and delays are substracted)
     359             : 
     360           0 :             tsNew = (tsStTR < tsStTL) ? tsStTR : tsStTL;
     361           0 :             if( tsNew > tsOK ) tsNew = tsOK;
     362             :                         // Time intervals are "prolonged" to the very eaarliest of time stamps.
     363             :                         //  It means that first output time stamp will be the same as the one
     364             :                         //  which is first in input arrays. Values of other DCS variables are
     365             :                         //  not defined in this time yet, but they will be treated as equal to
     366             :                         //  values in first records of input arrays.
     367             : 
     368           0 :             nStTLEntries--; nStTREntries--; nOKEntries--;
     369             :                         // Indexes in the input array must not exceed last records.
     370             : 
     371           0 :             while( (idxStTL < nStTLEntries) || (idxStTR < nStTREntries) || (idxOK < nOKEntries) )
     372             :             {           // Loop goes throug all three input files
     373             : 
     374           0 :                valStTL = (AliDCSValue *)( arrStTL->At(idxStTL) );
     375           0 :                valStTR = (AliDCSValue *)( arrStTR->At(idxStTR) );
     376           0 :                valOK = (AliDCSValue *)( arrOK->At(idxOK) );
     377             :                         // Values are readed from input arrays
     378             : 
     379             :                bitStatus = 0;
     380           0 :                if( valOK->GetBool() ) bitStatus += 1;        // 0. bit - _OK
     381           0 :                if( valStTL->GetInt() == 4 ) bitStatus += 2;  // 1. bit - _TEMP_L_STATE
     382           0 :                if( valStTR->GetInt() == 4 ) bitStatus += 4;  // 2. bit - _TEMP_R_STATE
     383             :                         // Bit map is created. *TEMP_*_STATE == 4 means "Thermometer is OK"
     384             : 
     385           0 :                if( lastBitStatus != bitStatus )
     386             :                {        // If the status bitmap is the same as last one, it would not be stored.
     387             :                         //  It will save much space.
     388           0 :                   fDCSData[moduleLoop]->SetValueStatus( tsNew, bitStatus );
     389             :                         // Bit map is written into the output array (if different from last value )
     390             :                   lastBitStatus = bitStatus;
     391           0 :                   counter += nEntries;
     392           0 :                } /*if*/
     393             : 
     394           0 :                if( idxStTL == nStTLEntries )
     395           0 :                 tsStTL = 0x7FFFFFFF;  // = 2147483647, maximal signed Int_t number
     396             :                else
     397           0 :                 tsStTL = ( (AliDCSValue *)arrStTL->At(idxStTL + 1) )->GetTimeStamp() - fStTLDelay;
     398             : 
     399           0 :                if( idxStTR == nStTREntries )
     400           0 :                 tsStTR = 0x7FFFFFFF;  // = 2147483647, maximal signed Int_t number
     401             :                else
     402           0 :                 tsStTR = ( (AliDCSValue *)arrStTR->At(idxStTR + 1) )->GetTimeStamp() - fStTRDelay;
     403             : 
     404           0 :                if( idxOK == nOKEntries )
     405           0 :                 tsOK = 0x7FFFFFFF;    // = 2147483647, maximal signed Int_t number
     406             :                else
     407           0 :                 tsOK = ( (AliDCSValue *)arrOK->At(idxOK + 1) )->GetTimeStamp() - fOKDelay;
     408             :                         // Reads time stamps of folowing records in the input arrays (and substracts delays).
     409             :                         // Validity of the last records in the input arrays are prolonged
     410             :                         //  to "infinity"
     411             : 
     412           0 :                if( tsStTL == tsOK && tsStTR == tsOK )  { tsNew = tsStTL; idxStTL++; idxStTR++; idxOK++; continue; }
     413           0 :                if( tsStTL == tsStTR && tsStTR < tsOK ) { tsNew = tsStTL; idxStTL++; idxStTR++; continue; }
     414           0 :                if( tsStTL == tsOK && tsOK < tsStTR )   { tsNew = tsStTL; idxStTL++; idxOK++; continue; }
     415           0 :                if( tsStTR == tsOK && tsOK < tsStTL )   { tsNew = tsStTR; idxStTR++; idxOK++; continue; } 
     416           0 :                if( tsOK < tsStTL && tsOK < tsStTR )    { tsNew = tsOK;   idxOK++;   continue; }
     417           0 :                if( tsStTL < tsOK && tsStTL < tsStTR )  { tsNew = tsStTL; idxStTL++; continue; }
     418           0 :                /*Last possibile case*/                 { tsNew = tsStTR; idxStTR++; }
     419             : 
     420             :                         // Index of array, whose following record have time stamp closest to just written one,
     421             :                         //  is increased. If there are more records with identical time stamps meeting this condition,
     422             :                         //  all correspondent indexes are increased. 
     423             : 
     424             :             } /*while*/
     425             : 
     426           0 :             fDCSData[moduleLoop]->Compress();
     427             :                         // Size taken by data in AliITSDCSDataSDD object is minimalized
     428             : 
     429           0 :             if( arrStTRcreated ) delete arrStTR;
     430           0 :             if( arrStTLcreated ) delete arrStTL;
     431           0 :             if( arrOKcreated ) delete arrOK;
     432             : 
     433             :           } /*for( iMod )*/
     434             :        } /*for( iLad )*/
     435             :     } /*for( iLay )*/
     436             : 
     437             : 
     438           0 : } /*AliITSDCSAnalyzerSDD::AnalyzeData*/
     439             : 
     440             : 
     441             : //---------------------------------------------------------------
     442             : 
     443             : 
     444             : void AliITSDCSAnalyzerSDD::Init()
     445             : {
     446             : // Initialization of DCS DP names
     447           0 :   TString modName;
     448             : 
     449           0 :   for( Int_t iLay = 3; iLay < 5; iLay++ ){
     450           0 :     Int_t maxLad = ( iLay == 3) ? kNladders3 : kNladders4;
     451           0 :     Int_t maxMod = ( iLay == 3) ? kNmodLad3 : kNmodLad4;
     452             : 
     453           0 :     for(Int_t iLad=0; iLad<maxLad; iLad++){
     454           0 :       for(Int_t iMod=0; iMod<maxMod;iMod++){
     455           0 :         modName.Form("SDD_LAYER%i_LADDER%02d_MODULE%d", iLay, iLad, iMod);
     456           0 :         Int_t id = AliITSgeomTGeo::GetModuleIndex( iLay, iLad + 1, iMod + 1 ) - 240;
     457             :         
     458           0 :         fHVDPNames[id].Form("%s_HV",modName.Data());
     459           0 :         fMVDPNames[id].Form("%s_MV",modName.Data());
     460           0 :         fOKDPNames[id].Form("%s_OK",modName.Data());
     461           0 :         fTLDPNames[id].Form("%s_TEMP_L",modName.Data());
     462           0 :         fTRDPNames[id].Form("%s_TEMP_R",modName.Data());
     463           0 :         fTLStDPNames[id].Form("%s_TEMP_L_STATE",modName.Data());
     464           0 :         fTRStDPNames[id].Form("%s_TEMP_R_STATE",modName.Data());
     465             :         
     466             :       } /*for( iMod )*/
     467             :     } /*for( iLad )*/
     468             :     
     469             :   } /*for( iLay )*/
     470             : 
     471             :   
     472           0 : } /*AliITSDCSAnalyzerSDD::Init*/
     473             : 
     474             : //---------------------------------------------------------------
     475             : void AliITSDCSAnalyzerSDD::PrintDCSDPNames( FILE *output )
     476             : {
     477             : // Prints constructed names of DCS variables into specified file (may be even stdout or stderr)
     478           0 :   for( Int_t j = 0; j < kNmodules; j++ )
     479             :   {
     480           0 :     fprintf( output, "Module %d      %s   %s   %s   %s\n",j,fHVDPNames[j].Data(),
     481           0 :                           fMVDPNames[j].Data(),fTLDPNames[j].Data(),fTRDPNames[j].Data());
     482             :   } /*for( j )*/
     483           0 : } /*AliITSDCSAnalyzerSDD::PrintDCSDPNames*/
     484             : 
     485             : //---------------------------------------------------------------
     486             : 
     487             : void AliITSDCSAnalyzerSDD::Export( char *outputDCSFileName )
     488             : {
     489             : // Exports all stored AliITSDCSDataSDD type object into specified root file. Objects are named as
     490             : //
     491             : // DCSDataSDD_module<number>
     492             : //
     493             : // where <number> is in range 0..256 and it is obtained by calling
     494             : //
     495             : // AliITSgeomTGeo::GetModuleIndex( layer, ladder, moduleInLadder ) - 240
     496             : 
     497           0 :    TFile * newFile = new TFile( outputDCSFileName, "RECREATE" );
     498           0 :    if( newFile == NULL )
     499             :    {                    // Creates .root file with specified name. if it is not possible,
     500             :                         //  warning is displayed and exporting aborted.
     501           0 :      AliWarning( Form( "Cannot create %s - export aborted ", outputDCSFileName ) );
     502           0 :      return;
     503             :    } /*if*/
     504             : 
     505           0 :    newFile->cd();
     506             : 
     507           0 :    char buffer[100];
     508             : 
     509           0 :    for( Int_t moduleLoop = 0; moduleLoop < kNmodules; moduleLoop++ )
     510             :    {                    // loops through all modules and writes appropriate object into the file
     511           0 :      snprintf( buffer, 99 , "DCSDataSDD_module%i", moduleLoop );
     512           0 :      if( fDCSData[moduleLoop] ) fDCSData[moduleLoop]->Write( buffer, TObject::kSingleKey );
     513             :    } /*for( moduleLoop )*/
     514             : 
     515           0 :    newFile->Close();
     516           0 :    delete newFile;
     517             : 
     518           0 : } /*AliITSDCSAnalyzerSDD::Export*/

Generated by: LCOV version 1.11