/* $Id$ */
///////////////////////////////////////////////////////////////////
-// //
// Implementation of the class for SDD DCS data analysis //
// Origin: F.Prino, Torino, prino@to.infn.it //
// V.Pospisil, CTU Prague, gdermog@seznam.cz //
//---------------------------------------------------------------
AliITSDCSAnalyzerSDD::AliITSDCSAnalyzerSDD(): TObject(),
-fHVDelay(0),fMVDelay(0),fTLDelay(0),fTRDelay(0),fStTLDelay(0),fStTRDelay(0),fOKDelay(0)
-{
+fHVDelay(0),fMVDelay(0),fTLDelay(0),fTRDelay(0),fStTLDelay(0),fStTRDelay(0),fOKDelay(0),
+fHVThresholdFrac(0), fMVThresholdFrac(0), fTLThresholdFrac(0), fTRThresholdFrac(0)
+{
// Default constructor
Init();
+ SetHVThreshold();
+ SetMVThreshold();
+ SetTLThreshold();
+ SetTRThreshold();
+ for( Int_t moduleLoop = 0; moduleLoop < kNmodules; moduleLoop++ ) fDCSData[moduleLoop] = NULL;
} /*AliITSDCSAnalyzerSDD::AliITSDCSAnalyzerSDD*/
//---------------------------------------------------------------
AliITSDCSAnalyzerSDD::AliITSDCSAnalyzerSDD(const AliITSDCSAnalyzerSDD& /* dcsa */): TObject(),
-fHVDelay(0),fMVDelay(0),fTLDelay(0),fTRDelay(0),fStTLDelay(0),fStTRDelay(0),fOKDelay(0)
-{
-// copy constructor
- // Copies are not allowed. The method is protected to avoid misuse.
- fprintf( stderr, "Copy constructor not allowed");
+fHVDelay(0),fMVDelay(0),fTLDelay(0),fTRDelay(0),fStTLDelay(0),fStTRDelay(0),fOKDelay(0),
+fHVThresholdFrac(0), fMVThresholdFrac(0), fTLThresholdFrac(0), fTRThresholdFrac(0)
+{
+// Copy constructor
+// Copies are not allowed. The method is protected to avoid misuse.
+ AliError("Copy constructor not allowed");
} /*AliITSDCSAnalyzerSDD::AliITSDCSAnalyzerSDD*/
//---------------------------------------------------------------
AliITSDCSAnalyzerSDD& AliITSDCSAnalyzerSDD::operator=(const AliITSDCSAnalyzerSDD& /* dcsa */)
-{
-// assigment operator
- // Assignment is not allowed. The method is protected to avoid misuse.
- fprintf( stderr, "Assignment operator not allowed");
+{
+// Assigment operator
+// Assignment is not allowed. The method is protected to avoid misuse.
+ AliError("Assignment operator not allowed");
return *this;
}/*AliITSDCSAnalyzerSDD::operator=*/
//---------------------------------------------------------------
AliITSDCSAnalyzerSDD::~AliITSDCSAnalyzerSDD()
-{
-// destructor
+{
+// Destructor
for(int j=0; j<kNmodules; j++)
{
- if(fDCSData[j]) delete fDCSData[j];
+ if( fDCSData[j] ) delete fDCSData[j];
} /*for( j )*/
} /*AliITSDCSAnalyzerSDD::~AliITSDCSAnalyzerSDD*/
//---------------------------------------------------------------
void AliITSDCSAnalyzerSDD::AnalyzeData(TMap* dcsMap)
-{
-// Data processing
+{
+// Data processing. Takes DCS points from alias map and sorts them into AliITSDCSDataSDD objects.
+
+ Int_t counter = 0; // Counter of stored DCS records
+
+ Float_t lastTLValUpper;
+ Float_t lastTLValLower;
+ Float_t lastTRValUpper;
+ Float_t lastTRValLower;
+ Float_t lastHVValUpper;
+ Float_t lastHVValLower;
+ Float_t lastMVValUpper;
+ Float_t lastMVValLower;
+ // Thresholds for float DCS variables
+
+ Int_t nEntries; // Number of entries in each TObjArray, that contains DCS variable values
+ AliDCSValue *valToProcess;
+ // Pointer to currently processed DCS variable value
+ Float_t valToProcessFloat;
+ // Value of currently processed DCS variable
- Int_t counter = 0;
for( Int_t iLay = 3; iLay < 5; iLay++ )
{
// DCS data for specific SDD module will be stored in this class
TObjArray* arrHV = (TObjArray*) dcsMap->GetValue( fHVDPNames[moduleLoop].Data() );
- if(!arrHV)
+ if(!arrHV) // There is no record for high voltage in the map
{
- fprintf( stderr, Form("DCS HV alias %s not found!\n", fHVDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS HV alias %s not found!\n", fHVDPNames[moduleLoop].Data()) );
continue;
} /*if*/
TObjArray* arrMV = (TObjArray*) dcsMap->GetValue( fMVDPNames[moduleLoop].Data() );
- if(!arrMV)
+ if(!arrMV) // There is no record for medium voltage in the map
{
- fprintf( stderr, Form("DCS MV alias %s not found!\n", fMVDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS MV alias %s not found!\n", fMVDPNames[moduleLoop].Data()));
continue;
} /*if*/
TObjArray* arrOK = (TObjArray*) dcsMap->GetValue( fOKDPNames[moduleLoop].Data() );
- if(!arrOK)
+ if(!arrOK) // There is no record for OK status in the map
{
- fprintf( stderr, Form("DCS MOD_OK alias %s not found!\n", fOKDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS MOD_OK alias %s not found!\n", fOKDPNames[moduleLoop].Data()));
continue;
} /*if*/
TObjArray* arrTL = (TObjArray*) dcsMap->GetValue( fTLDPNames[moduleLoop].Data() );
- if(!arrTL)
+ if(!arrTL) // There is no record for temperature on left side in the map
{
- fprintf( stderr, Form("DCS TEMP_L alias %s not found!\n", fTLDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS TEMP_L alias %s not found!\n", fTLDPNames[moduleLoop].Data()));
continue;
} /*if*/
TObjArray* arrTR = (TObjArray*) dcsMap->GetValue( fTRDPNames[moduleLoop].Data() );
- if(!arrTR)
+ if(!arrTR) // There is no record for temperature on right side in the map
{
- fprintf( stderr, Form("DCS TEMP_R alias %s not found!\n", fTRDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS TEMP_R alias %s not found!\n", fTRDPNames[moduleLoop].Data()));
continue;
} /*if*/
TObjArray* arrStTL = (TObjArray*) dcsMap->GetValue( fTLStDPNames[moduleLoop].Data() );
- if(!arrStTL)
+ if(!arrStTL) // There is no record for TEMP_L status in the map
{
- fprintf( stderr, Form("DCS TEMP_L_STATE alias %s not found!\n", fTLStDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS TEMP_L_STATE alias %s not found!\n", fTLStDPNames[moduleLoop].Data()));
continue;
} /*if*/
TObjArray* arrStTR = (TObjArray*) dcsMap->GetValue( fTRStDPNames[moduleLoop].Data() );
- if(!arrStTR)
+ if(!arrStTR) // There is no record for TEMP_R status in the map
{
- fprintf( stderr, Form("DCS TEMP_R_STATE alias %s not found!\n", fTRStDPNames[moduleLoop].Data()));
+ AliWarning( Form("DCS TEMP_R_STATE alias %s not found!\n", fTRStDPNames[moduleLoop].Data()));
continue;
} /*if*/
- Int_t nEntries;
- // Number of entries in each TObjArray, that contains DCS variable values
- AliDCSValue *valToProcess;
- // Pointer to currently processed DCS variable value
+ lastTLValUpper = -1e-10;
+ lastTLValLower = +1e+10;
+ lastTRValUpper = -1e-10;
+ lastTRValLower = +1e+10;
+ lastHVValUpper = -1e-10;
+ lastHVValLower = +1e+10;
+ lastMVValUpper = -1e-10;
+ lastMVValLower = +1e+10;
+ // First value of any DCS variable must be written
nEntries = arrTL->GetEntries();
fDCSData[moduleLoop]->SetNPointsTempLeft( nEntries );
for( Int_t tlLoop = 0; tlLoop < nEntries; tlLoop++ )
{ // Left temerature values are copied into the AliITSDCSDataSDD TempLeft array
valToProcess = (AliDCSValue *)(arrTL->At(tlLoop));
- fDCSData[moduleLoop]->SetValueTempLeft( valToProcess->GetTimeStamp() - fTLDelay, valToProcess->GetFloat() );
+ valToProcessFloat = valToProcess->GetFloat();
+ // Value is readed from the input array
+
+// /**//**/if( moduleLoop == 259 )
+// /**//**/fprintf( stderr, " lastTLValLower = %f, valToProcessFloat = %f, lastTLValUpper = %f, fTLThresholdFrac = %f\n",
+// /**//**/ lastTLValLower, valToProcessFloat, lastTLValUpper, fTLThresholdFrac );
+
+ if( lastTLValLower <= valToProcessFloat && valToProcessFloat <= lastTLValUpper ) continue;
+ // Value did not cross the treshold (upper neither lower),
+ // it is not necessary to store it.
+ fDCSData[moduleLoop]->SetValueTempLeft( valToProcess->GetTimeStamp() - fTLDelay, valToProcessFloat );
+ // Value is stored
+ lastTLValLower = valToProcessFloat * ( 1.0 - fTLThresholdFrac );
+ lastTLValUpper = valToProcessFloat * ( 1.0 + fTLThresholdFrac );
+ // New tresholds are set
+ counter ++;
} /*for( tlLoop )*/
- counter += nEntries;
+
+
nEntries = arrTR->GetEntries();
fDCSData[moduleLoop]->SetNPointsTempRight( nEntries );
for( Int_t trLoop = 0; trLoop < nEntries; trLoop++ )
{ // Right temerature values are copied into the AliITSDCSDataSDD TempRight array
valToProcess = (AliDCSValue *)(arrTR->At(trLoop));
- fDCSData[moduleLoop]->SetValueTempRight( valToProcess->GetTimeStamp() - fTRDelay, valToProcess->GetFloat() );
+ valToProcessFloat = valToProcess->GetFloat();
+ // Value is readed from the input array
+
+ if( lastTRValLower <= valToProcessFloat && valToProcessFloat <= lastTRValUpper ) continue;
+ // Value did not cross the treshold (upper neither lower),
+ // it is not necessary to store it.
+ fDCSData[moduleLoop]->SetValueTempRight( valToProcess->GetTimeStamp() - fTRDelay, valToProcessFloat );
+ // Value is stored
+ lastTRValLower = valToProcessFloat * ( 1.0 - fTRThresholdFrac );
+ lastTRValUpper = valToProcessFloat * ( 1.0 + fTRThresholdFrac );
+ // New tresholds are set
+ counter ++;
} /*for( trLoop )*/
- counter += nEntries;
+
+
nEntries = arrHV->GetEntries();
fDCSData[moduleLoop]->SetNPointsHV( nEntries );
for( Int_t hvLoop = 0; hvLoop < nEntries; hvLoop++ )
{ // HV values are copied into the AliITSDCSDataSDD HV array
valToProcess = (AliDCSValue *)(arrHV->At(hvLoop));
- fDCSData[moduleLoop]->SetValueHV( valToProcess->GetTimeStamp() - fHVDelay, valToProcess->GetFloat() );
+ valToProcessFloat = valToProcess->GetFloat();
+ // Value is readed from the input array
+ if( lastHVValLower <= valToProcessFloat && valToProcessFloat <= lastHVValUpper ) continue;
+ // Value did not cross the treshold (upper neither lower),
+ // it is not necessary to store it.
+ fDCSData[moduleLoop]->SetValueHV( valToProcess->GetTimeStamp() - fHVDelay, valToProcessFloat );
+ // Value is stored
+ lastHVValLower = valToProcessFloat * ( 1.0 - fHVThresholdFrac );
+ lastHVValUpper = valToProcessFloat * ( 1.0 + fHVThresholdFrac );
+ // New tresholds are set
+ counter ++;
} /*for( hvLoop )*/
- counter += nEntries;
+
+
nEntries = arrMV->GetEntries();
fDCSData[moduleLoop]->SetNPointsMV( nEntries );
for( Int_t mvLoop = 0; mvLoop < nEntries; mvLoop++ )
{ // MV values are copied into the AliITSDCSDataSDD MV array
valToProcess = (AliDCSValue *)(arrMV->At(mvLoop));
- fDCSData[moduleLoop]->SetValueMV( valToProcess->GetTimeStamp() - fMVDelay, valToProcess->GetFloat() );
+ valToProcessFloat = valToProcess->GetFloat();
+ // Value is readed from the input array
+ if( lastMVValLower <= valToProcessFloat && valToProcessFloat <= lastMVValUpper ) continue;
+ // Value did not cross the treshold (upper neither lower),
+ // it is not necessary to store it.
+ fDCSData[moduleLoop]->SetValueMV( valToProcess->GetTimeStamp() - fMVDelay, valToProcessFloat );
+ // Value is stored
+ lastMVValLower = valToProcessFloat * ( 1.0 - fMVThresholdFrac );
+ lastMVValUpper = valToProcessFloat * ( 1.0 + fMVThresholdFrac );
+ // New treshold is ser
+ counter ++;
} /*for( mvLoop )*/
- counter += nEntries;
+
/* Following part of the code is responsibile for the condensing of all status information given by DCS
into one array of Char_t. Each record of this array is in principle a bit map :
Let's vizualize time stamps of the three input arrays. There is time on x-axis :
+------------+---------------------+------
- | | | _OK
- +------+------+---+--------+------------+------
- | | | | | _TEMP_L_STATE
+ | | | _OK
+ +-----++------+----+--------+------------+------
+ | | | | | _TEMP_L_STATE
+--+------+---+--+-------+-----+--------+---+------
| | | | | | _TEMP_R_STATE
+-------------+----------+-----+--------+---+------
if( nStTLEntries < 1 )
{ // TObjArray arrStTL is empty. This would cause segmentation violation during
// the condensing, so this case must be handled before algorithm starts
- fprintf( stderr, "%s contains no data!\n", fTLStDPNames[moduleLoop].Data() );
+ AliWarning( Form( "%s contains no data!\n", fTLStDPNames[moduleLoop].Data() ) );
nStTLEntries = 1;
arrStTL->Add( new AliDCSValue( (Int_t)0, 0x7FFFFFFF ) );
// 0x7FFFFFFF = 2147483647, maximal signed Int_t number. Left temperature
if( nStTREntries < 1 )
{ // TObjArray arrStTR is empty. This would cause segmentation violation during
// the condensing, so this case must be handled before algorithm starts
- fprintf( stderr, "%s contains no data!\n", fTRStDPNames[moduleLoop].Data() );
+ AliWarning( Form( "%s contains no data!\n", fTRStDPNames[moduleLoop].Data() ) );
nStTREntries = 1;
arrStTR->Add( new AliDCSValue( (Int_t)0, 0x7FFFFFFF ) );
// 0x7FFFFFFF = 2147483647, maximal signed Int_t number. Right temperature
if( nOKEntries < 1 )
{ // TObjArray arrOK is empty. This would cause segmentation violation during
// the condensing, so this case must be handled before algorithm starts
- fprintf( stderr, "%s contains no data!\n", fOKDPNames[moduleLoop].Data() );
+ AliWarning( Form( "%s contains no data!\n", fOKDPNames[moduleLoop].Data() ) );
nOKEntries = 1;
arrOK->Add( new AliDCSValue( (Bool_t)0, 0x7FFFFFFF ) );
// 0x7FFFFFFF = 2147483647, maximal signed Int_t number.
// Bit map is created
if( lastBitStatus != bitStatus )
- { // If the status bitmap is teh same as last one, it would not be stored.
- // It will save much space.
+ { // If the status bitmap is the same as last one, it would not be stored.
+ // It will save much space.
fDCSData[moduleLoop]->SetValueStatus( tsNew, bitStatus );
- // Bit map is written into the output array (if different from last value )
+ // Bit map is written into the output array (if different from last value )
lastBitStatus = bitStatus;
counter += nEntries;
} /*if*/
} /*while*/
+ fDCSData[moduleLoop]->Compress();
+ // Size taken by data in AliITSDCSDataSDD object is minimalized
} /*for( iMod )*/
} /*for( iLad )*/
void AliITSDCSAnalyzerSDD::Init()
{
- // Initialization of DCS DP names
+// Initialization of DCS DP names
Char_t dpName[50];
Char_t modName[50];
-
for( Int_t iLay = 3; iLay < 5; iLay++ )
- {
-
+ {
Int_t maxLad = ( iLay == 3) ? kNladders3 : kNladders4;
Int_t maxMod = ( iLay == 3) ? kNmodLad3 : kNmodLad4;
} /*for( iLay )*/
-
+
} /*AliITSDCSAnalyzerSDD::Init*/
//---------------------------------------------------------------
void AliITSDCSAnalyzerSDD::PrintDCSDPNames( FILE *output )
{
- // Data processing
+// Prints constructed names of DCS variables into specified file (may be even stdout or stderr)
for( Int_t j = 0; j < kNmodules; j++ )
{
fprintf( output, "Module %d %s %s %s %s\n",j,fHVDPNames[j].Data(),
fMVDPNames[j].Data(),fTLDPNames[j].Data(),fTRDPNames[j].Data());
} /*for( j )*/
} /*AliITSDCSAnalyzerSDD::PrintDCSDPNames*/
+
+//---------------------------------------------------------------
+
+void AliITSDCSAnalyzerSDD::Export( char *outputDCSFileName )
+{
+// Exports all stored AliITSDCSDataSDD type object into specified root file. Objects are named as
+//
+// DCSDataSDD_module<number>
+//
+// where <number> is in range 0..256 and it is obtained by calling
+//
+// AliITSgeomTGeo::GetModuleIndex( layer, ladder, moduleInLadder ) - 240
+
+ TFile * newFile = new TFile( outputDCSFileName, "RECREATE" );
+ if( newFile == NULL )
+ { // Creates .root file with specified name. if it is not possible,
+ // warning is displayed and exporting aborted.
+ AliWarning( Form( "Cannot create %s - export aborted ", outputDCSFileName ) );
+ return;
+ } /*if*/
+
+ newFile->cd();
+
+ char buffer[100];
+
+ for( Int_t moduleLoop = 0; moduleLoop < kNmodules; moduleLoop++ )
+ { // loops through all modules and writes appropriate object into the file
+ sprintf( buffer, "DCSDataSDD_module%i", moduleLoop );
+ if( fDCSData[moduleLoop] ) fDCSData[moduleLoop]->Write( buffer, TObject::kSingleKey );
+ } /*for( moduleLoop )*/
+
+ newFile->Close();
+ delete newFile;
+
+} /*AliITSDCSAnalyzerSDD::Export*/
/* $Id$ */
-///////////////////////////////////////////////////////////////////
-// Class for SDD dcs data analysis //
-// called by AliITSPreprocessorSDD //
-// Origin: F.Prino, Torino, prino@to.infn.it //
-// V.Pospisil, CTU Prague, gdermog@seznam.cz //
-///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////
+// Class for SDD dcs data analysis called by AliITSPreprocessorSDD //
+// Origin: F.Prino, Torino, prino@to.infn.it //
+// V.Pospisil, CTU Prague, gdermog@seznam.cz //
+///////////////////////////////////////////////////////////////////////
#include <TMap.h>
#include <TObjArray.h>
+#include <TFile.h>
#include "AliITSDCSDataSDD.h"
#include "AliITSgeomTGeo.h"
// in voltage and temperature readouts. So it is necessary to substract some value from time stamps
// during the data processing
+ void SetHVThreshold( Float_t percent=0.1 ) { fHVThresholdFrac = percent / 100.0; };
+ void SetMVThreshold( Float_t percent=0.1 ) { fMVThresholdFrac = percent / 100.0; };
+ void SetTLThreshold( Float_t percent=0.1 ) { fTLThresholdFrac = percent / 100.0; };
+ void SetTRThreshold( Float_t percent=0.1 ) { fTRThresholdFrac = percent / 100.0; };
+ // It is possible to keep value arrays condensed - new value is stored
+ // only if it crosses a treshold. This threshold is determined from
+ // last stored value by
+ //
+ // low edge = value * (100 - percent) %
+ // upper edge = value * (100 + percent) %
+ //
+ // These four Setters allows to tune tresholds for each DCS variable
+ // independently. By default all tresholds are set to 0 % .
+
+
void AnalyzeData( TMap* dcsMap );
// Processes the data
{ return fDCSData[AliITSgeomTGeo::GetModuleIndex( iLayer, iLadder, iModule ) - 240]; }
// Returns data for module specified by layer[3..4], ladder[1..22] and module number[1..8]
+ void Export( char *outputDCSFileName );
+ // Exports all stored AliITSDCSDataSDD type object into specified root file. Objects are named as
+ //
+ // DCSDataSDD_module<number>
+ //
+ // where <number> is in range 0..256 and it is obtained by calling
+ //
+ // AliITSgeomTGeo::GetModuleIndex( layer, ladder, moduleInLadder ) - 240
+
protected:
AliITSDCSAnalyzerSDD(const AliITSDCSAnalyzerSDD& /* dcsa */);
AliITSDCSAnalyzerSDD& operator=(const AliITSDCSAnalyzerSDD& /* dcsa */);
kNladders3=14,
kNladders4=22,
kNmodLad3=6,
- kNmodLad4=8 }; // Basic SDD geometry
-
- TString fHVDPNames[kNmodules]; // DCS DP names for High Voltage
- TString fMVDPNames[kNmodules]; // DCS DP names for Medium Voltage
- TString fOKDPNames[kNmodules]; // DCS DP names for Medium Voltage
- TString fTLDPNames[kNmodules]; // DCS DP names for Temperature Left
- TString fTRDPNames[kNmodules]; // DCS DP names for Temperature Right
- TString fTLStDPNames[kNmodules]; // DCS DP names for status of Temperature Left
- TString fTRStDPNames[kNmodules]; // DCS DP names for status of Temperature Right
+ kNmodLad4=8 }; // Basic SDD geometry
+
+ TString fHVDPNames[kNmodules]; // DCS DP names for High Voltage
+ TString fMVDPNames[kNmodules]; // DCS DP names for Medium Voltage
+ TString fOKDPNames[kNmodules]; // DCS DP names for Medium Voltage
+ TString fTLDPNames[kNmodules]; // DCS DP names for Temperature Left
+ TString fTRDPNames[kNmodules]; // DCS DP names for Temperature Right
+ TString fTLStDPNames[kNmodules]; // DCS DP names for status of Temperature Left
+ TString fTRStDPNames[kNmodules]; // DCS DP names for status of Temperature Right
AliITSDCSDataSDD *fDCSData[kNmodules]; // values of DCS data points
- Int_t fHVDelay; // There is some delay between variable readout
- Int_t fMVDelay; // and setting up the time stamp. Delays differs
- Int_t fTLDelay; // in voltage and temperature readouts. So it is
- Int_t fTRDelay; // necessary to substract some value from time stamp
- Int_t fStTLDelay; // during the data processing.
- Int_t fStTRDelay; // Here are the values of delays stored
- Int_t fOKDelay; // for the 7 variables.
+ Int_t fHVDelay; // There is some delay between variable readout
+ Int_t fMVDelay; // and setting up the time stamp. Delays differs
+ Int_t fTLDelay; // in voltage and temperature readouts. So it is
+ Int_t fTRDelay; // necessary to substract some value from time stamp
+ Int_t fStTLDelay; // during the data processing.
+ Int_t fStTRDelay; // Here are the values of delays stored
+ Int_t fOKDelay; // for the 7 variables.
+
+ Float_t fHVThresholdFrac; // Value of HV won't be stored until it won't exceeds this fraction of last stored value
+ Float_t fMVThresholdFrac; // Same for MV
+ Float_t fTLThresholdFrac; // Same for TL
+ Float_t fTRThresholdFrac; // Same for TR
- ClassDef(AliITSDCSAnalyzerSDD, 2);
+ ClassDef(AliITSDCSAnalyzerSDD, 3);
}; /*class AliITSDCSAnalyzerSDD*/
/* $Id$ */
///////////////////////////////////////////////////////////////////
-// //
// Implementation of the class containing SDD DCS data //
// Origin: F.Prino, Torino, prino@to.infn.it //
// V. Pospisil, CTU Praguem gdermog@seznam.cz //
ClassImp(AliITSDCSDataSDD)
+const Float_t AliITSDCSDataSDD::fgkTPrec = 100.0;
+const Float_t AliITSDCSDataSDD::fgkMVPrec = 1000.0;
+
//---------------------------------------------------------------------------
AliITSDCSDataSDD::AliITSDCSDataSDD(): TObject(),
fTempLeft(0),
if( i < fTempLeftSetPoints )
{
- Float_t *fromPtrF = fTempLeft.GetArray() + i;
+ Short_t *fromPtrF = fTempLeft.GetArray() + i;
// Sets pointer to cell which have to be filled by new value
- Float_t *toPtrF = fromPtrF + 1;
+ Short_t *toPtrF = fromPtrF + 1;
// Sets pointer to cell where the array content have to be shifted
- memmove( toPtrF, fromPtrF, (fTempLeftSetPoints - i)*sizeof(Float_t) );
+ memmove( toPtrF, fromPtrF, (fTempLeftSetPoints - i)*sizeof(Short_t) );
// Shifts array content. Now there is vacant place for new value to be inserted
Int_t *fromPtrI = fTempLeftTimeStamp.GetArray() + i;
// Do the same for time stamp array
} /*if*/
- fTempLeft.AddAt( temperature, i );
+ UShort_t val = (UShort_t)( temperature * fgkTPrec );
+ // Float value of temperature is stored as UShort_t with given precision
+
+ fTempLeft.AddAt( (Short_t)val, i );
fTempLeftTimeStamp.AddAt( time, i );
fTempLeftSetPoints++;
// New values are inserted
if( i < fTempRightSetPoints )
{ // Some values have to be moved
- Float_t *fromPtrF = fTempRight.GetArray() + i;
+ Short_t *fromPtrF = fTempRight.GetArray() + i;
// Sets pointer to cell which have to be filled by new value
- Float_t *toPtrF = fromPtrF + 1;
+ Short_t *toPtrF = fromPtrF + 1;
// Sets pointer to cell where the array content have to be shifted
- memmove( toPtrF, fromPtrF, (fTempRightSetPoints - i)*sizeof(Float_t) );
+ memmove( toPtrF, fromPtrF, (fTempRightSetPoints - i)*sizeof(Short_t) );
// Shifts array content. Now there is vacant place for new value to be inserted
Int_t *fromPtrI = fTempRightTimeStamp.GetArray() + i;
// Do the same for time stamp array
} /*if*/
- fTempRight.AddAt( temperature, i );
+ UShort_t val = (UShort_t)( temperature * fgkTPrec );
+ // Float value of temperature is stored as UShort_t with given precision
+
+ fTempRight.AddAt( (Short_t)val, i );
fTempRightTimeStamp.AddAt( time, i );
fTempRightSetPoints++;
// New values are inserted
if( i < fMVSetPoints )
{
- Float_t *fromPtrF = fMV.GetArray() + i;
+ Short_t *fromPtrF = fMV.GetArray() + i;
// Sets pointer to cell which have to be filled by new value
- Float_t *toPtrF = fromPtrF + 1;
+ Short_t *toPtrF = fromPtrF + 1;
// Sets pointer to cell where the array content have to be shifted
- memmove( toPtrF, fromPtrF, (fMVSetPoints - i)*sizeof(Float_t) );
+ memmove( toPtrF, fromPtrF, (fMVSetPoints - i)*sizeof(Short_t) );
// Shifts array content. Now there is vacant place for new value to be inserted
Int_t *fromPtrI = fMVTimeStamp.GetArray() + i;
// Do the same for time stamp array
} /*if*/
- fMV.AddAt( voltage, i );
+ UShort_t val = (UShort_t)( voltage * fgkMVPrec );
+ // Float value of temperature is stored as UShort_t with given precision
+
+ fMV.AddAt( (Short_t)val, i );
fMVTimeStamp.AddAt( time, i );
fMVSetPoints++;
// New values are inserted
} /*AliITSDCSDataSDD::SetValueStatus*/
-//---------------------------------------------------------------------------
-
-Float_t AliITSDCSDataSDD::GetTempLeft( Int_t time )
-{
- //
- Int_t i = FindIndex( time, fTempLeftTimeStamp, fTempLeftSetPoints );
- return ( i < 0 ) ? -1.0 : fTempLeft.At(i);
-} /*AliITSDCSDataSDD::GetTempLeft*/
-
-Float_t AliITSDCSDataSDD::GetTempRight( Int_t time )
-{
- //
- Int_t i = FindIndex( time, fTempRightTimeStamp, fTempRightSetPoints );
- return ( i < 0 ) ? -1.0 : fTempRight.At(i);
-} /*AliITSDCSDataSDD::GetTempRight*/
-
-Float_t AliITSDCSDataSDD::GetHV( Int_t time )
-{
- //
- Int_t i = FindIndex( time, fHVTimeStamp, fHVSetPoints );
- return ( i < 0 ) ? -1.0 : fHV.At(i);
-} /*AliITSDCSDataSDD::GetHV*/
-
-Float_t AliITSDCSDataSDD::GetMV( Int_t time )
-{
- //
- Int_t i = FindIndex( time, fMVTimeStamp, fMVSetPoints );
- return ( i < 0 ) ? -1.0 : fMV.At(i);
-} /*AliITSDCSDataSDD::GetMV*/
-
-Char_t AliITSDCSDataSDD::GetStatus( Int_t time )
-{
- //
- Int_t i = FindIndex( time, fStatusTimeStamp, fStatusSetPoints );
- return ( i < 0 ) ? -1 : fStatus.At(i);
-} /*AliITSDCSDataSDD::GetStatus*/
-
//---------------------------------------------------------------------------
void AliITSDCSDataSDD::Compress()
{
- // Tries to minimize array sizes
+// Minimize array sizes
SetNPointsTempLeft( fTempLeftSetPoints );
SetNPointsTempRight( fTempRightSetPoints );
//---------------------------------------------------------------------------
-Float_t AliITSDCSDataSDD::GetDriftField( Int_t timeStamp )
-{
+Float_t AliITSDCSDataSDD::GetDriftField( Int_t timeStamp ) const
+{
// Returns drift field counted for specific time
Int_t cathodesNumber = 291;
Float_t AliITSDCSDataSDD::GetDriftSpeed( Int_t /*timeStamp*/ ) const
-{
-// Returns drift speed counted for specific time. This metod is not dedicated
-// for normal usage - it should be used only in cases that the injectors for
- // given module fails
+{
+// Returns drift speed counted for specific time. Calculation is based on temerature
+// taken from DCS. This metod is not dedicated for normal usage, it should be used
+// only in cases that the injectors for given module fails.
+//
+// Presently only a prototype, returns -1.0.
/* PROTOTYPE */
void AliITSDCSDataSDD:: PrintValues( FILE *output ) const
-{
+{
// Prints array contents
Int_t nTLEntries = GetTempLeftRecords();
Int_t nMVEntries = GetMVRecords();
Int_t nStatEntries = GetStatusRecords();
- fprintf( output, "+-----------------------------------------------------------------------------------------------------------+\n");
- fprintf( output, "| DCS content |\n" );
- fprintf( output, "+----------------------+----------------------+---------------------+---------------------+-----------------+\n");
- fprintf( output, "| %05i records | %05i records | %05i records | %05i records | %05i records |\n",
+ fprintf( output, "+------------------------------------------------------------------------------------------------------------+\n");
+ fprintf( output, "| DCS content |\n" );
+ fprintf( output, "+----------------------+-----------------------+---------------------+---------------------+-----------------+\n");
+ fprintf( output, "| %05i records | %05i records | %05i records | %05i records | %05i records |\n",
nHVEntries, nMVEntries, nTLEntries, nTREntries, nStatEntries );
- fprintf( output, "| time (s) HV | time (s) MV | time (s) TL | time (s) TR | time (s) Stat |\n" );
- fprintf( output, "+----------------------+----------------------+---------------------+---------------------+-----------------+\n");
+ fprintf( output, "| time (s) HV | time (s) MV | time (s) TL | time (s) TR | time (s) Stat |\n" );
+ fprintf( output, "+----------------------+-----------------------+---------------------+---------------------+-----------------+\n");
Int_t a = (nHVEntries > nMVEntries ) ? nHVEntries : nMVEntries;
Int_t b = (nTLEntries > nTREntries ) ? nTLEntries : nTREntries;
fprintf( output, "| | ");
if( entryLoop < nMVEntries )
- fprintf( output, " %12i %2.2f | ", GetMVTimeIdx(entryLoop), GetMVIdx(entryLoop) );
+ fprintf( output, " %12i %2.3f | ", GetMVTimeIdx(entryLoop), GetMVIdx(entryLoop) );
else
- fprintf( output, " | ");
+ fprintf( output, " | ");
if( entryLoop < nTLEntries )
fprintf( output, "%12i %2.2f | ", GetTempLeftTimeIdx(entryLoop), GetTempLeftIdx(entryLoop) );
//---------------------------------------------------------------------------
-Int_t AliITSDCSDataSDD::FindIndex( Int_t time, TArrayI &timeArray, Int_t n ) const
-{
-// Provides binary search in the time array
+Int_t AliITSDCSDataSDD::FindIndex( Int_t timeStamp, const TArrayI &timeStampArray, Int_t n ) const
+{
+// Provides binary search in the time array. Returns index in the array of time
+// stamps by selected value. Returns -1 if the time is less than time stamp in
+// the timeArray[0]
if( n < 1 ) return -1;// Empty array or wrong value of array size
- if( time >= timeArray.At(n-1) ) return n-1;
+ if( timeStamp >= timeStampArray.At(n-1) ) return n-1;
// Time is larger than last timestamp - last value in the array have
// to be used. This is the most frequent case, so it have sense
// to check it and avoid searching.
- if( time < timeArray.At(0) ) return -1;
+ if( timeStamp < timeStampArray.At(0) ) return -1;
// Time is less than all time stamp stored in the array
Int_t left = 0;
while( !( middle == left || middle == right) )
{ // Binary search in the time stamp array
- if( timeArray.At(middle) < time )
+ if( timeStampArray.At(middle) < timeStamp )
left = middle;
else
right = middle;
middle = (left + right)/2;
} /*while*/
- if( time >= timeArray.At(right) )
+ if( timeStamp >= timeStampArray.At(right) )
return right;
else
return left;
/* $Id$ */
///////////////////////////////////////////////////////////////////
-// //
// Class to define object containing SDD DCS data //
// Origin: F.Prino, Torino, prino@to.infn.it //
// V.Pospisil, CTU Prague, gdermog@seznam.cz //
#include<TArrayF.h>
#include<TArrayI.h>
#include<TArrayC.h>
+#include<TArrayS.h>
-class AliITSDCSDataSDD : public TObject
-{
+class AliITSDCSDataSDD : public TObject
+{
public:
AliITSDCSDataSDD( void );
~AliITSDCSDataSDD( void ){};
// Destructor is void
+/* There are allowed ranges of temperatures and medium voltages
+
+ MV ....... 0.0 - 65.535 V
+ TL, TR ... 0.0 - 655.35 C
+
+ because these variables are stores in UShort_t arrays (it halves
+ needed space). If value of any variable exceed allowed range,
+ something very stupid would be stored.
+*/
+
void SetNPointsTempLeft( Int_t npts );
void SetNPointsTempRight( Int_t npts );
void SetNPointsHV( Int_t npts );
// Inserts value of a DCS variable into the appropriate array.
// Resizes and sorts array if necessary.
- void Compress(); // Tries to minimize array sizes
+ void Compress(); // Minimize array sizes
Int_t GetTempLeftRecords() const {return fTempLeftSetPoints;}
Int_t GetTempRightRecords() const {return fTempRightSetPoints;}
Int_t GetStatusSize() const {return fStatusMaxPoints;}
// Returns size of selected array
- Float_t GetTempLeftIdx( Int_t index ) const {return fTempLeft.At(index);};
- Float_t GetTempRightIdx( Int_t index ) const {return fTempRight.At(index);};
- Float_t GetHVIdx( Int_t index ) const {return fHV.At(index);};
- Float_t GetMVIdx( Int_t index ) const {return fMV.At(index);};
- Char_t GetStatusIdx( Int_t index ) const {return fStatus.At(index);};
+ Float_t GetTempLeftIdx( Int_t index ) const { UShort_t val = (UShort_t)fTempLeft.At(index);
+ return (Float_t)val / fgkTPrec; };
+ Float_t GetTempRightIdx( Int_t index ) const { UShort_t val = (UShort_t)fTempRight.At(index);
+ return (Float_t)val / fgkTPrec;};
+ Float_t GetHVIdx( Int_t index ) const { return fHV.At(index);};
+ Float_t GetMVIdx( Int_t index ) const { UShort_t val = (UShort_t)fMV.At(index);
+ return (Float_t)val / fgkMVPrec;};
+ Char_t GetStatusIdx( Int_t index ) const { return fStatus.At(index);};
// Returns value of specific DCS variable by index in the array
Bool_t GetOKStatIdx( Int_t index ) const { return (Bool_t)(fStatus.At(index) & 1 ); };
Int_t GetStatusTimeIdx( Int_t index ) const {return fStatusTimeStamp.At(index);};
// Returns time stamp of specific DCS variable by index in the array
- Float_t GetTempLeft( Int_t time );
- Float_t GetTempRight( Int_t time );
- Float_t GetHV( Int_t time );
- Float_t GetMV( Int_t time );
- Char_t GetStatus( Int_t time );
+ Float_t GetTempLeft( Int_t time ) const { Int_t i = FindIndex( time, fTempLeftTimeStamp, fTempLeftSetPoints );
+ return ( i < 0 ) ? -1.0 : GetTempLeftIdx( i ); }
+ Float_t GetTempRight( Int_t time ) const { Int_t i = FindIndex( time, fTempRightTimeStamp, fTempRightSetPoints );
+ return ( i < 0 ) ? -1.0 : GetTempRightIdx( i ); }
+ Float_t GetHV( Int_t time ) const { Int_t i = FindIndex( time, fHVTimeStamp, fHVSetPoints );
+ return ( i < 0 ) ? -1.0 : GetHVIdx( i ); }
+ Float_t GetMV( Int_t time ) const { Int_t i = FindIndex( time, fMVTimeStamp, fMVSetPoints );
+ return ( i < 0 ) ? -1.0 : GetMVIdx( i ); }
+ Char_t GetStatus( Int_t time ) const { Int_t i = FindIndex( time, fStatusTimeStamp, fStatusSetPoints );
+ return ( i < 0 ) ? -1 : GetStatusIdx( i ); }
// Returns value of specific DCS variable by time stamp
- Bool_t GetOKStat( Int_t time ) { Char_t stat = GetStatus( time ); return (Bool_t)( stat & 1 ); };
- Bool_t GetTempLeftStat( Int_t time ) { Char_t stat = GetStatus( time ); return (Bool_t)( stat & 2 ); };
- Bool_t GetTempRightStat( Int_t time ) { Char_t stat = GetStatus( time ); return (Bool_t)( stat & 4 ); };
+ Bool_t GetOKStat( Int_t time ) const { return (Bool_t)( GetStatus( time ) & 1 ); };
+ Bool_t GetTempLeftStat( Int_t time ) const { return (Bool_t)( GetStatus( time ) & 2 ); };
+ Bool_t GetTempRightStat( Int_t time ) const { return (Bool_t)( GetStatus( time ) & 4 ); };
// Return status of a readout device in given time
- Float_t GetDriftField( Int_t timeStamp );
+ Float_t GetDriftField( Int_t timeStamp ) const;
// Returns drift field counted for specific time
- Float_t GetDriftSpeed( Int_t timeStamp ) const;
- // Returns drift speed counted for specific time. This metod is not dedicated
- // for normal usage - it should be used only in cases that the injectors for
- // given module fails
+ Float_t GetDriftSpeed( Int_t /*timeStamp*/ ) const; /* --- DUMMY --- */
+ // Returns drift speed counted for specific time. Calculation is based on temerature
+ // taken from DCS. This metod is not dedicated for normal usage, it should be used
+ // only in cases that the injectors for given module fails.
+ //
+ // Presently only a prototype, returns -1.0.
void PrintValues( FILE *output = stdout ) const;
// Displays stored DCS varable values or writes it into a text file
private:
- TArrayF fTempLeft; //|| "don't split" automatic streamer instruction
- // Temperature on left side. If there is stored a negative value
- // something wrong happend with the temperature chip.
- TArrayI fTempLeftTimeStamp; //||
- // Time stamps of the temperatures on left side
- Int_t fTempLeftMaxPoints; // Size of the arrays
- Int_t fTempLeftSetPoints; // Number of filled array cells (number of set values)
-
-
- TArrayF fTempRight; //||
- // Temperature on right side. If there is stored a negative value
- // something wrong happend with the temperature chip.
- TArrayI fTempRightTimeStamp; //||
- // Time stamps of temperatures on right side
- Int_t fTempRightMaxPoints; // Size of the arrays
- Int_t fTempRightSetPoints; // Number of filled array cells (number of set values)
-
-
- TArrayF fHV; //||
- // High voltage on SDD
- TArrayI fHVTimeStamp; //||
- // Time stamps of HV
- Int_t fHVMaxPoints; // Size of the arrays
- Int_t fHVSetPoints; // Number of filled array cells (number of set values)
-
-
- TArrayF fMV; //||
- // Medium voltage on SDD
- TArrayI fMVTimeStamp; //||
- // Time stamps of MV
- Int_t fMVMaxPoints; // Size of the arrays
- Int_t fMVSetPoints; // Number of filled array cells (number of set values)
-
-
- TArrayC fStatus; //||
- // Status of temperature and voltage readout
- //
- // bit 0 - _OK
- // bit 1 - _TEMP_L_STATE
- // bit 2 - _TEMP_R_STATE
-
- TArrayI fStatusTimeStamp; //||
- // Time stamps of MV
- Int_t fStatusMaxPoints; // Size of the arrays
- Int_t fStatusSetPoints; // Number of filled array cells (number of set values)
-
-
- Int_t FindIndex( Int_t timeStamp, TArrayI &timeStampArray, Int_t n ) const;
- // Returns index in the array of time stamps by selected value. Returns -1
- // if the time is less than time stamp in the timeArray[0]
-
- ClassDef(AliITSDCSDataSDD, 2)
+ TArrayS fTempLeft; // Temperature on left side. If there is stored a negative value
+ // something wrong happend with the temperature chip.
+ // Temperatures and medium voltages are stored as UShort_t, which
+ // takes half memory as Float_t. It makes ranges
+ //
+ // MV ....... 0.0 - 65.535 volts
+ // TL, TR ... 0.0 - 655.35 C
+ //
+ // which should be enough.
+ //
+ TArrayI fTempLeftTimeStamp; // Time stamps of the temperatures on left side
+ Int_t fTempLeftMaxPoints; // Size of the arrays
+ Int_t fTempLeftSetPoints; // Number of filled array cells (number of set values)
+
+
+ TArrayS fTempRight; // Temperature on right side. If there is stored a negative value
+ // something wrong happend with the temperature chip.
+ TArrayI fTempRightTimeStamp; // Time stamps of temperatures on right side
+ Int_t fTempRightMaxPoints; // Size of the arrays
+ Int_t fTempRightSetPoints; // Number of filled array cells (number of set values)
+
+
+ TArrayF fHV; // High voltage on SDD
+ TArrayI fHVTimeStamp; // Time stamps of HV
+ Int_t fHVMaxPoints; // Size of the arrays
+ Int_t fHVSetPoints; // Number of filled array cells (number of set values)
+
+
+ TArrayS fMV; // Medium voltage on SDD
+ TArrayI fMVTimeStamp; // Time stamps of MV
+ Int_t fMVMaxPoints; // Size of the arrays
+ Int_t fMVSetPoints; // Number of filled array cells (number of set values)
+
+ TArrayC fStatus; // Status of temperature and voltage readout
+ //
+ // bit 0 - _OK
+ // bit 1 - _TEMP_L_STATE
+ // bit 2 - _TEMP_R_STATE
+
+ TArrayI fStatusTimeStamp; // Time stamps of MV
+ Int_t fStatusMaxPoints; // Size of the arrays
+ Int_t fStatusSetPoints; // Number of filled array cells (number of set values)
+
+
+ static const Float_t fgkTPrec; // Number of temperature decimal places stored
+ static const Float_t fgkMVPrec; // Number of medium voltage decimal places stored
+ // There are three possibilities :
+ // 10.0 ..... one decimal place
+ // 100.0 .... two decimal places
+ // 1000.0 ... three decimal places
+ // Values are set in AliITSDCSDataSDD.cxx, by default
+ // it is fgkTPrec = 100.0, fgkMVPrec = 1000.0
+
+ Int_t FindIndex( Int_t timeStamp, const TArrayI &timeStampArray, Int_t n ) const;
+ // Provides binary search in the time array. Returns index in the array of time
+ // stamps by selected value. Returns -1 if the time is less than time stamp in
+ // the timeArray[0]
+
+ ClassDef(AliITSDCSDataSDD, 3)
}; /*class AliITSDCSDataSDD*/
#include <AliDCSValue.h>
#endif
-
//////////////////////////////////////////////////////////////////////////////////////
// Generator of testing data for AliITSDCSPreprocessorSDD and AliITSAnalyzerrSDD //
// Origin: F.Prino, Torino, prino@to.infn.it //
// V.Pospisil, CTU Prague, gdermog@seznam.cz //
//////////////////////////////////////////////////////////////////////////////////////
-
TMap* CreateRealisticMap( TTimeStamp startTime, TTimeStamp stopTime );
TMap* CreateRandomMap( Int_t maxRecords = 1000, Int_t randomTimeStamps = 0 );
void GenerateOutputFiles( TMap *map, char *dir );
+Int_t sizeOfMapContent = 0;
void CreateSDDDCSMap( void )
{
outMap->Write( "DCSAliasMap", TObject::kSingleKey );
- printf( "DCSAliasMap created...\n");
+ printf( "DCSAliasMap created, it size is %i byte ...\n", sizeOfMapContent );
} /*CreateMap*/
// --- Temperature readout (left side) - behavior of DCS --------
- Int_t freqROTL = 60; // Frequency of fixed readout
+ Int_t freqROTL = 300; // Frequency of fixed readout
Float_t fluctROTL = 5.0;
// Allowed fluctuation (%)
// Temperature readout status (left side) - behavior of SDD chip
- Int_t freqROStTL = 60;// Frequency of fixed readout
+ Int_t freqROStTL = 300;// Frequency of fixed readout
Float_t failureTL = 0.01;
// Probability of thermometer
// failure (in one hour)
// --- Temperature readout (right side) - behavior of DCS -------
- Int_t freqROTR = 60; // Frequency of fixed readout
+ Int_t freqROTR = 300; // Frequency of fixed readout
Float_t fluctROTR = 5.0;
// Allowed fluctuation (%)
// Temperature readout status (right side) - behavior of SDD
- Int_t freqROStTR = 60;// Frequency of fixed readout
+ Int_t freqROStTR = 300;// Frequency of fixed readout
Float_t failureTR = 0.01;
// Probability of thermometer
// failure (in one hour)
Float_t mvalHV = 1791.0;
// Mean value of HV
- Float_t fluctHV = 0.5; // Fluctuation (gaussian sigma)
+ Float_t fluctHV = 0.03;// Fluctuation (gaussian sigma)
// --- High voltage readout - behavior of DCS -------------------
- Int_t freqROHV = 60; // Frequency of fixed readout
+ Int_t freqROHV = 300; // Frequency of fixed readout
Float_t fluctROHV = 0.01;
// Allowed fluctuation (%)
// --- High voltage readout status - behavior of SDD voltage ----
- Int_t freqROOK = 60; // Frequency of fixed readout
+ Int_t freqROOK = 300; // Frequency of fixed readout
Float_t failureHV = 0.005;
// Probability of HV source
// failure (in one hour)
// --- Medium voltage - behavior of SDD voltage source --------
Float_t mvalMV = 45.0; // Mean value of MV
- Float_t fluctMV = 0.25;// Fluctuation (gaussian sigma)
+ Float_t fluctMV = 0.005;
+ // Fluctuation (gaussian sigma)
// --- Medium voltage readout - behavior of DCS -----------------
- Int_t freqROMV = 60; // Frequency of fixed readout
+ Int_t freqROMV = 300; // Frequency of fixed readout
Float_t fluctROMV = 0.1;
// Allowed fluctuation (%)
aliasMap->SetOwner(1);
// Empty map is created
+ sizeOfMapContent += sizeof( TMap );
+
TString aliasName;
Char_t dpName[50];
Int_t created = 0;
TObjArray* valueSetStTL = new TObjArray;
TObjArray* valueSetStTR = new TObjArray;
+ sizeOfMapContent += 7 * sizeof( TObjArray );
+
valueSetOK->SetOwner(1);
valueSetHV->SetOwner(1);
valueSetMV->SetOwner(1);
Int_t counterOK = 0;
// Periodic readout counters
- Int_t endingTimeStamp = stopTime.GetSec();
+ Int_t endingTimeStamp = /*1197477000;*/ stopTime.GetSec();
- for( Int_t timeLoop = startTime.GetSec(); timeLoop < endingTimeStamp; timeLoop ++ )
+ for( Int_t timeLoop = /*1197470000 */ startTime.GetSec(); timeLoop < endingTimeStamp; timeLoop ++ )
{ // Loop goes through period of run second per second and determines
// all values according to rules of DCS
fprintf( stderr, "\nCreated %i objects of type AliDCSValue (%i periodic + %i treshold)... \n",
created + created1, created, created1 );
+ sizeOfMapContent += (created + created1 ) * ( sizeof( AliDCSValue ) + sizeof( AliDCSValue * ) );
+
return aliasMap;
} /*CreateRealisticMap*/
TMap* aliasMap = new TMap;
aliasMap->SetOwner(1);
+ sizeOfMapContent += sizeof( TMap );
TString aliasName;
Char_t dpName[50];
TObjArray* valueSetStTL = new TObjArray;
TObjArray* valueSetStTR = new TObjArray;
+ sizeOfMapContent += 7 * sizeof( TObjArray );
+
valueSetOK->SetOwner(1);
valueSetH->SetOwner(1);
valueSetM->SetOwner(1);
sprintf(dpName,"SDD_LAYER%i_LADDER%02d_MODULE%d_OK", iLay,iLad,iMod);
aliasName=dpName;
- nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ) );
+ nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ) );
timeStamp = 1000000000;
- for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
+ for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
{
if( randomTimeStamps )
timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
else
timeStamp += (Int_t)(50*(gRandom->Rndm()) );
- if( 1000*(gRandom->Rndm()) > 50 )
- dcsVal = new AliDCSValue((Bool_t)1, timeStamp);
- else
- dcsVal = new AliDCSValue((Bool_t)0, timeStamp);
- valueSetOK->Add(dcsVal);
-
+ if( 1000*(gRandom->Rndm()) > 50 )
+ dcsVal = new AliDCSValue((Bool_t)1, timeStamp);
+ else
+ dcsVal = new AliDCSValue((Bool_t)0, timeStamp);
+ valueSetOK->Add(dcsVal);
} /*for( recLoop )*/
aliasMap->Add(new TObjString(aliasName), valueSetOK);
created += nrOfRecords;
if( randomTimeStamps )
timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
else
- timeStamp += (Int_t)(50*(gRandom->Rndm()) );
+ timeStamp += (Int_t)(50*(gRandom->Rndm()) );
dcsVal = new AliDCSValue( (Float_t)( 1600 + 200*(gRandom->Rndm()) ), timeStamp );
valueSetH->Add(dcsVal);
-
} /*for( recLoop )*/
aliasMap->Add(new TObjString(aliasName), valueSetH);
created += nrOfRecords;
sprintf(dpName,"SDD_LAYER%i_LADDER%02d_MODULE%d_MV", iLay, iLad,iMod);
aliasName=dpName;
- nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
+ nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
timeStamp = 1000000000;
for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
{
if( randomTimeStamps )
timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
else
- timeStamp += (Int_t)(50*(gRandom->Rndm()) );
+ timeStamp += (Int_t)(50*(gRandom->Rndm()) );
dcsVal = new AliDCSValue( (Float_t)( 30 + 20*(gRandom->Rndm()) ), timeStamp );
valueSetM->Add(dcsVal);
} /*for( recLoop )*/
sprintf(dpName,"SDD_LAYER%i_LADDER%02d_MODULE%d_TEMP_L", iLay, iLad,iMod);
aliasName=dpName;
- nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
+ nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
timeStamp = 1000000000;
for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
{
if( randomTimeStamps )
timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
- else
- timeStamp += (Int_t)(50*(gRandom->Rndm()) );
+ else
+ timeStamp += (Int_t)(50*(gRandom->Rndm()) );
dcsVal = new AliDCSValue( (Float_t)( 50 + 50*(gRandom->Rndm()) ), timeStamp );
valueSetTL->Add(dcsVal);
} /*for( recLoop )*/
sprintf(dpName,"SDD_LAYER%i_LADDER%02d_MODULE%d_TEMP_R", iLay, iLad,iMod);
aliasName=dpName;
- nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
- timeStamp = 1000000000;
+ nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
+ timeStamp = 1000000000;
for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
{
if( randomTimeStamps )
timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
else
- timeStamp += (Int_t)(50*(gRandom->Rndm()) );
+ timeStamp += (Int_t)(50*(gRandom->Rndm()) );
dcsVal = new AliDCSValue( (Float_t)( 50 + 50*(gRandom->Rndm()) ), timeStamp );
valueSetTR->Add(dcsVal);
} /*for( recLoop )*/
sprintf(dpName,"SDD_LAYER%i_LADDER%02d_MODULE%d_TEMP_L_STATE", iLay, iLad,iMod);
aliasName=dpName;
- nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
+ nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
timeStamp = 1000000000;
for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
{
if( randomTimeStamps )
- timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
+ timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
else
- timeStamp += (Int_t)(50*(gRandom->Rndm()) );
+ timeStamp += (Int_t)(50*(gRandom->Rndm()) );
if( 1000*(gRandom->Rndm()) > 50 )
dcsVal = new AliDCSValue((Int_t)1, timeStamp);
else
sprintf(dpName,"SDD_LAYER%i_LADDER%02d_MODULE%d_TEMP_R_STATE", iLay, iLad,iMod);
aliasName=dpName;
- nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
+ nrOfRecords = (Int_t)(maxRecords * ( gRandom->Rndm() ));
timeStamp = 1000000000;
for( Int_t recLoop = 0; recLoop < nrOfRecords; recLoop ++ )
{
if( randomTimeStamps )
timeStamp = (Int_t)(1200000000*(gRandom->Rndm()));
else
- timeStamp += (Int_t)(50*(gRandom->Rndm()) );
+ timeStamp += (Int_t)(50*(gRandom->Rndm()) );
if( 1000*(gRandom->Rndm()) > 50 )
dcsVal = new AliDCSValue((Int_t)1, timeStamp);
else
fprintf( stderr, "\nCreated %i objects of type AliDCSValue ... \n", created);
+ sizeOfMapContent += created * ( sizeof( AliDCSValue ) + sizeof( AliDCSValue * ) );
+
return aliasMap;
}
char buffer[100],cmd[100];
Int_t nHVEntries, nMVEntries, nTLEntries, nTREntries;
Int_t nOKEntries, nStTLEntries, nStTREntries;
-
+
sprintf(cmd,"ls -l %s >/dev/null 2>&1",dir);
if(gSystem->Exec(cmd)!=0){
printf("%s --- NOT EXISTS -- create it\n",dir);
nHVEntries, nMVEntries, nTLEntries, nTREntries, nStTLEntries );
fprintf( outputFile, " %05i records | %05i records |\n", nStTREntries, nOKEntries );
- fprintf( outputFile, "| time (s) HV | time (s) MV | time (s) TL | time (s) TR | time (s) StTL |" );
+ fprintf( outputFile, "| time (s) HV | time (s) MV | time (s) TL | time (s) TR | time (s) StTL |" );
fprintf( outputFile, " time (s) StTR | time (s) OK |\n" );
fprintf( outputFile, "+----------------------+----------------------+---------------------+---------------------+");
fprintf( outputFile, "-----------------+-----------------+-----------------+\n" );
fprintf( outputFile, "| | ");
if( entryLoop < nMVEntries )
- fprintf( outputFile, " %12i %2.2f | ", ((AliDCSValue*)arrMV->At(entryLoop))->GetTimeStamp(),
+ fprintf( outputFile, " %12i %2.3f | ", ((AliDCSValue*)arrMV->At(entryLoop))->GetTimeStamp(),
((AliDCSValue*)arrMV->At(entryLoop))->GetFloat() );
else
- fprintf( outputFile, " | ");
+ fprintf( outputFile, " | ");
if( entryLoop < nTLEntries )
fprintf( outputFile, "%12i %2.2f | ", ((AliDCSValue*)arrTL->At(entryLoop))->GetTimeStamp(),