X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSClusterFinderV2.cxx;h=836b857793a42ad9e6a3579a88e256354c4dc928;hb=60dd5042bf4e0785a7e9e79abd6d3c60b5282a71;hp=2be96be39487e2f42c4bfe6db955a4f02978854f;hpb=8ba39da91cc548b1300a6fffdca0a2199d0eb8ef;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSClusterFinderV2.cxx b/ITS/AliITSClusterFinderV2.cxx index 2be96be3948..836b857793a 100644 --- a/ITS/AliITSClusterFinderV2.cxx +++ b/ITS/AliITSClusterFinderV2.cxx @@ -22,9 +22,9 @@ #include "AliRun.h" #include "AliITSClusterFinderV2.h" -#include "AliITSclusterV2.h" +#include "AliITSRecPoint.h" +#include "AliITSgeomTGeo.h" #include "AliITSDetTypeRec.h" -//#include "AliITSgeom.h" #include #include "AliMC.h" @@ -32,28 +32,26 @@ ClassImp(AliITSClusterFinderV2) extern AliRun *gAlice; -AliITSClusterFinderV2::AliITSClusterFinderV2(AliITSDetTypeRec* dettyp):AliITSClusterFinder(dettyp){ - +AliITSClusterFinderV2::AliITSClusterFinderV2(AliITSDetTypeRec* dettyp):AliITSClusterFinder(dettyp), +fNModules(AliITSgeomTGeo::GetNModules()), +fEvent(0){ //Default constructor - fEvent = 0; - fModule = 0; - fNModules = dettyp->GetITSgeom()->GetIndexMax(); } - +/* //______________________________________________________________________ AliITSClusterFinderV2::AliITSClusterFinderV2(const AliITSClusterFinderV2 &source) : AliITSClusterFinder(source) { // Copy constructor // Copies are not allowed. The method is protected to avoid misuse. Fatal("AliITSClusterFinderV2","Copy constructor not allowed\n"); } - +*/ //______________________________________________________________________ -AliITSClusterFinderV2& AliITSClusterFinderV2::operator=(const AliITSClusterFinderV2& /* source */){ +//AliITSClusterFinderV2& AliITSClusterFinderV2::operator=(const AliITSClusterFinderV2& /* source */){ // Assignment operator // Assignment is not allowed. The method is protected to avoid misuse. - Fatal("= operator","Assignment operator not allowed\n"); - return *this; -} + //Fatal("= operator","Assignment operator not allowed\n"); + //return *this; +//} //______________________________________________________________________ @@ -61,19 +59,23 @@ void AliITSClusterFinderV2::CheckLabels2(Int_t lab[10]) { //------------------------------------------------------------ // Tries to find mother's labels //------------------------------------------------------------ - Int_t nlabels =0; - for (Int_t i=0;i<10;i++) if (lab[i]>=0) nlabels++; - if(nlabels == 0) return; // In case of no labels just exit + AliRunLoader *rl = AliRunLoader::GetRunLoader(); + TTree *trK=(TTree*)rl->TreeK(); + if(trK){ + Int_t nlabels =0; + for (Int_t i=0;i<10;i++) if (lab[i]>=0) nlabels++; + if(nlabels == 0) return; // In case of no labels just exit - Int_t ntracks = gAlice->GetMCApp()->GetNtrack(); - for (Int_t i=0;i<10;i++){ - Int_t label = lab[i]; - if (label>=0 && labelGetMCApp()->Particle(label); + Int_t ntracks = gAlice->GetMCApp()->GetNtrack(); - if (part->P() < 0.02) { + for (Int_t i=0;i<10;i++){ + Int_t label = lab[i]; + if (label>=0 && labelGetMCApp()->Particle(label); + + if (part->P() < 0.02) { Int_t m=part->GetFirstMother(); if (m<0) { continue; @@ -82,66 +84,69 @@ void AliITSClusterFinderV2::CheckLabels2(Int_t lab[10]) { continue; } lab[i]=m; + } + else + if (part->P() < 0.12 && nlabels>3) { + lab[i]=-2; + nlabels--; + } } - else - if (part->P() < 0.12 && nlabels>3) { + else{ + if ( (label>ntracks||label <0) && nlabels>3) { lab[i]=-2; nlabels--; } - } - else{ - if ( (label>ntracks||label <0) && nlabels>3) { - lab[i]=-2; - nlabels--; - } - } - } - if (nlabels>3){ - for (Int_t i=0;i<10;i++){ - if (nlabels>3){ - Int_t label = lab[i]; - if (label>=0 && labelGetMCApp()->Particle(label); - if (part->P() < 0.1) { - lab[i]=-2; - nlabels--; + } + } + if (nlabels>3){ + for (Int_t i=0;i<10;i++){ + if (nlabels>3){ + Int_t label = lab[i]; + if (label>=0 && labelGetMCApp()->Particle(label); + if (part->P() < 0.1) { + lab[i]=-2; + nlabels--; + } } } } } - } - //compress labels -- if multi-times the same - Int_t lab2[10]; - for (Int_t i=0;i<10;i++) lab2[i]=-2; - for (Int_t i=0;i<10 ;i++){ - if (lab[i]<0) continue; - for (Int_t j=0;j<10 &&lab2[j]!=lab[i];j++){ - if (lab2[j]<0) { - lab2[j]= lab[i]; - break; + //compress labels -- if multi-times the same + Int_t lab2[10]; + for (Int_t i=0;i<10;i++) lab2[i]=-2; + for (Int_t i=0;i<10 ;i++){ + if (lab[i]<0) continue; + for (Int_t j=0;j<10 &&lab2[j]!=lab[i];j++){ + if (lab2[j]<0) { + lab2[j]= lab[i]; + break; + } } } - } - for (Int_t j=0;j<10;j++) lab[j]=lab2[j]; + for (Int_t j=0;j<10;j++) lab[j]=lab2[j]; + } } //______________________________________________________________________ void AliITSClusterFinderV2::AddLabel(Int_t lab[10], Int_t label) { - //add label to the cluster + AliRunLoader *rl = AliRunLoader::GetRunLoader(); + TTree *trK=(TTree*)rl->TreeK(); + if(trK){ + if(label<0) return; // In case of no label just exit - if(label<0) return; // In case of no label just exit - - Int_t ntracks = gAlice->GetMCApp()->GetNtrack(); - if (label>ntracks) return; - for (Int_t i=0;i<10;i++){ - // if (label<0) break; - if (lab[i]==label) break; - if (lab[i]<0) { - lab[i]= label; - break; + Int_t ntracks = gAlice->GetMCApp()->GetNtrack(); + if (label>ntracks) return; + for (Int_t i=0;i<10;i++){ + // if (label<0) break; + if (lab[i]==label) break; + if (lab[i]<0) { + lab[i]= label; + break; + } } } } @@ -227,7 +232,7 @@ MarkPeak(Int_t k, Int_t max, AliBin *bins, UInt_t m) { //______________________________________________________________________ void AliITSClusterFinderV2:: -MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSclusterV2 &c) { +MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSRecPoint &c) { //------------------------------------------------------------ //make cluster using digits of this peak //------------------------------------------------------------ @@ -235,8 +240,8 @@ MakeCluster(Int_t k,Int_t max,AliBin *bins,UInt_t m,AliITSclusterV2 &c) { Int_t i=k/max, j=k-i*max; c.SetQ(c.GetQ()+q); - c.SetY(c.GetY()+i*q); - c.SetZ(c.GetZ()+j*q); + c.SetY(c.GetY()+i*q); + c.SetZ(c.GetZ()+j*q); c.SetSigmaY2(c.GetSigmaY2()+i*i*q); c.SetSigmaZ2(c.GetSigmaZ2()+j*j*q);