// --------------
+
#include "AliHLTEMCALRawAnalyzerComponent.h"
#include "AliHLTEMCALMapper.h"
#include "AliHLTEMCALDefinitions.h"
#include "AliHLTCaloChannelDataHeaderStruct.h"
//#include "unistd.h"
-//#include "TStopwatch.h"
-//TStopwatch fgWatch; //CRAP PTH
+
+#include "TStopwatch.h"
+TStopwatch fgWatch; //CRAP PTH
AliHLTEMCALRawAnalyzerComponent::AliHLTEMCALRawAnalyzerComponent() : AliHLTCaloRawAnalyzerComponentv3("EMCAL")
}
+/*
+struct AliHLTComponentDataType
+ {
+ AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
+ char fID[kAliHLTComponentDataTypefIDsize]; /// Data type identifier.
+ char fOrigin[kAliHLTComponentDataTypefOriginSize]; /// Subsystem or detector origin of the data.
+ };
+*/
+
bool
AliHLTEMCALRawAnalyzerComponent::CheckInputDataType(const AliHLTComponentDataType &datatype)
{
// Cheking if datatype is the correct one before processing
+ // cout << __FILE__ << __LINE__ << " : fID = " << datatype.fID << " : fOrigin = " << datatype.fOrigin << endl;
+ // cout << __FILE__ << __LINE__ << "fgkDDLRawDataType->fID = " << AliHLTEMCALDefinitions::fgkDDLRawDataType.fID <<
+ // "fgkDDLRawDataType->fOrigin = " << AliHLTEMCALDefinitions::fgkDDLRawDataType.fOrigin << endl;
+
+
if ( datatype == AliHLTEMCALDefinitions::fgkDDLRawDataType )
{
return true;
}
else
{
+ // return true;
return false;
}
}
if(fMapperPtr->GetIsInitializedMapping() == false )
{
- HLTError("%d:%d, ERROR, mapping not initialized ", __FILE__, __LINE__ );
+ // HLTError("%d:%d, ERROR, mapping not initialized ", __FILE__, __LINE__ );
exit(-2);
}
}
AliHLTEMCALRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/,
AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
{
- //-----------------------
- static int evntcnt = 0;
-// static double wlast = -1;
- // static double wcurrent = 0;
+ static int evntcnt = 0;
+ static double wlast = -1;
+ static double wcurrent = 0;
evntcnt ++;
+ if( evntcnt %1000 == 0 )
+ {
+ cout << __FILE__ << __LINE__ << " : Processing event " << evntcnt << endl;
+ wlast = wcurrent;
+ wcurrent = fgWatch.RealTime();
+ cout << wlast << ":" << wcurrent << endl;
+ cout << __FILE__ << __LINE__ << "The event rate is " << 1000/( wcurrent - wlast ) << " Hz" << endl;
+ fgWatch.Start(kFALSE);
+ // wlast = fgWatch.RealTime();
+ }
+
/*
if( evntcnt %100 == 0 )
{
for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
+ // cout << __FILE__ << __LINE__ << "ndx =" << ndx << endl;
iter = blocks+ndx;
if( ! CheckInputDataType(iter->fDataType) )
{
+ // cout << __FILE__ << __LINE__ << " continue" << endl;
continue;
}
else
{
+ // cout << __FILE__ << __LINE__ << " else" << endl;
+
InitMapping( iter->fSpecification);
blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
{
+ // cout << __FILE__ << __LINE__ << " return -ENOBUFS " << endl;
return -ENOBUFS;
}