instead of an array, this allows for channel by channel decision about attaching
raw data to the HLT outputstream (i.e higher compression rate) .
The data pointer has to be set correctly by
the new shared memory interface (AliHLTPHOSSharedMemoryInerface.h/cxx).
Component that uses the output from raw analyzer is updated to use the
new interface.
AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer &) {return *this;}
*/
+ /** Set digit container */
+ void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
+ { fDigitContainerPtr = digitContainerPtr; }
+
/** Set rec point container */
void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *RecPointContainerPtr)
{ fRecPointContainerPtr = RecPointContainerPtr; }
*/
void SetRawData(Int_t *data)
{
- for(Int_t i = 0; i < 512; i++)
+ for(Int_t i = 0; i < 512; i++) //Fy på deg Øystein
{
fData[i] = data[i];
}
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
#include "AliHLTPHOSDigitDataStruct.h"
#include "AliHLTPHOSDigitContainerDataStruct.h"
-
+#include "AliHLTPHOSSharedMemoryInterface.h" // added by PTH
ClassImp(AliHLTPHOSDigitMaker);
// fDigitStructPtr(0),
fDigitCount(0),
fNrPresamples(10),
- fDigitThreshold(0)
+ fDigitThreshold(0),
+ fShmPtr(0)
{
+ fShmPtr = new AliHLTPHOSSharedMemoryInterface();
// See header file for documentation
}
//See header file for documentation
}
+
+/*
+ *modified by PTH to use new interface too shared memory
+ */
Int_t
AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
{
Int_t x = -1;
Int_t z = -1;
Float_t amplitude = 0;
+
+ fShmPtr->SetMemory(rcuData);
+ // for ( i = 0; i < rcuData->fCnt; i++ )
+ // {
+ fCellDataPtr = fShmPtr->NextChannel();
+
+ while(fCellDataPtr != 0)
+ {
+
+ fCellDataPtr = & ( rcuData->fValidData[i] );
+ x = fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU;
+ z = fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU;
+ amplitude = fCellDataPtr->fEnergy;
+
+ if ( amplitude > fDigitThreshold )
+ {
+ fDigitStructPtr = & ( fDigitContainerStructPtr->fDigitDataStruct[j + fDigitCount] );
+ fDigitStructPtr->fX = ( fCellDataPtr->fX + rcuData->fRcuX * N_XCOLUMNS_RCU );
+ fDigitStructPtr->fZ = ( fCellDataPtr->fZ + rcuData->fRcuZ * N_ZROWS_RCU );
+ fDigitStructPtr->fAmplitude = ( amplitude );
+ fDigitStructPtr->fTime = ( fCellDataPtr->fTime );
+ fDigitStructPtr->fGain = ( fCellDataPtr->fGain );
+ fDigitStructPtr->SetRawData ( fCellDataPtr->fData );
+ fDigitStructPtr->fCrazyness = ( fCellDataPtr->fCrazyness );
+ fDigitStructPtr->fBaseline = -1;
+ j++;
+ }
+
+ fCellDataPtr = fShmPtr->NextChannel();
+ }
+ // }
+ fDigitCount += j;
+ return fDigitCount;
+}
+
+
+/*
+Int_t
+AliHLTPHOSDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
+{
+
+ //See header file for documentation
+ Int_t i = 0;
+ Int_t j = 0;
+ Int_t x = -1;
+ Int_t z = -1;
+ Float_t amplitude = 0;
for ( i = 0; i < rcuData->fCnt; i++ )
{
fCellDataPtr = & ( rcuData->fValidData[i] );
fDigitCount += j;
return fDigitCount;
}
+*/
+
/*
Int_t
AliHLTPHOSDigitMaker::SetDigitsTree(TTree *tree)
class AliHLTPHOSRcuCellEnergyDataStruct;
class AliHLTPHOSDigitContainerDataStruct;
class AliHLTPHOSDigitDataStruct;
+class AliHLTPHOSSharedMemoryInterface; // added by PTH
using namespace PhosHLTConst;
/** Threshold for making digit ( zero suppression threshold) */
Float_t fDigitThreshold;
-
+ AliHLTPHOSSharedMemoryInterface *fShmPtr; //added by PTH
ClassDef(AliHLTPHOSDigitMaker, 1);
};
std::vector<AliHLTComponentBlockData>& outputBlocks)
{
//see header file for documentation
-
UInt_t tSize = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
Int_t digitCount = 0;
- // cout << " AliHLTPHOSDigitMakerComponent::DoEven fEvtCnt = " << fEvtCnt <<endl;
AliHLTUInt8_t* outBPtr;
outBPtr = outputPtr;
fDigitMakerPtr->Reset();
+
+
+
if(fPhosEventCount % 10 == 0)
{
cout << "Event #: " << fPhosEventCount << endl;
AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
{
//comment
- UInt_t offset = 0;
- UInt_t mysize = 0;
- UInt_t tSize = 0;
- Float_t baseline = 0;
+ UInt_t offset = 0;
+ UInt_t mysize = 0;
+ UInt_t tSize = 0;
+ Float_t baseline = 0;
AliHLTUInt8_t* outBPtr;
outBPtr = outputPtr;
const AliHLTComponentBlockData* iter = NULL;
unsigned long ndx;
-
- // fDebugCnt++;
+ Int_t *rawDataBufferPos = (Int_t *)outputPtr;
for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
mysize = 0;
offset = tSize;
Int_t crazyness = 0;
-
+ mysize += sizeof(AliHLTPHOSRcuCellEnergyDataStruct);
+
if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType )
{
continue;
}
-
-
if( fPhosEventCount%100 == 0)
{
cout << "event count = "<< fPhosEventCount <<endl;
-
}
-
fDecoderPtr->SetMemory(reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize);
fDecoderPtr->Decode();
fOutPtr->fRcuX = fRcuX;
fOutPtr->fRcuZ = fRcuZ;
fOutPtr->fModuleID =fModuleID;
-
+ rawDataBufferPos += (mysize)/sizeof(Int_t);
+
while( fDecoderPtr->NextChannel(fAltroDataPtr) == true )
{
if(fAltroDataPtr->GetDataSize() != (fNTotalSamples +2))
cout << "Error, fDataSize = " << fAltroDataPtr->GetDataSize() << endl;
continue;
}
-
else
{
// cout << "Info, fDataSize = " << fAltroDataPtr->GetDataSize() << endl;
}
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;
-
if(fUseBaselineSubtraction)
{
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;
-
+ fOutPtr->fValidData[tmpChannelCnt].fNSamples = fNTotalSamples;
+ fOutPtr->fValidData[tmpChannelCnt].fData = rawDataBufferPos;
const UInt_t *tmpData = fAltroDataPtr->GetData();
for(Int_t sample = 0; sample < fNTotalSamples; sample++)
{
(fOutPtr->fValidData[tmpChannelCnt].fData)[sample] = tmpData[sample] - (int)baseline;
}
-
+
+ UInt_t tmpSize = sizeof(Int_t)*(fOutPtr->fValidData[tmpChannelCnt].fNSamples);
+ mysize += sizeof(Int_t)*(fOutPtr->fValidData[tmpChannelCnt].fNSamples);
+ mysize += tmpSize;
+ rawDataBufferPos += tmpSize/sizeof(Int_t);
tmpChannelCnt ++;
}
-
- fOutPtr->fCnt = tmpChannelCnt;
- mysize += sizeof(AliHLTPHOSRcuCellEnergyDataStruct);
+
+ fOutPtr->fCnt = tmpChannelCnt;
+ fOutPtr->fSize = mysize;
AliHLTComponentBlockData bd;
FillBlockData( bd );
}
-
fPhosEventCount++;
if(fPrintInfo == kTRUE)
{
- if(fPhosEventCount%fPrintInfoFrequncy == 0)
+ if(fPhosEventCount%fPrintInfoFrequncy == 0)
{
cout <<"Analyzing event " << fPhosEventCount << "for Equippment " << fkEquippmentID << endl;
}
}//end DoEvent
+
int
AliHLTPHOSRawAnalyzerComponent::DoInit( int argc, const char** argv )
{
SetBaselines(argv[i+1]);
}
}
-
if(fIsSetEquippmentID == kFALSE)
{
}
}
+
void
AliHLTPHOSRawAnalyzerComponent::SetBaselines(const char* file)
{
class AliHLTPHOSRawAnalyzer;
class AliHLTPHOSRcuCellEnergyDataStruct;
-//class AliHLTPHOSRcuChannelDataStruct;
class AliHLTPHOSMapper;
class AliHLTPHOSSanityInspector;
-class AliAltroDecoder; // decoder for altro payload
-class AliAltroData; // container for altro payload
-class AliAltroBunch; // container for altro bunches
+class AliAltroDecoder; // decoder for altro payload
+class AliAltroData; // container for altro payload
+class AliAltroBunch; // container for altro bunches
class AliHLTPHOSRawAnalyzerComponent: public AliHLTPHOSRcuProcessor
protected:
AliHLTPHOSRawAnalyzer *fAnalyzerPtr; /**<Pointer to an analyzer object used for raw data anlysis*/
- private:
+ using AliHLTPHOSRcuProcessor::DoEvent;
virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
- using AliHLTPHOSRcuProcessor::DoEvent;
+ private:
void Reset();
void ResetDataPtr(int startindex = 0, int sampleCnt = 0);
void SetBaselines(const char* baselineFile);
AliHLTPHOSSanityInspector *fSanityInspectorPtr; //comment
Bool_t fUseBaselineSubtraction; //comment
Float_t fBaselines[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; //comment
- // int fDebugCnt; //comment
+
AliAltroDecoder *fDecoderPtr; // decoder for altro payload
AliAltroData *fAltroDataPtr; // container for altro payload
AliAltroBunch *fAltroBunchPtr; // container for altro bunches
struct AliHLTPHOSRcuCellEnergyDataStruct
{
+ // Int_t fShmAddress;
+ Int_t fSize; //size in charcters
Int_t fModuleID;
Int_t fRcuX;
Int_t fRcuZ;
Int_t fCnt;
+ Int_t fAlgorithm;
+ Int_t fInfo;
AliHLTPHOSValidCellDataStruct fValidData[N_ZROWS_RCU*N_XCOLUMNS_RCU*N_GAINS];
-
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//#include <iostream>
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-//#include "AliHLTPHOSDebugRcuHistogramProducer.h"
-//#include "AliHLTPHOSDebugRcuHistogramProducerComponent.h"
#include "AliHLTPHOSRcuHistogramProducer.h"
#include "AliHLTPHOSRcuHistogramProducerComponent.h"
#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
-
+#include "AliHLTPHOSSharedMemoryInterface.h"
+#include "AliHLTPHOSValidCellDataStruct.h"
AliHLTPHOSRcuHistogramProducerComponent gAliHLTPHOSRcuHistogramProducerComponent;
-
-
-
/*************************************************************************
* Class AliHLTPHOSRcuHistogramProducerComponent accumulating histograms *
* with amplitudes per PHOS channel *
AliHLTPHOSRcuHistogramProducerComponent:: AliHLTPHOSRcuHistogramProducerComponent() :
AliHLTPHOSRcuProcessor(), fHistoWriteFrequency(100), fRcuHistoProducerPtr(0), fOutPtr(NULL)
{
- //Default constructor
+ fShmPtr = new AliHLTPHOSSharedMemoryInterface();
+ //Default constructor
}
{
//See html documentation of base class
cout << "AliHLTPHOSRcuHistogramProducerComponent::Deinit()" << endl;
- // fRcuHistoProducerPtr->WriteAllHistograms("update");
fRcuHistoProducerPtr->WriteAllHistograms("recreate");
return 0;
}
int AliHLTPHOSRcuHistogramProducerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr,
+ AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
{
- // cout << "AliHLTPHOSRcuHistogramProducerComponent::DoEven TP0" << endl;
-
//See html documentation of base class
+ AliHLTPHOSValidCellDataStruct *currentChannel =0;
unsigned long ndx = 0;
UInt_t offset = 0;
UInt_t mysize = 0;
const AliHLTComponentBlockData* iter = NULL;
AliHLTPHOSRcuCellEnergyDataStruct *cellDataPtr;
AliHLTUInt8_t* outBPtr;
- int tmpCnt;
for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
iter = blocks+ndx;
if(iter->fDataType != AliHLTPHOSDefinitions::fgkCellEnergyDataType)
{
- // cout << "Warning: data type is not fgkCellEnergyDataType " << endl;
continue;
}
-
-
- cellDataPtr = (AliHLTPHOSRcuCellEnergyDataStruct*)( iter->fPtr);
- tmpCnt = cellDataPtr->fCnt;
+
+ cellDataPtr = (AliHLTPHOSRcuCellEnergyDataStruct*)( iter->fPtr);
+ fShmPtr->SetMemory(cellDataPtr);
+ currentChannel = fShmPtr->NextChannel();
- for(int i= 0; i < tmpCnt; i ++)
+ while(currentChannel != 0)
{
- fRcuHistoProducerPtr->FillEnergy(cellDataPtr->fValidData[i].fX,
- cellDataPtr->fValidData[i].fZ,
- cellDataPtr->fValidData[i].fGain,
- cellDataPtr->fValidData[i].fEnergy);
-
- fRcuHistoProducerPtr->FillLiveChannels(cellDataPtr->fValidData[i].fData,
- fNTotalSamples,
- cellDataPtr->fValidData[i].fX,
- cellDataPtr->fValidData[i].fZ,
- cellDataPtr->fValidData[i].fGain);
+ fRcuHistoProducerPtr->FillEnergy(currentChannel->fX, currentChannel->fZ, currentChannel->fGain, currentChannel->fEnergy);
+ fRcuHistoProducerPtr->FillLiveChannels(currentChannel->fData, fNTotalSamples, currentChannel->fX, currentChannel->fZ,currentChannel->fGain);
+ currentChannel = fShmPtr->NextChannel();
}
}
- // cout << "Done filling\n";
-
+
outBPtr = outputPtr;
fOutPtr = (AliHLTPHOSRcuCellAccumulatedEnergyDataStruct*)outBPtr;
const AliHLTPHOSRcuCellAccumulatedEnergyDataStruct &innPtr = fRcuHistoProducerPtr->GetCellAccumulatedEnergies();
fOutPtr->fRcuX = fRcuX;
fOutPtr->fRcuZ = fRcuZ;
-
for(unsigned int x=0; x < N_XCOLUMNS_RCU; x ++)
{
for(unsigned int z=0; z < N_ZROWS_RCU; z ++)
}
}
-
- // cout << "AliHLTPHOSRcuHistogramProducerComponent::DoEven TP1" << endl;
- //pushing data to shared output memory
-
mysize += sizeof(AliHLTPHOSRcuCellAccumulatedEnergyDataStruct);
AliHLTComponentBlockData bd;
FillBlockData( bd );
outputBlocks.push_back( bd );
tSize += mysize;
outBPtr += mysize;
-
- // cout << "AliHLTPHOSRcuHistogramProducerComponent::DoEven TP2" << endl;
-
if( tSize > size )
{
fPhosEventCount++;
-
if( (fPhosEventCount%fHistoWriteFrequency == 0) && ( fPhosEventCount != 0))
- //if( (fPhosEventCount%fHistoWriteFrequency == 0))
{
- cout << "AliHLTPHOSRcuHistogramProducerComponent::DoEvent, updating histograms " << endl;
fRcuHistoProducerPtr->WriteAllHistograms("recreate");
}
-
return 0;
-
-
}//end DoEvent
}
+
/* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-
#include "AliHLTPHOSRcuProcessor.h"
-//#include "AliHLTPHOSDefinitions.h"
-//#include "AliHLTPHOSCommonDefs.h"
-//#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
-//#include "Rtypes.h"
-
class AliHLTPHOSRcuHistogramProducer;
class AliHLTPHOSRcuCellAccumulatedEnergyDataStruct;
+class AliHLTPHOSSharedMemoryInterface;
class AliHLTPHOSRcuHistogramProducerComponent:public AliHLTPHOSRcuProcessor
{
private:
int fHistoWriteFrequency;
-
- /*
- AliHLTPHOSRcuHistogramProducerComponent(const AliHLTPHOSRcuHistogramProducerComponent & );
- AliHLTPHOSRcuHistogramProducerComponent & operator = (const AliHLTPHOSRcuHistogramProducerComponent &)
- {
- return *this;
- };
- */
-
AliHLTPHOSRcuHistogramProducer* fRcuHistoProducerPtr; /**<Pointer to a phos histoproducer object*/
AliHLTPHOSRcuCellAccumulatedEnergyDataStruct* fOutPtr; /**<Pointer to outputbuffer to write results from the component into shared memory*/
// static const AliHLTComponentDataType fgkIinputDataTypes[];
// static const AliHLTComponentDataType fgkOutputDataType; /**<List of datatypes that can be given to this component*/
+ AliHLTPHOSSharedMemoryInterface *fShmPtr;
};
#endif
--- /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 "AliHLTPHOSSharedMemoryInterface.h"
+#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
+#include "AliHLTPHOSValidCellDataStruct.h"
+#include <iostream>
+
+
+AliHLTPHOSSharedMemoryInterface::AliHLTPHOSSharedMemoryInterface(): fCurrentChannel(0),
+ fCellEnergiesPtr(0),
+ fIsSetMemory(false),
+ fMaxCnt(0),
+ fCurrentCnt(0),
+ fCharDataOffset(0),
+ fCharPtr(0),
+ fIntPtr(0)
+
+
+{
+ fCharDataOffset = sizeof(AliHLTPHOSRcuCellEnergyDataStruct);
+}
+
+
+AliHLTPHOSSharedMemoryInterface::~AliHLTPHOSSharedMemoryInterface()
+{
+
+}
+
+
+AliHLTPHOSValidCellDataStruct*
+AliHLTPHOSSharedMemoryInterface::NextChannel()
+{
+ // Returns the next channel of the current AliHLTPHOSRcuCellEnergyDataStruct
+ // Returns zero when all cannels are read
+
+ if(fCurrentCnt < fMaxCnt)
+ {
+ fCurrentChannel = &fCellEnergiesPtr->fValidData[fCurrentCnt];
+ fCurrentChannel->fData = fIntPtr;
+ fIntPtr += fCurrentChannel->fNSamples;
+ fCurrentCnt ++;
+ return fCurrentChannel;
+ }
+ else
+ {
+ Reset();
+ return 0;
+ }
+}
+
+
+void
+AliHLTPHOSSharedMemoryInterface::SetMemory(AliHLTPHOSRcuCellEnergyDataStruct *rcuCellEnergyPtr)
+{
+ //Shutting up rule checker
+ fCellEnergiesPtr = rcuCellEnergyPtr;
+ fMaxCnt = fCellEnergiesPtr->fCnt;
+ PingPongPointer();
+ fIsSetMemory = true;
+}
+
+
+void
+AliHLTPHOSSharedMemoryInterface::Reset()
+{
+ //Shutting up rule checker
+ fMaxCnt =0;
+ fCurrentCnt = 0;
+ fIsSetMemory = false;
+}
+
+
+void
+AliHLTPHOSSharedMemoryInterface::PingPongPointer()
+{
+ // ping pong ping ping pong ping pong
+ fCharPtr = (char *)fCellEnergiesPtr ;
+ fCharPtr += fCharDataOffset;
+ fIntPtr = (Int_t *)fCharPtr;
+}
-#ifndef ALIHLTPHOSRCUCOMPRESSEDRAWDATA_H
-#define ALIHLTPHOSRCUCOMPRESSEDRAWDATA_H
+#ifndef ALIHLTPHOSSHAREDMEMORYINTERFACE_H
+#define ALIHLTPHOSSHAREDMEMORYINTERFACE_H
/**************************************************************************
* This file is property of and copyright by the Experimental Nuclear *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+#include "Rtypes.h"
-struct AliHLTPHOSRcuCompressedRawData
-{
- AliHLTPHOSRcuCompressedRawData();
- virtual ~AliHLTPHOSRcuCompressedRawData();
- int fTotalSize;
- int *fBuffer;
+class AliHLTPHOSRcuCellEnergyDataStruct;
+class AliHLTPHOSValidCellDataStruct;
+class AliHLTPHOSSharedMemoryInterface
+{
+ public:
+ AliHLTPHOSSharedMemoryInterface();
+ virtual ~AliHLTPHOSSharedMemoryInterface();
+ AliHLTPHOSValidCellDataStruct* NextChannel();
+ void SetMemory(AliHLTPHOSRcuCellEnergyDataStruct *rcuCeelEnergyPtr);
+ void Reset();
+ private:
+ void PingPongPointer();
+ AliHLTPHOSValidCellDataStruct *fCurrentChannel;
+ AliHLTPHOSRcuCellEnergyDataStruct *fCellEnergiesPtr ;
+ bool fIsSetMemory;
+ int fMaxCnt;
+ int fCurrentCnt;
+ Int_t fCharDataOffset;
+ char *fCharPtr;
+ Int_t *fIntPtr;
+ // Int_t *rawDataBufferPos = (Int_t *)outputPtr;
};
#endif
-#ifndef ALIHLTPHOSVALIDCELLDEBUGDATASTRUCT_H
-#define ALIHLTPHOSVALIDCELLDEBUGDATASTRUCT_H
+#ifndef ALIHLTPHOSVALIDCELLDATASTRUCT_H
+#define ALIHLTPHOSVALIDCELLDATASTRUCT_H
/***************************************************************************
* Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
#include "Rtypes.h"
//#define N_DATA_SAMPLES 70
-#define N_DATA_SAMPLES 510
+//#define N_DATA_SAMPLES 510
struct AliHLTPHOSValidCellDataStruct
{
Float_t fEnergy;
Float_t fTime;
Int_t fCrazyness;
- Int_t fData[N_DATA_SAMPLES];
+ Int_t fNSamples;
+ Int_t *fData;
+ // Int_t fData[N_DATA_SAMPLES];
};
+++ /dev/null
-#ifndef ALIHLTPHOSVALIDCHANNELDATASTRUCT_H
-#define ALIHLTPHOSVALIDCHANNELDATASTRUCT_H
-
-/***************************************************************************
- * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * 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 "AliHLTDataTypes.h"
-#include "Rtypes.h"
-#include "AliHLTPHOSCommonDefs.h"
-
-struct AliHLTPHOSValidChannelDataStruct
-{
- AliHLTUInt8_t fZ;
- AliHLTUInt8_t fX;
- AliHLTUInt8_t fGain;
- // AliHLTUInt16_t fNSamples;
- AliHLTUInt16_t fDataSize;
- // AliHLTUInt16_t fChannelData[ALTRO_MAX_SAMPLES];
- // Float_t fChannelData[350];
- // UInt_t fChannelData[1024];
- UInt_t fChannelData[200];
- // UInt_t *fChannelData;
-
-};
-
-
-#endif
-
#include <TRootEmbeddedCanvas.h>
#include <TCanvas.h>
#include "TGFrame.h"
-#include "AliHLTPHOSRcuChannelDataStruct.h"
+
+//#include "AliHLTPHOSRcuChannelDataStruct.h"
+//#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
+
#include "AliHLTPHOSOnlineDisplayEventTab.h"
#include "AliHLTPHOSOnlineDisplayCalibTab.h"
#include "AliHLTPHOSOnlineDisplayRawTab.h"
#define MAX_HISTOGRAMS 320
class TCanvas;
-class AliHLTPHOSRcuCellEnergyDataStruct;
+
+//class AliHLTPHOSRcuCellEnergyDataStruct;
class AliHLTPHOSOnlineDisplay : public TGMainFrame, public AliHLTPHOSBase
#include "HOMERWriter.h"
#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
//#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
+#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
#include "AliHLTPHOSOnlineDisplay.h"
+#include "AliHLTPHOSSharedMemoryInterface.h"
using namespace std;
AliHLTPHOSOnlineDisplayEventTab::AliHLTPHOSOnlineDisplayEventTab(AliHLTPHOSOnlineDisplay *onlineDisplayPtr, TGTab *tabPtr,
HOMERReader *homerSyncPtr, HOMERReader *homerPtrs[MAX_HOSTS], int nHosts) : AliHLTPHOSOnlineDisplayTab()
{
+ fShmPtr = new AliHLTPHOSSharedMemoryInterface();
+
fOnlineDisplayPtr = onlineDisplayPtr;
for(int mod =0; mod <N_MODULES; mod ++)
for(int i=0; i<nHosts; i++)
{
fgHomerReadersPtr[i] = homerPtrs[i] ;
+
}
fgCanvasHGPtr = 0;
void
AliHLTPHOSOnlineDisplayEventTab::ReadBlockData(HOMERReader *homeReaderPtr)
-{
- cout << "Reading block data" << endl;
+{
+ AliHLTPHOSValidCellDataStruct *currentChannel =0;
+
+
+ cout << "AliHLTPHOSOnlineDisplayEventTab::ReadBlockDat, Reading block data" << endl;
unsigned long blk = homeReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF );
while ( blk != ~(unsigned long)0 )
{
Int_t moduleID;
- // const AliHLTPHOSRcuCellEnergyDataStruct* cellEnergiesPtr = (const AliHLTPHOSRcuCellEnergyDataStruct*)homeReaderPtr->GetBlockData( blk );
- const AliHLTPHOSRcuCellEnergyDataStruct* cellEnergiesPtr = (const AliHLTPHOSRcuCellEnergyDataStruct*)homeReaderPtr->GetBlockData( blk );
+ // const AliHLTPHOSRcuCellEnergyDataStruct* cellEnergiesPtr = (const AliHLTPHOSRcuCellEnergyDataStruct*)homeReaderPtr->GetBlockData( blk );
+ AliHLTPHOSRcuCellEnergyDataStruct* cellEnergiesPtr = (AliHLTPHOSRcuCellEnergyDataStruct*)homeReaderPtr->GetBlockData( blk );
+
moduleID = cellEnergiesPtr->fModuleID ;
-
- cout <<"AliHLTPHOSOnlineDisplayEventTab::ReadBlockData, fModuleID =" <<moduleID << endl;
-
- Int_t tmpCount = cellEnergiesPtr->fCnt;
+ cout << "AliHLTPHOSOnlineDisplayEventTab::ReadBlockData, fModuleID =" <<moduleID << endl;
+ // Int_t offset = ((Int_t)cellEnergiesPtr->fShmAddress - (Int_t)cellEnergiesPtr)/sizeof(Int_t);
+ // Int_t tmpCount = cellEnergiesPtr->fCnt;
Int_t tmpZ;
Int_t tmpX;
Int_t tmpGain;
+ int cnt = 0;
+
+ cout << "the sizeof AliHLTPHOSRcuCellEnergyDataStruc=" << sizeof(AliHLTPHOSRcuCellEnergyDataStruct) << endl;
+
+ fShmPtr->SetMemory(cellEnergiesPtr);
+ currentChannel = fShmPtr->NextChannel();
+
+ while(currentChannel != 0)
+ {
+ cnt ++;
+ tmpZ = currentChannel->fZ;
+ tmpX = currentChannel->fX;
+ tmpGain = currentChannel->fGain;
+
+ if(cnt < 20)
+ {
+ cout << "the addresss of fData is " << (void *)currentChannel->fData << endl;
+ }
+
+ if(
+ tmpGain == HIGH_GAIN)
+ {
+ fgLegoPlotHGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX + N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,
+ tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ, currentChannel->fEnergy);
+
+
+ for(int j= 0; j< fNTotalSamples; j++)
+ {
+ // printf("%d\t", currentChannel->fData[j]);
+ fChannelData[moduleID][cellEnergiesPtr->fRcuX][cellEnergiesPtr->fRcuZ][tmpX][tmpZ][HIGH_GAIN][j] = currentChannel->fData[j];
+ }
+ }
+
+ else if(tmpGain == LOW_GAIN)
+ {
+ fgLegoPlotLGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX + N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,
+ tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ, currentChannel->fEnergy);
+ for(int j= 0; j< fNTotalSamples; j++)
+ {
+
+ // printf("%d\t", currentChannel->fData[j]);
+ fChannelData[moduleID][cellEnergiesPtr->fRcuX][cellEnergiesPtr->fRcuZ][tmpX][tmpZ][LOW_GAIN][j] = currentChannel->fData[j];
+ }
+ }
+
+ // printf("\n");
+ currentChannel = fShmPtr->NextChannel();
+ }
+
+
+ /*
for(int i= 0; i <= tmpCount; i++)
{
tmpZ = cellEnergiesPtr->fValidData[i].fZ;
tmpX = cellEnergiesPtr->fValidData[i].fX;
tmpGain = cellEnergiesPtr->fValidData[i].fGain;
-
+
if(tmpGain == HIGH_GAIN)
{
fgLegoPlotHGPtr->Fill(moduleID*N_XCOLUMNS_MOD + tmpX + N_XCOLUMNS_RCU*cellEnergiesPtr->fRcuX,
tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ, cellEnergiesPtr->fValidData[i].fEnergy);
+
for(int j= 0; j< fNTotalSamples; j++)
{
- fChannelData[moduleID][cellEnergiesPtr->fRcuX][cellEnergiesPtr->fRcuZ][tmpX][tmpZ][HIGH_GAIN][j] = cellEnergiesPtr->fValidData[i].fData[j];
- // fChannelData[moduleId][]
+ fChannelData[moduleID][cellEnergiesPtr->fRcuX][cellEnergiesPtr->fRcuZ][tmpX][tmpZ][HIGH_GAIN][j] = cellEnergiesPtr->fValidData[i].fData[j-offset];
}
-
}
else if(tmpGain == LOW_GAIN)
tmpZ + N_ZROWS_RCU*cellEnergiesPtr->fRcuZ, cellEnergiesPtr->fValidData[i].fEnergy);
for(int j= 0; j< fNTotalSamples; j++)
{
- fChannelData[moduleID][cellEnergiesPtr->fRcuX][cellEnergiesPtr->fRcuZ][tmpX][tmpZ][LOW_GAIN][j] = cellEnergiesPtr->fValidData[i].fData[j];
+ fChannelData[moduleID][cellEnergiesPtr->fRcuX][cellEnergiesPtr->fRcuZ][tmpX][tmpZ][LOW_GAIN][j] = cellEnergiesPtr->fValidData[i].fData[j -offset];
}
}
}
-
+ */
+
+
blk = homeReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF, blk+1);
}
}
#include <TH1D.h>
#include "AliHLTPHOSOnlineDisplayTH2D.h"
#include "AliHLTPHOSConstants.h"
+
+//#include
+
//#include "AliHLTPHOSOnlineDisplay.h"
//#define N_SAMPLES 70 //BAD, someone is going to pay for this
//class AliHLTPHOSRcuCellEnergyDataStruct;
class AliHLTPHOSRcuCellEnergyDataStruct;
class AliHLTPHOSOnlineDisplay;
+class AliHLTPHOSSharedMemoryInterface;
// AliHLTPHOSRcuCellEnergyDataStruct.h
class AliHLTPHOSOnlineDisplayEventTab : public AliHLTPHOSOnlineDisplayTab
// AliHLTPHOSOnlineDisplay.
AliHLTPHOSOnlineDisplay *fOnlineDisplayPtr;
-
+ AliHLTPHOSSharedMemoryInterface *fShmPtr;
};
#include <iostream>
#include "AliHLTPHOSRcuCellAccumulatedEnergyDataStruct.h"
#include "AliHLTPHOSGetEventButton.h"
-#include "AliHLTPHOSRcuChannelDataStruct.h"
+//#include "AliHLTPHOSRcuChannelDataStruct.h"
+#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
using namespace std;
{
cout << "GetNextEventRaw(): updating block " << endl;
AliHLTUInt16_t moduleID;
- const AliHLTPHOSRcuChannelDataStruct* rcuChannelDataPtr = (const AliHLTPHOSRcuChannelDataStruct*)homerReaderPtr->GetBlockData( blk );
+
+ // const AliHLTPHOSRcuChannelDataStruct* rcuChannelDataPtr = (const AliHLTPHOSRcuChannelDataStruct*)homerReaderPtr->GetBlockData( blk );
+ const AliHLTPHOSRcuCellEnergyDataStruct* rcuChannelDataPtr = (const AliHLTPHOSRcuCellEnergyDataStruct*)homerReaderPtr->GetBlockData( blk );
+
moduleID = rcuChannelDataPtr->fModuleID ;
cout << "GetNextEventRaw() Module ID =" << moduleID << endl;
+
+
int tmpx;
int tmpz;
AliHLTUInt32_t tmpChCnt =0;
AliHLTUInt16_t tmpSampleCnt =0;
- tmpChCnt = rcuChannelDataPtr->fNValidChannels;
+ // tmpChCnt = rcuChannelDataPtr->fNValidChannels;
+ tmpChCnt = rcuChannelDataPtr->fCnt;
+
cout << "tmpChCnt = " << tmpChCnt << endl;
for( AliHLTUInt32_t ch =0; ch < tmpChCnt; ch ++)
{
tmpz = rcuChannelDataPtr->fValidData[ch].fZ;
tmpx = rcuChannelDataPtr->fValidData[ch].fX;
- tmpSampleCnt = rcuChannelDataPtr->fValidData[ch].fDataSize -2;
+ // tmpSampleCnt = rcuChannelDataPtr->fValidData[ch].fDataSize -2;
+ tmpSampleCnt = rcuChannelDataPtr->fValidData[ch].fNSamples;
// fgChannelDataPlotPtr[tmpz][tmpx]->SetFillColor(3);
{
if( rcuChannelDataPtr->fValidData[ch].fGain == 0)
{
- fgChannelDataPlotPtr[tmpz][tmpx]->SetBinContent(sample, rcuChannelDataPtr->fValidData[ch].fChannelData[sample]);
+ // fgChannelDataPlotPtr[tmpz][tmpx]->SetBinContent(sample, rcuChannelDataPtr->fValidData[ch].fChannelData[sample]);
+ fgChannelDataPlotPtr[tmpz][tmpx]->SetBinContent(sample, rcuChannelDataPtr->fValidData[ch].fData[sample]);
}
}