X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSclustererV2.cxx;h=e81800fba2716eebb92173d8731ef210a382d72c;hb=3d5f4b023495312d273803a19b76504b54e1a027;hp=0113a3f195ad2844b6f36f9e331ae5bae7c7d085;hpb=60b9526b17b122ac6fa693b3d8829dd111f7576c;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSclustererV2.cxx b/ITS/AliITSclustererV2.cxx index 0113a3f195a..e81800fba27 100644 --- a/ITS/AliITSclustererV2.cxx +++ b/ITS/AliITSclustererV2.cxx @@ -185,7 +185,7 @@ void AliITSclustererV2::Digits2Clusters(AliRawReader* rawReader) { //------------------------------------------------------------ // This function creates ITS clusters from raw data //------------------------------------------------------------ - AliRunLoader* runLoader = AliRunLoader::GetRunLoader(); + AliRunLoader* runLoader = AliRunLoader::Instance(); if (!runLoader) { Error("Digits2Clusters", "no run loader found"); return; @@ -223,17 +223,19 @@ void AliITSclustererV2::Digits2Clusters(AliRawReader* rawReader) { // write all clusters to the tree Int_t nClusters = 0; + TClonesArray *emptyArray=new TClonesArray("AliITSclusterV2"); for (Int_t iModule = 0; iModule < fNModules; iModule++) { array = clusters[iModule]; if (!array) { Error("Digits2Clusters", "data for module %d missing!", iModule); - array = new TClonesArray("AliITSclusterV2"); + array = emptyArray; } cTree->SetBranchAddress("Clusters", &array); cTree->Fill(); nClusters += array->GetEntriesFast(); - delete array; } + delete emptyArray; + itsLoader->WriteRecPoints("OVERWRITE"); delete[] clusters; @@ -256,7 +258,7 @@ static void CheckLabels(Int_t lab[3]) { //------------------------------------------------------------ // Tries to find mother's labels //------------------------------------------------------------ - AliRunLoader *rl = AliRunLoader::GetRunLoader(); + AliRunLoader *rl = AliRunLoader::Instance(); TTree *trK=(TTree*)rl->TreeK(); if(trK){ @@ -277,9 +279,15 @@ static void CheckLabels(Int_t lab[3]) { label=m; part=(TParticle*)gAlice->GetMCApp()->Particle(label); } - if (lab[1]<0) lab[1]=label; - else if (lab[2]<0) lab[2]=label; - else ;//cerr<<"CheckLabels : No empty labels !\n"; + if(lab[1]<0){ + lab[1]=label; + } + else if (lab[2]<0) { + lab[2]=label; + } + else { + // cerr<<"CheckLabels : No empty labels !\n"; + } } } } @@ -316,7 +324,7 @@ static void CheckLabels2(Int_t lab[10]) { //------------------------------------------------------------ // Tries to find mother's labels //------------------------------------------------------------ - AliRunLoader *rl = AliRunLoader::GetRunLoader(); + AliRunLoader *rl = AliRunLoader::Instance(); TTree *trK=(TTree*)rl->TreeK(); if(trK){ @@ -387,7 +395,7 @@ static void CheckLabels2(Int_t lab[10]) { static void AddLabel(Int_t lab[10], Int_t label) { // add label of the particle in the kine tree which originates this cluster // (used for reconstruction of MC data only, for comparison purposes) - AliRunLoader *rl = AliRunLoader::GetRunLoader(); + AliRunLoader *rl = AliRunLoader::Instance(); TTree *trK=(TTree*)rl->TreeK(); if(trK){ @@ -521,7 +529,7 @@ FindClustersSPD(const TClonesArray *digits, TClonesArray *clusters) { for (Int_t iz=zmin; iz<=zmax;iz+=idz) for (Int_t iy=ymin; iy<=ymax;iy+=idy){ // - Int_t ndigits =0; + Int_t nodigits =0; Float_t y=0.,z=0.,q=0.; for (Int_t l=0; lUncheckedAt(idx[l]); @@ -529,12 +537,12 @@ FindClustersSPD(const TClonesArray *digits, TClonesArray *clusters) { if (TMath::Abs( d->GetCoord2()-iy)>0.75*idy) continue; if (TMath::Abs( d->GetCoord1()-iz)>0.75*idz) continue; } - ndigits++; + nodigits++; Float_t qq=d->GetSignal(); y+=qq*fYSPD[d->GetCoord2()]; z+=qq*fZSPD[d->GetCoord1()]; q+=qq; } - if (ndigits==0) continue; + if (nodigits==0) continue; y/=q; z/=q; y-=fHwSPD; z-=fHlSPD; @@ -1663,8 +1671,8 @@ void AliITSclustererV2::FindClustersSSD(AliITSRawStream* input, fI = iModule; FindClustersSSD(&clusters1D[0][0], nClusters[0], &clusters1D[1][0], nClusters[1], clusters[iModule]); - Int_t nClusters = clusters[iModule]->GetEntriesFast(); - nClustersSSD += nClusters; + Int_t noClusters = clusters[iModule]->GetEntriesFast(); + nClustersSSD += noClusters; } if (!next) break;