AliHLTPHOSBase::AliHLTPHOSBase(): AliHLTPHOSConfig(),
AliHLTPHOSAltroConfig()
{
- // fConfigPtr = new AliHLTPHOSConfig();
- // fAltroConfigPtr = new AliHLTPHOSAltroConfig();
+
}
}
+
+bool
+AliHLTPHOSBase::CheckFile(const char *fileName, const char *opt) const
+{
+ FILE *fp = fopen(fileName, opt);
+
+ if(fp == 0)
+ {
+ cout <<"Error: from" << typeid(*this).name() <<"could not open file: "<< fileName <<endl;
+ return false;
+ }
+ else
+ {
+ fclose(fp);
+ return true;
+ }
+}
using namespace std;
-class AliHLTPHOSConfig;
-class AliHLTPHOSAltroConfig;
-
class AliHLTPHOSBase : public AliHLTPHOSConfig, public AliHLTPHOSAltroConfig
{
-public:
+ public:
AliHLTPHOSBase();
virtual ~AliHLTPHOSBase();
+ bool CheckFile(const char *fileName, const char *opt) const;
template<typename T>
}
cout << array[i]<< "\t";
-
}
}
template<typename T>
T MaxValue(T *array, int N)
{
- // Double_t tmpMax = 0;
-
T tmpMax = 0;
for(int i = 0; i < N; i++)
virtual ~AliHLTPHOSConfig();
void SetSoftwareBaselineSubtraction(bool isSoftwareBaselineSubtraction);
void PrintDefaultValues();
+
protected:
bool fIsSoftwareBaselineSubtraction;
+ // int fRunNumber;
+
+ private:
+ // void ScanRunNumberFromFile();
};
#endif
AliHLTPHOSDigitMakerComponent::AliHLTPHOSDigitMakerComponent() :
AliHLTPHOSProcessor(),
- fDigitMakerPtr(0),
- fEvtCnt(0)
+ fDigitMakerPtr(0)
+ // fEvtCnt(0)
{
//comment
}
std::vector<AliHLTComponentBlockData>& outputBlocks)
{
//Do event
-
UInt_t tSize = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
- //Int_t nRecPoints = 0;
- //Int_t index = 0;
-
- //Int_t fileCount = 0;
Int_t digitCount = 0;
- //char filename [50];
-
+ // cout << " AliHLTPHOSDigitMakerComponent::DoEven fEvtCnt = " << fEvtCnt <<endl;
AliHLTUInt8_t* outBPtr;
outBPtr = outputPtr;
}
digitCount = fDigitMakerPtr->MakeDigits(reinterpret_cast<AliHLTPHOSRcuCellEnergyDataStruct*>(iter->fPtr));
}
- fEvtCnt++;
+
+ fPhosEventCount++;
mysize = 0;
offset = tSize;
fDigitMakerPtr->Reset();
- if(fEvtCnt % 10 == 0)
+ if(fPhosEventCount % 10 == 0)
{
- cout << "Event #: " << fEvtCnt << endl;
+ cout << "Event #: " << fPhosEventCount << endl;
cout << " - Number of digits found: " << digitCount << endl;
}
#define ALIHLTPHOSDIGITMAKERCOMPONENT_H
#include "AliHLTPHOSProcessor.h"
-//#include "AliHLTPHOSDigitMaker.h"
-//#include "TTree.h"
-//#include "TClonesArray.h"
class AliHLTPHOSDigitMaker;
private:
AliHLTPHOSDigitMaker *fDigitMakerPtr; //comment
AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //comment
- UInt_t fEvtCnt; //comment
- Int_t fRunNb; //comment
+ // UInt_t fEvtCnt; //comment
+ // Int_t fRunNb; //comment
static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
**************************************************************************/
#include "AliHLTPHOSProcessor.h"
+#include "unistd.h"
const AliHLTComponentDataType AliHLTPHOSProcessor::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
-AliHLTPHOSProcessor::AliHLTPHOSProcessor():AliHLTProcessor(), AliHLTPHOSBase(), fModuleID(0), fPrintInfoFrequncy(1000)
+AliHLTPHOSProcessor::AliHLTPHOSProcessor():AliHLTProcessor(), AliHLTPHOSBase(), fModuleID(0), fPrintInfoFrequncy(1000), fRunNumber(0)
{
-
+ ScanRunNumberFromFile();
}
}
+void
+AliHLTPHOSProcessor::ScanRunNumberFromFile()
+{
+ char tmpDirectory[512];
+ char tmpFileName[512];
+ sprintf(tmpDirectory, "%s", getenv("HOME"));
+ sprintf(tmpFileName, "%s%s", tmpDirectory, "/rundir/runNumber.txt");
+
+ if(CheckFile(tmpFileName, "r") == true)
+ {
+ FILE *fp = fopen(tmpFileName, "r");
+ fscanf(fp, "%d", &fRunNumber);
+ fclose(fp);
+ }
+
+ else
+ {
+ cout << "ERROR, could not find file " << tmpFileName <<endl;
+ }
+}
virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) =0;
virtual AliHLTComponent* Spawn() = 0;
+
protected:
+ void ScanRunNumberFromFile();
int fPhosEventCount; /**<Global event counter for this component*/
AliHLTUInt8_t fModuleID; /**<ID of the module this component read data from (0-4)*/
Bool_t fPrintInfo; /**<wether or not to print debugg info to std out*/
int fPrintInfoFrequncy; /**<Defines the update frequency for information printet to std out*/
static const AliHLTComponentDataType fgkInputDataTypes[]; /**<List of datatypes that can be given to this component*/
+ int fRunNumber;
private:
AliHLTPHOSProcessor(const AliHLTPHOSProcessor & );
AliHLTPHOSProcessor & operator = (const AliHLTPHOSProcessor &);
* Set data array. Overrides data data array set in the constructor.
**/
void
-AliHLTPHOSRawAnalyzer::SetData(UInt_t *data)
+AliHLTPHOSRawAnalyzer::SetData(const UInt_t *data)
{
fIntDataPtr = data;
}
* Set data array. Overrides data data array set in the constructor.
**/
void
-AliHLTPHOSRawAnalyzer::SetData(double *data)
+AliHLTPHOSRawAnalyzer::SetData(const double *data)
{
fFloatDataPtr = data;
}
float GetTiming() const;
float GetEnergy() const;
- void SetData(double *data);
- void SetData(UInt_t *data);
+ void SetData(const double *data);
+ void SetData(const UInt_t *data);
void SetSampleFreq(double freq);
void SetStartIndex(int startIndex);
virtual void Evaluate(Int_t start = 0, Int_t lenght = 100) = 0;
protected:
- Double_t *fFloatDataPtr; /**<Float representation of data that should be fitted */
- UInt_t *fIntDataPtr; /**<data that should be fitted */
+ // mutable Double_t *fFloatDataPtr; /**<Float representation of data that should be fitted */
+ // mutable UInt_t *fIntDataPtr; /**<data that should be fitted */
+ mutable const Double_t *fFloatDataPtr; /**<Float representation of data that should be fitted */
+ mutable const unsigned int *fIntDataPtr; /**<data that should be fitted */
+ // mutable const 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*/
#include "AliHLTPHOSRawAnalyzerComponent.h"
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
#include "AliHLTPHOSRcuChannelDataStruct.h"
-#include "AliHLTDDLDecoder.h"
-#include "AliHLTAltroData.h"
#include "AliHLTPHOSMapper.h"
-#include "AliHLTAltroBunch.h"
#include "AliHLTPHOSSanityInspector.h"
#include "AliHLTPHOSBaseline.h"
#include "TFile.h"
#include "TTree.h"
#include "TClonesArray.h"
-//using namespace std;
-AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTPHOSRcuProcessor(), fAnalyzerPtr(0),
- fSendChannelData(kFALSE),fOutPtr(0), fMapperPtr(0), fDecoderPtr(0),
- fAltroDataPtr(0), fAltroBunchPtr(0), fUseBaselineSubtraction(false), fDebugCnt(0)
+#include "AliAltroDecoder.h" // decoder for altro payload
+#include "AliAltroData.h" // container for altro payload
+#include "AliAltroBunch.h" // container for altro bunches
+
+
+AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTPHOSRcuProcessor(),
+ fAnalyzerPtr(0),
+ fSendChannelData(kFALSE),
+ fOutPtr(0),
+ fMapperPtr(0),
+ fUseBaselineSubtraction(false),
+ fDecoderPtr(0),
+ fAltroDataPtr(0),
+ fAltroBunchPtr(0)
+ // fRawMemoryReader(0), fPHOSRawStream(0)
{
//comment
fMapperPtr = new AliHLTPHOSMapper();
-
-}
+ fAltroDataPtr = new AliAltroData();
+ fAltroBunchPtr = new AliAltroBunch();
+ fDecoderPtr = new AliAltroDecoder();
+ fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+}
+
AliHLTPHOSRawAnalyzerComponent::~AliHLTPHOSRawAnalyzerComponent()
}
-//int
-//AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventD // AliHLTPHOSRcuCellEnergyDebugDataStruct* fOutPtr;ata& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData,
-// AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
+
int
AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/,
AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
UInt_t tSize = 0;
Float_t baseline = 0;
AliHLTUInt8_t* outBPtr;
- //AliHLTAltroBunch *bunchPtr;
outBPtr = outputPtr;
const AliHLTComponentBlockData* iter = NULL;
unsigned long ndx;
-
- // printf("\n% \n", ndx);
- // cout << "evtData block count = " << evtData.fBlockCnt << endl;
-
-
- fDebugCnt++;
-
+ // fDebugCnt++;
for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
- // cout <<"TP0"<< endl;
-
- Int_t tmpChannelCnt = 0;
+ Int_t tmpChannelCnt = 0;
iter = blocks+ndx;
mysize = 0;
offset = tSize;
- // cout <<"TP1"<< endl;
- //Int_t *dt = (Int_t*)(reinterpret_cast<UChar_t*>( iter->fPtr ));
- // cout <<"TP2"<< endl;
Int_t crazyness = 0;
if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType )
{
- // cout <<"WARNING: not AliHLTPHOSDefinitions::fgkDDLPackedRawDataType " << endl;
- // cout << "equippment "<< fkEquippmentID << " Event count =" << fDebugCnt <<" AliHLTPHOSRawAnalyzerComponent::DoEvent , ERROR"<< endl;
continue;
-
- // if(fPhosEventCount < 10)
- // {
- // continue; //!!!!! Commented out to read TPC data, remember to put back
- // }
- }
- else
- {
- // cout << "equippment " << fkEquippmentID << " Event count =" << fDebugCnt << " Dat type is: AliHLTPHOSDefinitions::fgkDDLPackedRawDataType" << endl;
}
+
if( fPhosEventCount%100 == 0)
{
}
- /*
- printf("\Common data header for equippment %d\n", fkEquippmentID);
- printf("Event#: %d -- RCU X: %d - RCU Z: %d\n\n", fPhosEventCount, fRcuX, fRcuZ);
-
- for(Int_t n = 0; n < 8; n++)
- {
- printf("CDH(%d): 0x%X\n", n, dt[n]);
- }
-
- printf("\n");
- */
-
-
fDecoderPtr->SetMemory(reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize);
- // fDecoderPtr->SetMemory2(reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize);
fDecoderPtr->Decode();
-
fOutPtr = (AliHLTPHOSRcuCellEnergyDataStruct*)outBPtr;
fOutPtr->fRcuX = fRcuX;
fOutPtr->fRcuZ = fRcuZ;
while( fDecoderPtr->NextChannel(fAltroDataPtr) == true )
{
-
- // if(fAltroDataPtr->fDataSize != 72)
- // if(fAltroDataPtr->fDataSize != 142)
- if(fAltroDataPtr->fDataSize != (fNTotalSamples +2))
+ if(fAltroDataPtr->GetDataSize() != (fNTotalSamples +2))
{
- cout << "Error, fDataSize = " << fAltroDataPtr->fDataSize << endl;
+ cout << "Error, fDataSize = " << fAltroDataPtr->GetDataSize() << endl;
continue;
}
- crazyness = fSanityInspectorPtr->CheckInsanity(fAltroDataPtr->fData, fAltroDataPtr->fDataSize - 2);
- fAnalyzerPtr->SetData(fAltroDataPtr->fData); // AliHLTPHOSRcuCellEnergyDebugDataStruct* fOutPtr;
- fAnalyzerPtr->Evaluate(0, fAltroDataPtr->fDataSize -2);
+ crazyness = fSanityInspectorPtr->CheckInsanity(fAltroDataPtr->GetData(), fAltroDataPtr->GetDataSize() - 2);
+
+ 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->hw2geomapPtr[fAltroDataPtr->fHadd].zRow;
- fOutPtr->fValidData[tmpChannelCnt].fX = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].xCol;
- fOutPtr->fValidData[tmpChannelCnt].fGain = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].gain;
if(fUseBaselineSubtraction)
- {
- baseline = fBaselines[fOutPtr->fValidData[tmpChannelCnt].fX][fOutPtr->fValidData[tmpChannelCnt].fZ][ fOutPtr->fValidData[tmpChannelCnt].fGain];
- }
+ {
+ baseline = fBaselines[fOutPtr->fValidData[tmpChannelCnt].fX][fOutPtr->fValidData[tmpChannelCnt].fZ][ fOutPtr->fValidData[tmpChannelCnt].fGain];
+ }
+
+
fOutPtr->fValidData[tmpChannelCnt].fEnergy = (float)fAnalyzerPtr->GetEnergy() - baseline;
+
+
fOutPtr->fValidData[tmpChannelCnt].fTime = (float)fAnalyzerPtr->GetTiming();
+
+
fOutPtr->fValidData[tmpChannelCnt].fCrazyness = (int)crazyness;
+
+ const UInt_t *tmpData = fAltroDataPtr->GetData();
+
for(Int_t sample = 0; sample < fNTotalSamples; sample++)
{
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- (fOutPtr->fValidData[tmpChannelCnt].fData)[sample] = fAltroDataPtr->fData[sample] - (int)baseline;
+ (fOutPtr->fValidData[tmpChannelCnt].fData)[sample] = tmpData[sample] - (int)baseline;
}
tmpChannelCnt ++;
-
}
+
fOutPtr->fCnt = tmpChannelCnt;
mysize += sizeof(AliHLTPHOSRcuCellEnergyDataStruct);
FillBlockData( bd );
bd.fOffset = offset;
bd.fSize = mysize;
-
+
bd.fDataType = AliHLTPHOSDefinitions::fgkCellEnergyDataType;
bd.fSpecification = 0xFFFFFFFF;
outputBlocks.push_back( bd );
-
+
tSize += mysize;
outBPtr += mysize;
return EMSGSIZE;
}
- // fDecoderPtr->GetFailureRate();
-
}
-
+
fPhosEventCount++;
- // cout << "event cunt =" << fPhosEventCount << endl;
-
if(fPrintInfo == kTRUE)
{
if(fPhosEventCount%fPrintInfoFrequncy == 0)
int
AliHLTPHOSRawAnalyzerComponent::DoInit( int argc, const char** argv )
{
- //comment
+ //See base class for documentation
cout <<"AliHLTPHOSRawAnalyzerComponent::DoInit( int argc, const char** argv ) "<< endl;
- fAltroDataPtr = new AliHLTAltroData();
- fAltroBunchPtr = new AliHLTAltroBunch();
- fDecoderPtr = new AliHLTDDLDecoder();
- fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+
fSendChannelData = kFALSE;
fPrintInfo = kFALSE;
Reset();
iResult = 0;
// fRawMemoryReader->SetEquipmentID(fkEquippmentID);
}
-
- // return iResult;
- // return 0;
+
return iResult;
}
class AliHLTPHOSRcuCellEnergyDataStruct;
class AliHLTPHOSRcuChannelDataStruct;
class AliHLTPHOSMapper;
-class AliHLTDDLDecoder;
-class AliHLTAltroData;
-class AliHLTAltroBunch;
class AliHLTPHOSSanityInspector;
+class AliAltroDecoder; // decoder for altro payload
+class AliAltroData; // container for altro payload
+class AliAltroBunch; // container for altro bunches
+
class AliHLTPHOSRawAnalyzerComponent: public AliHLTPHOSRcuProcessor
{
Bool_t fSendChannelData; /**<wether or not to send raw data from the component into shared memory*/
Double_t fTmpChannelData[ALTRO_MAX_SAMPLES]; /**<temporary variable to store raw samples from a single altro channel*/
Double_t fMaxValues[N_MODULES][N_ZROWS_MOD][N_XCOLUMNS_MOD][N_GAINS]; /**<array to store cell energies*/
- // AliHLTPHOSRcuCellEnergyDataStruct* fOutPtr; /**<Pointer to outputbuffer to write results from the component into shared memory*/
AliHLTPHOSRcuCellEnergyDataStruct* fOutPtr; //comment
- AliHLTPHOSMapper *fMapperPtr; //comment
- AliHLTDDLDecoder *fDecoderPtr; //comment
- AliHLTAltroData *fAltroDataPtr; //comment
- AliHLTAltroBunch *fAltroBunchPtr; //comment
+ AliHLTPHOSMapper *fMapperPtr; //Mapping from harware address to geometrical address
AliHLTPHOSSanityInspector *fSanityInspectorPtr; //comment
Bool_t fUseBaselineSubtraction; //comment
Float_t fBaselines[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; //comment
- int fDebugCnt; //comment
-
+ // int fDebugCnt; //comment
+ AliAltroDecoder *fDecoderPtr; // decoder for altro payload
+ AliAltroData *fAltroDataPtr; // container for altro payload
+ AliAltroBunch *fAltroBunchPtr; // container for altro bunches
};
#endif
{
// fDAmpl += fAVectorPtr[i]*fFloatDataPtr[i];
fDAmpl += fAVectorPtr[i]*fIntDataPtr[i];
+
}
for(int i=0; i < tmpLength; i++)
if(fDAmpl > 900)
{
- // Double_t tmpMax = GetMaxValue(fFloatDataPtr, tmpLength);
- // Double_t tmpMax = GetMaxValue(fIntDataPtr, tmpLength);
-
- Double_t tmpMax = MaxValue(fIntDataPtr, tmpLength);
+
+ Double_t tmpMax = MaxValue(const_cast<unsigned int*>(fIntDataPtr), tmpLength);
+
if(tmpMax == 1023)
{
AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks)
{
+ cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP1" << endl;
+
//Do event
UInt_t tSize = 0;
outBPtr = outputPtr;
const AliHLTComponentBlockData* iter = 0;
unsigned long ndx;
+
+ cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP2" << endl;
fDigitContainerPtr = (AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr;
//fDigitMakerPtr->SetDigitContainerStruct(fDigitContainerPtr);
fDigitMakerPtr->SetDigitContainerStruct((AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr);
-
+ cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP3" << endl;
for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
iter = blocks+ndx;
continue;
}
+
+
+
digitCount = fDigitMakerPtr->MakeDigits(reinterpret_cast<AliHLTPHOSRcuCellEnergyDataStruct*>(iter->fPtr));
}
fEvtCnt++;
**************************************************************************/
#include "AliHLTPHOSRcuProcessor.h"
-AliHLTPHOSRcuProcessor::AliHLTPHOSRcuProcessor(): fkEquippmentID(0)
+AliHLTPHOSRcuProcessor::AliHLTPHOSRcuProcessor():AliHLTPHOSProcessor(),
+ fkEquippmentID(0)
{
-
+ // cout << "AliHLTPHOSRcuProcessor::AliHLTPHOSRcuProcessor() "<< endl;
}
AliHLTPHOSRcuProcessor::~AliHLTPHOSRcuProcessor()
ClassImp(AliHLTPHOSRcuTreeMaker);
+void
+AliHLTPHOSRcuTreeMaker::FUCK()
+{
+ cout << "AliHLTPHOSTreeMaker::FUCK" << endl;
+}
+
AliHLTPHOSRcuTreeMaker::AliHLTPHOSRcuTreeMaker() :
AliHLTPHOSBase(),
fDigitArrayPtr(0),
class TClonesArray;
//class TTree;
+
+
class AliHLTPHOSRcuTreeMaker : public AliHLTPHOSBase
{
public:
~AliHLTPHOSRcuTreeMaker();
Int_t MakeDigitArray(AliHLTPHOSRcuDigitContainerDataStruct* digitContainer, Int_t nDigits);
-
+ void FUCK();
void FillDigitTree();
void ResetDigitTree() { fDigitTreePtr->Reset(); }
#include "AliHLTPHOSRcuTreeMakerComponent.h"
+
+#include "AliHLTPHOSRcuDigitContainerDataStruct.h"
+
#include "AliHLTPHOSRcuTreeMaker.h"
#include "AliHLTPHOSRcuProcessor.h"
#include "AliHLTPHOSDigitDataStruct.h"
AliHLTPHOSRcuTreeMakerComponent::AliHLTPHOSRcuTreeMakerComponent() :
AliHLTPHOSRcuProcessor(),
fDigitTreePtr(0),
- fEventCount(0),
+ fTreeMakerPtr(0),
+ // fEventCount(0),
fWriteInterval(1000)
{
//comment
std::vector<AliHLTComponentBlockData>& /*outputBlocks*/)
{
+
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0 " << endl;
//Do event
Bool_t digitEvent;
const AliHLTComponentBlockData* iter = 0;
unsigned long ndx;
-
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.1 " << endl;
for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
iter = blocks + ndx;
-
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.2 " << endl;
if ( iter->fDataType == AliHLTPHOSDefinitions::fgkAliHLTDigitDataType )
{
- digitEvent = true;
- nDigits = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSRcuDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
- totalDigits += nDigits;
- //cout << totalDigits << endl;
- continue;
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.2 " << endl;
+ digitEvent = true;
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3 " << endl;
+
+ // fTreeMakerPtr = new AliHLTPHOSRcuTreeMaker();
+
+ if( iter->fPtr == 0)
+ {
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.1 " << endl;
+ cout << "ERROR" << endl;
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.2 " << endl;
+ }
+ else
+ {
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.3 " << endl;
+
+ // fTreeMakerPtr = new AliHLTPHOSRcuTreeMaker();
+
+ if(fTreeMakerPtr == 0 )
+ {
+ // cout << "FUCK" << endl;
+ }
+ else
+ {
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.4, -1 " << endl;
+ // nDigits = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSRcuDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
+ //
+
+ nDigits = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSRcuDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
+
+ // AliHLTPHOSRcuDigitContainerDataStruct *tmp = new AliHLTPHOSRcuDigitContainerDataStruct();
+
+ // nDigits = fTreeMakerPtr->MakeDigitArray(tmp, totalDigits );
+
+ // nDigits = fTreeMakerPtr->MakeDigitArray ( (AliHLTPHOSRcuDigitContainerDataStruct*) ( iter->fPtr ), totalDigits );
+
+ fTreeMakerPtr->FUCK();
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.4 " << endl;
+
+ }
+ }
+
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.4 " << endl;
+ totalDigits += nDigits;
+ //cout << totalDigits << endl;
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.5 " << endl;
+ continue;
}
+
if ( iter->fDataType == AliHLTPHOSDefinitions::fgkAliHLTClusterDataType )
{
- //
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.6 " << endl;
+ //
}
}
- fEventCount++;
+
+ // fEventCount++;
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP1 " << endl;
+ fPhosEventCount++;
+
fTreeMakerPtr->FillDigitTree();
-
- if(fEventCount%fWriteInterval == 0)
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP2 " << endl;
+ // if(fEventCount%fWriteInterval == 0)
+ if(fPhosEventCount%fWriteInterval == 0)
{
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP3 " << endl;
Write();
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP4 " << endl;
ResetTrees();
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP5 " << endl;
}
-
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP6 " << endl;
return 0;
}
fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
- fstream runNbFile;
+ // fstream runNbFile;
//Int_t newRunNb;
- runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
- runNbFile >> fRunNb;
- runNbFile.close();
+ // runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
+ // runNbFile >> fRunNb;
+ // runNbFile.close();
/* newRunNb = fRunNb + 1;
runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
runNbFile << newRunNb;
runNbFile.close();*/
- cout << endl << "Run number is: " << fRunNb << " -- Check that this is correct!!!\n";
+ cout << endl << "Run number is: " << fRunNumber << " -- Check that this is correct!!!\n" << endl;
return 0;
cout << "Writing file...";
char filename [256];
- sprintf(filename, "%s/run%d_%d_digitTree_mod%d_rcuX%d_rcuZ%d_.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1), fModuleID, fRcuX, fRcuZ);
+ // sprintf(filename, "%s/run%d_%d_digitTree_mod%d_rcuX%d_rcuZ%d_.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1), fModuleID, fRcuX, fRcuZ);
+ sprintf(filename, "%s/run%d_%d_digitTree_mod%d_rcuX%d_rcuZ%d_.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval - 1), fModuleID, fRcuX, fRcuZ);
TFile *outfile = new TFile(filename,"recreate");
fDigitTreePtr->Write();
delete outfile;
fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
}
-
-
-
+
AliHLTComponent* Spawn();
+
+ void FUCK();
void Write();
void ResetTrees();
private:
AliHLTPHOSRcuTreeMaker *fTreeMakerPtr; //comment
TTree *fDigitTreePtr; //comment
- UInt_t fEventCount; //comment
+
+
+ // UInt_t fEventCount; //comment
UInt_t fWriteInterval; //comment
- UInt_t fRunNb; //comment
+ // UInt_t fRunNb; //comment
char *fDirectory; //comment
static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
**************************************************************************/
#include "AliHLTPHOSSanityInspector.h"
-#include "AliHLTAltroData.h"
#include "Rtypes.h"
ClassImp(AliHLTPHOSSanityInspector);
}
-Int_t
-AliHLTPHOSSanityInspector::CheckInsanity(UInt_t* data, Int_t N)
+
+const Int_t
+AliHLTPHOSSanityInspector::CheckInsanity(const UInt_t* data, const Int_t N) const
{
- //comment
+ //comment
for(Int_t i = 1; i < N; i++)
{
if((((Int_t)data[i] - (Int_t)data[i-1]) > fMaxDifference) || (((Int_t)data[i-1] - (Int_t)data[i]) > fMaxDifference))
return 0;
}
-Int_t
-AliHLTPHOSSanityInspector::CheckInsanity(Int_t* data, Int_t N)
-{
- //comment
- for(Int_t i = 1; i < N; i++)
- {
- if((((Int_t)data[i] - (Int_t)data[i-1]) > fMaxDifference) || (((Int_t)data[i-1] - (Int_t)data[i]) > fMaxDifference))
- return 1;
- }
- return 0;
-}
Int_t
AliHLTPHOSSanityInspector::CheckAndHealInsanity(UInt_t* data, Int_t N)
-//
+ //
{
- //comment
+ //comment
Int_t crazyness = 0;
-
- /* if(((data[0] - data[1]) > fMaxDifference) || ((data[1] - data[0]) > fMaxDifference))
- {
- if(((data[1] - data[2]) > fMaxDifference) || ((data[2] - data[1]) > fMaxDifference))
- {
- if(((data[2] - data[3]) > fMaxDifference) || ((data[3] - data[2]) > fMaxDifference))
- {
- return false; //To much crazyness!
- }
- data[1] = (data[2] + data[0])/2;
- crazyness++;
- }
- }
- */
+
if(N > 3)
{
//Require a stable start
return -1;
if((((Int_t)data[1] - (Int_t)data[2]) > fMaxDifference) || (((Int_t)data[2] - (Int_t)data[1]) > fMaxDifference))
return -1;
- /*
- for(Int_t i = 2; i < altroData->fDataSize - 3; i++)
- {
- if(((data[i] - data[i+1]) > fMaxDifference) || ((data[i+1] - data[i]) > fMaxDifference))
- {
- if(((data[i+1] - data[i+2]) > fMaxDifference) || ((data[i+2] - data[i+1]) > fMaxDifference))
- {
- if(((data[i+2] - data[i+3]) > fMaxDifference) || ((data[i+3] - data[i+2]) > fMaxDifference))
- {
- return false; //To0 crazy
- }
- data[i+1] = (data[i+2] + data[i])/2;
- crazyness++;
- }
- else
- return false;
- }
- }
- */
+
+
for(Int_t i = 2; i < N - 3; i++)
{
if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
}
+
+
Int_t
AliHLTPHOSSanityInspector::CheckAndHealInsanity(Int_t* data, Int_t N)
- //
{
- //comment
+ //comment
Int_t crazyness = 0;
-
- /* if(((data[0] - data[1]) > fMaxDifference) || ((data[1] - data[0]) > fMaxDifference))
- {
- if(((data[1] - data[2]) > fMaxDifference) || ((data[2] - data[1]) > fMaxDifference))
- {
- if(((data[2] - data[3]) > fMaxDifference) || ((data[3] - data[2]) > fMaxDifference))
- {
- return false; //To much crazyness!
-}
- data[1] = (data[2] + data[0])/2;
- crazyness++;
-}
-}
- */
+
if(N > 3)
- {
- //Require a stable start
- if((((Int_t)data[0] - (Int_t)data[1]) > fMaxDifference) || (((Int_t)data[1] - (Int_t)data[0]) > fMaxDifference))
- return -1;
- if((((Int_t)data[1] - (Int_t)data[2]) > fMaxDifference) || (((Int_t)data[2] - (Int_t)data[1]) > fMaxDifference))
- return -1;
- /*
- for(Int_t i = 2; i < altroData->fDataSize - 3; i++)
- {
- if(((data[i] - data[i+1]) > fMaxDifference) || ((data[i+1] - data[i]) > fMaxDifference))
- {
- if(((data[i+1] - data[i+2]) > fMaxDifference) || ((data[i+2] - data[i+1]) > fMaxDifference))
- {
- if(((data[i+2] - data[i+3]) > fMaxDifference) || ((data[i+3] - data[i+2]) > fMaxDifference))
{
- return false; //To0 crazy
- }
- data[i+1] = (data[i+2] + data[i])/2;
- crazyness++;
- }
- else
- return false;
- }
- }
- */
- for(Int_t i = 2; i < N - 3; i++)
- {
- if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
- {
- i++;
- if((((Int_t)data[i] -(Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
+ if((((Int_t)data[0] - (Int_t)data[1]) > fMaxDifference) || (((Int_t)data[1] - (Int_t)data[0]) > fMaxDifference))
+ return -1;
+ if((((Int_t)data[1] - (Int_t)data[2]) > fMaxDifference) || (((Int_t)data[2] - (Int_t)data[1]) > fMaxDifference))
+ return -1;
+
+
+ for(Int_t i = 2; i < N - 3; i++)
{
- i++;
if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
- {
- return -2; //Too crazy
- }
- data[i-1] = ((Int_t)data[i] + (Int_t)data[i-2])/2;
- crazyness++;
+ {
+ i++;
+ if((((Int_t)data[i] -(Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
+ {
+ i++;
+ if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
+ {
+ return -2; //Too crazy
+ }
+ data[i-1] = ((Int_t)data[i] + (Int_t)data[i-2])/2;
+ crazyness++;
+ }
+ else
+ return -3; //Two spikes in a row?
+ }
}
- else
- return -3; //Two spikes in a row?
- }
- }
- if((((Int_t)data[N - 3] -(Int_t) data[N - 2]) > fMaxDifference) ||
- (((Int_t)data[N - 2] - (Int_t)data[N - 3]) > fMaxDifference))
- {
- if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) ||
- (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
- {
- data[N - 2] = ((Int_t)data[N - 3] + (Int_t)data[N - 1])/2;
- return crazyness++;
- }
- return -4;
+ if((((Int_t)data[N - 3] -(Int_t) data[N - 2]) > fMaxDifference) ||
+ (((Int_t)data[N - 2] - (Int_t)data[N - 3]) > fMaxDifference))
+ {
+ if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) ||
+ (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
+ {
+ data[N - 2] = ((Int_t)data[N - 3] + (Int_t)data[N - 1])/2;
+ return crazyness++;
+ }
+ return -4;
- }
+ }
- if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) ||
- (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
- {
+ if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) ||
+ (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
+ {
// (Int_t)data[N - 3] = (Int_t)data[N - 4] -(Int_t) data[N - 5] + (Int_t)data[N-4];
- data[N - 1] = data[N - 2];
- return crazyness++;
- }
+ data[N - 1] = data[N - 2];
+ return crazyness++;
+ }
- }
+ }
return crazyness;
#define ALIHLTPHOSSANITYINSPECTOR_H
#include "AliHLTPHOSBase.h"
-//#include "AliHLTAltroData.h"
#include "Rtypes.h"
-class AliHLTAltroData;
-
class AliHLTPHOSSanityInspector : public AliHLTPHOSBase
{
public:
AliHLTPHOSSanityInspector();
-
virtual ~AliHLTPHOSSanityInspector();
-
- Int_t CheckInsanity(UInt_t* data, Int_t nSamples);
- Int_t CheckInsanity(Int_t* data, Int_t nSamples);
-
+ const Int_t CheckInsanity(const UInt_t* data, const Int_t nSamples) const;
Int_t CheckAndHealInsanity(UInt_t* data, Int_t nSamples); //Not completely reliable
Int_t CheckAndHealInsanity(Int_t* data, Int_t nSamples); //Not completely reliable
-
void SetMaxDifference(Int_t maxDiff) { fMaxDifference = maxDiff; }
private:
ClassImp(AliHLTPHOSTreeMaker);
+
+
AliHLTPHOSTreeMaker::AliHLTPHOSTreeMaker() :
AliHLTPHOSBase(),
fDigitArrayPtr(0),
}
+
AliHLTPHOSTreeMaker::~AliHLTPHOSTreeMaker()
{
+
}
Int_t
Int_t MakeDigitArray(AliHLTPHOSDigitContainerDataStruct* digitContainer, Int_t nDigits);
+
void FillDigitTree();
void ResetDigitTree() { fDigitTreePtr->Reset(); }
AliHLTPHOSTreeMakerComponent::AliHLTPHOSTreeMakerComponent() :
AliHLTPHOSProcessor(),
fDigitTreePtr(0),
- fEventCount(0),
+ // fEventCount(0),
fWriteInterval(1000)
{
//comment
//comment
cout << "Printing file...";
char filename [50];
- sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval));
+
+ // sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval));
+
+ // sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fEventCount/fWriteInterval));
+ sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval));
+
+
TFile *outfile = new TFile(filename,"recreate");
fDigitTreePtr->Write();
delete outfile;
//
}
}
- fEventCount++;
+
+ fPhosEventCount++;
+
fTreeMakerPtr->FillDigitTree();
- if(fEventCount%fWriteInterval == 0)
+ if( (fPhosEventCount%fWriteInterval == 0 ) && (fPhosEventCount != 0))
{
Write();
ResetTrees();
}
fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
-
- fstream runNbFile;
- //Int_t newRunNb;
- runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
- runNbFile >> fRunNb;
- runNbFile.close();
- /* newRunNb = fRunNb + 1;
- runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
- runNbFile << newRunNb;
- runNbFile.close();*/
-
- cout << endl << "Run number is: " << fRunNb << " -- Check that this is correct!!!\n";
+ cout << endl << "Run number is: " << fRunNumber << " -- Check that this is correct!!!\n" << endl;
+
+ // fRunNumber
return 0;
//comment
cout << "Writing file...";
char filename [256];
- sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1));
+ // sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1));
+ sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval - 1));
+
TFile *outfile = new TFile(filename,"recreate");
fDigitTreePtr->Write();
delete outfile;
private:
AliHLTPHOSTreeMaker *fTreeMakerPtr; //comment
TTree *fDigitTreePtr; //comment
- UInt_t fEventCount; //comment
+ // UInt_t fEventCount; //comment
UInt_t fWriteInterval; //comment
- UInt_t fRunNb; //comment
+ // UInt_t fRunNb; //comment
char *fDirectory; //comment
static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
include Makefile.arch
+ROOTLIBS = `root-config --libs` -lVMC -lGeom -lEG
+ALIROOTLIBS = -L$(ALICE_ROOT)/lib/tgt_linux -lESD -lRAWDatarec -lRAWDatabase -lSTEERBase
-MAINO = testDecoder.$(ObjSuf) AliHLTAltroData.$(ObjSuf) AliHLTAltroBunch.$(ObjSuf) AliHLTDDLDecoder.$(ObjSuf)
-MAINS = testDecoder.$(SrcSuf) AliHLTAltroData.$(SrcSuf) AliHLTAltroBunch.$(SrcSuf) AliHLTDDLDecoder.$(SrcSuf)
+#LIBS = $(LIBS) $(ROOTLIBS) $(ALIROOTLIBS)
+LIBS = $(ROOTLIBS) $(ALIROOTLIBS)
+
+ROOTINCLUDE = -I$(ROOTSYS)/include
+ALIROOTINCLUDE = -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/RAW
+INCLUDES = $(ROOTINCLUDE) $(ALIROOTINCLUDE)
+
+#MAINO = testDecoder.$(ObjSuf) AliHLTAltroData.$(ObjSuf) AliHLTAltroBunch.$(ObjSuf) AliHLTDDLDecoder.$(ObjSuf)
+#MAINS = testDecoder.$(SrcSuf) AliHLTAltroData.$(SrcSuf) AliHLTAltroBunch.$(SrcSuf) AliHLTDDLDecoder.$(SrcSuf)
+
+
+MAINO = testDecoder.$(ObjSuf)
+MAINS = testDecoder.$(SrcSuf)
MAIN = testDecoder$(ExeSuf)
$(MAIN): $(MAINO)
- $(LD) $(LDFLAGS) $^ $(LIBS) $(GLIBS) -lTreePlayer -lMathCore -lThread -lpthread $(OutPutOpt)$(MAIN)
+ $(LD) $(LDFLAGS) $(INCLUDES) $^ $(LIBS) $(GLIBS) -lTreePlayer -lMathCore -lThread -lpthread $(OutPutOpt)$(MAIN)
@echo "$@ done"
-@cd RootShower && $(MAKE) distclean
.SUFFIXES: .$(SrcSuf)
-
-AliHLTAltroData.$(ObjSuf): AliHLTAltroData.h
-AliHLTDDLDecoder.$(ObjSuf): AliHLTDDLDecoder.h
-testDecoder.$(ObjSuf): AliHLTAltroData.h AliHLTDDLDecoder.h
+
+
+#AliHLTAltroData.$(ObjSuf): AliHLTAltroData.h
+#AliHLTDDLDecoder.$(ObjSuf): AliHLTDDLDecoder.h
+#testDecoder.$(ObjSuf): AliHLTAltroData.h AliHLTDDLDecoder.h
+testDecoder.$(ObjSuf):
.$(SrcSuf).$(ObjSuf):
- $(CXX) $(CXXFLAGS) -c $<
+ $(CXX) $(CXXFLAGS) $(INCLUDES) -c $<
# -lGeom -lGpad -lGraf -lGuiBld -lGui -lMatrix\
# -lRint -lRootAuth -lThread -lVMC
+
ROOTLIBS = `root-config --libs --glibs`
###ALIROOTLIBS = -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) -lESD -lSTEER -lRAWDatarec -lRAWDatabase
#HLTLIBS =-L$(ALIHLT_DC_DIR)/lib/Linux-x86_64-debug -lHOMER
#HLTLIBS =-L$(ALIHLT_DC_DIR)/lib/Linux-i686/ -lHOMER
-HLTLIBS =-L$(ALIHLT_DC_DIR)/lib/Linux-x86_64-debug -lHOMER
+#HLTLIBS =-L$(ALIHLT_DC_DIR)/lib/Linux-x86_64-debug -lHOMER
+HLTLIBS =-L$(ALIHLT_DC_DIR)/lib/Linux-i686-debug -lHOMER
HOMERINCLUDE =$(ALIHLT_DC_DIR)/src/Util/HOMER/include
-N_SAMPLES 55
+N_SAMPLES 125
N_PRE_SAMPLES 15
+#include "AliAltroDecoder.h" // decoder for altro payload
+#include "AliAltroData.h" // container for altro payload
+#include "AliAltroBunch.h" // container for altro bunches
-#include "AliHLTDDLDecoder.h"
-
-#include "AliHLTAltroData.h"
#include "Rtypes.h"
#include <iostream>
#include <fstream>
#include <time.h>
#include "stdio.h"
+#define MIN_BUNCH_SIZE 0
using namespace std;
clock_t start;
clock_t end;
- AliHLTAltroData altrodata;
- AliHLTAltroBunch *altrobunchPtr = new AliHLTAltroBunch;
+ AliAltroData altrodata;
+ AliAltroBunch *altrobunchPtr = new AliAltroBunch;
ifstream fin;
int length;
- AliHLTDDLDecoder *decoder = new AliHLTDDLDecoder();
+ AliAltroDecoder *decoder = new AliAltroDecoder();
fin.open(argv[1], ios::binary);
while(decoder->NextChannel(&altrodata) == true && channelCnt < 10)
{
channelCnt ++;
- decoder->PrintInfo(altrodata, altrodata.fDataSize +4);
-
- if( altrodata.fDataSize != 0 )
+
+ // decoder->PrintInfo(altrodata, altrodata.GetDataSize() +4);
+
+ if( altrodata.GetDataSize() != 0 )
{
cnt = 0;
while( altrodata.NextBunch(altrobunchPtr) == true)
{
- printf("\n");
+ // printf("\n");
- if(cnt < 5)
+ if(altrobunchPtr->GetBunchSize() > MIN_BUNCH_SIZE)
{
printf("\n");
cout <<"cnt = "<< cnt <<endl;
- cout << "altrobunch.fDataSize = " << altrobunchPtr->fBunchSize << endl;
- cout << "altrobunch.fEndTimeBin = " << altrobunchPtr->fEndTimeBin << endl;
-
- for(int i=0; i<altrobunchPtr->fBunchSize+20; i++)
+ cout << "altrobunch.fDataSize = " << altrobunchPtr->GetBunchSize() << endl;
+ cout << "altrobunch.fEndTimeBin = " << altrobunchPtr->GetEndTimeBin() << endl;
+ cout << "altrobunch.fStartTimeBin = " << altrobunchPtr->GetStartTimeBin() << endl;
+
+ for(int i=0; i<altrobunchPtr->GetBunchSize() + 20; i++)
{
if(i != 0 && i%4==0)
{
printf("\n");
}
- printf("%d\t", altrobunchPtr->fData[i]);
+
+ // printf("%d\t", altrobunchPtr->fData[i]);
+ printf("%d\t", (altrobunchPtr->GetData())[i]);
+
}
printf("\n\n");