-AliHLTAltroData::AliHLTAltroData(): fBunchCounter(0), fBunchData(0), fData(0), fDataSize(0), fWc(0), fHadd(0), fIsComplete(true)
+AliHLTAltroData::AliHLTAltroData(): fData(0),
+ fBunchData(0),
+ fDataSize(0),
+ fWc(0),
+ fHadd(0),
+ fBunchCounter(0),
+ fIsComplete(0)
{
* provided "as is" without express or implied warranty. *
**************************************************************************/
-AliHLTDDLDecoder::AliHLTDDLDecoder() : f32DtaPtr(0), f8DtaPtr(0),fN32HeaderWords(8), fN32RcuTrailerWords(1), fNDDLBlocks(0),
- fBufferPos(0), fN40AltroWords(0), fN40RcuAltroWords(0), fSize(0), fSegmentation(0),
- f32LastDDLBlockSize(5), f32PayloadSize(0),fBufferIndex(0), fN10bitWords(0), fBad(0),fGood(0)
-{
+AliHLTDDLDecoder::AliHLTDDLDecoder() : f32DtaPtr(0),
+ f8DtaPtr(0),
+ fN32HeaderWords(8),
+ fN32RcuTrailerWords(1),
+ fN40AltroWords(0),
+ fN40RcuAltroWords(0),
+ fNDDLBlocks(0),
+ f32LastDDLBlockSize(5),
+ f32PayloadSize(0),
+ fOutBufferIndex(0),
+ fSize(0),
+ fNAltro10bitWords(0),
+ fComplete(0),
+ fInComplete(0),
+ fDecodeIfCorruptedTrailer(true),
+ fIsDecoded(false)
+{
+ // see header file for class documentation
}
AliHLTDDLDecoder::~AliHLTDDLDecoder()
{
-
+ // see header file for class documentation
}
bool
AliHLTDDLDecoder::CheckPayload()
{
+ // see header file for class documentation
if(fN40AltroWords != fN40RcuAltroWords)
{
return false;
}
else
{
-
return true;
-
}
}
+
+
+
+
+
+
bool
AliHLTDDLDecoder::Decode()
{
- // int naaa;
+ // see header file for class documentation
fComplete = 0;
fInComplete = 0;
- if((CheckPayload() == true) && (fSize > 32) )
+ if( ((CheckPayload() == true) || fDecodeIfCorruptedTrailer == true ) && (fSize > 32) )
{
- fDDLBlockCnt = 0;
- fBufferIndex = 0;
- fN10bitWords = 0;
-
- // for(fI=0; fI < fNDDLBlocks; fI++)
+ // fDDLBlockCnt = 0;
+ fOutBufferIndex = 0;
+
for(int i = 0; i < fNDDLBlocks; i++)
{
DecodeDDLBlock();
}
-
DecodeLastDDLBlock();
- fGood ++;
-
- /*
- printf("\n");
- DumpData(fBuffer, 1000, 4);
- printf("\n");
- */
-
- return true;
+ fOutBufferIndex = fN40AltroWords*4 - 1;
+ fIsDecoded = true;
+ return true;
}
else
cout << "Size of datablock is " << fSize << endl;
cout << "fN40AltroWords = " << fN40AltroWords << endl;
cout << "fN40RcuAltroWords = " << fN40RcuAltroWords << endl;
- fBad ++;
- float badPercent = (100*(float)fBad)/((float)fBad + (float)fGood);
-
- cout << "there are" << badPercent <<" % corrupted DDL corrupted blocks" << endl;
-
- fDDLBlockCnt = 0;
- fBufferIndex = 0;
- fN10bitWords = 0;
-
- // for(fI=0; fI < fNDDLBlocks; fI++)
- for(int i = 0; i < fNDDLBlocks; i++)
- {
- DecodeDDLBlock();
- }
-
-
- DecodeLastDDLBlock();
-
- /*
- printf("\n");
- DumpData(fBuffer, 1000, 4);
- printf("\n");
- */
-
- return true;
-
- // return false;
+ return false;
}
}
+
bool
AliHLTDDLDecoder::NextChannel(AliHLTAltroData *altroDataPtr)
{
+ // see header file for class documentation
+
+ // if(fIsDecoded == true)
+ // {
+ if(fIsDecoded != true)
+ {
+ cout <<"AliHLTDDLDecoder::NextChanne, WARNING, buffer not decoded "<< endl;
+ Decode();
+ }
+
- if(fBufferPos > fN32HeaderWords)
+ if(fOutBufferIndex > fN32HeaderWords)
{
- if((fBuffer[fBufferPos] << 4 ) | ((fBuffer[fBufferPos-1] & 0x3c0) >> 6) == 0x2aaa)
+ if((fOutBuffer[fOutBufferIndex] << 4 ) | ((fOutBuffer[fOutBufferIndex-1] & 0x3c0) >> 6) == 0x2aaa)
{
altroDataPtr->fIsComplete = true;
- // printf("\nAliHLTDDLDecoder::NextChannel data is complete 0x2aaa endmarker present\n");
fComplete ++;
}
else
{
- // printf("\nAliHLTDDLDecoder::NextChannel ERROR, data is incomplete 0x2aaa endmarker missing\n");
altroDataPtr->fIsComplete = false;
fInComplete ++;
}
- fBufferPos --;
- fNAltro10bitWords = ( (fBuffer[fBufferPos] & 0x3f) << 4 ) | ((fBuffer[fBufferPos -1] & (0xF << 6)) >> 6) ;
- fBufferPos --;
- fHadd = ((fBuffer[fBufferPos] & 0x3)) << 10 | ( fBuffer[fBufferPos-1] );
- fBufferPos --;
+ fOutBufferIndex --;
+ fNAltro10bitWords = ( (fOutBuffer[fOutBufferIndex] & 0x3f) << 4 ) | ((fOutBuffer[fOutBufferIndex -1] & (0xF << 6)) >> 6) ;
+ fOutBufferIndex --;
+ altroDataPtr->fHadd = ((fOutBuffer[fOutBufferIndex] & 0x3)) << 10 | ( fOutBuffer[fOutBufferIndex-1] );
+ fOutBufferIndex --;
if(fNAltro10bitWords%4 == 0)
{
- fBufferPos = fBufferPos - fNAltro10bitWords;
+ fOutBufferIndex = fOutBufferIndex - fNAltro10bitWords;
}
else
{
- fBufferPos = fBufferPos - fNAltro10bitWords -(4 - fNAltro10bitWords%4);
+ fOutBufferIndex = fOutBufferIndex - fNAltro10bitWords -(4 - fNAltro10bitWords%4);
}
- altroDataPtr->fData = &fBuffer[fBufferPos];
- fBufferPos --;
- altroDataPtr->fDataSize = fNAltro10bitWords ;
- altroDataPtr->fHadd = fHadd;
+ altroDataPtr->fData = &fOutBuffer[fOutBufferIndex];
+ fOutBufferIndex --;
+ altroDataPtr->fDataSize = fNAltro10bitWords;
-
return true;
+
}
else
{
return false;
}
}
+
+// else
+// {
+// cout <<"AliHLTDDLDecoder::NextChanne, WARNING, buffer not decoded "<< endl;
+// Decode();
+// }
+//}
+
+//}
int
AliHLTDDLDecoder::countAAApaddings()
{
-
-
+ // see header file for class documentation
+ int cnt = 0;
+ return cnt;
}
float
AliHLTDDLDecoder::GetFailureRate()
{
+ // see header file for class documentation
float tmp = 0;
cout << "Number of Complete channles = " << fComplete <<endl;
cout << "Number of InComplete channles = " << fInComplete <<endl;
return tmp;
}
-
-int
-AliHLTDDLDecoder::GetMarker(UInt_t *buffer, int index)
-{
- int tmpMarker = 0;
- int tmpMask = 0x3c0;
- tmpMarker = (buffer[index] << 4 ) | ((buffer[index-1] & tmpMask) >> 6);
- return tmpMarker;
-}
-
void
AliHLTDDLDecoder::PrintInfo(AliHLTAltroData &altrodata, int n, int nPerLine)
{
+ // see header file for class documentation
cout << "altrodata.fDataSize = " << altrodata.fDataSize << endl;
cout << "altrodata.fHadd = " << altrodata.fHadd <<endl;
for(int i= 0; i< n; i++)
void
AliHLTDDLDecoder::SetMemory(UChar_t *dtaPtr, UInt_t size)
{
+ // see header file for class documentation
+ fIsDecoded == false;
f8DtaPtr =dtaPtr;
fSize = size;
f32PayloadSize = fSize/4 - (fN32HeaderWords + fN32RcuTrailerWords);
fN40AltroWords = (32*f32PayloadSize)/40;
-
- // cout << "AliHLTDDLDecoder::SetMemory f32PayloadSize =" << f32PayloadSize <<endl;
- // cout << "AliHLTDDLDecoder::SetMemory 32*f32PayloadSize =" << 32*f32PayloadSize <<endl;
- // cout << "AliHLTDDLDecoder::SetMemory (32*f32PayloadSize)/40 =" << (32*f32PayloadSize)/40 <<endl;
-
f32LastDDLBlockSize = f32PayloadSize%DDL_32BLOCK_SIZE;
fNDDLBlocks = f32PayloadSize/5;
f8DtaPtr =f8DtaPtr + fSize;
- f32DtaPtr = (UInt_t *) f8DtaPtr;
+ f32DtaPtr = (UInt_t *)f8DtaPtr;
+ // f32DtaPtr = (UInt_t *)dtaPtr;
f32DtaPtr = f32DtaPtr - fN32RcuTrailerWords;
fN40RcuAltroWords = *f32DtaPtr;
f32DtaPtr = (UInt_t *)dtaPtr + fN32HeaderWords;
- fBufferPos = fN40AltroWords*4 - 1;
-
- // UShort_t *tmpBufferPos = fBufferPos;
-
- // tmpBufferPos = tmpBufferPos - 2*fN32RcuTrailerWords;
-
- for(int i=0; i<4; i++)
- {
- // printf("\nAliHLTDDLDecoder::SetMemory i= %d, content = 0x%x\n", i, *tmpBufferPos);
- }
}
+
void
AliHLTDDLDecoder::DecodeDDLBlock()
{
- fBuffer[fBufferIndex] = *f32DtaPtr & 0x3ff; //s0
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xffc00) >> 10; //s1
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0x3ff00000) >> 20; //s2
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xc0000000) >> 30; //s3_1
+ // see header file for class documentation
+ fOutBuffer[fOutBufferIndex] = *f32DtaPtr & 0x3ff; //s0
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xffc00) >> 10; //s1
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0x3ff00000) >> 20; //s2
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xc0000000) >> 30; //s3_1
f32DtaPtr ++;
- fBuffer[fBufferIndex] = fBuffer[fBufferIndex] | ((*f32DtaPtr & 0xff) << 2); //s3_2
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0x3ff00) >> 8; //s4
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xffc0000) >> 18; //s5
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xf0000000) >> 28; //s6_1
+ fOutBuffer[fOutBufferIndex] = fOutBuffer[fOutBufferIndex] | ((*f32DtaPtr & 0xff) << 2); //s3_2
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0x3ff00) >> 8; //s4
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xffc0000) >> 18; //s5
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xf0000000) >> 28; //s6_1
f32DtaPtr ++;
- fBuffer[fBufferIndex] = fBuffer[fBufferIndex] | ((*f32DtaPtr & 0x3f) << 4); //s6_2
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xffc0) >> 6; //s7
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0x3ff0000) >> 16; //s8
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xFC000000) >> 26; //s9_1
+ fOutBuffer[fOutBufferIndex] = fOutBuffer[fOutBufferIndex] | ((*f32DtaPtr & 0x3f) << 4); //s6_2
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xffc0) >> 6; //s7
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0x3ff0000) >> 16; //s8
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xFC000000) >> 26; //s9_1
f32DtaPtr ++;
- fBuffer[fBufferIndex] = fBuffer[fBufferIndex] | ((*f32DtaPtr & 0xf) << 6); //s9_2
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0x3ff0) >> 4; //s10
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xffc000) >> 14; //s11
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xff000000) >> 24; //s12_1
+ fOutBuffer[fOutBufferIndex] = fOutBuffer[fOutBufferIndex] | ((*f32DtaPtr & 0xf) << 6); //s9_2
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0x3ff0) >> 4; //s10
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xffc000) >> 14; //s11
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xff000000) >> 24; //s12_1
f32DtaPtr ++;
- fBuffer[fBufferIndex] = fBuffer[fBufferIndex] | ((*f32DtaPtr & 0x3) << 8); //s12_2
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xffc) >> 2; //s13
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0x3ff000) >> 12; //s14
- fBufferIndex ++;
- fBuffer[fBufferIndex] = (*f32DtaPtr & 0xffc00000) >> 22; //s15
- fN10bitWords =fN10bitWords + 16 ;
+ fOutBuffer[fOutBufferIndex] = fOutBuffer[fOutBufferIndex] | ((*f32DtaPtr & 0x3) << 8); //s12_2
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xffc) >> 2; //s13
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0x3ff000) >> 12; //s14
+ fOutBufferIndex ++;
+ fOutBuffer[fOutBufferIndex] = (*f32DtaPtr & 0xffc00000) >> 22; //s15
f32DtaPtr ++;
- fBufferIndex ++;
- fDDLBlockCnt ++;
+ fOutBufferIndex ++;
+ // fDDLBlockCnt ++;
}
void
AliHLTDDLDecoder::DecodeLastDDLBlock()
{
- for(unsigned fI=0; fI < f32LastDDLBlockSize; fI++)
+ // see header file for class documentation
+ for(int i=0; i < f32LastDDLBlockSize; i++)
{
- fDDLBlockDummy[fI] = *f32DtaPtr;
+ fDDLBlockDummy[i] = *f32DtaPtr;
f32DtaPtr ++;
}
DecodeDDLBlock();
}
-/*
-void
-AliHLTDDLDecoder::SetNTrailerWords(int n)
-{
- fN32RcuTrailerWords = n;
-}
-*/
+
+
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+#define DDL_32BLOCK_SIZE 5
#include "Rtypes.h"
#include <iostream>
+#include "AliHLTPHOSConstants.h"
+
using std::cout;
using std::endl;
-#define DDL_32BLOCK_SIZE 5
-#include "AliHLTPHOSConstants.h"
using namespace PhosHLTConst;
+
+
class AliHLTAltroData;
class AliHLTDDLDecoder
{
public:
+
+ /*
+ *Default constructor
+ */
AliHLTDDLDecoder();
+
+ /*
+ *Default destructor
+ */
virtual ~AliHLTDDLDecoder();
+
+ /*
+ *Check wether or not there is consistency between the number of 40 bit altro words given by
+ *the RCU payload and the number of 40 bit words calculated from the size of the RCU payload.
+ */
bool CheckPayload();
+
+ /*
+ *Decode the RCU/DDL payload
+ */
bool Decode();
+
+
bool NextChannel(AliHLTAltroData *altroDataPtr);
template<typename T>
}
- void SetMemory(UChar_t *dtaPtr, UInt_t size);
- // void SetNTrailerWords(int N);
+
+
+ void SetMemory(UChar_t *dtaPtr, UInt_t size);
void PrintInfo(AliHLTAltroData &altrodata, int n = 0, int nPerLine = 4);
- float GetFailureRate();
+ /*
+ *
+ */
+ float GetFailureRate();
private:
+ /*
+ *Decode one 160 bit DDL block into 16 x 16 bit integers (only least significant 10 bits are filled)
+ */
void DecodeDDLBlock();
- void DecodeLastDDLBlock();
- int GetMarker(UInt_t *buffer, int index);
- int countAAApaddings();
-
- UInt_t *f32DtaPtr;
- UChar_t *f8DtaPtr;
-
- const long int fN32HeaderWords;
- const long int fN32RcuTrailerWords;
+ /*
+ *Decode one 160 bit DDL block into 16 integers,
+ *if the las blaock does not align with 160 bits then first pad with zeroes
+ */
+ void DecodeLastDDLBlock();
- unsigned int fNDDLBlocks;
- long int fBufferPos;
-
- unsigned long fN40AltroWords;
- unsigned long fN40RcuAltroWords;
-
- UInt_t fSize;
- unsigned int fSegmentation;
- unsigned int f32LastDDLBlockSize;
- UInt_t f32PayloadSize;
- UInt_t fBufferIndex;
- UInt_t fN10bitWords;
- UInt_t fBuffer[N_FEECS*N_BRANCHES*8*N_ALTROCHANNELS*(ALTRO_MAX_SAMPLES + ALTRO_MAX_TRALER_SIZE)];
- UInt_t fDDLBlockDummy[DDL_BLOCK_SIZE];
- UInt_t fDDLBlockCnt;
- UInt_t fNAltro10bitWords;
- UInt_t fNAltroLastSequence10bitWords;
- UInt_t fHadd;
- UInt_t fI;
- int fComplete;
- int fInComplete;
-
- int fBad;
- int fGood;
+ int countAAApaddings();
+ UInt_t *f32DtaPtr; /**<Pointer to dat of the input buffer in entities of 32 bit words (the RCU/DDL block) */
+ UChar_t *f8DtaPtr; /**<Pointer to dat of the input buffer in entities of 8 bit words (the RCU/DDL block) */
+ const long int fN32HeaderWords; /**<Number of 32 bit words in the common data header*/
+ const long int fN32RcuTrailerWords; /**<Number of 32 bit words in the RCU trailer*/
+ int fN40AltroWords; /**<Number of 40 bit altro words contained in the RCU payload as calculated form the payload size*/
+ int fN40RcuAltroWords; /**<Number of 40 bit altro words contained in the RCU payload as given by the RCU trailer*/
+ int fNDDLBlocks; /**<Number of DDL blocks in the payload (the last blocj might/ight not be 160 bits )*/
+ int f32LastDDLBlockSize; /**<Size of the last DDL block*/
+ UInt_t fDDLBlockDummy[DDL_BLOCK_SIZE]; /**<buffer to contain the las DDL block, if the block is not aligned with 160 bitm the remaining fileds are padded with zeroes*/
+ UInt_t f32PayloadSize; /**<The size of the payload in entities of 32 bit words (after subtraction of the RCU header and the RCU trailer words)*/
+ long int fOutBufferIndex; /**<current buffer position of the buffer for the decoded data (10 bit words represnted as int's)*/
+ UInt_t fSize; /**<The size of the input RCU/DDL payload in entities of bytes, inluding the RCU header and trailer */
+ UInt_t fOutBuffer[N_FEECS*N_BRANCHES*8*N_ALTROCHANNELS*(ALTRO_MAX_SAMPLES + ALTRO_MAX_TRALER_SIZE)]; /**<Buffer to hold the decoded data*/
+ UInt_t fNAltro10bitWords; /**<The total number of 10 bit altro words in the RCU payload, including trailers (disregardin that the altro trialer is not aligned with 10 bit)*/
+ int fComplete; /**<Number of altro channels that is only partially read out (0x2aaa pattern missing in trailer)*/
+ int fInComplete; /**<Number of altro channels that is read out properly*/
+ bool fDecodeIfCorruptedTrailer; /**<Wether or not to try to decode the data if the RCU trailer is incorrect (will succseed in most cases)*/
+ bool fIsDecoded; /**<Wether or not the buffer set last by the "SetMemory()" function has been decoded*/
};
#endif
**************************************************************************/
#include "AliHLTPHOSBase.h"
+
AliHLTPHOSBase::AliHLTPHOSBase()
{
#include <Rtypes.h>
#include "TString.h"
#include "AliHLTDataTypes.h"
-#include "AliHLTPHOSDefinitions.h"
+//#include "AliHLTPHOSDefinitions.h"
+//#include "AliHLTPHOSCommonDefs.h"
#include "AliHLTPHOSConstants.h"
-#include "AliHLTPHOSCommonDefs.h"
using namespace PhosHLTConst;
+
+
+
using namespace std;
+
class AliHLTPHOSBase
{
public:
AliHLTPHOSBase();
virtual ~AliHLTPHOSBase();
+
template<typename T>
void DumpData(T *array, int N, int nPerLine)
{
template<typename T>
T MaxValue(T *array, int N)
{
- Double_t tmpMax = 0;
+ // Double_t tmpMax = 0;
+
+ T tmpMax = 0;
for(int i = 0; i < N; i++)
{
private:
- AliHLTPHOSBase(const AliHLTPHOSBase & );
- AliHLTPHOSBase & operator = (const AliHLTPHOSBase &);
+ // AliHLTPHOSBase(const AliHLTPHOSBase & );
+ // AliHLTPHOSBase & operator = (const AliHLTPHOSBase &);
+
/// const struct THIS IS STRANGE;
AliHLTPHOSClusterizer::AliHLTPHOSClusterizer():AliHLTPHOSBase(),fPHOSModule(0), fThreshold(0), fClusterThreshold(0),
fHighGainFactor(0.005), fLowGainFactor(0.08),
fArraySize(3), fMultiplicity(fArraySize*fArraySize)
+//AliHLTPHOSClusterizer::AliHLTPHOSClusterizer():AliHLTPHOSProcessor(),fPHOSModule(0), fThreshold(0), fClusterThreshold(0),
+// fHighGainFactor(0.005), fLowGainFactor(0.08),
+// fArraySize(3), fMultiplicity(fArraySize*fArraySize)
{
//See header file for documentation
}//end
-AliHLTPHOSClusterizer::AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &):AliHLTPHOSBase(),fPHOSModule(0), fThreshold(0), fClusterThreshold(0),
- fHighGainFactor(0.005), fLowGainFactor(0.08),
- fArraySize(3), fMultiplicity(fArraySize*fArraySize)
-{
+// PTH AliHLTPHOSClusterizer::AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &):AliHLTPHOSBase(),fPHOSModule(0), fThreshold(0), fClusterThreshold(0),
+// fHighGainFactor(0.005), fLowGainFactor(0.08),
+// fArraySize(3), fMultiplicity(fArraySize*fArraySize)
+
+//{
//Copy constructor, not implemented
-}//end
+//}//end
AliHLTPHOSClusterizer:: ~AliHLTPHOSClusterizer()
{
#ifndef ALIHLTPHOSCLUSTERIZER_H
#define ALIHLTPHOSCLUSTERIZER_H
-//#include "AliHLTPHOSProcessor.h"
+
+//#include "AliHLTPHOSProcessor.h"
#include "AliHLTPHOSBase.h"
struct AliHLTPHOSRcuCellEnergyDataStruct;
//class AliHLTPHOSClusterizer: public AliHLTPHOSProcessor
+
class AliHLTPHOSClusterizer: public AliHLTPHOSBase
{
AliHLTPHOSClusterizer();
virtual ~AliHLTPHOSClusterizer();
- AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &);
- AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer &) {return *this;}
+ // AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &);
+ //AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer &) {return *this;}
void SetThreshold(float threshold) {fThreshold = threshold;}
void SetClusterThreshold(float clusterThreshold) {fClusterThreshold = clusterThreshold;}
AliHLTPHOSClusterizerComponent gAliHLTPHOSClusterizerComponent;
-AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(): AliHLTPHOSBase(), AliHLTProcessor(), fClusterizerPtr(0), fOutPtr(0),
- fRecPointStructArrayPtr(0), fRecPointListPtr(0)
+//AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(): AliHLTPHOSBase(), AliHLTProcessor(), fClusterizerPtr(0), fOutPtr(0),
+// fRecPointStructArrayPtr(0), fRecPointListPtr(0)
+AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(): AliHLTPHOSProcessor(), fClusterizerPtr(0), fOutPtr(0),
+ fRecPointStructArrayPtr(0), fRecPointListPtr(0)
{
//Constructor
}
}
+/*
+int
+AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent::Deinit()
+{
+ ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
+}
+*/
+
// PTH AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent(const AliHLTPHOSClusterizerComponent &):AliHLTProcessor(),
// fClusterizerPtr(0),
// fOutPtr(0),
-#include "AliHLTProcessor.h"
-#include "AliHLTPHOSBase.h"
+#include "AliHLTPHOSProcessor.h"
+
+//#include "AliHLTPHOSBase.h"
//#include "AliHLTPHOSDefinitions.h"
//#include "AliHLTProcessor.h"
struct AliHLTPHOSRecPointListDataStruct;
-class AliHLTPHOSClusterizerComponent: public AliHLTPHOSBase, public AliHLTProcessor
+
+// PTH class AliHLTPHOSClusterizerComponent: public AliHLTPHOSBase, public AliHLTProcessor
+class AliHLTPHOSClusterizerComponent: public AliHLTPHOSProcessor
+//class AliHLTPHOSClusterizerComponent: public AliHLTPHOSBase, public AliHLTProcessor
{
public:
// return *this;
// }
+
+
const char* GetComponentID();
void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
protected:
+
int DoInit(int argc, const char** argv);
- int Deinit();
+ virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
int DoDeinit();
private:
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear *
+ * Physics Group, Dep. of Physics *
+ * University of Oslo, Norway, 2007 *
+ * *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate. *
+ * Please report bugs to perthi@fys.uio.no *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+
+#include "AliHLTPHOSDDLDecoderComponent.h"
+#include "AliRawReaderMemory.h"
+#include "AliCaloRawStream.h"
+#include "AliHLTPHOSRcuChannelDataStruct.h"
+#include "AliHLTPHOSPulseGenerator.h"
+#include "AliHLTPHOSDataCorruptor.h"
+#include "AliHLTDDLDecoder.h"
+#include "AliHLTPHOSMapper.h"
+#include "AliHLTAltroData.h"
+//#include "AliHLTPHOSBase.h"
+
+using namespace std;
+
+
+AliHLTPHOSDDLDecoderComponent gAliHLTPHOSDDLDecoderComponent;
+
+
+AliHLTPHOSDDLDecoderComponent::AliHLTPHOSDDLDecoderComponent():AliHLTPHOSRcuProcessor(),
+ fOutPtr(0), fDataCorruptorPtr(0), fDecoderPtr(0), fAltroDataPtr(0), fMapperPtr(0)
+{
+ //Default constructor
+ fDataCorruptorPtr = new AliHLTPHOSDataCorruptor();
+ fAltroDataPtr = new AliHLTAltroData();
+ fDecoderPtr = new AliHLTDDLDecoder();
+ fMapperPtr = new AliHLTPHOSMapper();
+}
+
+AliHLTPHOSDDLDecoderComponent::~AliHLTPHOSDDLDecoderComponent()
+{
+
+}
+
+int
+AliHLTPHOSDDLDecoderComponent::Deinit()
+{
+ //Se html documentation of base class
+ cout << "Deinit" << endl;
+ Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSRawAnalyzerComponen DoDeinit");
+ return 0;
+}
+
+
+const char*
+AliHLTPHOSDDLDecoderComponent::GetComponentID()
+{
+ //Se html documentation of base class
+ return "PhosDDLDecoder";
+}
+
+
+
+void
+AliHLTPHOSDDLDecoderComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
+{
+ //Se html documentation of base class
+ const AliHLTComponentDataType* pType=fgkInputDataTypes;
+ while (pType->fID!=0) {
+ list.push_back(*pType);
+ pType++;
+ }
+}
+
+AliHLTComponentDataType
+AliHLTPHOSDDLDecoderComponent::GetOutputDataType()
+{
+ //See html documentation of base class
+ return AliHLTPHOSDefinitions::fgkCellChannelDataDataType;
+}
+
+void
+AliHLTPHOSDDLDecoderComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+
+{
+ //Se html documentation of base class
+ constBase = 30;
+ inputMultiplier = 1;
+}
+
+
+int
+AliHLTPHOSDDLDecoderComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
+ AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
+ AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
+{
+
+ cout <<"AliHLTPHOSDDLDecoderComponent::DoEvent()" << endl;
+
+ Int_t sampleCnt = 0;
+ Int_t processedChannels = 0;
+ UInt_t offset = 0;
+ UInt_t mysize = 0;
+ UInt_t tSize = 0;
+ Int_t tmpChannelCnt = 0;
+ AliHLTUInt8_t* outBPtr;
+
+ outBPtr = outputPtr;
+ const AliHLTComponentBlockData* iter = NULL;
+ unsigned long ndx;
+
+ // cout << "evtData.fBlockCnt = " << evtData.fBlockCnt << endl;
+
+ for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
+ {
+ // cout << "AliHLTPHOSDDLDecoderComponent::DoEven ndx = " << ndx <<endl;
+ iter = blocks+ndx;
+ mysize = 0;
+ tmpChannelCnt = 0;
+ offset = tSize;
+
+ if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType )
+ {
+ // cout << "iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType" << endl;
+ continue;
+ }
+
+ // fRawMemoryReader->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize );
+
+ fDecoderPtr->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize );
+ fDecoderPtr->Decode();
+
+ fOutPtr = (AliHLTPHOSRcuChannelDataStruct*)outBPtr;
+ mysize += sizeof(AliHLTPHOSRcuChannelDataStruct);
+
+ fOutPtr->fRcuX = fRcuX;
+ fOutPtr->fRcuZ = fRcuZ;
+ fOutPtr->fModuleID = fModuleID;
+ tmpChannelCnt = 0;
+
+ while(fDecoderPtr->NextChannel(fAltroDataPtr) == true)
+ {
+ for(int i= 0; i<fAltroDataPtr->fDataSize;i ++ )
+ {
+ fOutPtr->fValidData[tmpChannelCnt].fChannelData[i] = fAltroDataPtr->fData[i];
+ }
+
+
+ fOutPtr->fValidData[tmpChannelCnt].fDataSize = fAltroDataPtr->fDataSize;
+ fOutPtr->fValidData[tmpChannelCnt].fX = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].xCol;
+ fOutPtr->fValidData[tmpChannelCnt].fZ = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].zRow;
+ fOutPtr->fRcuX = fRcuX;
+ fOutPtr->fRcuZ = fRcuZ;
+ fOutPtr->fModuleID = fModuleID;
+ tmpChannelCnt++;
+
+ // DumpData();
+ // printf("\n");
+ // DumpData(fOutPtr->fValidData[tmpChannelCnt].fChannelData, fOutPtr->fValidData[tmpChannelCnt].fDataSize, 16);
+ // printf("\n");
+
+ }
+
+ /*
+ for(int i=0; i<tmpChannelCnt; i++)
+ {
+ printf("\nDumping data for \n")
+
+ }
+ */
+
+
+ /*
+ while(fPHOSRawStream->Next())
+ {
+ if (fPHOSRawStream->IsNewHWAddress())
+ {
+ sampleCnt = 0;
+ fOutPtr->fValidData[tmpChannelCnt].fZ = (AliHLTUInt8_t)fPHOSRawStream->GetColumn() - fRcuZOffset;
+ fOutPtr->fValidData[tmpChannelCnt].fX = (AliHLTUInt8_t)fPHOSRawStream->GetRow() - fRcuXOffset;
+ fOutPtr->fValidData[tmpChannelCnt].fGain = fPHOSRawStream->IsLowGain();
+ fOutPtr->fValidData[tmpChannelCnt].fNSamples = 0;
+ tmpChannelCnt++;
+ }
+ fOutPtr->fValidData[tmpChannelCnt-1].fNSamples ++;
+ fOutPtr->fValidData[tmpChannelCnt-1].fChannelData[sampleCnt] = fPHOSRawStream->GetSignal();
+ sampleCnt ++;
+ }
+ */
+
+
+ fOutPtr->fNValidChannels = tmpChannelCnt-1;
+ // cout << "AliHLTPHOSDDLDecoderComponent::DoEven: setting fOutPtr->fNValidChannels =" << tmpChannelCnt-1<<endl;
+
+ int tmpSampleCnt=0;
+ AliHLTComponentBlockData bd;
+ FillBlockData( bd );
+ bd.fOffset = offset;
+ bd.fSize = mysize;
+ bd.fDataType = AliHLTPHOSDefinitions::fgkCellChannelDataDataType;
+ bd.fSpecification = 0xeFFFFFFF;
+ outputBlocks.push_back( bd);
+ tSize += mysize;
+ outBPtr += mysize;
+ }
+
+ if( tSize > size )
+ {
+ cout <<"kHLTLogFatal, HLT::AliHLTPHOSDDLDecoderComponent::DoEvent Too much data Data written over allowed buffer. Amount written:" << tSize << " allowed" << size << endl;
+ Logging( kHLTLogFatal, "HLT::AliHLTPHOSDDLDecoderComponent::DoEvent", "Too much data", "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.", tSize, size );
+ return EMSGSIZE;
+ }
+
+ fPhosEventCount++;
+
+ if(fPrintInfo == kTRUE)
+ {
+ if(fPhosEventCount%fPrintInfoFrequncy == 0)
+ {
+ cout <<"Analyzing event " << fPhosEventCount << "for Equippment " << fkEquippmentID << endl;
+ }
+ }
+ size = tSize;
+ return 0;
+}//end DoEvent
+
+
+int
+AliHLTPHOSDDLDecoderComponent::DoInit( int argc, const char** argv )
+{
+ //See html documentation of base class
+ fPrintInfo = kFALSE;
+ // fRawMemoryReader = new AliRawReaderMemory();
+ // fPHOSRawStream = new AliCaloRawStream(fRawMemoryReader,"PHOS");
+ // fPHOSRawStream->SetOldRCUFormat(kFALSE);
+
+ int iResult=0;
+ TString argument="";
+ ScanArguments(argc, argv);
+
+ if(fIsSetEquippmentID == kFALSE)
+
+ {
+ cout << "The argument equippmentID is not set: set it with a component argumet like this: -equippmentID <number>" << endl;
+ Logging( kHLTLogFatal, "HLT::AliHLTPHOSRcuHistogramProducerComponent::DoInt( int argc, const char** argv )", "Missing argument",
+ "The argument equippmentID is not set: set it with a component argumet like this: -equippmentID <number>");
+ iResult = -2;
+ }
+ else
+ {
+ // fRawMemoryReader->SetEquipmentID(fkEquippmentID);
+ }
+
+ return iResult;
+}
+
+AliHLTComponent*
+AliHLTPHOSDDLDecoderComponent::Spawn()
+{
+ //See html documentation of base class
+ return new AliHLTPHOSDDLDecoderComponent;
+}
--- /dev/null
+#ifndef ALIHLTPHOSDDLDECODERCOMPONENT_H
+#define ALIHLTPHOSDDLDECODERCOMPONENT_H
+
+/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+#include "AliHLTPHOSRcuProcessor.h"
+
+
+
+class AliHLTPHOSRcuCellEnergyDataStruct;
+class AliHLTPHOSRcuChannelDataStruct;
+class AliHLTPHOSPulseGenerator;
+class AliHLTPHOSDataCorruptor;
+class AliHLTDDLDecoder;
+class AliHLTAltroData;
+class AliHLTPHOSMapper;
+
+
+
+class AliHLTPHOSDDLDecoderComponent:public AliHLTPHOSRcuProcessor
+{
+ public:
+ AliHLTPHOSDDLDecoderComponent();
+ virtual ~AliHLTPHOSDDLDecoderComponent();
+ virtual int DoInit( int argc, const char** argv );
+ virtual int Deinit();
+ virtual const char* GetComponentID();
+ virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list);
+ virtual AliHLTComponentDataType GetOutputDataType();
+ virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
+ virtual AliHLTComponent* Spawn();
+
+ virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
+ AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
+ AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
+
+
+ private:
+ AliHLTPHOSDataCorruptor *fDataCorruptorPtr; /**<Pointer to data corruptor*/
+ Double_t fTmpChannelData[ALTRO_MAX_SAMPLES]; /**<Temporary storage for altro dat from a single channel*/
+ AliHLTPHOSRcuChannelDataStruct* fOutPtr; /**<Pointer to outputbuffer to write results from the component into shared memory*/
+ AliHLTDDLDecoder *fDecoderPtr;
+ AliHLTAltroData *fAltroDataPtr;
+ AliHLTPHOSMapper *fMapperPtr;
+};
+#endif
+
#include "TNamed.h"
-#include "AliHLTPHOSCommonDefs.h"
#include "AliHLTPHOSConstants.h"
-// PhosHLTConst
using namespace PhosHLTConst;
class AliHLTPHOSEmcCalibData: public TNamed {
#ifndef ALIHLTPHOSFILEWRITERCOMPONENT_H
#define ALIHLTPHOSFILEWRITERCOMPONENT_H
-//#include "AliHLTPHOSDefinitions.h"
#include <string>
-#include "AliHLTPHOSCommonDefs.h"
#include "Rtypes.h"
#include "AliHLTFileWriter.h"
#include <vector>
-
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all functions;
/*
-#pragma link C++ class AliHLTPHOSRawAnalyzerPeakFinder+;
-#pragma link C++ class AliHLTPHOSRawAnalyzerCrude+;
-#pragma link C++ class AliHLTPHOSRawAnalyzerChiSquareFit+;
-#pragma link C++ class AliHLTPHOSRawAnalyzerKLevel+;
-#pragma link C++ class AliHLTPHOSRawAnalyzerLMS+;
-#pragma link C++ class AliHLTPHOSPulseGenerator+;
+#pragma link C++ class AliHLTPHOSClusterizer+;
#pragma link C++ class AliHLTPHOSEmcCalibData+;
-#pragma link C++ class AliHLTPHOSDefinitions+;
-#pragma link C++ class AliHLTPHOSPhysicsAnalyzer+;
-#pragma link C++ class AliHLTPHOSPhysicsAnalyzerSpectrum+;
-#pragma link C++ class AliHLTPHOSClusterizer+;
-#pragma link C++ class AliHLTPHOSPhysicsAnalyzerPeakFitter+;
-#pragma link C++ class AliHLTPHOSPhysicsDefinitions+;
+#pragma link C++ class AliHLTPHOSPhysicsAnalyzer+;
+#pragma link C++ class AliHLTPHOSPhysicsAnalyzerPeakFitter+;
+#pragma link C++ class AliHLTPHOSPhysicsAnalyzerSpectrum+;
+#pragma link C++ class AliHLTPHOSPulseGenerator+;
+#pragma link C++ class AliHLTPHOSRawAnalyzerChiSquareFit+;
+#pragma link C++ class AliHLTPHOSRawAnalyzerCrude+;
+#pragma link C++ class AliHLTPHOSRawAnalyzerKLevel+;
+#pragma link C++ class AliHLTPHOSRawAnalyzerLMS+;
+#pragma link C++ class AliHLTPHOSRawAnalyzerPeakFinder+;
*/
+
#endif
}
-
void
AliHLTPHOSMapper::InitAltroMapping()
{
char filename[256];
char *base = getenv("ALICE_ROOT");
-
int nChannels = 0;
int maxaddr = 0;
-
int tmpHwaddr = 0;
int tmpZRow = 0;
int tmpXCol = 0;
printf("maxaddr = %d", maxaddr);
hw2geomapPtr = new altromap[maxaddr +1];
-
for(int i=0; i< maxaddr + 1 ; i ++)
{
- hw2geomapPtr[i].col = 0;
- hw2geomapPtr[i].row = 0;
+ hw2geomapPtr[i].xCol = 0;
+ hw2geomapPtr[i].zRow = 0;
hw2geomapPtr[i].gain = 0;
}
- printf("\n");
+ // 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].col = tmpXCol;
- hw2geomapPtr[tmpHwaddr].row = tmpZRow;
+ hw2geomapPtr[tmpHwaddr].xCol = tmpXCol;
+ hw2geomapPtr[tmpHwaddr].zRow = tmpZRow;
hw2geomapPtr[tmpHwaddr].gain = tmpGain;
}
- printf("\n");
+ // printf("\n");
// for(int i=0; i< nChannels; i ++)
}
-
-
-
-
-/*
-void
-AliHLTPHOSMapper::AddCsp(int csp, int chip, int chHi, int chLo, int numHi, int numLo)
-{
- // Find row & col by CSP
- int col = csp / 16;
- int row = csp % 16;
- //In 2004 beam test was also: if(row>7)row=23-row;
- // Check if arguments Ok
- assert((col>=0)&&(col<2));
- assert((row>=0)&&(row<16));
- assert((csp>=0)&&(csp<32));
- assert((numHi>=0)&&(numHi<64));
- assert((numLo>=0)&&(numLo<64));
- assert((chHi>=0)&&(chHi< N_ALTROCHANNELS));
- assert((chLo>=0)&&(chLo< N_ALTROCHANNELS));
- assert((chip>=0)&&(chip<N_ALTROS));
- // Fill CSP array
- CSP_MAP[chip][chHi].row=row; CSP_MAP[chip][chLo].row=row;
- CSP_MAP[chip][chHi].col=col; CSP_MAP[chip][chLo].col=col;
- CSP_MAP[chip][chHi].gain=1; CSP_MAP[chip][chLo].gain=0;
- CSP_MAP[chip][chHi].csp=csp; CSP_MAP[chip][chLo].csp=csp;
- CSP_MAP[chip][chHi].num=numHi; CSP_MAP[chip][chLo].num=numLo;
-}
-*/
-
-
- /////////////////////////////////////////////////////////////////
- // Initialize CSP mapping table.
- // Note we use (0,1,2,3) instead of (0,2,3,4) ALTRO chip numbers.
- // So strange numbers we have due to well known RCU firmware bug.
- /////////////////////////////////////////////////////////////////
-
- /*
-void
-AliHLTPHOSMapper::InitAltroCspMapping()
-{
- // T1 csp chip chHi chLo numHi numLo
- AddCsp( 0, 1, 10, 11, 26, 27);
- AddCsp( 1, 1, 14, 15, 30, 31);
- AddCsp( 2, 1, 5, 4, 21, 20);
- AddCsp( 3, 1, 1, 0, 17, 16);
- AddCsp( 4, 2, 1, 0, 33, 32);
- AddCsp( 5, 2, 5, 4, 37, 36);
- AddCsp( 6, 2, 14, 15, 46, 47);
- AddCsp( 7, 2, 10, 11, 42, 43);
- // T2 csp chip chHi chLo numHi numLo
- AddCsp( 8, 0, 10, 11, 10, 11);
- AddCsp( 9, 0, 14, 15, 14, 15);
- AddCsp( 10, 0, 5, 4, 5, 4);
- AddCsp( 11, 0, 1, 0, 1, 0);
- AddCsp( 12, 3, 1, 0, 49, 48);
- AddCsp( 13, 3, 5, 4, 53, 52);
- AddCsp( 14, 3, 14, 15, 62, 63);
- AddCsp( 15, 3, 10, 11, 58, 59);
- // T3 csp chip chHi chLo numHi numLo
- AddCsp( 16, 1, 8, 9, 24, 25);
- AddCsp( 17, 1, 12, 13, 28, 29);
- AddCsp( 18, 1, 7, 6, 23, 22);
- AddCsp( 19, 1, 3, 2, 19, 18);
- AddCsp( 20, 2, 3, 2, 35, 34);
- AddCsp( 21, 2, 7, 6, 39, 38);
- AddCsp( 22, 2, 12, 13, 44, 45);
- AddCsp( 23, 2, 8, 9, 40, 41);
- // T4 csp chip chHi chLo numHi numLo
- AddCsp( 24, 0, 8, 9, 8, 9);
- AddCsp( 25, 0, 12, 13, 12, 13);
- AddCsp( 26, 0, 7, 6, 7, 6);
- AddCsp( 27, 0, 3, 2, 3, 2);
- AddCsp( 28, 3, 3, 2, 51, 50);
- AddCsp( 29, 3, 7, 6, 55, 54);
- AddCsp( 30, 3, 12, 13, 60, 61);
- AddCsp( 31, 3, 8, 9, 56, 57);
-}
-
-*/
-//void
-//AliHLTPHOSMapper::GeomToAFL(int startZ, int endZ, int startX, int endX, int rcuZ, int rcuX)
-//{
-//
-//
-//}
-
-//inline int
-
-/*
-int
-AliHLTPHOSMapper::Geo2hid(int mod, int gain, int row, int col)
-{
- return mod*100000+gain*10000+row*100+col;
-}
-
-//inline int
-int
-AliHLTPHOSMapper::Hid2mod(int hid)
-{
- return hid/100000;
-}
-
-
-//inline int
-int
-AliHLTPHOSMapper::Hid2gain(int hid)
-{
- return (hid/10000)%10;
-}
-
-//inline int
-int
-AliHLTPHOSMapper::Hid2row(int hid)
-{
- return (hid/100)%100;
-}
-
-//inline int
-int
-AliHLTPHOSMapper::Hid2col(int hid)
-{
- return hid%100;
-}
-
-////////////////////////////////////////////////////////////////////////
-// ALTRO mapping first time initialization (do it once in startup time).
-////////////////////////////////////////////////////////////////////////
-
-
-
-//inline void
-//AliHLTPHOSMapper::initAltroMapping(int saveMapping=0)
-// initAltroMapping(int)'
-void
-AliHLTPHOSMapper::InitAltroMapping(int saveMapping)
-{
- //
- // Init CSP mapping first.
- //
- InitAltroCspMapping();
- //
-
- // Clear index arrays
- //
- for(int m=0; m<N_MODULES; m++)
- for(int g=0; g<N_GAINS;g++)
- for(int r=0; r< N_XCOLUMNS_MOD; r++)
- for(int c=0; c<N_ZROWS_MOD; c++)
- {
- geo2hdw[m][g][r][c]=-1;
- }
-
- for(int m=0; m<N_MODULES; m++)
- for(int r=0; r<N_RCUS; r++)
- for(int b=0; b<N_BRANCHES; b++)
- for(int f=0; f<N_FEECS; f++)
- for(int a=0; a<N_ALTROS; a++)
- for(int c=0; c<N_ALTROCHANNELS; c++)
- {
- hdw2geo[m][r][b][f][a][c]=-1;
- }
- //
- // Fill all FEE cards via formula
- //
- int index=0;
- for(int m=0; m<N_MODULES; m++)
- for(int r=0; r<N_RCUS; r++)
- for(int b=0; b<N_BRANCHES; b++)
- for(int f=0; f<N_FEECS; f++)
- for(int a=0; a<N_ALTROS; a++)
- for(int c=0; c<N_ALTROCHANNELS; c++)
- {
- int row = (r/2)*32 + b*16 + CSP_MAP[a][c].row;
- int col = (r%2)*28 + f*2 + CSP_MAP[a][c].col;
- int gain = CSP_MAP[a][c].gain;
- int csp = CSP_MAP[a][c].csp;
- int num = CSP_MAP[a][c].num;
- ALTRO_MAP[index].mod=m;
- ALTRO_MAP[index].row=row;
- ALTRO_MAP[index].col=col;
- ALTRO_MAP[index].gain=gain;
- ALTRO_MAP[index].rcu=r;
- ALTRO_MAP[index].branch=b;
- ALTRO_MAP[index].card=f;
- ALTRO_MAP[index].chip=a;
- ALTRO_MAP[index].chan=c;
- ALTRO_MAP[index].csp=csp;
- ALTRO_MAP[index].num=num;
- ALTRO_MAP[index].hid=Geo2hid(m,gain,row,col);
- hdw2geo[m][r][b][f][a][c]=index;
- if((row>=0)&&(row< N_XCOLUMNS_MOD))
- if((col>=0)&&(col<N_ZROWS_MOD))
- if((gain>=0)&&(gain<N_GAINS)) geo2hdw[m][gain][row][col]=index;
- index++;
- }
-
- //
- // Check if geo2hdw map table is filled
- //
- for(int m=0; m<N_MODULES; m++)
- for(int g=0; g<N_GAINS;g++)
- for(int r=0; r< N_XCOLUMNS_MOD; r++)
- for(int c=0; c< N_ZROWS_MOD; c++)
- {
- assert(geo2hdw[m][g][r][c] >= 0);
- }
- //
- // Check if hdw2geo map table is filled
- //
- for(int m=0; m<N_MODULES; m++)
- for(int r=0; r<N_RCUS; r++)
- for(int b=0; b<N_BRANCHES; b++)
- for(int f=0; f<N_FEECS; f++)
- for(int a=0; a<N_ALTROS; a++)
- for(int c=0; c<N_ALTROCHANNELS; c++)
- {
- assert(hdw2geo[m][r][b][f][a][c] >= 0);
- }
-}
-
-
-*/
-
-/*
-
-////////////////////////////////////////////////////////////////////////
-// Return histogramm id from histogramm name or -1 on error.
-// extractHid("hMax011426")=11426;
-////////////////////////////////////////////////////////////////////////
-//inline int
-int
-AliHLTPHOSMapper::ExtractHid(char *objName){
- // char *perr= NULL;
- char *perr= 0;
- if(strlen(objName)<7) return -1;
- int hid=strtol(&objName[strlen(objName)-6],&perr,10);
- if(strlen(perr))return -1;
- return hid;
-}
-
-////////////////////////////////////////////////////////////////////////
-// Print geometry and hardware information for given histogramm
-// printHistMapInfo("hMax011426");
-// hid mod gain row col rcu bran fee chip chan csp num
-// 011426 0 1 14 26 0 0 13 3 14 14 62
-////////////////////////////////////////////////////////////////////////
-//inline void
-void
-AliHLTPHOSMapper::PrintHistMapInfo(char *objName){
- int hid=ExtractHid(objName);
- if(hid>=0){
- int mod=Hid2mod(hid);
- int gain=Hid2gain(hid);
- int row=Hid2row(hid);
- int col=Hid2col(hid);
- int index=geo2hdw[mod][gain][row][col]; assert(index>=0);
- int rcu = ALTRO_MAP[index].rcu;
- int bran = ALTRO_MAP[index].branch;
- int fec = ALTRO_MAP[index].card;
- int chip = ALTRO_MAP[index].chip;
- int chan = ALTRO_MAP[index].chan;
- int csp = ALTRO_MAP[index].csp;
- int num = ALTRO_MAP[index].num;
- printf("%s attributes:\nhid\tmod\tgain\trow\tcol\trcu\tbran\tfee\tchip\tchan\tcsp\tnum\n",objName);
- printf("%06d\t%d\t%d\t%02d\t%02d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",hid,mod,gain,row,col,rcu,bran,fec,chip,chan,csp,num);
- }
-}
-
-
-*/
AliHLTPHOSMapper();
virtual ~AliHLTPHOSMapper();
void InitAltroMapping();
-
struct altromap{
// int mod;
- int row;
- int col;
+ int zRow;
+ int xCol;
int gain;
// int rcu;
// int branch;
altromap *hw2geomapPtr;
-
- /*
- struct FEE_CSP_MAP{
- int row;
- int col;
- int gain;
- int csp;
- int num;
- };
- */
-
- /*
- struct ALTRO_GEO_MAP{
- int mod;
- int gain;
- int row;
- int col;
- int rcu;
- int branch;
- int card;
- int chip;
- int chan;
- int csp;
- int num;
- int hid;
- };
- */
-
- // void AddCsp(int csp, int chip, int chHi, int chLo, int numHi, int numLo);
-
-
- //Function to generate Active Channel List (ACL)for each of the four readout partitions
- //Of the Phos Module. The ACL register is 256x16 bit big.
- // void GenerateACL(int startZ, int endZ, int startX, int endX, int mID, int acl[RCUS_PER_MODULE][256], unsigned long int afl[RCUS_PER_MODULE]);
-
- // void InitAltroCspMapping();
-
- /*
- inline int Geo2hid(int mod, int gain, int row, int col);
- inline int Hid2mod(int hid);
- inline int Hid2gain(int hid);
- inline int Hid2row(int hid);
- inline int Hid2col(int hid);
- inline int ExtractHid(char *objName);
-
- inline void InitAltroMapping(int saveMapping);
- inline void PrintHistMapInfo(char *objName);
- */
-
- /*
- int Geo2hid(int mod, int gain, int row, int col);
- int Hid2mod(int hid);
- int Hid2gain(int hid);
- int Hid2row(int hid);
- int Hid2col(int hid);
- int ExtractHid(char *objName);
-
- void InitAltroMapping(int saveMapping);
- void PrintHistMapInfo(char *objName);
-
- FEE_CSP_MAP CSP_MAP[N_ALTROS][N_ALTROCHANNELS];
- ALTRO_GEO_MAP ALTRO_MAP[N_MODULES*N_RCUS*N_BRANCHES*N_FEECS*N_ALTROS*N_ALTROCHANNELS];
- int hdw2geo[N_MODULES][N_RCUS][N_BRANCHES][N_FEECS][N_ALTROS][N_ALTROCHANNELS];
- int geo2hdw[N_MODULES][N_GAINS][ N_XCOLUMNS_MOD][N_ZROWS_MOD];
- */
-
- private:
-
-
-
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-#include "AliHLTPHOSCommonDefs.h"
+
+//#include "AliHLTPHOSCommonDefs.h"
+#include "AliHLTPHOSConstants.h"
+#include "AliHLTPHOSValidCellDataStruct.h"
struct AliHLTPHOSModuleCellAverageEnergyDataStruct
{
AliHLTUInt8_t fModuleID;
- AliHLTPHOSValidCellDataStruct fValidData[N_MODULES*N_ROWS_MOD*N_COLUMNS_MOD*N_GAINS];
- Double_t fAverageEnergies[N_ROWS_MOD][N_COLUMNS_MOD][N_GAINS];
+ AliHLTPHOSValidCellDataStruct fValidData[N_MODULES*N_ZROWS_MOD*N_XCOLUMNS_MOD*N_GAINS];
+ Double_t fAverageEnergies[N_ZROWS_MOD][N_XCOLUMNS_MOD][N_GAINS];
};
AliHLTPHOSPhysicsAnalyzerSpectrumComponent gAliHLTPHOSPhysicsAnalyzerSpectrumComponent;
-AliHLTPHOSPhysicsAnalyzerSpectrumComponent::AliHLTPHOSPhysicsAnalyzerSpectrumComponent():AliHLTPHOSBase(), AliHLTProcessor(), fAnalyzerPtr(0),
+// removed by PTH AliHLTPHOSPhysicsAnalyzerSpectrumComponent::AliHLTPHOSPhysicsAnalyzerSpectrumComponent():AliHLTPHOSBase(), AliHLTProcessor(), fAnalyzerPtr(0),
+// fPeakFitter(0), fRootHistPtr(0),
+// fWriteInterval(0)
+
+AliHLTPHOSPhysicsAnalyzerSpectrumComponent::AliHLTPHOSPhysicsAnalyzerSpectrumComponent():AliHLTPHOSProcessor(), fAnalyzerPtr(0), // added by PTH
fPeakFitter(0), fRootHistPtr(0),
fWriteInterval(0)
-
{
//Constructor
}
#ifndef ALIHLTPHOSPHYSICSANALYZERSPECTRUMCOMPONENT_H
#define ALIHLTPHOSPHYSICSANALYZERSPECTRUMCOMPONENT_H
-#include "AliHLTProcessor.h"
+// removed PTH#include "AliHLTProcessor.h"
+#include "AliHLTPHOSProcessor.h" // added by PTH
#include "AliHLTPHOSBase.h"
class TH1F;
struct AliHLTPHOSClusterDataStruct;
-class AliHLTPHOSPhysicsAnalyzerSpectrumComponent: public AliHLTPHOSBase, public AliHLTProcessor
+// PTH class AliHLTPHOSPhysicsAnalyzerSpectrumComponent: public AliHLTPHOSBase, public AliHLTProcessor
+class AliHLTPHOSPhysicsAnalyzerSpectrumComponent: public AliHLTPHOSProcessor // added by PTH
{
public:
}
+
AliHLTPHOSProcessor::~AliHLTPHOSProcessor()
{
#include "AliHLTProcessor.h"
#include "AliHLTPHOSBase.h"
#include "AliHLTPHOSDefinitions.h"
+#include "AliHLTDataTypes.h"
using namespace PhosHLTConst;
class AliHLTPHOSProcessor:public AliHLTProcessor, public AliHLTPHOSBase
{
+
public:
AliHLTPHOSProcessor();
virtual ~AliHLTPHOSProcessor();
AliHLTPHOSRawAnalyzer::~AliHLTPHOSRawAnalyzer()
{
-
+ delete[] fIntDataPtr;
}
-/*
-AliHLTPHOSRawAnalyzer::AliHLTPHOSRawAnalyzer(AliHLTPHOSRawAnalyzer const&):fIntDataPtr(0), fSampleFrequency(10), fTau(2), fDTof(99999), fDAmpl(99999), fStartIndex(0)
-{
-
-}
-*/
/**
cout <<"ERROR: AliHLTPHOSRawAnalyzer::SetAVector: You cannot set the peakfindervector here, must be set in derived class peakfinder"<<endl;
}
-
-
/*
UInt_t
AliHLTPHOSRawAnalyzer::GetMaxValue(UInt_t *dta, Int_t size) const
/* $Id$ */
-//#include "Rtypes.h"
#include "AliHLTPHOSBase.h"
class AliHLTPHOSRawAnalyzer: public AliHLTPHOSBase
+//class AliHLTPHOSRawAnalyzer
{
public:
AliHLTPHOSRawAnalyzer();
virtual ~AliHLTPHOSRawAnalyzer();
AliHLTPHOSRawAnalyzer(double *dataPtr, double fs);
- // AliHLTPHOSRawAnalyzer(const AliHLTPHOSRawAnalyzer & );
- // AliHLTPHOSRawAnalyzer & operator = (const AliHLTPHOSRawAnalyzer &)
- // {
- // return *this;
- // }
void BaselineCorrection(double *dataPtr, int N);
void BaselineCorrection(double *dataPtr, double baselineValue);
void SetStartIndex(int startIndex);
void MakeInitialGuess();
void MakeInitialGuess(int treshold);
-
virtual void SetTVector(Double_t *tVector, Int_t size);
virtual void SetAVector(Double_t *aVector, Int_t size);
-
-
- /**
- *Abstratct class documentation
- */
virtual void Evaluate(Int_t start = 0, Int_t lenght = 100) = 0;
- // Double_t GetMaxValue(Double_t *dta, Int_t size) const;
- // UInt_t GetMaxValue(UInt_t *dta, Int_t size) const;
protected:
Double_t *fFloatDataPtr; /**<Float representation of data that should be fitted */
- UInt_t *fIntDataPtr; /**<data that should be fitted */
+ UInt_t *fIntDataPtr; /**<data that should be fitted */
double fSampleFrequency; /**<The ADC sample frequency in MHz used under data taking */
double fDTofGuess; /**<Initial guess for t0*/
double fDAmplGuess; /**<Initial guess for amplitude*/
double fTau; /**<The risetime in micro seconds*/
double fDTof; /**<Time of flight in entities of sample intervals */
double fDAmpl; /**<Amplitude in entities of ADC levels*/
- int fStartIndex;
+ int fStartIndex; /**<Starindex of the time dependent altro signal*/
+
+ private:
+ AliHLTPHOSRawAnalyzer(const AliHLTPHOSRawAnalyzer & );
+ AliHLTPHOSRawAnalyzer & operator = (const AliHLTPHOSRawAnalyzer &);
};
fAnalyzerPtr->SetData(fAltroDataPtr->fData);
fAnalyzerPtr->Evaluate(0, fAltroDataPtr->fDataSize -2);
- fOutPtr->fValidData[tmpChannelCnt].fZ = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].row;
- fOutPtr->fValidData[tmpChannelCnt].fX = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].col;
+ fOutPtr->fValidData[tmpChannelCnt].fZ = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].zRow;
+ fOutPtr->fValidData[tmpChannelCnt].fX = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].xCol;
fOutPtr->fValidData[tmpChannelCnt].fGain = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].gain;
fOutPtr->fValidData[tmpChannelCnt].fEnergy = (float)fAnalyzerPtr->GetEnergy();
fOutPtr->fValidData[tmpChannelCnt].fTime = (float)fAnalyzerPtr->GetTiming();
#include "AliHLTPHOSRawAnalyzerCrude.h"
-#include <iostream>
+//#include <iostream>
-using std::cout;
-using std::endl;
-ClassImp(AliHLTPHOSRawAnalyzerCrude)
+//using std::cout;
+//using std::endl;
+//ClassImp(AliHLTPHOSRawAnalyzerCrude)
-//____________________________________________________________________________
-AliHLTPHOSRawAnalyzerCrude::AliHLTPHOSRawAnalyzerCrude(const AliHLTPHOSRawAnalyzerCrude&):AliHLTPHOSRawAnalyzer()
-{
-}
+//AliHLTPHOSRawAnalyzerCrude::AliHLTPHOSRawAnalyzerCrude(const AliHLTPHOSRawAnalyzerCrude&):AliHLTPHOSRawAnalyzer()
+//{
+//
+//}
/**
* The AliHLTPHOSPeakfinder class is the class for extracting the basic signal parameters
+
/**
* Extraction of timing and energy using Crude estimate.
* The. The parameters "start" and "length" defines a sub array of the data array
#include "AliHLTPHOSRawAnalyzer.h"
-
/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
{
public:
AliHLTPHOSRawAnalyzerCrude();
- AliHLTPHOSRawAnalyzerCrude(const AliHLTPHOSRawAnalyzerCrude & );
- AliHLTPHOSRawAnalyzerCrude & operator = (const AliHLTPHOSRawAnalyzerCrude)
- {
- return *this;
- }
+
+ // AliHLTPHOSRawAnalyzerCrude(const AliHLTPHOSRawAnalyzerCrude & );
+ // AliHLTPHOSRawAnalyzerCrude & operator = (const AliHLTPHOSRawAnalyzerCrude)
+ // {
+ // return *this;
+ // }
virtual ~AliHLTPHOSRawAnalyzerCrude();
virtual void Evaluate(int start = 0, int lenght = 100);
private:
- ClassDef(AliHLTPHOSRawAnalyzerCrude, 2)
+ // ClassDef(AliHLTPHOSRawAnalyzerCrude, 2)
};
#ifndef ALIHLTPHOSRCUCHANNELDATASTRUCT_H
#define ALIHLTPHOSRCUCHANNELDATASTRUCT_H
-#include "AliHLTPHOSCommonDefs.h"
+//#include "AliHLTPHOSCommonDefs.h"
#include "AliHLTPHOSValidChannelDataStruct.h"
+#include "AliHLTPHOSConstants.h"
+
+using namespace PhosHLTConst;
struct AliHLTPHOSRcuChannelDataStruct
{
AliHLTUInt32_t fNValidChannels;
- // AliHLTUInt32_t fMaxValidChannels;
AliHLTUInt8_t fModuleID;
AliHLTUInt8_t fRcuX;
AliHLTUInt8_t fRcuZ;
// AliHLTPHOSValidChannelDataStruct fValidData[N_ROWS_RCU*N_COLUMNS_RCU*N_GAINS];
- AliHLTPHOSValidChannelDataStruct fValidData[512];
+ // AliHLTPHOSValidChannelDataStruct fValidData[512];
+ AliHLTPHOSValidChannelDataStruct fValidData[N_ZROWS_RCU*N_XCOLUMNS_RCU*N_GAINS];
// AliHLTUInt16_t fBuffer[(ALTRO_MAX_SAMPLES+2)*N_ZROWS_RCU*N_XCOLUMNS_RCU*N_GAINS];
AliHLTUInt8_t fZ;
AliHLTUInt8_t fX;
AliHLTUInt8_t fGain;
- AliHLTUInt16_t fNSamples;
+ // AliHLTUInt16_t fNSamples;
+ AliHLTUInt16_t fDataSize;
// AliHLTUInt16_t fChannelData[ALTRO_MAX_SAMPLES];
- Float_t fChannelData[350];
+ // Float_t fChannelData[350];
+ // UInt_t fChannelData[1024];
+ UInt_t fChannelData[200];
+ // UInt_t *fChannelData;
+
};
AliHLTAltroBunch.cxx \
AliHLTPHOSMapper.cxx \
AliHLTPHOSRcuProcessor.cxx \
+ AliHLTPHOSDDLDecoderComponent.cxx \
AliHLTPHOSBase.cxx
# class header files, the link definition for the root dictionary
# will be created from the names of the header files
CLASS_HDRS = AliHLTPHOSPulseGenerator.h \
- AliHLTPHOSRawAnalyzer.h \
AliHLTPHOSRawAnalyzerPeakFinder.h \
AliHLTPHOSRawAnalyzerCrude.h \
AliHLTPHOSRawAnalyzerKLevel.h \
AliHLTPHOSMapper.h \
AliHLTPHOSRcuProcessor.h \
AliHLTPHOSBase.h \
+ AliHLTPHOSDDLDecoderComponent.h \
AliHLTPHOSMapper.h
pkginclude_HEADERS = $(CLASS_HDRS) \
AliHLTPHOSCommonDefs.h \
+ AliHLTPHOSRawAnalyzer.h \
AliHLTPHOSDefinitions.h \
AliHLTPHOSModuleCellEnergyDataStruct.h\
AliHLTPHOSRcuCellEnergyDataStruct.h \
AddFrame(fTab, fL1);
MapSubwindows();
Resize();
- SetWindowName("online display");
+ SetWindowName("IFRAX");
MapWindow();
MoveResize(100,100,1200,1000);
}
/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+
#include "HOMERData.h"
#include "HOMERReader.h"
#include "HOMERWriter.h"
{
tmpz = rcuChannelDataPtr->fValidData[ch].fZ;
tmpx = rcuChannelDataPtr->fValidData[ch].fX;
- tmpSampleCnt = rcuChannelDataPtr->fValidData[ch].fNSamples;
+ tmpSampleCnt = rcuChannelDataPtr->fValidData[ch].fDataSize -2;
// fgChannelDataPlotPtr[tmpz][tmpx]->SetFillColor(3);
{
fgChannelDataPlotPtr[tmpz][tmpx]->SetBinContent(sample, rcuChannelDataPtr->fValidData[ch].fChannelData[sample]);
}
+
}
}
}
+
blk = homerReaderPtr->FindBlockNdx("ATADNAHC","SOHP", 0xeFFFFFFF, blk+1);
+
}
}
{
for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
{
- sprintf(tmpHistoName, "blablaz%d x%d",z, x);
- fgChannelDataPlotPtr[z][x] = new TH1D(tmpHistoName, tmpHistoName, 300, 0, 299);
- fgChannelDataPlotPtr[z][x]->SetMaximum(MAX_BIN_VALUE);
+ sprintf(tmpHistoName, "row %d column %d",z, x);
+ // fgChannelDataPlotPtr[z][x] = new TH1D(tmpHistoName, tmpHistoName, 300, 0, 299);
+ fgChannelDataPlotPtr[z][x] = new AliHLTPHOSTH1D(tmpHistoName, tmpHistoName, 100, 0, 100);
+ // fgChannelDataPlotPtr[z][x]->SetMaximum(MAX_BIN_VALUE);
+ fgChannelDataPlotPtr[z][x]->SetMaximum(1023);
fgChannelDataPlotPtr[z][x]->Reset();
}
}
{
fgTestCanvasPtr = new TCanvas("TEST", "testcanvas", 1200, 1000);
+ int startZ = 25;
+ int endZ = 31;
+ int startX = 20;
+ int endX = 27;
+
+ int nRows = endZ - startZ;
+ int nCols = endX - startX;
+
+
+ // int start = 0;
+ // fgTestCanvasPtr->Divide(N_XCOLUMNS_RCU, N_ZROWS_RCU, 0, 0);
+ cout <<"nRows = "<< nRows << endl;
+ cout <<"nCols = "<< nCols << endl;
+
/*
- fgTestCanvasPtr->Divide(N_XCOLUMNS_RCU, N_ZROWS_RCU, 0, 0);
+ fgTestCanvasPtr->Divide(nCols, nRows, 0, 0);
+ // fgTestCanvasPtr->Divide(nRows, nCols, 0, 0);
+
+
+ for(int z = startZ; z < endZ; z ++)
+ {
+ for(int x = startX; x < endX; x ++)
+ {
+ cout << "z = "<< z << " x= " << x<<endl;
+ // fgTestCanvasPtr->cd(x*N_ZROWS_RCU +z +1);
+ // fgTestCanvasPtr->cd((z - startZ)*nCols +x +1);
+ fgTestCanvasPtr->cd((z - startZ)*nCols +x);
+ // fgTestCanvasPtr->cd( z*nCols +x);
+
+ cout << "(z - startZ)*nCols +x ="<< (z - startZ)*nCols +x <<endl;
+
+ fgChannelDataPlotPtr[x][z]->Draw();
+ }
+ }
+ */
- for(int z = 0; z < N_ZROWS_RCU; z ++)
+
+ /*
+ for(int z = 0; z < nRows; z ++)
{
- for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
+ for(int x = 0; x < nCols; x ++)
{
// fgTestCanvasPtr->cd(x*N_ZROWS_RCU +z + 1);
- fgTestCanvasPtr->cd(z*N_XCOLUMNS_RCU +x + 1);
-
+ fgTestCanvasPtr->cd(z*nCols +x + 1);
fgChannelDataPlotPtr[z][x]->Draw();
}
}
+
+ // fgTestCanvasPtr->Divide(N_XCOLUMNS_RCU, N_ZROWS_RCU, 0, 0);
+
+ /*
+ for(int z = 0; z < N_ZROWS_RCU; z ++)
+ {
+ for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
+ {
+ // fgTestCanvasPtr->cd(x*N_ZROWS_RCU +z + 1);
+
+ fgTestCanvasPtr->cd(z*N_XCOLUMNS_RCU +x + 1);
+
+ // fgTestCanvasPtr->cd(z*N_ZROWS_RCU +x + 1);
+
+ fgChannelDataPlotPtr[z][x]->Draw();
+ }
+ }
+ */
+
+
+
fgTestCanvasPtr->Divide(N_XCOLUMNS_RCU, N_ZROWS_RCU, 0, 0);
+
for(int z = 0; z < N_ZROWS_RCU; z ++)
{
for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
{
// fgTestCanvasPtr->cd(x*N_ZROWS_RCU +z + 1);
- fgTestCanvasPtr->cd(z*N_XCOLUMNS_RCU +x + 1);
-
+
+ fgTestCanvasPtr->cd(z*N_XCOLUMNS_RCU +x +1);
+
+ // fgTestCanvasPtr->cd(z*N_ZROWS_RCU +x + 1);
+
fgChannelDataPlotPtr[z][x]->Draw();
}
}
+
+
+
+
fgTestCanvasPtr->Update();
-
}
+
+
#include <TRootEmbeddedCanvas.h>
#include <TCanvas.h>
#include "AliHLTDataTypes.h"
+#include "AliHLTPHOSTH1D.h"
#include "AliHLTPHOSConstants.h"
using namespace PhosHLTConst;
TH2D *fgLegoPlotLGPtr;
TH2D *fgLegoPlotHGPtr;
AliHLTPHOSGetEventButton* fgEventButtPtr;
- TH1D *fgChannelDataPlotPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
+ // TH1D *fgChannelDataPlotPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
+ AliHLTPHOSTH1D *fgChannelDataPlotPtr[N_ZROWS_RCU][N_XCOLUMNS_RCU];
};
GETEVENTBUTTONS =AliHLTPHOSGetEventButton.$(SrcSuf)
GETEVENTBUTTONH =AliHLTPHOSGetEventButton.$(HeadSuf)
+ALIHLTPHOSTH1DO =AliHLTPHOSTH1D.$(ObjSuf)
+ALIHLTPHOSTH1DS =AliHLTPHOSTH1D.$(SrcSuf)
+ALIHLTPHOSTH1DH =AliHLTPHOSTH1D.$(HeadSuf)
+
ALIHLTPHOSONLINEDISPLAYO =AliHLTPHOSOnlineDisplay.$(ObjSuf)
ALIHLTPHOSONLINEDISPLAYS =AliHLTPHOSOnlineDisplay.$(SrcSuf)
ALIHLTPHOSONLINEDISPLAYH =AliHLTPHOSOnlineDisplay.$(HeadSuf)
ALIHLTPHOSONLINEDISPLAYCALIBTABH =AliHLTPHOSOnlineDisplayCalibTab.$(HeadSuf)
OBJS = $(MAINO) $(ALIHLTPHOSONLINEDISPLAYO) $(ALIHLTPHOSONLINEDISPLAYTABO) \
- $(ALIHLTPHOSONLINEDISPLAYEVENTTABO) $(ALIHLTPHOSONLINEDISPLAYRAWTABO) $(ALIHLTPHOSONLINEDISPLAYCALIBTABO) $(GETEVENTBUTTONO)
+ $(ALIHLTPHOSONLINEDISPLAYEVENTTABO) $(ALIHLTPHOSONLINEDISPLAYRAWTABO) $(ALIHLTPHOSONLINEDISPLAYCALIBTABO) $(GETEVENTBUTTONO)\
+ $(ALIHLTPHOSTH1DO)
pftest:$(OBJS)
$(ALIHLTPHOSONLINEDISPLAYO):$(ALIHLTPHOSONLINEDISPLAYS) $(ALIHLTPHOSONLINEDISPLAYH)
g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYS)
+
+$(ALIHLTPHOSTH1DO):$(ALIHLTPHOSTH1DS) $(ALIHLTPHOSTH1DH)
+ g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSTH1DS)
+
+
$(ALIHLTPHOSONLINEDISPLAYTABO):$(ALIHLTPHOSONLINEDISPLAYTABS) $(ALIHLTPHOSONLINEDISPLAYTABH)
g++ -g -I$(ROOTSYS)/include -I$(ALIHLTPHOSINCLUDE) -I$(HOMERINCLUDE) -I$(ALIHLTINCLUDE) -c $(ALIHLTPHOSONLINEDISPLAYTABS)
}
- tSystError = tSystError*pow(10, 9); //to give systematic error of timing in nanoseconds
+ tSystError = tSystError*pow((double)10, (double)9); //to give systematic error of timing in nanoseconds
aSystError = aSystError*100; //to give systematic error of amplitude in percent
using namespace std;
-///#define N_LOOPS 1000
+
int main(int argc, const char** argv)
{
- int n_loops = 1000000;
+ int n_loops = 1;
clock_t start;
clock_t end;
AliHLTAltroData altrodata;
- AliHLTAltroBunch altrobunch;
+ AliHLTAltroBunch *altrobunchPtr = new AliHLTAltroBunch;
ifstream fin;
int length;
{
decoder->SetMemory((UChar_t*)dataPtr, length);
decoder->Decode();
+
while(decoder->NextChannel(&altrodata) == true)
{
- // altrodata.Reset();
- // decoder->PrintInfo(altrodata, altrodata.fDataSize, 4);
-
- // cout << endl;
-
-
-
- while( altrodata.NextBunch(altrobunch) == true)
+ // printf("\n\n");
+ altrodata.Reset();
+
+ if( altrodata.fDataSize != 0 )
{
- // cout << "altrobunch.fDataSize = " << altrobunch.fBunchSize << endl;
- // cout << "altrobunch. fEndTimeBin = " << altrobunch. fEndTimeBin << endl;
+
+ // printf("\n\n");
+ Double_t tmpMax = 0;
+
+ for(int i = 0; i < altrodata.fDataSize -3 ; i++)
+ {
+ if(altrodata.fData[i] > tmpMax)
+ {
+ tmpMax = altrodata.fData[i];
+ }
+ }
+
+
+ // cout <<"tmpMax = "<< tmpMax<<endl;
+
+ if (tmpMax > 100)
+ {
+ cout <<"tmpMax = "<< tmpMax<<endl;
+ decoder->PrintInfo(altrodata, altrodata.fDataSize, 4);
+ }
+
+ while( altrodata.NextBunch(altrobunchPtr) == true)
+ {
+ // cout << "altrobunch.fDataSize = " << altrobunchPtr->fBunchSize << endl;
+ // cout << "altrobunch.fEndTimeBin = " << altrobunchPtr->fEndTimeBin << endl;
+ }
+ // printf("\n\n");
}
-
}
// end = clock();