{
//See header file for documentation
- printf("Header with %d clusters and %d digits\n", clusterHeaderPtr->fNClusters, clusterHeaderPtr->fNDigits);
fMaxCnt = clusterHeaderPtr->fNClusters;
fCurrentClusterPtr = reinterpret_cast<AliHLTCaloClusterDataStruct*>((UChar_t*)(clusterHeaderPtr) + sizeof(AliHLTCaloClusterHeaderStruct) + sizeof(AliHLTCaloDigitDataStruct)*clusterHeaderPtr->fNDigits);
- printf("First cluster energy: %f\n", fCurrentClusterPtr->fEnergy);
fIsSetMemory = true;
}
// esdCluster.SetCellsAbsId(idArrayPtr);
// esdCluster.SetCellsAmplitudeFraction(ampFracArrayPtr);
- printf("Cluster energy: %f\n", esdCluster.E());
-
esdPtr->AddCaloCluster(&esdCluster);
nClusters++;
}
fClusterType(AliESDCaloCluster::kPHOSCluster)
{
//See header file for documentation
- fHist = new TH1F("cluster_energies", "cluster_energies", 200, 0, 20);
-
}
AliHLTCaloClusterAnalyser::~AliHLTCaloClusterAnalyser()
{
- TFile *file = TFile::Open("debug.root", "RECREATE");
- fHist->Write();
- file->Close();
+ // See header file for class documentation
}
void
Float_t zi = 0.;
AliHLTCaloDigitDataStruct *digit = 0;
- //AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance() ;
-
-
- //AliHLTCaloClusterizer cl("PHOS");
- //cl.CheckDigits(fRecPointArray, fDigitDataArray, fNRecPoints);
UInt_t iDigit = 0;
{
AliHLTCaloRecPointDataStruct *recPoint = fRecPointArray[iRecPoint];
// digit = &(recPoint->fDigits);
- cout << "COG: Rec point multiplicity: " << recPoint->fMultiplicity << ", rec point energy: " << recPoint->fAmp << endl;
+
Int_t *digitIndexPtr = &(recPoint->fDigits);
for(iDigit = 0; iDigit < recPoint->fMultiplicity; iDigit++)
{
- //cout << "1. Digit array: " << fDigitDataArray << ", Digit: " << digit << ", Index: " << *digitIndexPtr << ", ID: " << digit->fID << endl;
digit = &(fDigitDataArray[*digitIndexPtr]);
- cout << "COG: 2. Digit array: " << fDigitDataArray << ", Digit: " << digit << ", Index: " << *digitIndexPtr << ", index pointer: " << digitIndexPtr<< endl;
- cout << ", dig Energy: " << digit->fEnergy << ", Index: " << *digitIndexPtr << ", ID: " << digit->fID << endl;
+
xi = digit->fX;
zi = digit->fZ;
- // cout << "COG digits (x:z:E:time): " << xi << " : " << zi << " : " << digit->fEnergy << " : " << digit->fTime << endl;
+
if (recPoint->fAmp > 0 && digit->fEnergy > 0)
{
Float_t w = TMath::Max( 0., fLogWeight + TMath::Log( digit->fEnergy / recPoint->fAmp ) ) ;
}
digitIndexPtr++;
}
- //cout << endl;
+
if (wtot>0)
{
recPoint->fX = x/wtot ;
UShort_t* cellIDPtr = 0;
Float_t* cellAmpFracPtr = 0;;
- Int_t id = -1;
+// Int_t id = -1;
TVector3 globalPos;
for(Int_t i = 0; i < fNRecPoints; i++) //TODO needs fix when we start unfolding (number of clusters not necessarily same as number of recpoints gotten from the clusterizer
cellAmpFracPtr = &(caloClusterPtr->fCellsAmpFraction);
AliHLTCaloRecPointDataStruct *recPointPtr = fRecPointArray[i];
- cout << "CA: rec point energy: " << recPointPtr->fAmp << ", rec point multiplicity: " << recPointPtr->fMultiplicity << endl;
- // cout << "Local Position (x:z:module): " << recPointPtr->fX << " : "<< recPointPtr->fZ << " : " << recPointPtr->fModule << endl;
AliHLTCaloGlobalCoordinate globalCoord;
fGeometry->GetGlobalCoordinates(*recPointPtr, globalCoord);
- // cout << "Global Position (x:y:z): " << globalPos[0] << " : "<< globalPos[1] << " : " << globalPos[2] << endl << endl;
caloClusterPtr->fGlobalPos[0] = globalCoord.fX;
caloClusterPtr->fGlobalPos[1] = globalCoord.fY;
caloClusterPtr->fEnergy = recPointPtr->fAmp;
- fHist->Fill(caloClusterPtr->fEnergy);
-
- cout << "CA: cluster energy: " << caloClusterPtr->fEnergy << endl;
- cout << "CA: recpoint energy: " << recPointPtr->fAmp << endl;
-
-
if(fDoClusterFit)
{
FitCluster(recPointPtr);
recPointPtr = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(digitPtr);
//digitPtr = &(recPointPtr->fDigits);
}
- // cout << "CA: Energy End: " << fCaloClusterDataPtr->fEnergy << endl;
- //cout << "CA totSize: " << totSize << endl;
- return fNRecPoints;
+
+return fNRecPoints;
}
/** The cluster type */
Char_t fClusterType; //COMMENT
-
- TH1F *fHist;
-
+
+ /** Copy constructor not implemented */
+ AliHLTCaloClusterAnalyser ( const AliHLTCaloClusterAnalyser &); // not implemented
+
+ /** Assignment */
+AliHLTCaloClusterAnalyser & operator = ( const AliHLTCaloClusterAnalyser &); // not implemented
+
};
#endif
fAvailableSize = sizeof(AliHLTCaloRecPointDataStruct) * 20;\r
fRecPointDataPtr = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(new UChar_t[fAvailableSize]);\r
fFirstRecPointPtr = fRecPointDataPtr; \r
- printf("Start of rec point data: %x, end of rec point data: %x\n", fRecPointDataPtr, reinterpret_cast<UChar_t*>(fRecPointDataPtr) + fAvailableSize);\r
\r
}//end\r
\r
for(Int_t i = 0; i < nDigits; i++)\r
{ \r
fDigitsInCluster = 0;\r
- // printf("ENERGY: %f\n", fDigitsPointerArray[i]->fEnergy);\r
+\r
if(fDigitsPointerArray[i]->fEnergy < fEmcClusteringThreshold)\r
{\r
continue;\r
}\r
CheckArray();\r
CheckBuffer();\r
- // printf("` candidate!\n");\r
+\r
// First digit is placed at the fDigits member variable in the recpoint\r
fDigitIndexPtr = &(fRecPointDataPtr->fDigits);\r
fUsedSize += sizeof(AliHLTCaloRecPointDataStruct);\r
\r
// Assigning the digit to this rec point\r
fRecPointDataPtr->fDigits = i;\r
- printf("Clusterizier: adding digit: index pointer: %x, index: %d\n", fDigitIndexPtr, *fDigitIndexPtr);\r
fUsedSize += sizeof(AliHLTCaloRecPointDataStruct);\r
\r
// Incrementing the pointer to be ready for new entry\r
//fUsedSize += sizeof(AliHLTCaloRecPointDataStruct) + (fDigitsInCluster-1)*sizeof(AliHLTCaloDigitDataStruct); \r
\r
fRecPointDataPtr->fMultiplicity = fDigitsInCluster; \r
- printf("Rec point energy: %f\n", fRecPointDataPtr->fAmp);\r
- printf("Multiplicity: %d\n", fDigitsInCluster);\r
fRecPointArray[fNRecPoints] = fRecPointDataPtr; \r
\r
fRecPointDataPtr = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(fDigitIndexPtr);\r
// } \r
CheckBuffer();\r
// Assigning index to digit\r
- printf("Digit index pointer: %x\n", fDigitIndexPtr);\r
*fDigitIndexPtr = j;\r
fUsedSize += sizeof(Int_t);\r
\r
- printf("Clusterizier: adding digit: index pointer: %x, index: %d\n", fDigitIndexPtr, *fDigitIndexPtr); \r
// Incrementing digit pointer to be ready for new entry\r
fDigitIndexPtr++;\r
\r
\r
Int_t AliHLTCaloClusterizer::CheckArray()\r
{\r
- printf("CheckArray: fArraySize: %d, fNRecPoints: %d\n", fArraySize, fNRecPoints);\r
if(fArraySize == fNRecPoints)\r
{\r
- printf("Expanding array...");\r
fArraySize *= 2;\r
AliHLTCaloRecPointDataStruct **tmp = new AliHLTCaloRecPointDataStruct*[fArraySize];\r
memcpy(tmp, fRecPointArray, fArraySize/2 * sizeof(AliHLTCaloRecPointDataStruct*));\r
Int_t AliHLTCaloClusterizer::CheckBuffer()\r
{\r
// See header file for class documentation \r
- printf("CheckBuffer: Used size %d, fAvailableSize: %d\n", fUsedSize, fAvailableSize);\r
- if((fAvailableSize - fUsedSize) < sizeof(AliHLTCaloRecPointDataStruct) )\r
+ if((fAvailableSize - fUsedSize) < sizeof(AliHLTCaloRecPointDataStruct))\r
{\r
- printf("Expanding buffer...\n");\r
Int_t recPointOffset = reinterpret_cast<UChar_t*>(fRecPointDataPtr) - reinterpret_cast<UChar_t*>(fFirstRecPointPtr);\r
fAvailableSize *= 2;\r
UChar_t *tmp = new UChar_t[fAvailableSize];\r
{\r
nRecPoints = fNRecPoints;\r
}\r
- printf("CL: CheckDigits: Number of rec points: %d\n", nRecPoints);\r
for(Int_t i = 0; i < nRecPoints; i++)\r
{\r
\r
//AliHLTCaloRecPointDataStruct *recPoint = fRecPointArray[0];\r
Int_t multiplicity = recPoint->fMultiplicity;\r
Int_t *digitIndexPtr = &(recPoint->fDigits);\r
- printf("CL: Rec point with energy: %f, multiplicity: %d\n", recPoint->fAmp, recPoint->fMultiplicity);\r
for(Int_t j = 0; j < multiplicity; j++)\r
{\r
//AliHLTCaloRecPointDataStruct *recPoint = fRecPointArray[j];\r
- AliHLTCaloDigitDataStruct *digit = digits[*digitIndexPtr];\r
- printf("CL: Digit ID: %d, energy: %f, index: %d, indexpointer: %x\n", digit->fID, digit->fEnergy, *digitIndexPtr, digitIndexPtr);\r
+// AliHLTCaloDigitDataStruct *digit = digits[*digitIndexPtr];\r
digitIndexPtr++;\r
//recPoint = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(digitIndexPtr);\r
}\r
}\r
\r
- \r
- \r
- \r
- \r
- \r
- \r
+ return 0;\r
}\r
\r
Int_t AliHLTCaloClusterizer::CheckDigits(AliHLTCaloRecPointDataStruct** recArray, AliHLTCaloDigitDataStruct* digitArray, Int_t nRP)\r
{\r
nRecPoints = fNRecPoints;\r
}\r
- printf("CL: CheckDigits: Number of rec points: %d\n", nRecPoints);\r
for(Int_t i = 0; i < nRecPoints; i++)\r
{\r
\r
//AliHLTCaloRecPointDataStruct *recPoint = fRecPointArray[0];\r
Int_t multiplicity = recPoint->fMultiplicity;\r
Int_t *digitIndexPtr = &(recPoint->fDigits);\r
- printf("CL: Rec point with energy: %f, multiplicity: %d\n", recPoint->fAmp, recPoint->fMultiplicity);\r
for(Int_t j = 0; j < multiplicity; j++)\r
{\r
//AliHLTCaloRecPointDataStruct *recPoint = fRecPointArray[j];\r
AliHLTCaloDigitDataStruct digit = digits[*digitIndexPtr];\r
- printf("CL: digits: %x, recpoints: %x, digitIndexPtr: %x\n", digits, recpoints, digitIndexPtr);\r
- printf("CL: Digit ID: %d, energy: %f, index: %d, indexpointer: %x\n", digit.fID, digit.fEnergy, *digitIndexPtr, digitIndexPtr);\r
digitIndexPtr++;\r
//recPoint = reinterpret_cast<AliHLTCaloRecPointDataStruct*>(digitIndexPtr);\r
}\r
}\r
- \r
- \r
- \r
- \r
- \r
- \r
+ return 0;\r
\r
}
\ No newline at end of file
private:\r
\r
/** Default constructor, prohibited */\r
- //AliHLTCaloClusterizer(); // COMMENT\r
+ AliHLTCaloClusterizer(); // COMMENT\r
\r
/** Copy constructor, prohibited */\r
- //AliHLTCaloClusterizer (const AliHLTCaloClusterizer &); //COMMENT\r
+ AliHLTCaloClusterizer (const AliHLTCaloClusterizer &); //COMMENT\r
\r
/** Assignment operator, prohibited */\r
- //AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer &); //COMMENT\r
+ AliHLTCaloClusterizer & operator = (const AliHLTCaloClusterizer &); //COMMENT\r
\r
ClassDef(AliHLTCaloClusterizer, 0);\r
\r
AliHLTCaloClusterizerComponent::AliHLTCaloClusterizerComponent(TString det):
AliHLTCaloProcessor(),
AliHLTCaloConstantsHandler(det),
+ fDataOrigin('\0'),
+ fAnalyserPtr(0),
fDigitsPointerArray(0),
+ fOutputDigitsArray(0),
fClusterizerPtr(0),
- fAnalyserPtr(0),
fDigitCount(0)
{
//See headerfile for documentation
return 0;
}
-// 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,
AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
AliHLTCaloDigitDataStruct *digitDataPtr = 0;
-// delete fAnalyserPtr;
-// fAnalyserPtr = new AliHLTCaloClusterAnalyser();
-//
// Adding together all the digits, should be put in standalone method
for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
if (iter->fDataType == (AliHLTCaloDefinitions::fgkDigitDataType|fDataOrigin))
{
-// fDigitsPointerArray[digCount] = reinterpret_cast<AliHLTCaloDigitDataStruct*>(iter->fPtr);
-
- //cout << "Digits pointer array [" << digCount << "]: " << fDigitsPointerArray[digCount] << endl;
// Update the number of digits
nDigits = iter->fSize/sizeof(AliHLTCaloDigitDataStruct);;
-// digCount += nDigits;
- // HLTError("Got %d digits", nDigits);
availableSize -= iter->fSize;
memcpy(outBPtr, fDigitsPointerArray[n], sizeof(AliHLTCaloDigitDataStruct));
//fOutputDigitsArray[n] = reinterpret_cast<AliHLTCaloDigitDataStruct*>(outBPtr);
outBPtr = outBPtr + sizeof(AliHLTCaloDigitDataStruct);
- printf("CL: digit energy: %f, ID: %d\n", fOutputDigitsArray[n].fEnergy, fOutputDigitsArray[n].fID);
}
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("Total number of digits: %d", digCount );
nRecPoints = fClusterizerPtr->ClusterizeEvent(digCount);
- //fClusterizerPtr->CheckDigits();
+
//HLTDebug("Number of rec points found: %d", nRecPoints);
fAnalyserPtr->SetCaloClusterData(reinterpret_cast<AliHLTCaloClusterDataStruct*>(outBPtr));
- //fClusterizerPtr->CheckDigits(fClusterizerPtr->GetRecPoints(), fOutputDigitsArray, nRecPoints);
-
fAnalyserPtr->SetRecPointArray(fClusterizerPtr->GetRecPoints(), nRecPoints);
- //fClusterizerPtr->CheckDigits(fClusterizerPtr->GetRecPoints(), fOutputDigitsArray, nRecPoints);
-
fAnalyserPtr->SetDigitDataArray(fOutputDigitsArray);
-// fClusterizerPtr->CheckDigits(fClusterizerPtr->GetRecPoints(), fOutputDigitsArray, nRecPoints);
-
Int_t nClusters = fAnalyserPtr->CreateClusters(nRecPoints, size, mysize);
caloClusterHeaderPtr->fNClusters = nClusters;
- // HLTError("Number of clusters: %d", nRecPoints);
-
-
+ //HLTDebug("Number of clusters: %d", nRecPoints);
AliHLTComponentBlockData bd;
FillBlockData( bd );
AliHLTCaloGeometry::~AliHLTCaloGeometry()
{
-
+ //see header file for class documentation
}
-//void AliHLTCaloGeometry:: GetGlobalCoordinates(AliHLTCaloCoordinate &channelCoord, AliHLTCaloGlobalCoordinate &globalCoord )
-//{
- //Virtual base class
-//}
-
{
public:
- AliHLTCaloGeometry (TString det);
+
+ /** Constructor */
+ AliHLTCaloGeometry (TString det); //COMMENT
- virtual ~AliHLTCaloGeometry();
+ /** Destructor */
+ virtual ~AliHLTCaloGeometry(); //COMMENT
- virtual void GetGlobalCoordinates(AliHLTCaloRecPointDataStruct &recPoint, AliHLTCaloGlobalCoordinate &globalCoord ) = 0;
+ /**
+ * Get the global coordinates for a rec point.
+ * Pure virtual - must be implemented by child classes
+ * @param recPoint is the rec point containing the local coordinates
+ * @param globalCoord is a AliHLTCaloGlobalCoordinate to write to
+ */
+ virtual void GetGlobalCoordinates(AliHLTCaloRecPointDataStruct &recPoint, AliHLTCaloGlobalCoordinate &globalCoord ) = 0; //COMMENT
/**
* Get the absolute ID from the relative position in the module
* @param z is the z position in the module
* @param AbsId is a the absolute id variable
*/
- virtual void GetCellAbsId(UInt_t module, UInt_t x, UInt_t z, Int_t& AbsId) const = 0;
+ virtual void GetCellAbsId(UInt_t module, UInt_t x, UInt_t z, Int_t& AbsId) const = 0; //COMMENT
private:
-
- AliHLTCaloGeometry();
+ /** Default constructor, not implemented */
+ AliHLTCaloGeometry(); //COMMENT
};
fDataOrigin = const_cast<char*>(kAliHLTDataOriginPHOS);
- AliHLTPHOSGeometry *geom = new AliHLTPHOSGeometry;
+ //AliHLTPHOSGeometry *geom = new AliHLTPHOSGeometry;
fAnalyserPtr->SetGeometry(new AliHLTPHOSGeometry);
-/*
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
AliHLTPHOSGeometry::AliHLTPHOSGeometry() :
AliHLTCaloGeometry("PHOS")
{
-
+ // See header file for class documentation
}
AliHLTPHOSGeometry::~AliHLTPHOSGeometry()
{
-
+// See header file for class documentation
}
-void AliHLTPHOSGeometry::GetGlobalCoordinates ( AliHLTCaloRecPointDataStruct& recPoint, AliHLTCaloGlobalCoordinate& globalCoord )
+void AliHLTPHOSGeometry::GetGlobalCoordinates ( AliHLTCaloRecPointDataStruct& /*recPoint*/, AliHLTCaloGlobalCoordinate& globalCoord )
{
+ // See header file for class documentation
globalCoord.fX = 0;
globalCoord.fZ = 0;
globalCoord.fY = 0;
}
-
-/*
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
virtual void GetGlobalCoordinates ( AliHLTCaloRecPointDataStruct& recPoint, AliHLTCaloGlobalCoordinate& globalCoord ); //COMMENT
/** See base class for class documentation */
- virtual void GetCellAbsId(UInt_t module, UInt_t x, UInt_t z, Int_t& AbsId) const { AbsId = 0; }
-
-
-
-
+ virtual void GetCellAbsId(UInt_t /*module*/, UInt_t /*x*/, UInt_t /*z*/, Int_t& AbsId) const { AbsId = 0; }
+
};
#endif // ALIHLTPHOSGEOMETRY_H