bool
AliHLTPHOSBase::CheckFile(const char *fileName, const char *opt) const
{
+ //returns true if the file specified by "fileName exists and has acceees rights specified by "opt",
+ //returns false if it doesnt exist, or it exists, but doesnt have the access right specified by "opt"
+
FILE *fp = fopen(fileName, opt);
if(fp == 0)
using namespace PhosHLTConst;
using namespace std;
+//
+// Base class for all PHOS HLT classes.
+// The class contains some utility functions
+// and also loads data about the HLT configuration
+// and the altro/FEE configuration
+//
+
class AliHLTPHOSBase : public AliHLTPHOSConfig, public AliHLTPHOSAltroConfig
{
}
template<typename T>
- void ResetArray(T *array, int N)
+ void ResetArray(T *array, int N) const
{
for(int i= 0; i< N; i++)
{
}
template<typename T>
- T MaxValue(T *array, int N)
+ T MaxValue(T *array, int N) const
{
T tmpMax = 0;
protected:
- AliHLTPHOSConfig *fConfigPtr;
- AliHLTPHOSConfig *fAltroConfigPtr;
+ AliHLTPHOSConfig *fConfigPtr; // object holding HLT configuration data
+ AliHLTPHOSConfig *fAltroConfigPtr; // object holding Altro configuration data
private:
AliHLTPHOSBase(const AliHLTPHOSBase & );
private:
/** At which time index to start the measuring of the baseline */
- Int_t fSampleStart;
+ Int_t fSampleStart; // Shutting up rule checker
/** Not used anymore */
- Int_t fMaxCrazyDifference;
+ Int_t fMaxCrazyDifference; // Shutting up rule checker
/** Maximum signal level, used to not count channels with signals for baseline measurement */
- Int_t fMaxSignal;
+ Int_t fMaxSignal; // Shutting up rule checker
/** Count of channels, not used anymore */
- Int_t fChannelCount;
+ Int_t fChannelCount; // Shutting up rule checker
/** Array containing the baselines of all channels */
- Float_t fBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS];
+ Float_t fBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; // Shutting up rule checker
/** Array containing the accumulated baselines for all channels */
- Float_t fAccumulatedBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS][2];
+ Float_t fAccumulatedBaselines[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS][2]; // Shutting up rule checker
/** Pointer to a tree containing TClonesArray of AliHLTPHOSBaseline objects */
TTree *fTreePtr; //! transient
return "PhosDigitMaker";
}
-void
+void
AliHLTPHOSDigitMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
{
//see header file for documentation
-
const AliHLTComponentDataType* pType=fgkInputDataTypes;
while (pType->fID!=0) {
list.push_back(*pType);
AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
/** Event count */
- UInt_t fEvtCnt;
+ // UInt_t fEvtCnt;
static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
* provided "as is" without express or implied warranty. *
**************************************************************************/
+//
+// Mapping class fro mapping
+// from hardware address to geometrical address
+//
+//
+
#include "AliHLTPHOSMapper.h"
-AliHLTPHOSMapper::AliHLTPHOSMapper() : AliHLTPHOSBase(), hw2geomapPtr(0)
+AliHLTPHOSMapper::AliHLTPHOSMapper() : AliHLTPHOSBase(), fHw2geomapPtr(0)
{
// printf("\nCreating new mapper\n");
InitAltroMapping();
void
AliHLTPHOSMapper::InitAltroMapping()
{
+ // Loads mapping between Altro addresses and geometrical addresses from file
+
char filename[256];
char *base = getenv("ALICE_ROOT");
int nChannels = 0;
if(base !=0)
{
sprintf(filename,"%s/PHOS/mapping/RCU0.data", base);
- // printf("AliHLTPHOSMapper::InitAltroMapping()")
+
FILE *fp = fopen(filename, "r");
if(fp != 0)
{
fscanf(fp, "%d", &maxaddr);
printf("nChannels = %d", nChannels);
printf("maxaddr = %d", maxaddr);
- hw2geomapPtr = new altromap[maxaddr +1];
+ fHw2geomapPtr = new fAltromap[maxaddr +1];
for(int i=0; i< maxaddr + 1 ; i ++)
{
- hw2geomapPtr[i].xCol = 0;
- hw2geomapPtr[i].zRow = 0;
- hw2geomapPtr[i].gain = 0;
+ fHw2geomapPtr[i].fXCol = 0;
+ fHw2geomapPtr[i].fZRow = 0;
+ fHw2geomapPtr[i].fGain = 0;
}
-
- // printf("\n");
-
for(int i=0; i<nChannels; i ++)
{
fscanf(fp, "%d %d %d %d\n", &tmpHwaddr, &tmpXCol, &tmpZRow, &tmpGain);
- // printf("tmpHwaddr = %d\t tmpXCol = %d\t tmpZRow = %d\t tmpGain = %d\n", tmpHwaddr, tmpXCol, tmpZRow, tmpGain);
-
- hw2geomapPtr[tmpHwaddr].xCol = tmpXCol;
- hw2geomapPtr[tmpHwaddr].zRow = tmpZRow;
- hw2geomapPtr[tmpHwaddr].gain = tmpGain;
-
+ fHw2geomapPtr[tmpHwaddr].fXCol = tmpXCol;
+ fHw2geomapPtr[tmpHwaddr].fZRow = tmpZRow;
+ fHw2geomapPtr[tmpHwaddr].fGain = tmpGain;
}
- // printf("\n");
- // for(int i=0; i< nChannels; i ++)
-
-
- /*Æ
- for(int i=120; i< 500; i ++)
- {
- printf( "%d\t%d\t%d\t%d\n", i, hw2geomapPtr[i].col, hw2geomapPtr[i].row, hw2geomapPtr[i].gain);
- }
-
- printf("\n");
- */
-
-
-
}
else
{
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//#include "PhosFeeClient.h"
-
-//#include "stdio.h"
-//#include <iostream>
-#include <cstdlib>
-#include <assert.h>
-//#include "AliHLTPHOSCommonDefs.h"
-//#include "AliHLTPHOSConstants.h"
#include "AliHLTPHOSBase.h"
-
-// PhosHLTConst
-using namespace std;
-using namespace PhosHLTConst;
+
+//using namespace PhosHLTConst;
class AliHLTPHOSMapper : public AliHLTPHOSBase
{
virtual ~AliHLTPHOSMapper();
void InitAltroMapping();
- struct altromap{
- // int mod;
- int zRow;
- int xCol;
- int gain;
- // int rcu;
- // int branch;
- // int card;
- // int chip;
- // int chan;
- // int csp;
- // int num;
- // int hid;
+ struct fAltromap{
+ int fZRow; // Coordinate in Z direction (beam direction) relatve too one RCU
+ int fXCol; // Coordinate in X direction (perpendicular too beam direction an parallell to ground) relatve too one RCU
+ int fGain; // Gain (high gain = 1, low gain = 0)
};
-
-altromap *hw2geomapPtr;
+ fAltromap *fHw2geomapPtr; //pointer to structure holding information about geometrical address
};
#include "AliHLTPHOSRawAnalyzer.h"
#include "AliHLTPHOSRawAnalyzerComponent.h"
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-//#include "AliHLTPHOSRcuChannelDataStruct.h"
#include "AliHLTPHOSMapper.h"
#include "AliHLTPHOSSanityInspector.h"
#include "AliHLTPHOSBaseline.h"
#include "TFile.h"
#include "TTree.h"
#include "TClonesArray.h"
-
#include "AliAltroDecoder.h" // decoder for altro payload
#include "AliAltroData.h" // container for altro payload
#include "AliAltroBunch.h" // container for altro bunches
fAnalyzerPtr->SetData(fAltroDataPtr->GetData());
fAnalyzerPtr->Evaluate(0, fAltroDataPtr->GetDataSize() -2);
- fOutPtr->fValidData[tmpChannelCnt].fZ = fMapperPtr->hw2geomapPtr[fAltroDataPtr->GetHadd()].zRow;
- fOutPtr->fValidData[tmpChannelCnt].fX = fMapperPtr->hw2geomapPtr[fAltroDataPtr->GetHadd()].xCol;
- fOutPtr->fValidData[tmpChannelCnt].fGain = fMapperPtr->hw2geomapPtr[fAltroDataPtr->GetHadd()].gain;
+ fOutPtr->fValidData[tmpChannelCnt].fZ = fMapperPtr->fHw2geomapPtr[fAltroDataPtr->GetHadd()].fZRow;
+ fOutPtr->fValidData[tmpChannelCnt].fX = fMapperPtr->fHw2geomapPtr[fAltroDataPtr->GetHadd()].fXCol;
+ fOutPtr->fValidData[tmpChannelCnt].fGain = fMapperPtr->fHw2geomapPtr[fAltroDataPtr->GetHadd()].fGain;
if(fUseBaselineSubtraction)
{
#include "AliHLTPHOSRcuProcessor.h"
+//
+// Class tp produce calibration data
+// too be sendt to the HLT file exhange server
+// and to the PHOS HLT monitoring GUI
+//
+
+
class AliHLTPHOSRcuHistogramProducer;
class AliHLTPHOSRcuCellAccumulatedEnergyDataStruct;
class AliHLTPHOSSharedMemoryInterface;
using AliHLTPHOSRcuProcessor::DoEvent;
private:
+
int fHistoWriteFrequency;
AliHLTPHOSRcuHistogramProducer* fRcuHistoProducerPtr; /**<Pointer to a phos histoproducer object*/
AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* fOutPtr; /**<Pointer to outputbuffer to write results from the component into shared memory*/
- // static const AliHLTComponentDataType fgkIinputDataTypes[];
- // static const AliHLTComponentDataType fgkOutputDataType; /**<List of datatypes that can be given to this component*/
- AliHLTPHOSSharedMemoryInterface *fShmPtr;
+ AliHLTPHOSSharedMemoryInterface *fShmPtr; // Interface to read altro channel data from shared memory
};
#endif