X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCclusterer.cxx;h=f9849ebe3c337167299db15c1a61bde1bb502e3a;hb=ecb7e705361b01c6b23703357324a2f0bf176b78;hp=aeb503fd5cda486403d3b9d54faf0c97f98a6a29;hpb=88cb7938ca21d4a80991d4e7aa564008c29340f7;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCclusterer.cxx b/TPC/AliTPCclusterer.cxx index aeb503fd5cd..f9849ebe3c3 100644 --- a/TPC/AliTPCclusterer.cxx +++ b/TPC/AliTPCclusterer.cxx @@ -25,16 +25,35 @@ #include "AliTPCcluster.h" #include #include -#include "AliTPCClustersArray.h" -#include "AliTPCClustersRow.h" #include "AliDigits.h" #include "AliSimDigits.h" #include "AliTPCParam.h" -#include +#include "AliTPCClustersRow.h" #include -#include "AliRunLoader.h" -#include "AliLoader.h" +ClassImp(AliTPCclusterer) + + +//____________________________________________________ +AliTPCclusterer::AliTPCclusterer(const AliTPCclusterer ¶m) + :TObject(), + fPar(0) +{ + // + // dummy + // + fPar = param.fPar; +} +//----------------------------------------------------- +AliTPCclusterer & AliTPCclusterer::operator =(const AliTPCclusterer & param) +{ + // + // assignment operator - dummy + // + fPar = param.fPar; + return (*this); +} +//____________________________________________________ void AliTPCclusterer::FindPeaks(Int_t k,Int_t max, AliBin *b,Int_t *idx,UInt_t *msk,Int_t& n) { //find local maxima @@ -87,76 +106,54 @@ AliTPCcluster &c) { } //_____________________________________________________________________________ -void AliTPCclusterer::Digits2Clusters(const AliTPCParam *par, AliLoader *of, Int_t eventn) -{ +Int_t AliTPCclusterer::Digits2Clusters(TTree *dTree, TTree *cTree) { //----------------------------------------------------------------- // This is a simple cluster finder. //----------------------------------------------------------------- - AliRunLoader* rl = (AliRunLoader*)of->GetEventFolder()->FindObject(AliRunLoader::fgkRunLoaderName); - rl->GetEvent(eventn); - TDirectory *savedir=gDirectory; - - if (of->TreeR() == 0x0) of->MakeTree("R"); - - - if (of == 0x0) - { - cerr<<"AliTPC::Digits2Clusters(): output file not open !\n"; - return; - } - - const Int_t kMAXZ=par->GetMaxTBin()+2; - - - TTree *t = (TTree *)of->TreeD(); - - if (!t) { - cerr<<"Input tree with digits not found"<GetBranch("Segment"); + if (!branch) { + Error("Digits2Cluster","Can't get the branch !"); + return 1; } - AliSimDigits digarr, *dummy=&digarr; - t->GetBranch("Segment")->SetAddress(&dummy); - Stat_t nentries = t->GetEntries(); - - cout<<"Got "<Write(par->GetTitle()); + branch->SetAddress(&dummy); - AliTPCClustersArray carray; - carray.Setup(par); - carray.SetClusterType("AliTPCcluster"); - - TTree* treeR = of->TreeR(); - carray.MakeTree(treeR); - + AliTPCClustersRow ddd,*clrow=&ddd; + clrow->SetClass("AliTPCcluster"); clrow->SetArray(1); + cTree->Branch("Segment","AliTPCClustersRow",&clrow,32000,200); + const Int_t kMAXZ=fPar->GetMaxTBin()+2; Int_t nclusters=0; - for (Int_t n=0; nGetEntries(); + for (Int_t n=0; nGetEvent(n); + dTree->GetEvent(n); - if (!par->AdjustSectorRow(digarr.GetID(),sec,row)) { - cerr<<"AliTPC warning: invalid segment ID ! "<AdjustSectorRow(digarr.GetID(),sec,row)) { + Error("Digits2Clusters","!nvalid segment ID ! %d",digarr.GetID()); continue; } - AliTPCClustersRow *clrow=carray.CreateRow(sec,row); + clrow=new AliTPCClustersRow(); + + clrow->SetClass("AliTPCcluster"); clrow->SetArray(1); + clrow->SetID(digarr.GetID()); - Float_t rx=par->GetPadRowRadii(sec,row); + cTree->GetBranch("Segment")->SetAddress(&clrow); + + Float_t rx=fPar->GetPadRowRadii(sec,row); Int_t npads, sign; { - const Int_t kNIS=par->GetNInnerSector(), kNOS=par->GetNOuterSector(); + const Int_t kNIS=fPar->GetNInnerSector(), kNOS=fPar->GetNOuterSector(); if (sec < kNIS) { - npads = par->GetNPadsLow(row); + npads = fPar->GetNPadsLow(row); sign = (sec < kNIS/2) ? 1 : -1; } else { - npads = par->GetNPadsUp(row); + npads = fPar->GetNPadsUp(row); sign = ((sec-kNIS) < kNOS/2) ? 1 : -1; } } @@ -170,7 +167,7 @@ void AliTPCclusterer::Digits2Clusters(const AliTPCParam *par, AliLoader *of, Int digarr.First(); do { Short_t dig=digarr.CurrentDigit(); - if (dig<=par->GetZeroSup()) continue; + if (dig<=fPar->GetZeroSup()) continue; Int_t j=digarr.CurrentRow()+1, i=digarr.CurrentColumn()+1; bins[i*kMAXZ+j].SetQ(dig); bins[i*kMAXZ+j].SetMask(1); @@ -218,25 +215,25 @@ void AliTPCclusterer::Digits2Clusters(const AliTPCParam *par, AliLoader *of, Int c.SetZ(c.GetZ()/c.GetQ()); Float_t s2 = c.GetSigmaY2()/c.GetQ() - c.GetY()*c.GetY(); - Float_t w=par->GetPadPitchWidth(sec); + Float_t w=fPar->GetPadPitchWidth(sec); c.SetSigmaY2((s2 + 1./12.)*w*w); if (s2 != 0.) { c.SetSigmaY2(c.GetSigmaY2()*0.108); - if (secGetNInnerSector()) c.SetSigmaY2(c.GetSigmaY2()*2.07); + if (secGetNInnerSector()) c.SetSigmaY2(c.GetSigmaY2()*2.07); } s2 = c.GetSigmaZ2()/c.GetQ() - c.GetZ()*c.GetZ(); - w=par->GetZWidth(); + w=fPar->GetZWidth(); c.SetSigmaZ2((s2 + 1./12.)*w*w); if (s2 != 0.) { c.SetSigmaZ2(c.GetSigmaZ2()*0.169); - if (secGetNInnerSector()) c.SetSigmaZ2(c.GetSigmaZ2()*1.77); + if (secGetNInnerSector()) c.SetSigmaZ2(c.GetSigmaZ2()*1.77); } - c.SetY((c.GetY() - 0.5 - 0.5*npads)*par->GetPadPitchWidth(sec)); - c.SetZ(par->GetZWidth()*(c.GetZ()-1)); - c.SetZ(c.GetZ() - 3.*par->GetZSigma()); // PASA delay - c.SetZ(sign*(par->GetZLength() - c.GetZ())); + c.SetY((c.GetY() - 0.5 - 0.5*npads)*fPar->GetPadPitchWidth(sec)); + c.SetZ(fPar->GetZWidth()*(c.GetZ()-1)); + c.SetZ(c.GetZ() - 3.*fPar->GetZSigma()); // PASA delay + c.SetZ(sign*(fPar->GetZLength(sec) - c.GetZ())); if (rx<230./250.*TMath::Abs(c.GetZ())) continue; @@ -254,23 +251,17 @@ void AliTPCclusterer::Digits2Clusters(const AliTPCParam *par, AliLoader *of, Int clrow->InsertCluster(&c); ncl++; } } - carray.StoreRow(sec,row); - carray.ClearRow(sec,row); + cTree->Fill(); - //cerr<<"sector, row, compressed digits, clusters: " - //<WriteRecPoints("OVERWRITE"); - - savedir->cd(); + Info("Digits2Cluster","Number of found clusters : %d",nclusters); -// delete t; //Thanks to Mariana Bondila + return 0; }