}//main ctor
//__________________________________________________________________________________________________
-void AliRICHClusterFinder::FindLocalMaxima(AliRICHcluster *pRawCluster)
+void AliRICHClusterFinder::FindLocalMaxima(AliRICHcluster &rawCluster)
{// Split the cluster according to the number of maxima inside
Info("SplitbyLocalMaxima","Start.");
Int_t Nlocal = 0;
Int_t localX[100],localY[100];
- for(Int_t iDig1=0;iDig1<pRawCluster->Size();iDig1++) {
+ for(Int_t iDig1=0;iDig1<rawCluster.Size();iDig1++) {
Int_t iNotMax = 0;
- AliRICHdigit *pDig1 = (AliRICHdigit *)pRawCluster->Digits()->At(iDig1);
+ AliRICHdigit *pDig1 = (AliRICHdigit *)rawCluster.Digits()->At(iDig1);
Int_t padX1 = pDig1->X();
Int_t padY1 = pDig1->Y();
Double_t padQ1 = pDig1->Q();
- for(Int_t iDig2=0;iDig2<pRawCluster->Size();iDig2++) {
- AliRICHdigit *pDig2 = (AliRICHdigit *)pRawCluster->Digits()->At(iDig2);
+ for(Int_t iDig2=0;iDig2<rawCluster.Size();iDig2++) {
+ AliRICHdigit *pDig2 = (AliRICHdigit *)rawCluster.Digits()->At(iDig2);
Int_t padX2 = pDig2->X();
Int_t padY2 = pDig2->Y();
Double_t padQ2 = pDig2->Q();
Info("FindRawClusters","Start for Chamber %i with %i digits.",iChamber,nDigits);
if(nDigits==0)return;
- fHitMap=new AliRICHMap(Rich()->Digits(iChamber));
+ fHitMap=new AliRICHMap(Rich()->Digits(iChamber));//create digit map for the given chamber
- AliRICHcluster *pRawCluster;
-
for(Int_t iDig=0;iDig<nDigits;iDig++){
AliRICHdigit *dig=(AliRICHdigit*)Rich()->Digits(iChamber)->At(iDig);
Int_t i=dig->X(); Int_t j=dig->Y();
if(fHitMap->TestHit(i,j)==kUsed) continue;
- pRawCluster = new AliRICHcluster;
- FormRawCluster(i,j,pRawCluster);
+ AliRICHcluster rawCluster;
+ FormRawCluster(i,j,rawCluster);
if(AliRICHParam::IsResolveClusters()) {
- ResolveCluster(pRawCluster); // ResolveCluster serialization will happen inside
+ ResolveCluster(rawCluster); // ResolveCluster serialization will happen inside
} else {
- WriteRawCluster(pRawCluster); // simply output of the RawCluster found without deconvolution
+ WriteRawCluster(rawCluster); // simply output of the RawCluster found without deconvolution
}
- delete pRawCluster;
}//digits loop
}//FindRawClusters()
//__________________________________________________________________________________________________
-void AliRICHClusterFinder::FormRawCluster(Int_t i, Int_t j, AliRICHcluster *pCluster)
+void AliRICHClusterFinder::FormRawCluster(Int_t i, Int_t j, AliRICHcluster &rawCluster)
{// Builder of the final Raw Cluster (before deconvolution)
Info("FormRawCluster","Start with digit(%i,%i)",i,j);
-// Int_t idx = fHitMap->GetHitIndex(i,j);
- AliRICHdigit* pDigit = (AliRICHdigit*) fHitMap->GetHit(i,j);
- pCluster->AddDigit(pDigit);
-
+ rawCluster.AddDigit((AliRICHdigit*) fHitMap->GetHit(i,j));
fHitMap->FlagHit(i,j);// Flag hit as taken
Int_t listX[4], listY[4]; // Now look recursively for all neighbours
for (Int_t iNeighbour=0;iNeighbour<Rich()->Param()->PadNeighbours(i,j,listX,listY);iNeighbour++)
if(fHitMap->TestHit(listX[iNeighbour],listY[iNeighbour])==kUnused)
- FormRawCluster(listX[iNeighbour],listY[iNeighbour],pCluster);
+ FormRawCluster(listX[iNeighbour],listY[iNeighbour],rawCluster);
}//AddDigit2Cluster()
//__________________________________________________________________________________________________
-void AliRICHClusterFinder::ResolveCluster(AliRICHcluster *pRawCluster)
+void AliRICHClusterFinder::ResolveCluster(AliRICHcluster &rawCluster)
{// Decluster algorithm
Info("ResolveCluster","Start.");
- pRawCluster->SetStatus(kRaw);// just dummy to compile...
+ rawCluster.SetStatus(kRaw);// just dummy to compile...
}//ResolveCluster()
//__________________________________________________________________________________________________
-void AliRICHClusterFinder::WriteRawCluster(AliRICHcluster *pRawCluster)
+void AliRICHClusterFinder::WriteRawCluster(AliRICHcluster &rawCluster)
{// out the current RawCluster
- Info("ResolveCluster","Start.");
+ Info("WriteRawCluster","Start.");
- pRawCluster->SetStatus(kRaw);
+ rawCluster.CoG();
+ Rich()->AddCluster(rawCluster);
}//WriteRawCluster()
//__________________________________________________________________________________________________
class AliRICH;
class AliHitMap;
class AliRICHcluster;
+
class AliRICHClusterFinder : public TTask
{
-public:
-
- AliRICHClusterFinder(AliRICH *pRICH);
+public:
+ AliRICHClusterFinder(AliRICH *pRICH);
virtual ~AliRICHClusterFinder() {;}
- void Exec(); //Loop on events and chambers
- void FindRawClusters(Int_t iChamber); //Find initial clusters
- void FindLocalMaxima(AliRICHcluster *pCluster); //Find local maxima in a cluster
- void ResolveCluster(AliRICHcluster *pCluster); //Try to resolve a cluster with maxima > 2
- void FormRawCluster(Int_t i, Int_t j, AliRICHcluster *pCluster); //form a raw cluster
- void CoG(); //Evaluate the CoG as the best
- void WriteRawCluster(AliRICHcluster *pRawCluster); //write in the list of the raw clusters
- AliRICH *Rich() {return fRICH;}
-
- protected:
-
- AliRICH *fRICH;
- AliHitMap *fHitMap; //Hit Map with digit positions
-
- ClassDef(AliRICHClusterFinder,0) //Class for clustering and reconstruction of space points
+ AliRICH *Rich() {return fRICH;} //Pointer to RICH
+ void Exec(); //Loop on events and chambers
+ void FindRawClusters(Int_t iChamber); //Find raw clusters
+ void FormRawCluster(Int_t i, Int_t j, AliRICHcluster &cluster); //form a raw cluster
+ void FindLocalMaxima(AliRICHcluster &cluster); //Find local maxima in a cluster
+ void ResolveCluster(AliRICHcluster &cluster); //Try to resolve a cluster with maxima > 2
+ void CoG(); //Evaluate the CoG as the best
+ void WriteRawCluster(AliRICHcluster &cluster); //write in the list of the raw clusters
+protected:
+ AliRICH *fRICH; //Pointer to RICH
+ AliHitMap *fHitMap; //Hit Map with digit positions
+ ClassDef(AliRICHClusterFinder,0) //Finds raw clusters, trasfers them to resolved clusters through declustering.
};
#endif