* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//
-// Cluster finder
-// for Silicon pixels
-//
-//
+////////////////////////////////////////////////////////////////////////////
+// Cluster finder ///
+// for Silicon pixels //
+// //
+////////////////////////////////////////////////////////////////////////////
+
#include "AliITSClusterFinderSPD.h"
-#include "AliITS.h"
-#include "AliITSdigitSPD.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSRawClusterSPD.h"
#include "AliITSRecPoint.h"
-#include "AliITSresponseSPD.h"
+#include "AliITSdigitSPD.h"
#include "AliITSsegmentationSPD.h"
-#include "AliRun.h"
+#include "AliLog.h"
//#define DEBUG
// constructor
}
//----------------------------------------------------------
-AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg,
- AliITSresponse *res):
-AliITSClusterFinder(seg,res),
+AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSDetTypeRec* dettyp):
+AliITSClusterFinder(dettyp),
fDz(0.0),
fDx(0.0),
fMinNCells(0){
SetDz();
}
//----------------------------------------------------------
-AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg,
+AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSDetTypeRec* dettyp,
TClonesArray *digits,
TClonesArray *recp):
-AliITSClusterFinder(seg,0),
+AliITSClusterFinder(dettyp,digits),
fDz(0.0),
fDx(0.0),
fMinNCells(0){
SetDx();
SetDz();
}
-//_____________________________________________________________________
-AliITSClusterFinderSPD::AliITSClusterFinderSPD(
- const AliITSClusterFinderSPD &source): AliITSClusterFinder(source){
- // Copy Constructor
- if(&source == this) return;
- this->fDz = source.fDz;
- this->fDx = source.fDx;
- this->fMinNCells = source.fMinNCells;
- return;
-}
//______________________________________________________________________
-AliITSClusterFinderSPD& AliITSClusterFinderSPD::operator=(
- const AliITSClusterFinderSPD &source) {
- // Assignment operator
+AliITSClusterFinderSPD::AliITSClusterFinderSPD(const AliITSClusterFinderSPD &source) : AliITSClusterFinder(source) {
+ // Copy constructor
+ // Copies are not allowed. The method is protected to avoid misuse.
+ Fatal("AliITSClusterFinderSPD","Copy constructor not allowed\n");
+}
- if(&source == this) return *this;
- this->fDz = source.fDz;
- this->fDx = source.fDx;
- this->fMinNCells = source.fMinNCells;
- return *this;
+//______________________________________________________________________
+AliITSClusterFinderSPD& AliITSClusterFinderSPD::operator=(const AliITSClusterFinderSPD& /* source */){
+ // Assignment operator
+ // Assignment is not allowed. The method is protected to avoid misuse.
+ Fatal("= operator","Assignment operator not allowed\n");
+ return *this;
}
//______________________________________________________________________
void AliITSClusterFinderSPD::FindRawClusters(Int_t module){
AliITSdigitSPD *dig;
Int_t ndig=0,i;
/*
- if(GetDebug(4)){
- cout << "SPD - FindRawclusters"<<endl;
+ AliDebug(4," ");
scanf("%d",&ndig);
- } // end if GetDebug
*/
for(ndig=0; ndig<ndigits; ndig++) {
dig= (AliITSdigitSPD*)GetDigit(ndig);
digtr1[digitcount] = dig->GetTrack(0);
digtr2[digitcount] = -3;
digtr3[digitcount] = -3;
- if(GetDebug(5)){
- cout << "digtr1["<<digitcount <<"]="<<digtr1[digitcount];
- cout << " fTracks["<<0<<"]="<<dig->GetTrack(0)<<": ";
- } // end if GetDebug
+ AliDebug(5,Form("digtr1[%d]=%d fTracks[%d]=%d: ",
+ digitcount,digtr1[digitcount],0,dig->GetTrack(0)));
i=1;
while(digtr1[digitcount]==dig->GetTrack(i) && i<dig->GetNTracks()) i++;
- if(GetDebug(5)) cout << " fTracks["<<i<<"]="<<dig->GetTrack(i);
+ AliDebug(5,Form(" fTracks[%d]=%d",i,dig->GetTrack(i)));
if(i<dig->GetNTracks()){
digtr2[digitcount] = dig->GetTrack(i);
- if(GetDebug(5)) cout<<"digtr2["<<digitcount <<"]="
- <<digtr2[digitcount]<<": ";
+ AliDebug(5,Form("digtr2[%d]=%d: ",digitcount,digtr2[digitcount]));
while((digtr1[digitcount]==dig->GetTrack(i) ||
digtr2[digitcount]==dig->GetTrack(i))&&
i<=dig->GetNTracks()) i++;
if(i<dig->GetNTracks()) digtr3[digitcount] = dig->GetTrack(i);
- if(GetDebug(5)){
- cout << " fTracks["<<i<<"]=";
- if(i<dig->GetNTracks()) cout <<dig->GetTrack(i);
- cout << "digtr3["<<digitcount <<"]="<<digtr3[digitcount];
- } // end if GetDebug
+ AliDebug(5,Form(" fTracks[%d]=%d digtr3[%d]=%d",
+ i,i<dig->GetNTracks()?dig->GetTrack(i):-1,digitcount,digtr3[digitcount]));
} // end if
- if(GetDebug(4)) cout<<endl;
+ // if(GetDebug(4)) cout<<endl;
digtr4[digitcount] = dig->GetSignal();
digitcount++;
} // end for ndig
} // end if iclus[i]
// store the cluster information to the AliITSRawCLusterSPD object
- static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
+
//put the cluster center in local reference frame of the detector
// and in microns
(Double_t) ndzmin,
(Double_t) ndzmax,
0,GetModule());
- iTS->AddCluster(0,clust);
+ fDetTypeRec->AddCluster(0,clust);
delete clust;
}//end loop on clusters
delete[] ifpad;
Double_t l[3],xg,zg;
const Double_t kconv = 1.0e-4; // micron -> cm
+ Int_t lay,lad,det;
+ fDetTypeRec->GetITSgeom()->GetModuleId(fModule,lay,lad,det);
+ Int_t ind=(lad-1)*fDetTypeRec->GetITSgeom()->GetNdetectors(lay)+(det-1);
+ Int_t lyr=(lay-1);
// get rec points
- static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
for (Int_t i=0; i<nclus; i++){
l[0] = kconv*xcenter[i];
l[1] = kconv*GetSeg()->Dy()/2.;
Double_t sigma2x = (kconv*errxcenter[i]) * (kconv*errxcenter[i]);
Double_t sigma2z = (kconv*errzcenter[i]) * (kconv*errzcenter[i]);
- AliITSRecPoint rnew;
- rnew.SetX(xg);
- rnew.SetZ(zg);
+ AliITSRecPoint rnew(fDetTypeRec->GetITSgeom());
+ rnew.SetXZ(fModule,xg,zg);
rnew.SetQ(1.);
rnew.SetdEdX(0.);
- rnew.SetSigmaX2(sigma2x);
+ rnew.SetSigmaDetLocX2(sigma2x);
rnew.SetSigmaZ2(sigma2z);
- rnew.fTracks[0]=tr1clus[i];
- rnew.fTracks[1]=tr2clus[i];
- rnew.fTracks[2]=tr3clus[i];
- iTS->AddRecPoint(rnew);
+ rnew.SetLabel(tr1clus[i],0);
+ rnew.SetLabel(tr2clus[i],1);
+ rnew.SetLabel(tr3clus[i],2);
+ rnew.SetDetectorIndex(ind);
+ rnew.SetLayer(lyr);
+ fDetTypeRec->AddRecPoint(rnew);
} // end for i
}