From: martinez Date: Fri, 23 Jan 2004 10:58:41 +0000 (+0000) Subject: Conding violations X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=c1aed84f40479d6b1cfe3a0f05574f5053e74e89;p=u%2Fmrichter%2FAliRoot.git Conding violations --- diff --git a/MUON/AliMUONClusterFinderAZ.cxx b/MUON/AliMUONClusterFinderAZ.cxx index 308150d9f83..684e51f822d 100644 --- a/MUON/AliMUONClusterFinderAZ.cxx +++ b/MUON/AliMUONClusterFinderAZ.cxx @@ -25,6 +25,10 @@ #include "AliMUONPixel.h" #include "AliMC.h" +// Clusterizer class developped by Zitchenko (Dubna) +// +// +// // This function is used for fitting void fcn1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag); @@ -94,7 +98,7 @@ void AliMUONClusterFinderAZ::EventLoop(Int_t nev=0, Int_t ch=0) TView *view = 0; TH2F *hist = 0; Double_t p1[3]={0}, p2[3]; - TTree *TR = 0; + TTree *treeR = 0; if (fDraw) { // File lun = fopen("pool.dat","w"); @@ -116,31 +120,31 @@ newev: cout << "nparticles " << nparticles <TreeH(); - Int_t ntracks = (Int_t) TH->GetEntries(); + TTree *treeH = gime->TreeH(); + Int_t ntracks = (Int_t) treeH->GetEntries(); cout<<"ntracks "<GetModule("MUON"); - if (!MUON) return; + AliMUON *muon = (AliMUON*) gAlice->GetModule("MUON"); + if (!muon) return; // TClonesArray *Particles = gAlice->Particles(); if (!fReco) { - TR = gime->TreeR(); - if (TR) { - MUON->ResetRawClusters(); - nent = (Int_t) TR->GetEntries(); + treeR = gime->TreeR(); + if (treeR) { + muon->ResetRawClusters(); + nent = (Int_t) treeR->GetEntries(); if (nent != 1) { cout << "Error in MUONdrawClust" << endl; cout << " nent = " << nent << " not equal to 1" << endl; //exit(0); } - } // if (TR) + } // if (treeR) } // if (!fReco) - TTree *TD = gime->TreeD(); - //MUON->ResetDigits(); + TTree *treeD = gime->TreeD(); + //muon->ResetDigits(); - TClonesArray *MUONrawclust; + TClonesArray *listMUONrawclust ; AliMUONChamber* iChamber = 0; // As default draw the first cluster of the chamber #0 @@ -148,17 +152,17 @@ newev: newchamber: if (ch > 9) {if (fReco) return; nev++; ch = 0; goto newev;} //gAlice->ResetDigits(); - fMuonDigits = MUON->GetMUONData()->Digits(ch); + fMuonDigits = muon->GetMUONData()->Digits(ch); if (fMuonDigits == 0) return; - iChamber = &(MUON->Chamber(ch)); + iChamber = &(muon->Chamber(ch)); fSegmentation[0] = iChamber->SegmentationModel(1); fSegmentation[1] = iChamber->SegmentationModel(2); fResponse = iChamber->ResponseModel(); nent = 0; - if (TD) { - nent = (Int_t) TD->GetEntries(); + if (treeD) { + nent = (Int_t) treeD->GetEntries(); //printf(" entries %d \n", nent); } @@ -185,8 +189,8 @@ next: for (Int_t iii = 0; iii<2; iii++) { Int_t cath = TMath::Odd(iii); gAlice->ResetDigits(); - TD->GetEvent(cath); - fMuonDigits = MUON->GetMUONData()->Digits(ch); + treeD->GetEvent(cath); + fMuonDigits = muon->GetMUONData()->Digits(ch); ndigits[cath] = fMuonDigits->GetEntriesFast(); if (!ndigits[0] && !ndigits[1]) {if (fReco) return; ch++; goto newchamber;} @@ -196,7 +200,7 @@ next: AliMUONDigit *mdig; Int_t digit; - Bool_t EOC = kTRUE; // end-of-cluster + Bool_t eEOC = kTRUE; // end-of-cluster for (digit = 0; digit < ndigits[cath]; digit++) { mdig = (AliMUONDigit*)fMuonDigits->UncheckedAt(digit); if (mdig->Cathode() != cath) continue; @@ -213,10 +217,10 @@ next: } // Add pad - recursive call AddPad(cath,digit); - EOC = kFALSE; + eEOC = kFALSE; if (digit >= 0) break; } - if (first && EOC) { + if (first && eEOC) { // No more unused pads if (cath == 0) continue; // on cathode #0 - check #1 else { @@ -226,7 +230,7 @@ next: goto newchamber; // next chamber } } - if (EOC) break; // cluster found + if (eEOC) break; // cluster found first = kFALSE; cout << " nPads: " << fnPads[cath] << " " << nShown[cath]+fnPads[cath] << " " << cath << endl; } // for (Int_t iii = 0; @@ -388,10 +392,10 @@ next: fnMu = 0; Int_t ix, iy, iok; for (Int_t i=0; iGetEvent(i); - for (AliMUONHit* mHit=(AliMUONHit*)MUON->FirstHit(-1); + treeH->GetEvent(i); + for (AliMUONHit* mHit=(AliMUONHit*)muon->FirstHit(-1); mHit; - mHit=(AliMUONHit*)MUON->NextHit()) { + mHit=(AliMUONHit*)muon->NextHit()) { if (mHit->Chamber() != ch+1) continue; // chamber number if (TMath::Abs(mHit->Z()-zpad0) > 1) continue; // different slat p2[0] = p1[0] = mHit->X(); // x-pos of hit @@ -433,14 +437,14 @@ next: } // for (Int_t i=0; iGetMUONData()->RawClusters(ch); - TR->GetEvent(ch); - //cout << MUONrawclust << " " << MUONrawclust->GetEntries() << endl; + listMUONrawclust = muon->GetMUONData()->RawClusters(ch); + treeR->GetEvent(ch); + //cout << listMUONrawclust << " " << listMUONrawclust ->GetEntries() << endl; AliMUONRawCluster *mRaw; gStyle->SetLineColor(3); cout << " *** Reconstructed hits *** " << endl; - for (Int_t i=0; iGetEntries(); i++) { - mRaw = (AliMUONRawCluster*)MUONrawclust->UncheckedAt(i); + for (Int_t i=0; iGetEntries(); i++) { + mRaw = (AliMUONRawCluster*)listMUONrawclust ->UncheckedAt(i); if (TMath::Abs(mRaw->fZ[0]-zpad0) > 1) continue; // different slat p2[0] = p1[0] = mRaw->fX[0]; // x-pos of hit p2[1] = p1[1] = mRaw->fY[0]; // y-pos @@ -449,7 +453,7 @@ next: if (p1[1] < hist->GetYaxis()->GetXmin() || p1[1] > hist->GetYaxis()->GetXmax()) continue; /* - TD->GetEvent(cath); + treeD->GetEvent(cath); cout << mRaw->fMultiplicity[0] << mRaw->fMultiplicity[1] << endl; for (Int_t j=0; jfMultiplicity[cath]; j++) { Int_t digit = mRaw->fIndexMap[j][cath]; @@ -475,7 +479,7 @@ next: line[nLine++]->Draw(); } } - } // for (Int_t i=0; iGetEntries(); + } // for (Int_t i=0; iGetEntries(); if (fDraw) c1->Update(); skip: @@ -1565,8 +1569,8 @@ void AliMUONClusterFinderAZ::Split(TH2D *mlem, Double_t *coef) } // Compute couplings of clusters to pads - TMatrixD *aij_clu_pad = new TMatrixD(nclust,npad); - *aij_clu_pad = 0; + TMatrixD *aijclupad = new TMatrixD(nclust,npad); + *aijclupad = 0; Int_t npxclu; for (Int_t iclust=0; iclust 1) aij_clu_clu->Print(); + if (nclust > 1) aijcluclu->Print(); // Find groups of coupled clusters used = new Bool_t[nclust]; @@ -1617,7 +1621,7 @@ void AliMUONClusterFinderAZ::Split(TH2D *mlem, Double_t *coef) clustNumb[0] = igroup; nCoupled = 1; // Find group of coupled clusters - AddCluster(igroup, nclust, aij_clu_clu, used, clustNumb, nCoupled); // recursive + AddCluster(igroup, nclust, aijcluclu, used, clustNumb, nCoupled); // recursive cout << " nCoupled: " << nCoupled << endl; for (Int_t i=0; i 1) { + if (SelectPad(nCoupled, nForFit, clustNumb, clustFit, aijclupad) < 3 && nCoupled > 1) { // Deselect pads for (Int_t j=0; j 0) } // for (Int_t igroup=0; igroupDelete(); aij_clu_pad->Delete(); + //delete aij_clu; aij_clu = 0; delete aijclupad; aijclupad = 0; + aijcluclu->Delete(); aijclupad->Delete(); for (Int_t iclust=0; iclustClear(); @@ -1772,21 +1776,21 @@ TObject* AliMUONClusterFinderAZ::BinToPix(TH2D *mlem, Int_t jc, Int_t ic) } //_____________________________________________________________________________ -void AliMUONClusterFinderAZ::AddCluster(Int_t ic, Int_t nclust, TMatrixD *aij_clu_clu, Bool_t *used, Int_t *clustNumb, Int_t &nCoupled) +void AliMUONClusterFinderAZ::AddCluster(Int_t ic, Int_t nclust, TMatrixD *aijcluclu, Bool_t *used, Int_t *clustNumb, Int_t &nCoupled) { // Add a cluster to the group of coupled clusters for (Int_t i=0; i 3) { - pad_pix = new Double_t[npad]; - for (Int_t i=0; i 3) { @@ -1894,8 +1898,8 @@ Int_t AliMUONClusterFinderAZ::SelectPad(Int_t nCoupled, Int_t nForFit, Int_t *cl for (Int_t iclust1=0; iclust1 3) } // for (Int_t j=0; j couplMax) { - couplMax = (*aij_clu_clu)(indx,indx1); + if ((*aijcluclu)(indx,indx1) > couplMax) { + couplMax = (*aijcluclu)(indx,indx1); imax = indx1; } } // for (Int_t icl1=0; /*if (couplMax < kCouplMin) { cout << " Oops " << couplMax << endl; - aij_clu_clu->Print(); + aijcluclu->Print(); cout << icl << " " << indx << " " << npxclu << " " << nLinks << endl; ::exit(0); }*/ @@ -1950,20 +1954,20 @@ void AliMUONClusterFinderAZ::Merge(Int_t nForFit, Int_t nCoupled, Int_t *clustNu for (Int_t i=0; iAdd(pix->UncheckedAt(i)); pix->RemoveAt(i); } cout << " New number of pixels: " << npxclu1 << " " << pix1->GetEntriesFast() << endl; //Add cluster-to-cluster couplings - //aij_clu_clu->Print(); + //aijcluclu->Print(); for (Int_t icl1=0; icl1Print(); + (*aijcluclu)(indx,imax) = (*aijcluclu)(imax,indx) = 0; + //aijcluclu->Print(); //Add cluster-to-pad couplings for (Int_t j=0; j