/************************************************************************** * 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. * **************************************************************************/ #include "AliITSClusterFinderSPD.h" #include "AliITS.h" #include "AliITSgeom.h" #include "AliITSdigit.h" #include "AliITSRawCluster.h" #include "AliITSRecPoint.h" #include "AliITSsegmentation.h" #include "AliITSresponse.h" #include "AliRun.h" //#define DEBUG ClassImp(AliITSClusterFinderSPD) //---------------------------------------------------------- AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg, TClonesArray *digits, TClonesArray *recp){ // constructor fSegmentation = seg; fDigits = digits; fClusters = recp; fNclusters = fClusters->GetEntriesFast(); SetDx(); SetDz(); } //______________________________________________________________________ AliITSClusterFinderSPD::AliITSClusterFinderSPD(){ // constructor fSegmentation = 0; fDigits = 0; fClusters = 0; fNclusters = 0; SetDx(); SetDz(); } //_____________________________________________________________________ AliITSClusterFinderSPD::AliITSClusterFinderSPD(const AliITSClusterFinderSPD &source){ // Copy Constructor if(&source == this) return; this->fClusters = source.fClusters ; this->fNclusters = source.fNclusters ; this->fDz = source.fDz ; this->fDx = source.fDx ; return; } //______________________________________________________________________ AliITSClusterFinderSPD& AliITSClusterFinderSPD::operator=( const AliITSClusterFinderSPD &source) { // Assignment operator if(&source == this) return *this; this->fClusters = source.fClusters ; this->fNclusters = source.fNclusters ; this->fDz = source.fDz ; this->fDx = source.fDx ; 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; Float_t *xcenterl = new Float_t[numberc]; Float_t *zcenterl = new Float_t[numberc]; Float_t *errxcenter = new Float_t[numberc]; Float_t *errzcenter = new Float_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; digitcount=0; Int_t ndigits = fDigits->GetEntriesFast(); if (!ndigits) return; AliITSdigitSPD *dig; Int_t ndig,i; // cout << "FindRawcluters"<UncheckedAt(ndig); digx[digitcount] = dig->fCoord2+1; //starts at 1 digz[digitcount] = dig->fCoord1+1; //starts at 1 digtr1[digitcount] = dig->fTracks[0]; digtr2[digitcount] = -3; digtr3[digitcount] = -3; //cout << "digtr1["<fTracks[i] && iGetNTracks()) i++; //cout << " fTracks["<fTracks[i]; if(iGetNTracks()){ digtr2[digitcount] = dig->fTracks[i]; //cout << "digtr2["<fTracks[i] || digtr2[digitcount]==dig->fTracks[i] )&& i<=dig->GetNTracks()) i++; if(iGetNTracks()) digtr3[digitcount] = dig->fTracks[i]; //cout << " fTracks["<GetNTracks()) cout <fTracks[i]; //cout << "digtr3["<Dx()/2.; zcenter[i] = zcenter[i] - fSegmentation->Dz()/2.; AliITSRawClusterSPD *clust = new AliITSRawClusterSPD(zcenter[i], //f xcenter[i], //f ndig, //f ndz,ndx, //ii ndxmin,ndxmax,//ii (Float_t) ndzmin, (Float_t) ndzmax, 0,module); //ii 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, Float_t *xcenter,Float_t *zcenter, Float_t *errxcenter, Float_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. Float_t l[3],xg,zg; const Float_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]; Float_t sigma2x = (kconv*errxcenter[i]) * (kconv*errxcenter[i]); Float_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 }