#include "AliITSDetTypeRec.h"
#include "AliITSCalibrationSDD.h"
#include "AliITSsegmentationSDD.h"
+#include "AliITSgeom.h"
#include "AliLog.h"
ClassImp(AliITSClusterFinderSDD)
// set the signal threshold for cluster finder
Double_t baseline,noiseAfterEl;
-
+ AliITSresponseSDD* res = (AliITSresponseSDD*)((AliITSCalibrationSDD*)GetResp(mod))->GetResponse();
+ const char *option=res->ZeroSuppOption();
Int_t nanodes = GetResp(mod)->Wings()*GetResp(mod)->Channels()*GetResp(mod)->Chips();
fCutAmplitude.Set(nanodes);
for(Int_t ian=0;ian<nanodes;ian++){
- baseline=GetResp(mod)->GetBaseline(ian);
noiseAfterEl = ((AliITSCalibrationSDD*)GetResp(mod))->GetNoiseAfterElectronics(ian);
- fCutAmplitude[ian] = (Int_t)((baseline + nsigma*noiseAfterEl));
+ if((strstr(option,"1D")) || (strstr(option,"2D"))){
+ fCutAmplitude[ian] = (Int_t)(nsigma*noiseAfterEl);
+ }
+ else{
+ baseline=GetResp(mod)->GetBaseline(ian);
+ fCutAmplitude[ian] = (Int_t)((baseline + nsigma*noiseAfterEl));
+ }
}
}
//______________________________________________________________________
Int_t dummy = 0;
Double_t fTimeStep = GetSeg()->Dpx(dummy);
Double_t fSddLength = GetSeg()->Dx();
- Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
- Double_t anodePitch = GetSeg()->Dpz(dummy);
+ AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
+ AliITSresponseSDD* res = (AliITSresponseSDD*)((AliITSCalibrationSDD*)GetResp(fModule))->GetResponse();
+ const char *option=res->ZeroSuppOption();
// map the signal
Map()->ClearMap();
Int_t clusterMult = 0;
Double_t clusterPeakAmplitude = 0.;
Int_t its,peakpos = -1;
- //Double_t n, baseline;
- //GetResp(fModule)->GetNoiseParam(n,baseline);
- Double_t baseline=GetResp(fModule)->GetBaseline(idx);
+
for(its=tstart; its<=tstop; its++) {
fadc=(float)Map()->GetSignal(idx,its);
- if(fadc>baseline) fadc -= baseline;
- else fadc = 0.;
+ if(!((strstr(option,"1D")) || (strstr(option,"2D")))){
+ Double_t baseline=GetResp(fModule)->GetBaseline(idx);
+ if(fadc>baseline) fadc -= baseline;
+ else fadc = 0.;
+ }
clusterCharge += fadc;
// as a matter of fact we should take the peak
// pos before FFT
//ns
} // end if
} // end for its
-
- Double_t clusteranodePath = (clusterAnode - fNofAnodes/2)*
- anodePitch;
- Double_t clusterDriftPath = clusterTime*fDriftSpeed;
+ Float_t theAnode=clusterAnode+j*fNofAnodes;
+ Double_t clusteranodePath = GetSeg()->GetLocalZFromAnode(theAnode);
+ Double_t clusterDriftPath = (Double_t)cal->GetDriftPath(clusterTime,clusteranodePath);
clusterDriftPath = fSddLength-clusterDriftPath;
if(clusterCharge <= 0.) break;
AliITSRawClusterSDD clust(j+1,//i
Int_t dummy=0;
Double_t fTimeStep = GetSeg()->Dpx( dummy );
Double_t fSddLength = GetSeg()->Dx();
- Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
- Double_t anodePitch = GetSeg()->Dpz( dummy );
-
+ AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
Map()->ClearMap();
Map()->SetThresholdArr( fCutAmplitude );
Map()->FillMap2();
+ AliITSresponseSDD* res = (AliITSresponseSDD*)cal->GetResponse();
+ const char *option=res->ZeroSuppOption();
+
Int_t nClu = 0;
// cout << "Search cluster... "<< endl;
for( Int_t j=0; j<2; j++ ){
for( Int_t k=0; k<fNofAnodes; k++ ){
- Int_t idx = j*fNofAnodes+k;
- Double_t baseline=GetResp(fModule)->GetBaseline(idx);
+ Int_t idx = j*fNofAnodes+k;
Bool_t on = kFALSE;
Int_t start = 0;
Int_t nTsteps = 0;
nTsteps = 0;
} // end if on...
nTsteps++ ;
- if( fadc > baseline ) fadc -= baseline;
- else fadc=0.;
+ if(!((strstr(option,"1D")) || (strstr(option,"2D")))){
+ Double_t baseline=GetResp(fModule)->GetBaseline(idx);
+ if( fadc > baseline ) fadc -= baseline;
+ else fadc=0.;
+ }
charge += fadc;
time += fadc*l;
if( fadc > fmax ){
time /= (charge/fTimeStep); // ns
// time = lmax*fTimeStep; // ns
if( time > fTimeCorr ) time -= fTimeCorr; // ns
- Double_t anodePath =(anode-fNofAnodes/2)*anodePitch;
- Double_t driftPath = time*fDriftSpeed;
+ Float_t theAnode=anode+j*fNofAnodes;
+ Double_t anodePath =GetSeg()->GetLocalZFromAnode(theAnode);
+ Double_t driftPath = (Double_t)cal->GetDriftPath(time,anode);
driftPath = fSddLength-driftPath;
AliITSRawClusterSDD clust(j+1,anode,time,charge,
fmax, peakpos,0.,0.,
Int_t dummy=0;
Double_t fTimeStep = GetSeg()->Dpx( dummy );
Double_t fSddLength = GetSeg()->Dx();
- Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
Double_t anodePitch = GetSeg()->Dpz( dummy );
- //Double_t n, baseline;
- //GetResp(fModule)->GetNoiseParam( n, baseline );
Int_t electronics =GetResp(fModule)->GetElectronics(); // 1 = PASCAL, 2 = OLA
+ AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
+ AliITSresponseSDD* res = (AliITSresponseSDD*)cal->GetResponse();
+ const char *option=res->ZeroSuppOption();
+
for( Int_t j=0; j<nofClusters; j++ ){
// get cluster information
// make a local map from cluster region
for( Int_t ianode=astart; ianode<=astop; ianode++ ){
for( Int_t itime=tstart; itime<=tstop; itime++ ){
- Double_t fadc = Map()->GetSignal( ianode, itime );
- Double_t baseline=GetResp(fModule)->GetBaseline(ianode);
- if( fadc > baseline ) fadc -= (Double_t)baseline;
- else fadc = 0.;
+ Double_t fadc = Map()->GetSignal( ianode, itime );
+ if(!((strstr(option,"1D")) || (strstr(option,"2D")))){
+ Double_t baseline=GetResp(fModule)->GetBaseline(ianode);
+ if( fadc > baseline ) fadc -= (Double_t)baseline;
+ else fadc = 0.;
+ }
Int_t index = (itime-tstart+1)*zdim+(ianode-astart+1);
sp[index] = fadc;
} // time loop
//if(AliDebugLevel()>=3) clusterI.PrintInfo();
continue;
}
- clusterI.SetPeakPos( peakpos );
- Double_t driftPath = fSddLength - newiTimef * fDriftSpeed;
- Double_t sign = ( wing == 1 ) ? -1. : 1.;
- clusterI.SetX( driftPath*sign * 0.0001 );
- clusterI.SetZ( anodePath * 0.0001 );
+ clusterI.SetPeakPos( peakpos );
+ Float_t dp = cal->GetDriftPath(newiTimef,newAnodef);
+ Float_t driftPath = fSddLength - (Double_t)dp;
+ Float_t sign = ( wing == 1 ) ? -1. : 1.;
+ Float_t xcoord = driftPath*sign * 0.0001;
+ Float_t zcoord = anodePath * 0.0001;
+ Float_t corrx=0, corrz=0;
+ cal->GetCorrections(zcoord,xcoord,corrz,corrx,GetSeg());
+ xcoord+=corrx;
+ zcoord+=corrz;
+ clusterI.SetX( xcoord );
+ clusterI.SetZ( zcoord );
clusterI.SetAnode( newAnodef );
clusterI.SetTime( newiTimef );
clusterI.SetAsigma( sigma[i]*anodePitch );
}
//______________________________________________________________________
-void AliITSClusterFinderSDD::GetRecPoints(){
+void AliITSClusterFinderSDD::GetRecPoints(AliITSCalibrationSDD* cal){
// get rec points
// get number of clusters for this module
nofClusters -= fNclusters;
const Double_t kconvGeV = 1.e-6; // GeV -> KeV
const Double_t kconv = 1.0e-4;
+ const Double_t kcmToMicrons = 10000.;
const Double_t kRMSx = 38.0*kconv; // microns->cm ITS TDR Table 1.3
const Double_t kRMSz = 28.0*kconv; // microns->cm ITS TDR Table 1.3
+ Int_t nAnodes=GetSeg()->NpzHalf();
Int_t i;
Int_t ix, iz, idx=-1;
AliITSdigitSDD *dig=0;
if(idx&&idx<= ndigits) dig =(AliITSdigitSDD*)GetDigit(idx);
if(!dig) {
// try cog
- GetSeg()->GetPadIxz(clusterI->X(),clusterI->Z(),ix,iz);
+ Float_t xMicrons=clusterI->X()*kcmToMicrons;
+ Float_t zMicrons=clusterI->Z()*kcmToMicrons;
+ Float_t zAnode=zMicrons/GetSeg()->Dpz(0)+nAnodes/2;
+ Float_t driftSpeed=cal->GetDriftSpeedAtAnode(zAnode);
+ Float_t driftPath=GetSeg()->Dx()-TMath::Abs(xMicrons);
+ ix=1+(Int_t)(driftPath/driftSpeed/GetSeg()->Dpx(0));
+ iz=1+(Int_t)zAnode;
+ if(xMicrons>0) iz+=nAnodes;
dig = (AliITSdigitSDD*)Map()->GetHit(iz-1,ix-1);
// if null try neighbours
if (!dig) dig = (AliITSdigitSDD*)Map()->GetHit(iz-1,ix);
SetModule(mod);
SetCutAmplitude(mod);
+ AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(mod);
Int_t nanodes=GetSeg()->Npz();
Int_t noise=0;
for(Int_t i=0;i<nanodes;i++){
- noise+=(Int_t)(((AliITSCalibrationSDD*)GetResp(mod))->GetNoiseAfterElectronics(i));
+ noise+=(Int_t)cal->GetNoiseAfterElectronics(i);
}
SetMinPeak((noise/nanodes)*5);
Find1DClustersE();
GroupClusters();
SelectClusters();
ResolveClusters();
- GetRecPoints();
+ GetRecPoints(cal);
}
//_______________________________________________________________________
void AliITSClusterFinderSDD::PrintStatus() const{
cout << "Maximum number of cells/clusters: " << fMaxNCells << endl;
cout << "**************************************************" << endl;
}
+
+