X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HMPID%2FAliHMPIDRecon.cxx;h=0e832ebba7efb30e7bef5bbaf514f9e3941aeaed;hb=2ddda051eebd7119f2485d6e0ce400076364fa34;hp=56b1549b5ceb620d3cab32ddd8e6adedb3eb2e5c;hpb=f1970e74adf888c7c72ecccd09eedb9dab2d5775;p=u%2Fmrichter%2FAliRoot.git diff --git a/HMPID/AliHMPIDRecon.cxx b/HMPID/AliHMPIDRecon.cxx index 56b1549b5ce..0e832ebba7e 100644 --- a/HMPID/AliHMPIDRecon.cxx +++ b/HMPID/AliHMPIDRecon.cxx @@ -28,27 +28,6 @@ #include //CkovAngle() #include //CkovAngle() - Int_t fPhotCnt; // counter of photons candidate - Int_t *fPhotFlag; // flags of photon candidates - Double_t *fPhotCkov; // Ckov angles of photon candidates, [rad] - Double_t *fPhotPhi; // phis of photons candidates, [rad] - Double_t *fPhotWei; // weigths of photon candidates - Double_t fCkovSigma2; // sigma2 of the reconstructed ring - - Bool_t fIsWEIGHT; // flag to consider weight procedure - Float_t fDTheta; // Step for sliding window - Float_t fWindowWidth; // Hough width of sliding window - - Double_t fRingArea; // area of a given ring - Double_t fRingAcc; // fraction of the ring accepted by geometry - TVector3 fTrkDir; // track direction in LORS at RAD - TVector2 fTrkPos; // track positon in LORS at RAD - TVector2 fMipPos; // mip positon for a given track - TVector2 fPc; // track position at PC - - AliHMPIDParam *fParam; // Pointer to AliHMPIDParam - - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ AliHMPIDRecon::AliHMPIDRecon(): TTask("RichRec","RichPat"), @@ -81,7 +60,7 @@ void AliHMPIDRecon::InitVars(Int_t n) //.. //Init some variables //.. - if(n<0) return; + if(n<=0) return; fPhotFlag = new Int_t[n]; fPhotCkov = new Double_t[n]; fPhotPhi = new Double_t[n]; @@ -94,13 +73,13 @@ void AliHMPIDRecon::DeleteVars()const //.. //Delete variables //.. - delete fPhotFlag; - delete fPhotCkov; - delete fPhotPhi; - delete fPhotWei; + delete [] fPhotFlag; + delete [] fPhotCkov; + delete [] fPhotPhi; + delete [] fPhotWei; } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean,Double_t qthre) +void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Int_t index,Double_t nmean,Float_t xRa,Float_t yRa) { // Pattern recognition method based on Hough transform // Arguments: pTrk - track for which Ckov angle is to be found @@ -110,52 +89,49 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t n const Int_t nMinPhotAcc = 3; // Minimum number of photons required to perform the pattern recognition - Int_t nClusTot = pCluLst->GetEntries(); if(nClusTot>fParam->MultCut()) fIsWEIGHT = kTRUE; // offset to take into account bkg in reconstruction else fIsWEIGHT = kFALSE; InitVars(nClusTot); - Float_t xRa,yRa,th,ph; - pTrk->GetHMPIDtrk(xRa,yRa,th,ph); //initialize this track: th and ph angles at middle of RAD + Float_t xPc,yPc,th,ph; + pTrk->GetHMPIDtrk(xPc,yPc,th,ph); //initialize this track: th and ph angles at middle of RAD SetTrack(xRa,yRa,th,ph); fParam->SetRefIdx(nmean); - Float_t dMin=999,mipX=-1,mipY=-1;Int_t chId=-1,mipId=-1,mipQ=-1; - fPhotCnt=0; + Float_t mipX=-1,mipY=-1; + Int_t chId=-1,mipQ=-1,sizeClu = -1; + + fPhotCnt=0; + for (Int_t iClu=0; iCluGetEntriesFast();iClu++){//clusters loop AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu); //get pointer to current cluster + if(iClu == index) { // this is the MIP! not a photon candidate: just store mip info + mipX = pClu->X(); + mipY = pClu->Y(); + mipQ=(Int_t)pClu->Q(); + sizeClu=pClu->Size(); + continue; + } chId=pClu->Ch(); - if(pClu->Q()>qthre){ //charge compartible with MIP clusters - Float_t dX=fPc.X()-pClu->X(),dY=fPc.Y()-pClu->Y(),d =TMath::Sqrt(dX*dX+dY*dY); //distance between current cluster and intersection point - if( d < dMin) {mipId=iClu; dMin=d;mipX=pClu->X();mipY=pClu->Y();mipQ=(Int_t)pClu->Q();} //current cluster is closer, overwrite data for min cluster - }else{ //charge compatible with photon cluster - Double_t thetaCer,phiCer; - if(FindPhotCkov(pClu->X(),pClu->Y(),thetaCer,phiCer)){ //find ckov angle for this photon candidate - fPhotCkov[fPhotCnt]=thetaCer; //actual theta Cerenkov (in TRS) - fPhotPhi [fPhotCnt]=phiCer; //actual phi Cerenkov (in TRS): -pi to come back to "unusual" ref system (X,Y,-Z) - //PH Printf("photon n. %i reconstructed theta = %f",fPhotCnt,fPhotCkov[fPhotCnt]); - fPhotCnt++; //increment counter of photon candidates - } + Double_t thetaCer,phiCer; + if(FindPhotCkov(pClu->X(),pClu->Y(),thetaCer,phiCer)){ //find ckov angle for this photon candidate + fPhotCkov[fPhotCnt]=thetaCer; //actual theta Cerenkov (in TRS) + fPhotPhi [fPhotCnt]=phiCer; //actual phi Cerenkov (in TRS): -pi to come back to "unusual" ref system (X,Y,-Z) + fPhotCnt++; //increment counter of photon candidates } }//clusters loop + + pTrk->SetHMPIDmip(mipX,mipY,mipQ,fPhotCnt); //store mip info in any case + pTrk->SetHMPIDcluIdx(chId,index+1000*sizeClu); //set index of cluster if(fPhotCnt<=nMinPhotAcc) { //no reconstruction with <=3 photon candidates pTrk->SetHMPIDsignal(kNoPhotAccept); //set the appropriate flag - pTrk->SetHMPIDmip(mipX,mipY,mipQ,fPhotCnt); //store mip info - pTrk->SetHMPIDcluIdx(-1,-1); //set index of cluster return; } - if(mipId==-1) { - pTrk->SetHMPIDcluIdx(chId,9999); //set index of cluster - pTrk->SetHMPIDsignal(kMipQdcCut); - return; - } //no clusters with QDC more the threshold at all - pTrk->SetHMPIDcluIdx(chId,mipId); //set index of cluster - if(dMin>fParam->DistCut()) {pTrk->SetHMPIDsignal(kMipDistCut); return;} //closest cluster with enough charge is still too far from intersection fMipPos.Set(mipX,mipY);