X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ITS%2FAliITSClusterFinderSDD.cxx;h=84e9a2afc74c15e265c8c92a619c1b6903d935c6;hp=2ff2df5793d56d06ecd4acdebc27324905a73ca2;hb=2745fd4d0ab80237cefc6e2d25ea5d0a83acb9b5;hpb=44b3710f401962ee409984d35acade5851a207e4 diff --git a/ITS/AliITSClusterFinderSDD.cxx b/ITS/AliITSClusterFinderSDD.cxx index 2ff2df5793d..84e9a2afc74 100644 --- a/ITS/AliITSClusterFinderSDD.cxx +++ b/ITS/AliITSClusterFinderSDD.cxx @@ -15,6 +15,9 @@ #include "AliITSClusterFinderSDD.h" +#include "AliITSMapA2.h" +#include "AliITSMapA1.h" +#include "AliITS.h" #include "AliRun.h" @@ -31,13 +34,12 @@ AliITSClusterFinderSDD::AliITSClusterFinderSDD fDigits=digits; fClusters=recp; fNclusters= fClusters->GetEntriesFast(); - printf("SDD: fNclusters %d\n",fNclusters); SetCutAmplitude(); SetDAnode(); SetDTime(); - SetMap(); SetMinPeak(); SetNCells(); + SetMap(); } //_____________________________________________________________________________ @@ -49,15 +51,25 @@ AliITSClusterFinderSDD::AliITSClusterFinderSDD() 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 @@ -65,6 +77,7 @@ AliITSClusterFinderSDD::AliITSClusterFinderSDD(const AliITSClusterFinderSDD &sou 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 ; @@ -81,6 +94,7 @@ AliITSClusterFinderSDD& 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 ; @@ -93,30 +107,8 @@ AliITSClusterFinderSDD& 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; ndigUncheckedAt(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); } //_____________________________________________________________________________ @@ -128,7 +120,6 @@ void AliITSClusterFinderSDD::Find1DClusters() 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; @@ -139,7 +130,7 @@ void AliITSClusterFinderSDD::Find1DClusters() 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 @@ -147,11 +138,9 @@ void AliITSClusterFinderSDD::Find1DClusters() Int_t nofFoundClusters = 0; - + Int_t i; Float_t **dfadc = new Float_t*[fNofMaps]; for(i=0;iGetSignal(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 @@ -192,10 +181,10 @@ void AliITSClusterFinderSDD::Find1DClusters() 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) { @@ -205,19 +194,19 @@ void AliITSClusterFinderSDD::Find1DClusters() } 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(kGetSignal(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(imaxGetSignal(idx,imax+1) > fCutAmplitude) lthrt++; + if(fMapA2->TestHit(idx,imax+1) != kEmpty) lthrt++; // cluster charge Int_t tstart = it-1; @@ -243,8 +232,10 @@ void AliITSClusterFinderSDD::Find1DClusters() 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; @@ -283,16 +274,11 @@ void AliITSClusterFinderSDD::Find1DClusters() } // 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;iGetEntriesFast(); nofClusters -= fNclusters; - //printf("SDD- GroupClusters: fNclusters nofClusters %d %d \n",fNclusters, nofClusters); - AliITSRawClusterSDD *clusterI; AliITSRawClusterSDD *clusterJ; @@ -329,8 +313,8 @@ void AliITSClusterFinderSDD::GroupClusters() 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); @@ -340,7 +324,6 @@ void AliITSClusterFinderSDD::GroupClusters() fClusters->Compress(); delete [] label; - delete label; return; } @@ -353,8 +336,6 @@ void AliITSClusterFinderSDD::SelectClusters() Int_t nofClusters = fClusters->GetEntriesFast(); nofClusters -= fNclusters; - //printf("SDD- SelectClusters: fNclusters nofClusters %d %d \n",fNclusters, nofClusters); - Int_t i; for(i=0; iAt(i); @@ -378,7 +359,6 @@ void AliITSClusterFinderSDD::SelectClusters() void AliITSClusterFinderSDD::GetRecPoints() { // get rec points - //static Int_t counter=0; AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); @@ -386,31 +366,32 @@ void AliITSClusterFinderSDD::GetRecPoints() 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; iAt(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(); } //_____________________________________________________________________________