void AliITSClusterFinderSPD::SetMap()
{
// set map
+
if(!fMap) fMap=new AliITSMapA1(fSegmentation,fDigits);
-
+
}
//_____________________________________________________________________________
// read in digits -> do not apply threshold
// signal in fired pixels is always 1
+
fMap->FillMap();
Int_t nofFoundClusters = 0;
label[i] = 1;
} // I clusters
fClusters->Compress();
- //Int_t totalNofClusters = fClusters->GetEntriesFast();
- //cout << " Nomber of clusters at the group end ="<< totalNofClusters<<endl;
+ // Int_t totalNofClusters = fClusters->GetEntriesFast();
+ // cout << " Nomber of clusters at the group end ="<< totalNofClusters<<endl;
delete [] label;
}
//_____________________________________________________________________________
+void AliITSClusterFinderSPD::TracksInCluster()
+{
+
+ // Find tracks creating one cluster
+
+ // get number of clusters for this module
+ Int_t nofClusters = fClusters->GetEntriesFast();
+ nofClusters -= fNclusters;
+
+ Int_t i, ix, iz, jx, jz, xstart, xstop, zstart, zstop, nclx, nclz;
+ // Int_t signal, track0, track1, track2;
+ Int_t trmax = 100;
+ Int_t cltracks[trmax], itr, tracki, ii, is, js, ie, ntr, tr0, tr1, tr2;
+
+ for(i=0; i<nofClusters; i++) {
+ ii = 0;
+ memset(cltracks,-1,sizeof(int)*trmax);
+ tr0=tr1=tr2=-1;
+
+ AliITSRawClusterSPD *clusterI = (AliITSRawClusterSPD*) fClusters->At(i);
+
+ nclx = clusterI->NclX();
+ nclz = clusterI->NclZ();
+ xstart = clusterI->XStartf();
+ xstop = clusterI->XStopf();
+ zstart = clusterI->Zend()-nclz+1;
+ zstop = clusterI->Zend();
+
+ Int_t ind;
+
+ for(iz=0; iz<nclz; iz++) {
+ jz = zstart + iz;
+ for(ix=0; ix<nclx; ix++) {
+ jx = xstart + ix;
+ ind = fMap->GetHitIndex(jz,jx);
+ if(ind == 0 && iz >= 0 && ix > 0) {
+ continue;
+ }
+ if(ind == 0 && iz > 0 && ix >= 0) {
+ continue;
+ }
+ if(ind == 0 && iz == 0 && ix == 0 && i > 0) {
+ continue;
+ }
+
+ AliITSdigitSPD *dig = (AliITSdigitSPD*)fMap->GetHit(jz,jx);
+ /*
+ signal=dig->fSignal;
+ track0=dig->fTracks[0];
+ track1=dig->fTracks[1];
+ track2=dig->fTracks[2];
+ */
+ for(itr=0; itr<3; itr++) {
+ tracki = dig->fTracks[itr];
+ if(tracki >= 0) {
+ ii += 1;
+ cltracks[ii-1] = tracki;
+ }
+ }
+ } // ix pixel
+ } // iz pixel
+
+ for(is=0; is<trmax; is++) {
+ if(cltracks[is]<0) continue;
+ for(js=is+1; js<trmax; js++) {
+ if(cltracks[js]<0) continue;
+ if(cltracks[js]==cltracks[is]) cltracks[js]=-5;
+ }
+ }
+
+ ntr = 0;
+ for(ie=0; ie<trmax; ie++) {
+ if(cltracks[ie] >= 0) {
+ ntr=ntr+1;
+ if(ntr==1) tr0=cltracks[ie];
+ if(ntr==2) tr1=cltracks[ie];
+ if(ntr==3) tr2=cltracks[ie];
+ }
+ }
+ // if delta ray only
+ if(ntr == 0) ntr = 1;
+
+ clusterI->SetNTracks(ntr);
+ clusterI->SetTracks(tr0,tr1,tr2);
+
+ } // I cluster
+
+}
+//_____________________________________________________________________________
+
void AliITSClusterFinderSPD::GetRecPoints()
{
// get rec points
// get number of clusters for this module
Int_t nofClusters = fClusters->GetEntriesFast();
nofClusters -= fNclusters;
-
-
const Float_t kconv = 1.0e-4;
const Float_t kRMSx = 12.0*kconv; // microns -> cm ITS TDR Table 1.3
const Float_t kRMSz = 70.0*kconv; // microns -> cm ITS TDR Table 1.3
Float_t spdLength = fSegmentation->Dz();
Float_t spdWidth = fSegmentation->Dx();
- Int_t i, ix, iz;
+ Int_t i;
+ Int_t track0, track1, track2;
+
for(i=0; i<nofClusters; i++) {
+
AliITSRawClusterSPD *clusterI = (AliITSRawClusterSPD*) fClusters->At(i);
- fSegmentation->GetPadIxz(clusterI->X(),clusterI->Z(),ix,iz);
- AliITSdigitSPD *dig = (AliITSdigitSPD*)fMap->GetHit(iz-1,ix-1);
+ clusterI->GetTracks(track0, track1, track2);
AliITSRecPoint rnew;
+
rnew.SetX((clusterI->X() - spdWidth/2)*kconv);
rnew.SetZ((clusterI->Z() - spdLength/2)*kconv);
rnew.SetQ(1.);
rnew.SetdEdX(0.);
rnew.SetSigmaX2(kRMSx*kRMSx);
rnew.SetSigmaZ2(kRMSz*kRMSz);
- rnew.fTracks[0]=dig->fTracks[0];
- rnew.fTracks[1]=dig->fTracks[1];
- rnew.fTracks[2]=dig->fTracks[2];
+ rnew.fTracks[0]=track0;
+ rnew.fTracks[1]=track1;
+ rnew.fTracks[2]=track2;
iTS->AddRecPoint(rnew);
} // I clusters
// find raw clusters
Find1DClusters();
GroupClusters();
+ TracksInCluster();
GetRecPoints();
}
// constructor
fX=fZ=fQ;
fZStart=fZStop;
- fNClZ=fNClX=fXStart=fXStop=fXStartf=fXStopf=fZend;
+ fNClZ=fNClX=fXStart=fXStop=fXStartf=fXStopf=fZend=fNTracks;
}
- AliITSRawClusterSPD(Float_t clz,Float_t clx,Float_t Charge,
- Int_t ClusterSizeZ,Int_t ClusterSizeX,Int_t xstart,Int_t xstop,
- Int_t xstartf,Int_t xstopf,Float_t zstart,Float_t zstop,Int_t zend);
+ AliITSRawClusterSPD(Float_t clz,Float_t clx,Float_t Charge,Int_t ClusterSizeZ,Int_t ClusterSizeX,Int_t xstart,Int_t xstop,Int_t xstartf,Int_t xstopf,Float_t zstart,Float_t zstop,Int_t zend);
virtual ~AliITSRawClusterSPD() {
// destructor
}
// X
return fX ;
}
- Float_t NclZ() const {
+ // Float_t NclZ() const {
+ Int_t NclZ() const {
// NclZ
return fNClZ ;
}
- Float_t NclX() const {
+ // Float_t NclX() const {
+ Int_t NclX() const {
// NclX
return fNClX ;
}
//Zend
return fZend;
}
+ Int_t NTracks() const {
+ //NTracks
+ return fNTracks;
+ }
+
+ void GetTracks(Int_t &track0,Int_t &track1,Int_t &track2) const {
+ // returns tracks created a cluster
+
+ track0=fTracks[0];
+ track1=fTracks[1];
+ track2=fTracks[2];
+ return;
+ };
+
+ void SetTracks(Int_t track0, Int_t track1, Int_t track2) {
+ // set tracks in cluster (not more than three ones)
+ fTracks[0]=track0;
+ fTracks[1]=track1;
+ fTracks[2]=track2;
+ }
+ void SetNTracks(Int_t ntracks) {
+ // set ntracks
+ fNTracks=ntracks;
+ }
protected:
Float_t fZStart; // number of first pixel in cluster
Float_t fZStop; // number of last pixel in cluster
Int_t fZend; // Zend
+ Int_t fNTracks; // number of tracks created a cluster
+ Int_t fTracks[3]; // tracks created a cluster
ClassDef(AliITSRawClusterSPD,1) // AliITSRawCluster class for SPD
TObjArray *fHits = mod->GetHits();
Int_t nhits = fHits->GetEntriesFast();
if (!nhits) return;
-
-
+ // cout << "module, nhits ="<<module<<","<<nhits<< endl;
// Array of pointers to the label-signal list
// Fill detector maps with GEANT hits
// loop over hits in the module
- static Bool_t first=kTRUE;
+ static Bool_t first;
Int_t lasttrack=-2;
Int_t hit, iZi, jz, jx;
for (hit=0;hit<nhits;hit++) {
AliITShit *iHit = (AliITShit*) fHits->At(hit);
Int_t layer = iHit->GetLayer();
-
// work with the idtrack=entry number in the TreeH
Int_t idhit,idtrack;
mod->GetHitTrackAndHitIndex(hit,idtrack,idhit);
// or store straight away the particle position in the array
// of particles :
Int_t itrack = iHit->GetTrack();
+ Int_t dray = 0;
+ if (lasttrack != itrack || hit==(nhits-1)) first = kTRUE;
+
+ // Int_t parent = iHit->GetParticle()->GetFirstMother();
+ Int_t partcode = iHit->GetParticle()->GetPdgCode();
+
+// partcode (pdgCode): 11 - e-, 13 - mu-, 22 - gamma, 111 - pi0, 211 - pi+
+// 310 - K0s, 321 - K+, 2112 - n, 2212 - p, 3122 - lambda
+
+ Float_t px = iHit->GetPXL();
+ Float_t py = iHit->GetPYL();
+ Float_t pz = iHit->GetPZL();
+ Float_t pmod = 1000*sqrt(px*px+py*py+pz*pz);
+
+
+ if(partcode == 11 && pmod < 6) dray = 1; // delta ray is e-
+ // at p < 6 MeV/c
+
+
// Get hit z and x(r*phi) cordinates for each module (detector)
// in local system.
zPix0 = zPix;
xPix0 = xPix;
}
- yPrev = yPix; //ch
+ yPrev = yPix;
- if (lasttrack != itrack || hit==(nhits-1)) {
+ if(dray == 0) {
GetList(itrack,idhit,pList,indexRange);
- first=kTRUE;
}
lasttrack=itrack;
for(Int_t ix=indexRange[2];ix<indexRange[3]+1;ix++){
Float_t signal=fMapA2->GetSignal(iz,ix);
+
if (!signal) continue;
Int_t globalIndex = iz*fNPixelsX+ix; // GlobalIndex starts from 0!
if(!pList[globalIndex]){
-
+
//
// Create new list (9 elements - 3 signals and 3 tracks + 3 hits)
//
}
charges[j1] = 0;
}
+
+ if(tracks[0] == tracks[1] && tracks[0] == tracks[2]) {
+ tracks[1] = -3;
+ hits[1] = -1;
+ tracks[2] = -3;
+ hits[2] = -1;
+ }
+ if(tracks[0] == tracks[1] && tracks[0] != tracks[2]) {
+ tracks[1] = -3;
+ hits[1] = -1;
+ }
+ if(tracks[0] == tracks[2] && tracks[0] != tracks[1]) {
+ tracks[2] = -3;
+ hits[2] = -1;
+ }
+ if(tracks[1] == tracks[2] && tracks[0] != tracks[1]) {
+ tracks[2] = -3;
+ hits[2] = -1;
+ }
+
phys=0;
aliITS->AddSimDigit(0,phys,digits,tracks,hits,charges);
}