X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HMPID%2FAliHMPIDCluster.cxx;h=3e4351b6e25b5046f7347d91cb1e5d287022d772;hb=03768ab205d91f06a8091dc8b2156e72e60b803c;hp=ceb7c7bab5b8f0d917336f18c7a8a41f95ee1d2a;hpb=b38ac33a29ed255808c76e6f2952f7b1b9737c24;p=u%2Fmrichter%2FAliRoot.git diff --git a/HMPID/AliHMPIDCluster.cxx b/HMPID/AliHMPIDCluster.cxx index ceb7c7bab5b..3e4351b6e25 100644 --- a/HMPID/AliHMPIDCluster.cxx +++ b/HMPID/AliHMPIDCluster.cxx @@ -13,13 +13,13 @@ // * provided "as is" without express or implied warranty. * // ************************************************************************** +#include "AliHMPIDCluster.h" //class header #include //Solve() #include //Solve() #include //Solve() #include //Draw() -#include "AliLog.h" //FitFunc() -#include "AliHMPIDCluster.h" //class header +#include "AliLog.h" //FindCusterSize() Bool_t AliHMPIDCluster::fgDoCorrSin=kTRUE; @@ -185,12 +185,12 @@ void AliHMPIDCluster::FitFunc(Int_t &iNpars, Double_t* deriv, Double_t &chi2, Do for(Int_t i=0;iDig(i)->IntMathieson(par[3*j],par[3*j+1]); - derivPart[3*j ][i] += par[3*j+2]*(pClu->Dig(i)->Mathieson(par[3*j]-pClu->Dig(i)->LorsX()-0.5*AliHMPIDParam::SizePadX())- - pClu->Dig(i)->Mathieson(par[3*j]-pClu->Dig(i)->LorsX()+0.5*AliHMPIDParam::SizePadX()))* - pClu->Dig(i)->IntPartMathi(par[3*j+1],2); - derivPart[3*j+1][i] += par[3*j+2]*(pClu->Dig(i)->Mathieson(par[3*j+1]-pClu->Dig(i)->LorsY()-0.5*AliHMPIDParam::SizePadY())- - pClu->Dig(i)->Mathieson(par[3*j+1]-pClu->Dig(i)->LorsY()+0.5*AliHMPIDParam::SizePadY()))* - pClu->Dig(i)->IntPartMathi(par[3*j],1); + derivPart[3*j ][i] += par[3*j+2]*(pClu->Dig(i)->MathiesonX(par[3*j]-pClu->Dig(i)->LorsX()-0.5*AliHMPIDParam::SizePadX())- + pClu->Dig(i)->MathiesonX(par[3*j]-pClu->Dig(i)->LorsX()+0.5*AliHMPIDParam::SizePadX()))* + pClu->Dig(i)->IntPartMathiY(par[3*j+1]); + derivPart[3*j+1][i] += par[3*j+2]*(pClu->Dig(i)->MathiesonY(par[3*j+1]-pClu->Dig(i)->LorsY()-0.5*AliHMPIDParam::SizePadY())- + pClu->Dig(i)->MathiesonY(par[3*j+1]-pClu->Dig(i)->LorsY()+0.5*AliHMPIDParam::SizePadY()))* + pClu->Dig(i)->IntPartMathiX(par[3*j]); derivPart[3*j+2][i] += fracMathi; } } @@ -211,6 +211,9 @@ void AliHMPIDCluster::FitFunc(Int_t &iNpars, Double_t* deriv, Double_t &chi2, Do for(Int_t i=0;iPrint(); }//Print() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) +Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Int_t *pSigmaCut, Bool_t isTryUnfold) { //This methode is invoked when the cluster is formed to solve it. Solve the cluster means to try to unfold the cluster //into the local maxima number of clusters. This methode is invoked by AliHMPIDRconstructor::Dig2Clu() on cluster by cluster basis. @@ -253,10 +257,14 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) const Int_t kMaxLocMax=6; //max allowed number of loc max for fitting // CoG(); //First calculate CoG for the given cluster + Int_t iCluCnt=pCluLst->GetEntriesFast(); //get current number of clusters already stored in the list by previous operations - if(isTryUnfold==kFALSE || Size()==1) { //if cluster contains single pad there is no way to improve the knowledge - fSt = (isTryUnfold)? kSi1: kNot; - if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh); + + Int_t rawSize = Size(); //get current raw cluster size + + if(rawSize>100 || isTryUnfold==kFALSE || Size()==1) { //No deconv if: 1 - big cluster (also avoid no zero suppression!) + fSt = (isTryUnfold)? kSi1: kNot; // 2 - flag is set to FALSE + if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh); // 3 - size = 1 new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //add this raw cluster return 1; } @@ -282,12 +290,12 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) //Phase 1. Find number of local maxima. Strategy is to check if the current pad has QDC more then all neigbours. Also find the box contaning the cluster fNlocMax=0; - for(Int_t iDig1=0;iDig1 no loc max found if ( fNlocMax == 0) { // case of no local maxima found: pads with same charge... - - ierflg = fitter->SetParameter(3*fNlocMax ,Form("x%i",fNlocMax),fXX,0.1,0,0); // Init values taken from CoG() -> fXX,fYY,fQRaw - ierflg = fitter->SetParameter(3*fNlocMax+1,Form("y%i",fNlocMax),fYY,0.1,0,0); // - ierflg = fitter->SetParameter(3*fNlocMax+2,Form("q%i",fNlocMax),fQRaw,0.1,0,10000); // - fNlocMax = 1; fSt=kNoLoc; + if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh); //need to fill the AliCluster3D part + new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //add new unfolded cluster + + return fNlocMax; } // case 2 -> loc max found. Check # of loc maxima @@ -351,21 +358,25 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) Double_t dummy; char sName[80]; //vars to get results from Minuit Double_t edm, errdef; Int_t nvpar, nparx; - + for(Int_t i=0;iGetParameter(3*i ,sName, fXX, fErrX , dummy, dummy); // X - fitter->GetParameter(3*i+1 ,sName, fYY, fErrY , dummy, dummy); // Y + fitter->GetParameter(3*i ,sName, fXX, fErrX , dummy, dummy); // X + fitter->GetParameter(3*i+1 ,sName, fYY, fErrY , dummy, dummy); // Y fitter->GetParameter(3*i+2 ,sName, fQ, fErrQ , dummy, dummy); // Q fitter->GetStats(fChi2, edm, errdef, nvpar, nparx); //get fit infos - if(fSt!=kAbn) { - if(fNlocMax!=1)fSt=kUnf; // if unfolded - if(fNlocMax==1&&fSt!=kNoLoc) fSt=kLo1; // if only 1 loc max - if ( !IsInPc()) fSt = kEdg; // if Out of Pc - if(fSt==kNoLoc) fNlocMax=0; // if with no loc max (pads with same charge..) - } - if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh); //need to fill the AliCluster3D part - new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //add new unfolded cluster - + + if(fNlocMax>1)FindClusterSize(i,pSigmaCut); //find clustersize for deconvoluted clusters + //after this call, fSi temporarly is the calculated size. Later is set again + //to its original value + if(fSt!=kAbn) { + if(fNlocMax!=1)fSt=kUnf; // if unfolded + if(fNlocMax==1&&fSt!=kNoLoc) fSt=kLo1; // if only 1 loc max + if ( !IsInPc()) fSt = kEdg; // if Out of Pc + if(fSt==kNoLoc) fNlocMax=0; // if with no loc max (pads with same charge..) + } + if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh); //need to fill the AliCluster3D part + new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this); //add new unfolded cluster + if(fNlocMax>1)SetSize(rawSize); //Original raw size is set again to its proper value } } @@ -373,3 +384,19 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold) }//Solve() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +void AliHMPIDCluster::FindClusterSize(Int_t i,Int_t *pSigmaCut) +{ + +//Estimate of the clustersize for a deconvoluted cluster + Int_t size = 0; + for(Int_t iDig=0;iDigCh(); + Double_t qPad = Q()*pDig->IntMathieson(X(),Y()); //pad charge + AliDebug(1,Form("Chamber %i X %i Y %i SigmaCut %i pad %i qpadMath %8.2f qPadRaw %8.2f Qtotal %8.2f cluster n.%i",iCh,pDig->PadChX(),pDig->PadChY(), + pSigmaCut[iCh],iDig,qPad,pDig->Q(),QRaw(),i)); + if(qPad>pSigmaCut[iCh]) size++; + } + AliDebug(1,Form(" Calculated size %i",size)); + if(size>0) SetSize(size); //in case of size == 0, original raw clustersize used +}