**************************************************************************/
/*
$Id$
- $Log$
- Revision 1.37 2004/06/10 21:00:24 nilsen
- Modifications associated with remerging the Ba/Sa and Dubna pixel simulations,
- some cleaning of general code (including coding convensions), and adding some
- protections associated with SetDefaults/SetDefaultSimulations which should help
- with the Test beam simulations. Details below. The default SPD simulation for
- the general ITS runs/geometry is still the Ba/Sa, but for the Test beam
- geometries this has been changed to the merged versions.
- File: AliITS.cxx Modified
- File: AliITS.h Modified
- In lined many one-two line functions. Added some protection to
- SetDefaults(), SetDefaultSimulation(), and SetDefaultClusterFinders(),
- such that they should now even work when only one detector type has
- been defined (as it should be for the test beams...). Some mostly
- cosmetic issues associated with getting branch names for digits. And
- Generally some cleaning up of the code.
- File: AliITSClusterFinder.cxx Modified
- File: AliITSClusterFinder.h Modified
- Did some additional consolidation of data into the base class, added
- TClonesArray *fClusters, a fDebug, and fModule variables. Otherwise
- some cosmetic and coding conversion changes.
- File: AliITSClusterFinderSDD.cxx Modified
- File: AliITSClusterFinderSDD.h Modified
- Changes to be consistent with the modified base class, and cosmetic
- and coding conversion changes.
- File: AliITSClusterFinderSPD.cxx Modified
- File: AliITSClusterFinderSPD.h Modified
- Changes to be consistent with the modified base class, and cosmetic
- and coding conversion changes.
- File: AliITSClusterFinderSPDdubna.h Removed
- File: AliITSClusterFinderSPDdubna.cxx Removed
- Since we have ClusterFinderSPD and V2 and this version isn't being
- maintained, it is being retired.
- File: AliITSClusterFinderSSD.cxx Modified
- File: AliITSClusterFinderSSD.h Modified
- Changes to be consistent with the modified base class, and cosmetic
- and coding conversion changes.
- File: AliITSDetType.cxx Modified
- File: AliITSDetType.h Modified
- Added a new class variable to indicate what the detector type is
- AliITSDetector fDetType; values of kSPD, kSDD, kSSD, .... Otherwise
- cosmetic and Coding convention changes.
- File: AliITSLoader.cxx Modified
- File: AliITSLoader.h Modified
- Some changes which are not complete. The idea is to be able to get,
- simply via one call, a specific hit, Sdigit, digit, RecPoint,...
- without all of the usual over head of initializing TClonesArrays setting
- branch addresses and the like. Work is far form ready.
- File: AliITSdcsSSD.cxx Modified
- Some nearly cosmetic changes necessary due to changes to response and
- segmentation class'.
- File: AliITSgeom.h Modified
- In the definition of AliITSDetector type, added kND=-1, no detector
- defined. Expect to use it later(?).
- File: AliITSresponse.h Modified
- Basically cosmetic. Mostly changing Float_t to Double_t.
- File: AliITSresponseSDD.cxx Modified
- File: AliITSresponseSDD.h Modified
- Basically the cosmetic and Float_t to Double_t
- File: AliITSresponseSPD.cxx Modified
- File: AliITSresponseSPD.h Modified
- Mostly Float_t to Double_t and added in the IsPixelDead function for
- the dubna version (otherwise the merging had been done).
- File: AliITSresponseSPDdubna.h Removed
- File: AliITSresponseSPDdubna.cxx Removed
- We should be able to remove this class now. AliITSresponseSPD is now
- used for both the Bari-Salerno and the dubna models.
- File: AliITSresponseSSD.cxx Modified
- File: AliITSresponseSSD.h Modified
- Float_t to Double_t changes.
- File: AliITSsegmentation.h Modified
- Made LocaltoDet return a Bool_t. Now if the x,z location is outside
- of the volume, it returns kFALSE. see below.
- File: AliITSsegmentationSDD.cxx Modified
- File: AliITSsegmentationSDD.h Modified
- Made LocaltoDet return a Bool_t. Now if the x,z location is outside
- of the volume, it returns kFALSE.
- File: AliITSsegmentationSPD.cxx Modified
- File: AliITSsegmentationSPD.h Modified
- Made LocaltoDet return a Bool_t. Now if the x,z location is outside
- of the volume, it returns kFALSE.
- File: AliITSsegmentationSSD.cxx Modified
- File: AliITSsegmentationSSD.h Modified
- Made LocaltoDet return a Bool_t. Now if the x,z location is outside
- of the volume, it returns kFALSE. see below.
- File: AliITSsimulation.cxx Modified
- File: AliITSsimulation.h Modified
- Added fDebug variable, new Constructor for use below. Cosmetic and
- coding convention changes
- File: AliITSsimulationSDD.cxx Modified
- File: AliITSsimulationSDD.h Modified
- Added new Constructor, removed redundant variables and Cosmetic and
- coding convention changes.
- File: AliITSsimulationSPD.cxx Modified
- File: AliITSsimulationSPD.h Modified
- Removed some dead code, made changes as needed by the changes above
- (response and segmentation classes...). a few cosmetic and coding
- convention changes.
- File: AliITSsimulationSPDdubna.cxx Modified
- File: AliITSsimulationSPDdubna.h Modified
- New merged version, implemented new and old coupling with switch,
- coding convention and similar changes. (found 1 bugs, missing
- ! in front of if(mod-LineSegmentL(....,).
- File: AliITSsimulationSSD.cxx Modified
- File: AliITSsimulationSSD.h Modified
- removed redundant variables with base class. Fixed for coding
- convention and other cosmetic changes.
- File: AliITSvSDD03.cxx Modified
- File: AliITSvSPD02.cxx Modified
- File: AliITSvSSD03.cxx Modified
- These two have their private versions of SetDefaults and
- SetDefaultSimulation which have been similarly protected as in AliITS.cxx
- File: ITSLinkDef.h Modified
- File: libITS.pkg Modified
- Versions which include v11 geometry and other private changes
-
- Revision 1.36 2004/01/27 16:12:03 masera
- Coding conventions for AliITSdigitXXX classes and AliITSTrackerV1
-
- Revision 1.35 2003/11/10 16:33:50 masera
- Changes to obey our coding conventions
-
- Revision 1.34 2003/09/11 13:48:52 masera
- Data members of AliITSdigit classes defined as protected (They were public)
-
- Revision 1.33 2003/07/21 14:20:51 masera
- Fix to track labes in SDD Rec-points
-
- Revision 1.31.2.1 2003/07/16 13:18:04 masera
- Proper fix to track labels associated to SDD rec-points
-
- Revision 1.31 2003/05/19 14:44:41 masera
- Fix to track labels associated to SDD rec-points
-
- Revision 1.30 2003/03/03 16:34:35 masera
- Corrections to comply with coding conventions
-
- Revision 1.29 2002/10/25 18:54:22 barbera
- Various improvements and updates from B.S.Nilsen and T. Virgili
-
- Revision 1.28 2002/10/22 14:45:29 alibrary
- Introducing Riostream.h
-
- Revision 1.27 2002/10/14 14:57:00 hristov
- Merging the VirtualMC branch to the main development branch (HEAD)
-
- Revision 1.23.4.2 2002/10/14 13:14:07 hristov
- Updating VirtualMC to v3-09-02
-
- Revision 1.26 2002/09/09 17:23:28 nilsen
- Minor changes in support of changes to AliITSdigitS?D class'.
-
- Revision 1.25 2002/05/10 22:29:40 nilsen
- Change my Massimo Masera in the default constructor to bring things into
- compliance.
-
- Revision 1.24 2002/04/24 22:02:31 nilsen
- New SDigits and Digits routines, and related changes, (including new
- noise values).
-
*/
///////////////////////////////////////////////////////////////////////////
// Cluster finder //
// for Silicon //
// Drift Detector //
//////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
-#include <TMath.h>
-#include <math.h>
#include "AliITSClusterFinderSDD.h"
#include "AliITSMapA1.h"
-#include "AliITS.h"
-#include "AliITSdigitSDD.h"
#include "AliITSRawClusterSDD.h"
#include "AliITSRecPoint.h"
+#include "AliITSdigitSDD.h"
+#include "AliITSDetTypeRec.h"
+#include "AliITSCalibrationSDD.h"
#include "AliITSsegmentationSDD.h"
-#include "AliITSresponseSDD.h"
-#include "AliRun.h"
+#include "AliLog.h"
ClassImp(AliITSClusterFinderSDD)
// default constructor
}
//______________________________________________________________________
-AliITSClusterFinderSDD::AliITSClusterFinderSDD(AliITSsegmentation *seg,
- AliITSresponse *response,
+AliITSClusterFinderSDD::AliITSClusterFinderSDD(AliITSDetTypeRec* dettyp,
TClonesArray *digits,
TClonesArray *recp):
-AliITSClusterFinder(seg,response),
+AliITSClusterFinder(dettyp),
fNclusters(0),
fDAnode(0.0),
fDTime(0.0),
SetDigits(digits);
SetClusters(recp);
- SetCutAmplitude();
+ SetCutAmplitude(fDetTypeRec->GetITSgeom()->GetStartSDD());
SetDAnode();
SetDTime();
- SetMinPeak((Int_t)(((AliITSresponseSDD*)GetResp())->
+ SetMinPeak((Int_t)(((AliITSCalibrationSDD*)GetResp(fDetTypeRec->GetITSgeom()->GetStartSDD()))->
GetNoiseAfterElectronics()*5));
// SetMinPeak();
SetMinNCells();
SetMap(new AliITSMapA1(GetSeg(),Digits(),fCutAmplitude));
}
//______________________________________________________________________
-void AliITSClusterFinderSDD::SetCutAmplitude(Double_t nsigma){
+void AliITSClusterFinderSDD::SetCutAmplitude(Int_t mod,Double_t nsigma){
// set the signal threshold for cluster finder
Double_t baseline,noise,noiseAfterEl;
- GetResp()->GetNoiseParam(noise,baseline);
- noiseAfterEl = ((AliITSresponseSDD*)GetResp())->GetNoiseAfterElectronics();
+ GetResp(mod)->GetNoiseParam(noise,baseline);
+ noiseAfterEl = ((AliITSCalibrationSDD*)GetResp(mod))->GetNoiseAfterElectronics();
fCutAmplitude = (Int_t)((baseline + nsigma*noiseAfterEl));
}
//______________________________________________________________________
Int_t dummy = 0;
Double_t fTimeStep = GetSeg()->Dpx(dummy);
Double_t fSddLength = GetSeg()->Dx();
- Double_t fDriftSpeed = GetResp()->DriftSpeed();
+ Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
Double_t anodePitch = GetSeg()->Dpz(dummy);
// map the signal
Double_t noise;
Double_t baseline;
- GetResp()->GetNoiseParam(noise,baseline);
+ GetResp(fModule)->GetNoiseParam(noise,baseline);
Int_t nofFoundClusters = 0;
Int_t i;
} // anodes
for(k=0;k<fNofAnodes;k++) {
- if(GetDebug(5)) cout<<"Anode: "<<k+1<<", Wing: "<<j+1<< endl;
+ AliDebug(5,Form("Anode: %d, Wing: %d",k+1,j+1));
idx = j*fNofAnodes+k;
Int_t imax = 0;
Int_t imaxd = 0;
Double_t clusterPeakAmplitude = 0.;
Int_t its,peakpos = -1;
Double_t n, baseline;
- GetResp()->GetNoiseParam(n,baseline);
+ GetResp(fModule)->GetNoiseParam(n,baseline);
for(its=tstart; its<=tstop; its++) {
fadc=(float)Map()->GetSignal(idx,its);
if(fadc>baseline) fadc -= baseline;
clusteranodePath, //f
clusterMult, //i
0,0,0,0,0,0,0);//7*i
- fITS->AddCluster(1,&clust);
+ fDetTypeRec->AddCluster(1,&clust);
it = tstop;
} // ilcl
it++;
Int_t dummy=0;
Double_t fTimeStep = GetSeg()->Dpx( dummy );
Double_t fSddLength = GetSeg()->Dx();
- Double_t fDriftSpeed = GetResp()->DriftSpeed();
+ Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
Double_t anodePitch = GetSeg()->Dpz( dummy );
Double_t n, baseline;
- GetResp()->GetNoiseParam( n, baseline );
+ GetResp(fModule)->GetNoiseParam( n, baseline );
// map the signal
Map()->ClearMap();
Map()->SetThreshold( fCutAmplitude );
Map()->FillMap();
-
+
Int_t nClu = 0;
// cout << "Search cluster... "<< endl;
for( Int_t j=0; j<2; j++ ){
driftPath,anodePath,
nTsteps,start,stop,
start, stop, 1, k, k );
- fITS->AddCluster( 1, &clust );
- if(GetDebug(5)) clust.PrintInfo();
+ fDetTypeRec->AddCluster( 1, &clust );
+ if(AliDebugLevel()>=5) clust.PrintInfo();
nClu++;
} // end if nTsteps
on = kFALSE;
} // samples
} // anodes
} // wings
- if(GetDebug(3)) cout << "# Rawclusters " << nClu << endl;
+ AliDebug(3,Form("# Rawclusters %d",nClu));
return;
}
//_______________________________________________________________________
// par[i+2] = zpos
// par[i+3] = tau
// par[i+4] = sigma.
- Int_t electronics = GetResp()->Electronics(); // 1 = PASCAL, 2 = OLA
+ Int_t electronics = GetResp(fModule)->GetElectronics(); // 1 = PASCAL, 2 = OLA
const Int_t knParam = 5;
Int_t npeak = (Int_t)par[0];
delta = steprm[k];
d1 = delta;
// ENSURE THAT STEP SIZE IS SENSIBLY LARGER THAN MACHINE ROUND OFF
- if( fabs( p1 ) > 1.0E-6 )
- if ( fabs( delta/p1 ) < 1.0E-4 ) delta = p1/1000;
+ if( TMath::Abs( p1 ) > 1.0E-6 )
+ if ( TMath::Abs( delta/p1 ) < 1.0E-4 ) delta = p1/1000;
else delta = (Double_t)1.0E-4;
// EVALUATE CHI-SQUARED AT FIRST TWO SEARCH POINTS
PeakFunc( xdim, zdim, param, speFit );
if( param[k] <= 20 ) param[k] = fMinPeak;
break;
case 1 :
- if( fabs( param[k] - prm0[k] ) > 1.5 ) param[k] = prm0[k];
+ if( TMath::Abs( param[k] - prm0[k] ) > 1.5 ) param[k] = prm0[k];
break;
case 2 :
- if( fabs( param[k] - prm0[k] ) > 1. ) param[k] = prm0[k];
+ if( TMath::Abs( param[k] - prm0[k] ) > 1. ) param[k] = prm0[k];
break;
case 3 :
if( param[k] < .5 ) param[k] = .5;
//--IN CASE OF NEARLY EQUAL CHI-SQUARED AND TOO SMALL STEP SIZE PREVENT
// ERRONEOUS EVALUATION OF PARABOLA MINIMUM
//---NEXT TWO LINES CAN BE OMITTED FOR HIGHER PRECISION MACHINES
- //dp = (Double_t) max (fabs(p3-p2), fabs(p2-p1));
- //if( fabs( p2-p0 ) > dp ) p0 = p2;
+ //dp = (Double_t) max (TMath::Abs(p3-p2), TMath::Abs(p2-p1));
+ //if( TMath::Abs( p2-p0 ) > dp ) p0 = p2;
param[k] = p0;
// Constrain paramiters
Int_t kpos = (k-1) % knParam;
if( param[k] <= 20 ) param[k] = fMinPeak;
break;
case 1 :
- if( fabs( param[k] - prm0[k] ) > 1.5 ) param[k] = prm0[k];
+ if( TMath::Abs( param[k] - prm0[k] ) > 1.5 ) param[k] = prm0[k];
break;
case 2 :
- if( fabs( param[k] - prm0[k] ) > 1. ) param[k] = prm0[k];
+ if( TMath::Abs( param[k] - prm0[k] ) > 1. ) param[k] = prm0[k];
break;
case 3 :
if( param[k] < .5 ) param[k] = .5;
iterNum++;
chi0 = chi1;
Minim( xdim, zdim, param, prm0, step, &chi1, spe, speFit );
- reldif = ( chi1 > 0 ) ? ((Double_t) fabs( chi1-chi0)/chi1 ) : 0;
+ reldif = ( chi1 > 0 ) ? ((Double_t) TMath::Abs( chi1-chi0)/chi1 ) : 0;
// EXIT conditions
if( reldif < (float) kchilmt ){
*chir = (chi1>0) ? (float) TMath::Sqrt (chi1/degFree) :0;
if ((double)a < 1.0E-6) prmin = 0;
else prmin = (float) (0.5*b/a);
dp = 5*(tmp2-tmp0);
- if( fabs(prmin-tmp2) > fabs(dp) ) prmin = tmp2+dp;
+ if( TMath::Abs(prmin-tmp2) > TMath::Abs(dp) ) prmin = tmp2+dp;
param[k] = prmin;
step[k] = dp/10; // OPTIMIZE SEARCH STEP
} // end for k
Int_t dummy=0;
Double_t fTimeStep = GetSeg()->Dpx( dummy );
Double_t fSddLength = GetSeg()->Dx();
- Double_t fDriftSpeed = GetResp()->DriftSpeed();
+ Double_t fDriftSpeed = GetResp(fModule)->GetDriftSpeed();
Double_t anodePitch = GetSeg()->Dpz( dummy );
Double_t n, baseline;
- GetResp()->GetNoiseParam( n, baseline );
- Int_t electronics = GetResp()->Electronics(); // 1 = PASCAL, 2 = OLA
+ GetResp(fModule)->GetNoiseParam( n, baseline );
+ Int_t electronics =GetResp(fModule)->GetElectronics(); // 1 = PASCAL, 2 = OLA
for( Int_t j=0; j<nofClusters; j++ ){
// get cluster information
if( peakpos < 0 ) {
//Warning("ResolveClusters",
// "Digit not found for cluster");
- //if(GetDebug(3)) clusterI.PrintInfo();
+ //if(AliDebugLevel()>=3) clusterI.PrintInfo();
continue;
}
clusterI.SetPeakPos( peakpos );
clusterI.SetTsigma( tau[i]*fTimeStep );
clusterI.SetQ( integral[i] );
- fITS->AddCluster( 1, &clusterI );
+ fDetTypeRec->AddCluster( 1, &clusterI );
} // end for i
Clusters()->RemoveAt( j );
delete [] par;
if(clusterI->T() < fTimeStep*10) fDAnode = 1.5; // TB 1.
Bool_t pair = clusterI->Brother(clusterJ,fDAnode,fDTime);
if(!pair) continue;
- if(GetDebug(4)){
+ if(AliDebugLevel()>=4){
clusterI->PrintInfo();
clusterJ->PrintInfo();
- } // end if GetDebug
+ } // end if AliDebugLevel
clusterI->Add(clusterJ);
label[j] = 1;
Clusters()->RemoveAt(j);
Int_t ix, iz, idx=-1;
AliITSdigitSDD *dig=0;
Int_t ndigits=NDigits();
+
+ 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);
+
+
for(i=0; i<nofClusters; i++) {
AliITSRawClusterSDD *clusterI = (AliITSRawClusterSDD*)Cluster(i);
if(!clusterI) Error("SDD: GetRecPoints","i clusterI ",i,clusterI);
if (!dig) dig = (AliITSdigitSDD*)Map()->GetHit(iz-1,ix+1);
if (!dig) printf("SDD: cannot assign the track number!\n");
} // end if !dig
- AliITSRecPoint rnew;
- rnew.SetX(clusterI->X());
- rnew.SetZ(clusterI->Z());
+ AliITSRecPoint rnew(fDetTypeRec->GetITSgeom());
+ rnew.SetXZ(fModule,clusterI->X(),clusterI->Z());
rnew.SetQ(clusterI->Q()); // in KeV - should be ADC
rnew.SetdEdX(kconvGeV*clusterI->Q());
- rnew.SetSigmaX2(kRMSx*kRMSx);
+ rnew.SetSigmaDetLocX2(kRMSx*kRMSx);
rnew.SetSigmaZ2(kRMSz*kRMSz);
- if(dig) rnew.fTracks[0]=dig->GetTrack(0);
- if(dig) rnew.fTracks[1]=dig->GetTrack(1);
- if(dig) rnew.fTracks[2]=dig->GetTrack(2);
-
- fITS->AddRecPoint(rnew);
+ if(dig) rnew.SetLabel(dig->GetTrack(0),0);
+ if(dig) rnew.SetLabel(dig->GetTrack(1),1);
+ if(dig) rnew.SetLabel(dig->GetTrack(2),2);
+ rnew.SetDetectorIndex(ind);
+ rnew.SetLayer(lyr);
+ fDetTypeRec->AddRecPoint(rnew);
} // I clusters
// Map()->ClearMap();
}
GetRecPoints();
}
//_______________________________________________________________________
-void AliITSClusterFinderSDD::Print() const{
+void AliITSClusterFinderSDD::PrintStatus() const{
// Print SDD cluster finder Parameters
cout << "**************************************************" << endl;