/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // // Cluster finder // for Silicon pixels // // #include "AliITSClusterFinderSPD.h" #include "AliITS.h" #include "AliITSdigitSPD.h" #include "AliITSRawClusterSPD.h" #include "AliITSRecPoint.h" #include "AliITSresponseSPD.h" #include "AliITSsegmentationSPD.h" #include "AliRun.h" //#define DEBUG ClassImp(AliITSClusterFinderSPD) //______________________________________________________________________ AliITSClusterFinderSPD::AliITSClusterFinderSPD():AliITSClusterFinder(), fDz(0.0), fDx(0.0), fMinNCells(0){ // constructor } //---------------------------------------------------------- AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg, AliITSresponse *res): AliITSClusterFinder(seg,res), fDz(0.0), fDx(0.0), fMinNCells(0){ // constructor SetDx(); SetDz(); } //---------------------------------------------------------- AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg, TClonesArray *digits, TClonesArray *recp): AliITSClusterFinder(seg,0), fDz(0.0), fDx(0.0), fMinNCells(0){ // constructor SetDigits(digits); SetClusters(recp); SetDx(); SetDz(); } //_____________________________________________________________________ AliITSClusterFinderSPD::AliITSClusterFinderSPD( const AliITSClusterFinderSPD &source): AliITSClusterFinder(source){ // Copy Constructor if(&source == this) return; this->fDz = source.fDz; this->fDx = source.fDx; this->fMinNCells = source.fMinNCells; return; } //______________________________________________________________________ AliITSClusterFinderSPD& AliITSClusterFinderSPD::operator=( const AliITSClusterFinderSPD &source) { // Assignment operator if(&source == this) return *this; this->fDz = source.fDz; this->fDx = source.fDx; this->fMinNCells = source.fMinNCells; return *this; } //______________________________________________________________________ void AliITSClusterFinderSPD::FindRawClusters(Int_t module){ // input of Cluster Finder Int_t digitcount = 0; Int_t numberd = 100000; Int_t *digx = new Int_t[numberd]; Int_t *digz = new Int_t[numberd]; Int_t *digtr1 = new Int_t[numberd]; Int_t *digtr2 = new Int_t[numberd]; Int_t *digtr3 = new Int_t[numberd]; Int_t *digtr4 = new Int_t[numberd]; // output of Cluster Finder Int_t numberc = 10000; Double_t *xcenterl = new Double_t[numberc]; Double_t *zcenterl = new Double_t[numberc]; Double_t *errxcenter = new Double_t[numberc]; Double_t *errzcenter = new Double_t[numberc]; Int_t *tr1clus = new Int_t[numberc]; Int_t *tr2clus = new Int_t[numberc]; Int_t *tr3clus = new Int_t[numberc]; Int_t nclus; SetModule(module); digitcount=0; Int_t ndigits = Digits()->GetEntriesFast(); if (!ndigits) return; AliITSdigitSPD *dig; Int_t ndig=0,i; /* if(GetDebug(4)){ cout << "SPD - FindRawclusters"<GetCoord2()+1; //starts at 1 digz[digitcount] = dig->GetCoord1()+1; //starts at 1 digtr1[digitcount] = dig->GetTrack(0); digtr2[digitcount] = -3; digtr3[digitcount] = -3; if(GetDebug(5)){ cout << "digtr1["<GetTrack(i) && iGetNTracks()) i++; if(GetDebug(5)) cout << " fTracks["<GetTrack(i); if(iGetNTracks()){ digtr2[digitcount] = dig->GetTrack(i); if(GetDebug(5)) cout<<"digtr2["<GetTrack(i) || digtr2[digitcount]==dig->GetTrack(i))&& i<=dig->GetNTracks()) i++; if(iGetNTracks()) digtr3[digitcount] = dig->GetTrack(i); if(GetDebug(5)){ cout << " fTracks["<GetNTracks()) cout <GetTrack(i); cout << "digtr3["<Dx()/2.; zcenter[i] = zcenter[i] - GetSeg()->Dz()/2.; AliITSRawClusterSPD *clust = new AliITSRawClusterSPD(zcenter[i], //f xcenter[i], //f ndig, //f ndz,ndx, //ii ndxmin,ndxmax,//ii (Double_t) ndzmin, (Double_t) ndzmax, 0,GetModule()); iTS->AddCluster(0,clust); delete clust; }//end loop on clusters delete[] ifpad; delete[] xpad ; delete[] zpad ; delete[] iclus; delete[] tr1pad; delete[] tr2pad; delete[] tr3pad; delete[] tr4pad; } //______________________________________________________---------------- void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus, Double_t *xcenter,Double_t *zcenter, Double_t *errxcenter, Double_t *errzcenter, Int_t *tr1clus, Int_t *tr2clus, Int_t *tr3clus){ // A point is associated to each cluster of SPD digits. The points // and their associated errors are stored in the file galiceSP.root. Double_t l[3],xg,zg; const Double_t kconv = 1.0e-4; // micron -> cm // get rec points static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); for (Int_t i=0; iDy()/2.; l[2] = kconv*zcenter[i]; xg = l[0]; zg = l[2]; Double_t sigma2x = (kconv*errxcenter[i]) * (kconv*errxcenter[i]); Double_t sigma2z = (kconv*errzcenter[i]) * (kconv*errzcenter[i]); AliITSRecPoint rnew; rnew.SetX(xg); rnew.SetZ(zg); rnew.SetQ(1.); rnew.SetdEdX(0.); rnew.SetSigmaX2(sigma2x); rnew.SetSigmaZ2(sigma2z); rnew.fTracks[0]=tr1clus[i]; rnew.fTracks[1]=tr2clus[i]; rnew.fTracks[2]=tr3clus[i]; iTS->AddRecPoint(rnew); } // end for i }