for(Int_t iRecPoint=0; iRecPoint < fNRecPoints; iRecPoint++)
{
- digit = &(recPoint->fDigits);
+ // digit = &(recPoint->fDigits);
for(iDigit = 0; iDigit < recPoint->fMultiplicity; iDigit++)
{
UInt_t maxClusterSize = sizeof(AliHLTCaloClusterDataStruct) + (6 << 7); //Reasonable estimate... (6 = sizeof(Short_t) + sizeof(Float_t)
AliHLTCaloRecPointDataStruct* recPointPtr = fRecPointDataPtr;
- AliHLTCaloDigitDataStruct* digitPtr = &(recPointPtr->fDigits);
-
+ // AliHLTCaloDigitDataStruct* digitPtr = &(recPointPtr->fDigits);
+ AliHLTCaloDigitDataStruct* digitPtr = 0;
+
AliHLTCaloClusterDataStruct* caloClusterPtr = fCaloClusterDataPtr;
UShort_t* cellIDPtr = &(caloClusterPtr->fCellsAbsId);
Float_t* cellAmpFracPtr = &(caloClusterPtr->fCellsAmpFraction);
// caloClusterPtr = reinterpret_cast<AliHLTCaloClusterDataStruct*>(cellAmpFracPtr);
caloClusterPtr = reinterpret_cast<AliHLTCaloClusterDataStruct*>(cellIDPtr);
recPointPtr = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(digitPtr);
- digitPtr = &(recPointPtr->fDigits);
+ ///digitPtr = &(recPointPtr->fDigits);
}
// cout << "CA: Energy End: " << fCaloClusterDataPtr->fEnergy << endl;
//cout << "CA totSize: " << totSize << endl;
AliHLTCaloClusterizer::AliHLTCaloClusterizer(TString det):\r
AliHLTCaloConstantsHandler(det),\r
fRecPointDataPtr(0),\r
- fDigitDataPtr(0),\r
+ fDigitIndexPtr(0),\r
fEmcClusteringThreshold(0),\r
fEmcMinEnergyThreshold(0),\r
fEmcTimeGate(0),\r
fDigitsInCluster(0),\r
fDigitContainerPtr(0),\r
- fMaxDigitIndexDiff(0)\r
+ fMaxDigitIndexDiff(0),\r
+ fNDigits(0)\r
{\r
//See header file for documentation\r
fEmcClusteringThreshold = 0.2;\r
\r
\r
//BALLE how do you set the right detector?\r
-AliHLTCaloClusterizer::AliHLTCaloClusterizer(const AliHLTCaloClusterizer &) :\r
- AliHLTCaloConstantsHandler("BALLE"),\r
- fRecPointDataPtr(0),\r
- fDigitDataPtr(0),\r
- fEmcClusteringThreshold(0),\r
- fEmcMinEnergyThreshold(0),\r
- fEmcTimeGate(0),\r
- fDigitsInCluster(0),\r
- fDigitContainerPtr(0),\r
- fMaxDigitIndexDiff(0)\r
-{\r
- // dummy copy constructor\r
-}//end\r
+// AliHLTCaloClusterizer::AliHLTCaloClusterizer(const AliHLTCaloClusterizer &) :\r
+// AliHLTCaloConstantsHandler("BALLE"),\r
+// fRecPointDataPtr(0),\r
+// fDigitDataPtr(0),\r
+// fEmcClusteringThreshold(0),\r
+// fEmcMinEnergyThreshold(0),\r
+// fEmcTimeGate(0),\r
+// fDigitsInCluster(0),\r
+// fDigitContainerPtr(0),\r
+// fMaxDigitIndexDiff(0)\r
+// {\r
+// // dummy copy constructor\r
+// }//end\r
\r
\r
AliHLTCaloClusterizer::~AliHLTCaloClusterizer() \r
}\r
\r
Int_t \r
-AliHLTCaloClusterizer::ClusterizeEvent(UInt_t availableSize, UInt_t& totSize)\r
+AliHLTCaloClusterizer::ClusterizeEvent(Int_t nDigits, UInt_t availableSize, UInt_t& totSize)\r
{\r
//see header file for documentation\r
Int_t nRecPoints = 0;\r
\r
+ fNDigits = nDigits;\r
+\r
UInt_t maxRecPointSize = sizeof(AliHLTCaloRecPointDataStruct) + (sizeof(AliHLTCaloDigitDataStruct) << 7); //Reasonable estimate... \r
\r
//Clusterization starts\r
- for(UInt_t i = 0; i < fDigitContainerPtr->fNDigits; i++)\r
+ for(UInt_t i = 0; i < nDigits; i++)\r
{ \r
fDigitsInCluster = 0;\r
- \r
- if(fDigitContainerPtr->fDigitDataStruct[i].fEnergy < fEmcClusteringThreshold)\r
+ // printf("ENERGY: %f\n", fDigitsPointerArray[i]->fEnergy);\r
+ if(fDigitsPointerArray[i]->fEnergy < fEmcClusteringThreshold)\r
{\r
continue;\r
}\r
{\r
return -1; //Might get out of buffer, exiting\r
}\r
-\r
+ // printf("cluster candidate!\n");\r
// First digit is placed at the fDigits member variable in the recpoint\r
- fDigitDataPtr = &(fRecPointDataPtr->fDigits);\r
+ fDigitIndexPtr = &(fRecPointDataPtr->fDigits);\r
\r
fRecPointDataPtr->fAmp = 0;\r
- fRecPointDataPtr->fModule = fDigitContainerPtr->fDigitDataStruct[i].fModule;\r
+ fRecPointDataPtr->fModule = fDigitsPointerArray[i]->fModule;\r
\r
- // Assigning digit data to the digit pointer\r
- fRecPointDataPtr->fDigits = fDigitContainerPtr->fDigitDataStruct[i];\r
+ // Assigning the digit to this rec point\r
+ fRecPointDataPtr->fDigits = i;\r
\r
// Incrementing the pointer to be ready for new entry\r
- fDigitDataPtr++;\r
+ fDigitIndexPtr++;\r
\r
- fRecPointDataPtr->fAmp += fDigitContainerPtr->fDigitDataStruct[i].fEnergy;\r
- fDigitContainerPtr->fDigitDataStruct[i].fEnergy = 0;\r
+ fRecPointDataPtr->fAmp += fDigitsPointerArray[i]->fEnergy;\r
+ fDigitsPointerArray[i]->fEnergy = 0;\r
fDigitsInCluster++;\r
nRecPoints++;\r
\r
\r
totSize += sizeof(AliHLTCaloRecPointDataStruct) + (fDigitsInCluster-1)*sizeof(AliHLTCaloDigitDataStruct); \r
fRecPointDataPtr->fMultiplicity = fDigitsInCluster; \r
+ // printf("Rec point energy: %f\n", fRecPointDataPtr->fAmp);\r
+ fRecPointDataPtr = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(fDigitIndexPtr);\r
\r
- fRecPointDataPtr = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(fDigitDataPtr);\r
}//end of clusterization\r
\r
return nRecPoints;\r
AliHLTCaloClusterizer::ScanForNeighbourDigits(Int_t index, AliHLTCaloRecPointDataStruct* recPoint)\r
{\r
//see header file for documentation\r
- Int_t max = TMath::Min((Int_t)fDigitContainerPtr->fNDigits, (Int_t)fMaxDigitIndexDiff+index);\r
+ Int_t max = TMath::Min(fNDigits, (Int_t)fMaxDigitIndexDiff+index);\r
Int_t min = TMath::Max(0, (Int_t)(index - (Int_t)fMaxDigitIndexDiff));\r
\r
- max = fDigitContainerPtr->fNDigits;\r
+ max = fNDigits;\r
min = 0;\r
for(Int_t j = min; j < max; j++)\r
{\r
- if(fDigitContainerPtr->fDigitDataStruct[j].fEnergy > fEmcMinEnergyThreshold)\r
+ if(fDigitsPointerArray[j]->fEnergy > fEmcMinEnergyThreshold)\r
{\r
if(j != index)\r
{\r
- if(AreNeighbours(&(fDigitContainerPtr->fDigitDataStruct[index]),\r
- &(fDigitContainerPtr->fDigitDataStruct[j])))\r
+ if(AreNeighbours(fDigitsPointerArray[index],\r
+ fDigitsPointerArray[j]))\r
{\r
// Assigning value to digit ptr\r
- *fDigitDataPtr = fDigitContainerPtr->fDigitDataStruct[j];\r
+ *fDigitIndexPtr = j;\r
// Incrementing digit pointer to be ready for new entry\r
- fDigitDataPtr++;\r
+ fDigitIndexPtr++;\r
\r
- recPoint->fAmp += fDigitContainerPtr->fDigitDataStruct[j].fEnergy;\r
- fDigitContainerPtr->fDigitDataStruct[j].fEnergy = 0; \r
+ recPoint->fAmp += fDigitsPointerArray[j]->fEnergy;\r
+ fDigitsPointerArray[j]->fEnergy = 0; \r
fDigitsInCluster++;\r
ScanForNeighbourDigits(j, recPoint);\r
}\r
//#include "AliPHOSGeometry.h"\r
\r
class TClonesArray;\r
+class TString;\r
//class AliPHOSDigit;\r
//class AliPHOSRecoParamEmc;\r
//class AliPHOSRecoParam;\r
void SetDigitContainer(AliHLTCaloDigitContainerDataStruct* digitContainerPtr)\r
{ fDigitContainerPtr = digitContainerPtr; }\r
\r
+ /** Set array with digits */\r
+ void SetDigitArray(AliHLTCaloDigitDataStruct **digitPointerArr)\r
+ { fDigitsPointerArray = digitPointerArr; } \r
+\r
/** Set rec point data buffer */\r
void SetRecPointDataPtr(AliHLTCaloRecPointDataStruct* recPointDataPtr);\r
\r
void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }\r
\r
/** Starts clusterization of the event */ \r
- virtual Int_t ClusterizeEvent(UInt_t availableSize, UInt_t& totSize);\r
+ virtual Int_t ClusterizeEvent(Int_t nDigits, UInt_t availableSize, UInt_t& totSize);\r
\r
/**\r
* For a given digit this digit scans for neighbouring digits which \r
protected:\r
\r
/** Pointer to the rec point output */\r
- AliHLTCaloRecPointDataStruct* fRecPointDataPtr; //! transient\r
+ AliHLTCaloRecPointDataStruct *fRecPointDataPtr; //! transient\r
\r
- /** Pointer to the digit output */\r
- AliHLTCaloDigitDataStruct* fDigitDataPtr; //! transient\r
+ /** Pointer to the digit index array in the rec point */\r
+ Int_t* fDigitIndexPtr; //! transient\r
\r
/** Energy threshold for starting a cluster for the calorimeter */\r
Float_t fEmcClusteringThreshold; //COMMENT\r
/** Counts the digits in a rec point */\r
Int_t fDigitsInCluster; //COMMENT\r
\r
+ /** Array of our digits */\r
+ AliHLTCaloDigitDataStruct **fDigitsPointerArray; //! transient\r
+\r
/** Contains the digits from one event */\r
AliHLTCaloDigitContainerDataStruct *fDigitContainerPtr; //! transient\r
\r
/** Maximum difference in index to be a neighbour */\r
Int_t fMaxDigitIndexDiff; //COMMENT\r
\r
+ /** Number of digits in event */\r
+ Int_t fNDigits; //COMMENT\r
+\r
private:\r
\r
AliHLTCaloClusterizer();\r
#include "AliHLTCaloDigitDataStruct.h"
#include "AliHLTCaloDigitContainerDataStruct.h"
#include "AliHLTCaloDefinitions.h"
+#include "TString.h"
/** @file AliHLTCaloClusterizerComponent.cxx
@author Oystein Djuvsland
// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-AliHLTCaloClusterizerComponent gAliHLTCaloClusterizerComponent;
-AliHLTCaloClusterizerComponent::AliHLTCaloClusterizerComponent():
- AliHLTPHOSProcessor(),
- fAllDigitsPtr(0),
+AliHLTCaloClusterizerComponent::AliHLTCaloClusterizerComponent(TString det):
+ AliHLTCaloConstantsHandler(det),
+ AliHLTCaloProcessor(),
+ fDigitsPointerArray(0),
fClusterizerPtr(0),
- fDigitCount(0),
- fNoCrazyness(0)
+ fDigitCount(0)
+
{
//See headerfile for documentation
+
+ fDigitsPointerArray = new AliHLTCaloDigitDataStruct*[fCaloConstants->GetNXCOLUMNSRCU()*fCaloConstants->GetNZROWSRCU()];
+
+ fClusterizerPtr = new AliHLTCaloClusterizer(det);
+
+ fClusterizerPtr->SetDigitArray(fDigitsPointerArray);
+
}
AliHLTCaloClusterizerComponent::~AliHLTCaloClusterizerComponent()
delete fClusterizerPtr;
fClusterizerPtr = 0;
}
- if(fAllDigitsPtr)
- {
- delete fAllDigitsPtr;
- fAllDigitsPtr = 0;
- }
}
return 0;
}
-void
-AliHLTCaloClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
-{
- //See headerfile for documentation
- list.clear();
- list.push_back(AliHLTPHOSDefinitions::fgkDigitDataType);
-}
-
-AliHLTComponentDataType
-AliHLTCaloClusterizerComponent::GetOutputDataType()
-{
- //See headerfile for documentation
- return AliHLTPHOSDefinitions::fgkRecPointDataType;
-}
-
-void
-AliHLTCaloClusterizerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
-
-{
- //See headerfile for documentation
- constBase = sizeof(AliHLTCaloRecPointHeaderStruct) + sizeof(AliHLTPHOSRecPointDataStruct) + (sizeof(AliHLTCaloDigitDataStruct) << 7); //Reasonable estimate... ;
- inputMultiplier = 1.5;
-}
+// void
+// AliHLTCaloClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+// {
+// //See headerfile for documentation
+// list.clear();
+// list.push_back(AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginPHOS);
+// }
+
+// AliHLTComponentDataType
+// AliHLTCaloClusterizerComponent::GetOutputDataType()
+// {
+// //See headerfile for documentation
+// return AliHLTCaloDefinitions::fgkRecPointDataType|kAliHLTDataOriginPHOS;
+// }
+
+// void
+// AliHLTCaloClusterizerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+
+// {
+// //See headerfile for documentation
+// constBase = sizeof(AliHLTCaloRecPointHeaderStruct) + sizeof(AliHLTCaloRecPointDataStruct) + (sizeof(AliHLTCaloDigitDataStruct) << 7); //Reasonable estimate... ;
+// inputMultiplier = 1.5;
+// }
int
AliHLTCaloClusterizerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
UInt_t mysize = 0;
Int_t nRecPoints = 0;
Int_t nDigits = 0;
+ Int_t digCount = 0;
UInt_t availableSize = size;
AliHLTUInt8_t* outBPtr;
AliHLTCaloDigitDataStruct *digitDataPtr = 0;
- AliHLTCaloRecPointHeaderStruct* recPointHeaderPtr = reinterpret_cast<AliHLTCaloRecPointHeaderStruct*>(outBPtr);
-
- fClusterizerPtr->SetRecPointDataPtr(reinterpret_cast<AliHLTCaloRecPointDataStruct*>(outBPtr+sizeof(AliHLTCaloRecPointHeaderStruct)));
-
// Adding together all the digits, should be put in standalone method
for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
iter = blocks+ndx;
- if (iter->fDataType == AliHLTCaloDefinitions::fgkDigitDataType)
+ // HLTError("Got block");
+ if (iter->fDataType == (AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginPHOS))
{
// Get the digit header
// Update the number of digits
- nDigits += iter->fSize/sizeof(AliHLTCaloDigitDataStruct);;
- // Get the specification
+ nDigits = iter->fSize/sizeof(AliHLTCaloDigitDataStruct);;
+ // HLTError("Got %d digits", nDigits);
+
specification = specification|iter->fSpecification;
digitDataPtr = reinterpret_cast<AliHLTCaloDigitDataStruct*>(iter->fPtr);
for (Int_t i = 0; i < nDigits; i++)
{
- fAllDigitsPtr->fDigitDataStruct[j].fX = digitDataPtr->fX;
- fAllDigitsPtr->fDigitDataStruct[j].fZ = digitDataPtr->fZ;
- fAllDigitsPtr->fDigitDataStruct[j].fEnergy = digitDataPtr->fEnergy;
- // HLTDebug("Digit energy: %f", digitDataPtr->fEnergy);
- fAllDigitsPtr->fDigitDataStruct[j].fTime = digitDataPtr->fTime;
- fAllDigitsPtr->fDigitDataStruct[j].fCrazyness = digitDataPtr->fCrazyness;
- j++;
+ fDigitsPointerArray[digCount] = digitDataPtr;
+ digCount++;
digitDataPtr++;
}
}
}
-
- fAllDigitsPtr->fNDigits = j;
- nRecPoints = fClusterizerPtr->ClusterizeEvent(size, mysize);
- if(nRecPoints == -1)
+ if(digCount > 0)
{
- HLTError("Running out of buffer, exiting for safety.");
- return -ENOBUFS;
- }
+
+ // Sort the digit pointers
+ qsort(fDigitsPointerArray, digCount, sizeof(AliHLTCaloDigitDataStruct*), CompareDigits);
- recPointHeaderPtr->fNRecPoints = nRecPoints;
- mysize += sizeof(AliHLTCaloRecPointHeaderStruct);
+ // Copy the digits to the output
+ for(Int_t n = 0; n < digCount; n++)
+ {
+ memcpy(outBPtr, fDigitsPointerArray[n], sizeof(AliHLTCaloDigitDataStruct));
+ outBPtr = outBPtr + sizeof(AliHLTCaloDigitDataStruct);
+ }
+
+ mysize += digCount*sizeof(AliHLTCaloDigitDataStruct);
+
+ AliHLTComponentBlockData bdDigits;
+ FillBlockData( bdDigits );
+ bdDigits.fOffset = offset;
+ bdDigits.fSize = mysize;
+ bdDigits.fDataType = iter->fDataType;
+ bdDigits.fSpecification = specification;
+ outputBlocks.push_back( bdDigits );
- HLTDebug("Number of clusters: %d", nRecPoints);
-
- AliHLTComponentBlockData bd;
- FillBlockData( bd );
- bd.fOffset = offset;
- bd.fSize = mysize;
- bd.fDataType = AliHLTPHOSDefinitions::fgkClusterDataType;
- bd.fSpecification = specification;
- outputBlocks.push_back( bd );
-
+
+ AliHLTCaloRecPointHeaderStruct* recPointHeaderPtr = reinterpret_cast<AliHLTCaloRecPointHeaderStruct*>(outBPtr);
+
+ fClusterizerPtr->SetRecPointDataPtr(reinterpret_cast<AliHLTCaloRecPointDataStruct*>(outBPtr+sizeof(AliHLTCaloRecPointHeaderStruct)));
+
+ // HLTError("Total number of digits: %d", digCount );
+
+ printf("Total number of digits: %d\n", digCount);
+
+ nRecPoints = fClusterizerPtr->ClusterizeEvent(digCount, size, mysize);
+
+ if(nRecPoints == -1)
+ {
+ // HLTError("Running out of buffer, exiting for safety.");
+ return -ENOBUFS;
+ }
+
+ recPointHeaderPtr->fNRecPoints = nRecPoints;
+ mysize += sizeof(AliHLTCaloRecPointHeaderStruct);
+
+ // HLTError("Number of clusters: %d", nRecPoints);
+
+ AliHLTComponentBlockData bd;
+ FillBlockData( bd );
+ bd.fOffset = offset;
+ bd.fSize = mysize;
+ bd.fDataType = AliHLTCaloDefinitions::fgkClusterDataType;
+ bd.fSpecification = specification;
+ outputBlocks.push_back( bd );
+ }
+
size = mysize;
return 0;
{
//See headerfile for documentation
- fAllDigitsPtr = new AliHLTCaloDigitContainerDataStruct();
- fClusterizerPtr = new AliHLTCaloClusterizer();
- fClusterizerPtr->SetDigitContainer(fAllDigitsPtr);
- fNoCrazyness = false;
+
//
// const char *path = "HLT/ConfigPHOS/ClusterizerComponent";
return 0;
}
-AliHLTComponent*
-AliHLTCaloClusterizerComponent::Spawn()
+Int_t
+AliHLTCaloClusterizerComponent::CompareDigits(const void *dig0, const void *dig1)
{
- //See headerfile for documentation
-
- return new AliHLTCaloClusterizerComponent();
+ // See header file for documentation
+ return (*((AliHLTCaloDigitDataStruct**)(dig0)))->fID - (*((AliHLTCaloDigitDataStruct**)(dig1)))->fID;
}
* provided "as is" without express or implied warranty. *
**************************************************************************/
-#ifndef ALIHLTPHOSCLUSTERIZERCOMPONENT_H
-#define ALIHLTPHOSCLUSTERIZERCOMPONENT_H
+#ifndef ALIHLTCALOCLUSTERIZERCOMPONENT_H
+#define ALIHLTCALOCLUSTERIZERCOMPONENT_H
// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-#include "AliHLTPHOSProcessor.h"
+#include "AliHLTCaloConstantsHandler.h"
+#include "AliHLTCaloProcessor.h"
+
class AliHLTCaloDigitDataStruct;
-class AliHLTCaloDigitContainerStruct;
+class AliHLTCaloDigitContainerDataStruct;
class AliHLTCaloClusterizer;
class AliHLTCaloRecPointDataStruct;
* @ingroup alihlt_phos
*/
-class AliHLTCaloClusterizerComponent: public AliHLTPHOSProcessor
+//class AliHLTCaloClusterizerComponent : public AliHLTCaloConstantsHandler, public AliHLTCaloProcessor
+class AliHLTCaloClusterizerComponent : public AliHLTCaloProcessor, public AliHLTCaloConstantsHandler
{
public:
/** Constructor */
- AliHLTCaloClusterizerComponent();
+ AliHLTCaloClusterizerComponent(TString det);
/** Destructor */
virtual ~AliHLTCaloClusterizerComponent();
- /** Copy constructor */
- AliHLTCaloClusterizerComponent ( const AliHLTCaloClusterizerComponent & ) :
- AliHLTPHOSProcessor(),
- fAllDigitsPtr ( 0 ),
- fClusterizerPtr ( 0 ),
- // fRecPointStructArrayPtr(0),
- fDigitCount ( 0 )
- {
- //Copy constructor not implemented
- }
-
- /** Assignment */
- AliHLTCaloClusterizerComponent & operator = ( const AliHLTCaloClusterizerComponent )
- {
- //Assignment
- return *this;
- }
-
- /** interface function, see @ref AliHLTComponent for description */
- void GetInputDataTypes ( std::vector<AliHLTComponentDataType>& list ) = 0;
-
- /** interface function, see @ref AliHLTComponent for description */
- AliHLTComponentDataType GetOutputDataType();
+// /** Copy constructor */
+// AliHLTCaloClusterizerComponent ( const AliHLTCaloClusterizerComponent & ) :
+// AliHLTPHOSProcessor(),
+// fAllDigitsPtr ( 0 ),
+// fClusterizerPtr ( 0 ),
+// // fRecPointStructArrayPtr(0),
+// fDigitCount ( 0 )
+// {
+// //Copy constructor not implemented
+// }
+
+// /** Assignment */
+// AliHLTCaloClusterizerComponent & operator = ( const AliHLTCaloClusterizerComponent )
+// {
+// //Assignment
+// return *this;
+// }
+
+// /** interface function, see @ref AliHLTComponent for description */
+// void GetInputDataTypes ( std::vector<AliHLTComponentDataType>& list );
+
+// /** interface function, see @ref AliHLTComponent for description */
+// AliHLTComponentDataType GetOutputDataType();
+
+// /** interface function, see @ref AliHLTComponent for description */
+// void GetOutputDataSize ( unsigned long& constBase, double& inputMultiplier );
/** interface function, see @ref AliHLTComponent for description */
- void GetOutputDataSize ( unsigned long& constBase, double& inputMultiplier );
- /** interface function, see @ref AliHLTComponent for description */
+ using AliHLTCaloProcessor::DoEvent;
- using AliHLTPHOSProcessor::DoEvent;
int DoEvent ( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
std::vector<AliHLTComponentBlockData>& outputBlocks );
+
+ /**
+ * Compare two digits, used during the sorting
+ */
+ static Int_t CompareDigits(const void *dig0, const void *dig);
protected:
- /** interface function, see @ref AliHLTComponent for description */
+ /** interface function, see @ref AliHLTComponent for
+ description */
int DoInit ( int argc, const char** argv );
/** interface function, see @ref AliHLTComponent for description */
/** interface function, see @ref AliHLTComponent for description */
int ScanConfigurationArgument ( int argc, const char** argv );
- /** The data type we want */
- AliHLTComponentDataType fDataType; //COMMENT
-
private:
- /** Pointer to our digits */
- AliHLTCaloDigitContainerStruct *fAllDigitsPtr; //! transient
+ /** Array of pointers to our digits */
+ AliHLTCaloDigitDataStruct **fDigitsPointerArray; //! transient
/** Pointer to the clusterizer it self */
AliHLTCaloClusterizer* fClusterizerPtr; //! transient
/** Number of digits in event */
Int_t fDigitCount; //COMMENT
+ /** Default constructor, not implemented */
+ AliHLTCaloClusterizerComponent(); //COMMENT
+
};
#endif
UInt_t fCaloModule; //COMMENT
/** Array of digits in container */
- AliHLTCaloDigitDataStruct fDigitDataStruct[NXCOLUMNSRCU*NZROWSRCU*NGAINS]; //COMMENT
+ AliHLTCaloDigitDataStruct fDigitDataStruct[10000];
};
*/
struct AliHLTCaloDigitDataStruct
{
+
+ /** Unique ID (in the module) for this digit */
+ UInt_t fID;
+
/** The x coordinate */
UShort_t fX;
/** The z coordinate */
UShort_t fZ;
- /** x position in local coordinates*/
- Float_t fLocX;
-
- /** z position in local coordinates*/
- Float_t fLocZ;
-
/** The module number */
Int_t fModule;
//See header file for documentation\r
\r
Reset();\r
- \r
+\r
Int_t j = 0;\r
UInt_t totSize = sizeof(AliHLTCaloDigitDataStruct);\r
\r
if(UseDigit(coord, currentchannel))\r
{\r
AddDigit(currentchannel, coord);\r
- j++; \r
- totSize += sizeof(AliHLTCaloDigitDataStruct);\r
+ // j++; \r
+ totSize += sizeof(AliHLTCaloDigitDataStruct);\r
}\r
currentchannel = fShmPtr->NextChannel(); // Get the next channel\r
}\r
// }\r
// }\r
\r
- fDigitCount += j;\r
+// fDigitCount += j;\r
return fDigitCount; \r
}\r
\r
void AliHLTCaloDigitMaker::AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord)\r
{\r
\r
+ AliHLTCaloDigitDataStruct *tmpDigit = fDigitStructPtr + 1;\r
+\r
+ if(fChannelBook[coord.fX][coord.fZ])\r
+ {\r
+ tmpDigit = fDigitStructPtr;\r
+ fDigitStructPtr = fChannelBook[coord.fX][coord.fZ];\r
+ fDigitCount--;\r
+ // printf("Going to overwrite digit: x = %d, z = %d, gain = %d, energy = %f\n", fDigitStructPtr->fX, fDigitStructPtr->fZ, fDigitStructPtr->fGain, fDigitStructPtr->fEnergy);\r
+ }\r
+ \r
fChannelBook[coord.fX][coord.fZ] = fDigitStructPtr;\r
\r
+ fDigitStructPtr->fID = fDigitStructPtr->fZ * fCaloConstants->GetNXCOLUMNSMOD() + fDigitStructPtr->fX;\r
+\r
fDigitStructPtr->fX = coord.fX;\r
fDigitStructPtr->fZ = coord.fZ;\r
+ fDigitStructPtr->fGain = coord.fGain;\r
fDigitStructPtr->fOverflow = false;\r
if(coord.fGain == fCaloConstants->GetHIGHGAIN() )\r
{\r
{\r
fDigitStructPtr->fOverflow = true;\r
}\r
- // printf("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy);\r
+ // printf("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy);\r
}\r
else\r
{\r
{\r
fDigitStructPtr->fOverflow = true;\r
}\r
- // printf("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy); \r
+ // printf("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy); \r
}\r
fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //TODO\r
fDigitStructPtr->fCrazyness = channelData->fCrazyness;\r
fDigitStructPtr->fModule = coord.fModuleId;\r
- fDigitStructPtr++;\r
+ fDigitStructPtr = tmpDigit;\r
+ // fDigitStructPtr++;\r
+ fDigitCount++;\r
}\r
\r
bool AliHLTCaloDigitMaker::UseDigit(AliHLTCaloCoordinate &channelCoordinates, AliHLTCaloChannelDataStruct *channel) \r
// printf("UseDigit: Already have digit with, x: %d, z: %d, with high gain \n", channelCoordinates.fX, channelCoordinates.fZ);\r
if(tmpDigit->fOverflow)\r
{\r
- // printf("But it was in overflow! Let's use this low gain!");\r
+ // printf("But it was in overflow! Let's use this low gain!\n");\r
return true;\r
}\r
return false;\r
channelCoord[1] = (channelId >> 6)&0x3f;
channelCoord[2] = (channelId >> 12)&0x1;
channelCoord[3] = (channelId >> 13)&0x1f;
- printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
+ // printf("Channel ID: 0x%X Coordinates: x = %d, z = %d, gain = %d\n", channelId, channelCoord[0], channelCoord[1], channelCoord[2]);
}
void
channelDataPtr->fEnergy = static_cast<Float_t>(fAnalyzerPtr->GetEnergy()) - fOffset;
AliHLTCaloCoordinate c;
fMapperPtr->ChannelId2Coordinate(chId, c);
- // HLTError("Got channel, x: %d, z: %d, gain: %d, energy: %f", c.fX, c.fZ, c.fGain, channelDataPtr->fEnergy);
+ HLTDebug("Got channel, x: %d, z: %d, gain: %d, energy: %f", c.fX, c.fZ, c.fGain, channelDataPtr->fEnergy);
channelDataPtr->fTime = static_cast<Float_t>(fAnalyzerPtr->GetTiming());
channelDataPtr->fCrazyness = static_cast<Short_t>(crazyness);
channelCount++;
// channelDataHeaderPtr->fHasRawData = false;
channelDataHeaderPtr->fHasRawData = fDoPushRawData;
- HLTError("Number of channels: %d", channelCount);
+ HLTDebug("Number of channels: %d", channelCount);
tmpsize += sizeof(AliHLTCaloChannelDataStruct)*channelCount + sizeof(AliHLTCaloChannelDataHeaderStruct);
return tmpsize;
/** Distance to nearest bad channel */
Float_t fDistanceToBadChannel; //COMMENT
- /** Digits in the rec point */
- AliHLTCaloDigitDataStruct fDigits; //COMMENT
+ /** Index of the digits in the rec point */
+ Int_t fDigits; //COMMENT
};
fEmcTimeGate(0),
fDigitsInCluster(0),
fDigitContainerPtr(0),
- fMaxDigitIndexDiff(2*NZROWSMOD),
+ fMaxDigitIndexDiff(2*56),
fAvailableSize(0),
fDigitReader(0)
{
/** Set emc time gate */
void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
-
+
/** Starts clusterization of the event */
virtual Int_t ClusterizeEvent(AliHLTPHOSDigitHeaderStruct *digitHeader, UInt_t availableSize, UInt_t& totSize);
#include <iostream>
#include "AliHLTPHOSClusterizerComponent.h"
-#include "AliHLTPHOSClusterizer.h"
-#include "AliHLTPHOSRecPointDataStruct.h"
-#include "AliHLTPHOSRecPointHeaderStruct.h"
-#include "AliHLTPHOSDigitDataStruct.h"
-#include "AliHLTPHOSDigitContainerDataStruct.h"
+#include "AliHLTCaloRecPointDataStruct.h"
+#include "AliHLTCaloRecPointHeaderStruct.h"
+
AliHLTPHOSClusterizerComponent gAliHLTPHOSClusterizerComponent;
AliHLTPHOSClusterizerComponent::AliHLTPHOSClusterizerComponent():
- AliHLTCaloClusterizerComponent()
+ AliHLTCaloClusterizerComponent("PHOS")
{
//See headerfile for documentation
- fDataType = AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginPHOS;
}
AliHLTPHOSClusterizerComponent::~AliHLTPHOSClusterizerComponent()
{
//See headerfile for documentation
+}
+
+void
+AliHLTPHOSClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+ //See headerfile for documentation
+ list.clear();
+ list.push_back(AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginPHOS);
+}
+AliHLTComponentDataType
+AliHLTPHOSClusterizerComponent::GetOutputDataType()
+{
+ //See headerfile for documentation
+ return AliHLTCaloDefinitions::fgkRecPointDataType|kAliHLTDataOriginPHOS;
+}
+
+void
+AliHLTPHOSClusterizerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
+
+{
+ //See headerfile for documentation
+ constBase = sizeof(AliHLTCaloRecPointHeaderStruct) + sizeof(AliHLTCaloRecPointDataStruct) + (sizeof(AliHLTCaloDigitDataStruct) << 7); //Reasonable estimate... ;
+ inputMultiplier = 2.0;
}
return new AliHLTPHOSClusterizerComponent();
}
+
+
// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-#include "AliHLTPHOSProcessor.h"
-#include <AliHLTCaloClusterizerComponent.h>
+#include "AliHLTCaloClusterizerComponent.h"
-class AliHLTPHOSClusterizer;
-class AliHLTPHOSRcuCellEnergyDataStruct;
-class AliHLTPHOSRecPointDataStruct;
-class AliHLTPHOSRecPointContainerStruct;
-class AliHLTPHOSRecPointListDataStruct;
-class AliHLTPHOSDigitContainerDataStruct;
+#include <vector>
+
+// class AliHLTPHOSClusterizer;
+// class AliHLTPHOSRcuCellEnergyDataStruct;
+// class AliHLTPHOSRecPointDataStruct;
+// class AliHLTPHOSRecPointContainerStruct;
+// class AliHLTPHOSRecPointListDataStruct;
+// class AliHLTPHOSDigitContainerDataStruct;
/**
* @class AliHLTPHOSClusterizerComponent
* @ingroup alihlt_phos
*/
-class AliHLTPHOSClusterizerComponent: public AliHLTCaloClusterizerComponent
+class AliHLTPHOSClusterizerComponent : public AliHLTCaloClusterizerComponent
+//class AliHLTPHOSClusterizerComponent : public AliHLTPHOSProcessor
{
+
public:
/** Constructor */
/** Destructor */
virtual ~AliHLTPHOSClusterizerComponent();
- /** Copy constructor */
- AliHLTPHOSClusterizerComponent(const AliHLTPHOSClusterizerComponent &) :
- AliHLTCaloClusterizerComponent()
- {
- //Copy constructor not implemented
- }
-
- /** Assignment */
- AliHLTPHOSClusterizerComponent & operator = (const AliHLTPHOSClusterizerComponent)
- {
- //Assignment
- return *this;
- }
-
/** interface function, see @ref AliHLTComponent for description */
const char* GetComponentID();
/** interface function, see @ref AliHLTComponent for description */
void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponentDataType GetOutputDataType();
+
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetOutputDataSize ( unsigned long& constBase, double& inputMultiplier );
+
/** interface function, see @ref AliHLTComponent for description */
AliHLTComponent* Spawn();
+
+protected:
+ virtual int DoDeinit(){;}
+
+private:
+
+ /** Copy constructor, not implemented */
+ AliHLTPHOSClusterizerComponent(const AliHLTPHOSClusterizerComponent &);
+ /** Assignment operator, not implemented */
+ AliHLTPHOSClusterizerComponent & operator = (const AliHLTPHOSClusterizerComponent);
+
};
UInt_t fPHOSModule; //COMMENT
/** Array of digits in container */
- AliHLTPHOSDigitDataStruct fDigitDataStruct[NXCOLUMNSRCU*NZROWSRCU*NGAINS]; //COMMENT
+ AliHLTPHOSDigitDataStruct fDigitDataStruct[1000]; //COMMENT
};
#include "AliHLTPHOSProcessor.h"
+
class AliHLTCaloDigitMaker;
class AliHLTCaloDigitContainerDataStruct;
{
// AliCDBManager::Instance()->SetDefaultStorage("raw://");
// AliCDBManager::Instance()->SetDefaultStorage("raw://");
-
+ AliCDBManager::Instance()->SetRun(10);
if(!gSystem->AccessPathName("galice.root")){
cerr << "please delete the galice.root or run at different place." << endl;
//
int moduleStart = 2;
int moduleEnd = 2;
- int rcuStart = 1;
- int rcuEnd = 1;
+ int rcuStart = 0;
+ int rcuEnd = 3;
// TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so libAliHLTGlobal.so loglevel=0x7f chains=ESD-FILE";
//TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so libAliHLTGlobal.so loglevel=0x7f chains=PHS-CA_02";
- TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTCalo.so libAliHLTPHOS.so libAliHLTGlobal.so loglevel=0x7f chains=PHS-DM_02_1";
+ TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTCalo.so libAliHLTPHOS.so libAliHLTGlobal.so loglevel=0x7f chains=PHS-CL_02";
TString ecInput;
TString emInput;
}
TString arg, cl, ca;
-// cl.Form("PHS-CL_%02d", module);
-// arg = "";
-// arg.Form("-digitthreshold 0.005 -recpointthreshold 0.1 -modulemode");
-// AliHLTConfiguration clConf(cl.Data(), "PhosClusterizer", clInput.Data(), arg.Data());
+ cl.Form("PHS-CL_%02d", module);
+ arg = "";
+ arg.Form("-digitthreshold 0.005 -recpointthreshold 0.1 -modulemode");
+ AliHLTConfiguration clConf(cl.Data(), "PhosClusterizer", clInput.Data(), arg.Data());
//
// ca.Form("PHS-CA_%02d", module);
// arg = "";