#include "AliITSClusterFinderSDD.h"
+#include "AliITSMapA2.h"
+#include "AliITSMapA1.h"
+#include "AliITS.h"
#include "AliRun.h"
fDigits=digits;
fClusters=recp;
fNclusters= fClusters->GetEntriesFast();
- printf("SDD: fNclusters %d\n",fNclusters);
SetCutAmplitude();
SetDAnode();
SetDTime();
- SetMap();
SetMinPeak();
SetNCells();
+ SetMap();
}
//_____________________________________________________________________________
fDigits=0;
fClusters=0;
fNclusters=0;
+ fMap=0;
+ fMapA2=0;
SetCutAmplitude();
SetDAnode();
SetDTime();
- SetMap();
SetMinPeak();
SetNCells();
}
+//_____________________________________________________________________________
+AliITSClusterFinderSDD::~AliITSClusterFinderSDD()
+{
+ // destructor
+
+ if(fMap) delete fMap;
+ if(fMapA2) delete fMapA2;
+
+}
//__________________________________________________________________________
AliITSClusterFinderSDD::AliITSClusterFinderSDD(const AliITSClusterFinderSDD &source){
// Copy Constructor
this->fClusters = source.fClusters ;
this->fNclusters = source.fNclusters ;
this->fMap = source.fMap ;
+ this->fMapA2 = source.fMapA2 ;
this->fCutAmplitude = source.fCutAmplitude ;
this->fDAnode = source.fDAnode ;
this->fDTime = source.fDTime ;
this->fClusters = source.fClusters ;
this->fNclusters = source.fNclusters ;
this->fMap = source.fMap ;
+ this->fMapA2 = source.fMapA2 ;
this->fCutAmplitude = source.fCutAmplitude ;
this->fDAnode = source.fDAnode ;
this->fDTime = source.fDTime ;
void AliITSClusterFinderSDD::SetMap()
{
// set map
- if(!fMap) fMap=new AliITSMapA2(fSegmentation);
-
-}
-//_____________________________________________________________________________
-void AliITSClusterFinderSDD::FillMap()
-{
- // fCoord1 = anode #
- // fCoord2 = time sample
-
- if (!fDigits) return;
-
- Int_t ndigits = fDigits->GetEntriesFast();
- //printf("FillMap: ndigits %d\n",ndigits);
- if (!ndigits) return;
-
- AliITSdigitSDD *dig;
- Int_t ndig;
- for(ndig=0; ndig<ndigits; ndig++) {
- dig = (AliITSdigitSDD*)fDigits->UncheckedAt(ndig);
- Double_t signal=dig->fSignal;
- //printf("FillMap: ndig fCoord1 fCoord2 signal %d %d %d %f\n",ndig,dig->fCoord1,dig->fCoord2,signal);
- fMap->SetHit(dig->fCoord1,dig->fCoord2,signal);
- }
-
+ if(!fMapA2) fMapA2=new AliITSMapA2(fSegmentation,fDigits,(double)fCutAmplitude);
+ if(!fMap) fMap=new AliITSMapA1(fSegmentation,fDigits);
}
//_____________________________________________________________________________
AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
// retrieve the parameters
- Int_t i;
Int_t fNofMaps = fSegmentation->Npz();
Int_t fMaxNofSamples = fSegmentation->Npx();
Int_t fNofAnodes = fNofMaps/2;
Float_t anodePitch = fSegmentation->Dpz(dummy);
// map the signal
- FillMap();
+ fMapA2->FillMap();
// Piergiorgio's code - do not subtract baseline since we start
// from digits and do not duplicate arrays, i.e. use fMap instead
Int_t nofFoundClusters = 0;
-
+ Int_t i;
Float_t **dfadc = new Float_t*[fNofMaps];
for(i=0;i<fNofMaps;i++) dfadc[i] = new Float_t[fMaxNofSamples];
-
-
Float_t fadc, fadc1, fadc2;
Int_t j,k,idx,l,m;
for(j=0;j<2;j++) {
idx = j*fNofAnodes+k;
// signal (fadc) & derivative (dfadc)
for(l=0; l<fMaxNofSamples; l++) {
- fadc2=(Float_t)fMap->GetSignal(idx,l);
- fadc1=(Float_t)fMap->GetSignal(idx,l-1);
+ fadc2=(Float_t)fMapA2->GetSignal(idx,l);
+ fadc1=(Float_t)fMapA2->GetSignal(idx,l-1);
if(l>0) dfadc[k][l-1] = fadc2-fadc1;
} // samples
} // anodes
for(m=0;m<10;m++) {
Int_t id = it+m;
if(id>=fMaxNofSamples) break;
- fadc=fMap->GetSignal(idx,id);
+ fadc=fMapA2->GetSignal(idx,id);
if(fadc > fadcmax) {
fadcmax = fadc;
- if(fadc > fCutAmplitude) { lthra++; lthrt++; }
+ if(fadc > 0) { lthra++; lthrt++; }
imax = id;
}
if(dfadc[k][id] > dfadcmax) {
}
it = imaxd;
// skip if no signal over threshold
- if(fMap->GetSignal(idx,imax) < fCutAmplitude) {it++; continue;}
+ if(fMapA2->TestHit(idx,imax) == kEmpty) {it++; continue;}
if(k>0) {
- if(fMap->GetSignal(idx-1,imax) > fCutAmplitude) lthra++;
+ if(fMapA2->TestHit(idx-1,imax) != kEmpty) lthra++;
}
if(k<fNofAnodes-1)
- if(fMap->GetSignal(idx+1,imax) > fCutAmplitude) lthra++;
+ if(fMapA2->TestHit(idx+1,imax) != kEmpty) lthra++;
if(imax>0) {
- if(fMap->GetSignal(idx,imax-1) > fCutAmplitude) lthrt++;
+ if(fMapA2->TestHit(idx,imax-1) != kEmpty) lthrt++;
}
if(imax<fMaxNofSamples)
- if(fMap->GetSignal(idx,imax+1) > fCutAmplitude) lthrt++;
+ if(fMapA2->TestHit(idx,imax+1) != kEmpty) lthrt++;
// cluster charge
Int_t tstart = it-1;
Float_t clusterMult = 0.;
Float_t clusterPeakAmplitude = 0.;
Int_t its;
+ Float_t n, baseline;
+ fResponse->GetNoiseParam(n,baseline);
for(its=tstart; its<=tstop; its++) {
- fadc=fMap->GetSignal(idx,its);
+ fadc=fMapA2->GetSignal(idx,its)-baseline;
clusterCharge += fadc;
if(fadc > clusterPeakAmplitude) clusterPeakAmplitude = fadc;
clusterTime += fadc*its;
} // anodes
} // detectors (2)
- Int_t nofClusters = fClusters->GetEntriesFast();
- nofClusters -= fNclusters;
-
- //printf("SDD- Find1Dclust: fNclusters nofClusters %d %d \n",fNclusters, nofClusters);
- fMap->ClearMap();
+ fMapA2->ClearMap();
for(i=0;i<fNofMaps;i++) delete[] dfadc[i];
delete [] dfadc;
- delete dfadc;
return;
Int_t nofClusters = fClusters->GetEntriesFast();
nofClusters -= fNclusters;
- //printf("SDD- GroupClusters: fNclusters nofClusters %d %d \n",fNclusters, nofClusters);
-
AliITSRawClusterSDD *clusterI;
AliITSRawClusterSDD *clusterJ;
if(clusterI->T() < fTimeStep*10) fDAnode = 1.2;
Bool_t pair = clusterI->Brother(clusterJ,fDAnode,fDTime);
if(!pair) continue;
- // clusterI->Print();
- // clusterJ->Print();
+ // clusterI->PrintInfo();
+ // clusterJ->PrintInfo();
clusterI->Add(clusterJ);
label[j] = 1;
fClusters->RemoveAt(j);
fClusters->Compress();
delete [] label;
- delete label;
return;
}
Int_t nofClusters = fClusters->GetEntriesFast();
nofClusters -= fNclusters;
- //printf("SDD- SelectClusters: fNclusters nofClusters %d %d \n",fNclusters, nofClusters);
-
Int_t i;
for(i=0; i<nofClusters; i++) {
AliITSRawClusterSDD *clusterI = (AliITSRawClusterSDD*) fClusters->At(i);
void AliITSClusterFinderSDD::GetRecPoints()
{
// get rec points
- //static Int_t counter=0;
AliITS *iTS=(AliITS*)gAlice->GetModule("ITS");
Int_t nofClusters = fClusters->GetEntriesFast();
nofClusters -= fNclusters;
- //printf("SDD- GetRecPoints: fNclusters nofClusters %d %d \n",fNclusters, nofClusters);
-
-// const Float_t kdEdXtoQ = 2.778e+2; // KeV -> number of e-hole pairs in Si
const Float_t kconvGeV = 1.e-6; // GeV -> KeV
const Float_t kconv = 1.0e-4;
const Float_t kRMSx = 38.0*kconv; // microns->cm ITS TDR Table 1.3
const Float_t kRMSz = 28.0*kconv; // microns->cm ITS TDR Table 1.3
- Int_t i;
+ fMap->FillMap();
+
+ Int_t i, ix, iz;
for(i=0; i<nofClusters; i++) {
AliITSRawClusterSDD *clusterI = (AliITSRawClusterSDD*) fClusters->At(i);
+ fSegmentation->GetPadIxz(clusterI->X(),clusterI->Z(),ix,iz);
+ AliITSdigitSDD *dig = (AliITSdigitSDD*)fMap->GetHit(iz-1,ix-1);
AliITSRecPoint rnew;
rnew.SetX(clusterI->X());
rnew.SetZ(clusterI->Z());
rnew.SetQ(clusterI->Q()); // in KeV - should be ADC
- //rnew.SetdEdX((clusterI->Q())/kdEdXtoQ);
rnew.SetdEdX(kconvGeV*clusterI->Q());
rnew.SetSigmaX2(kRMSx*kRMSx);
rnew.SetSigmaZ2(kRMSz*kRMSz);
- rnew.SetProbability(1.);
+ rnew.fTracks[0]=dig->fTracks[0];
+ rnew.fTracks[1]=dig->fTracks[1];
+ rnew.fTracks[2]=dig->fTracks[2];
iTS->AddRecPoint(rnew);
- //counter++;
} // I clusters
- //printf("counter %d\n",counter);
+ fMap->ClearMap();
}
//_____________________________________________________________________________