X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSClusterizerv1.cxx;h=b296714649985ba549ebdccd3860a6d4baf86a3a;hb=80e5a1aefcd8841f01ff6234270a1c6b5b14729c;hp=4450e4d56be29793ca2d54aab8581dc8064e2e79;hpb=e347da7b731301c3ab6359b3256ff1e7126e9080;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSClusterizerv1.cxx b/PHOS/AliPHOSClusterizerv1.cxx index 4450e4d56be..b2967146499 100644 --- a/PHOS/AliPHOSClusterizerv1.cxx +++ b/PHOS/AliPHOSClusterizerv1.cxx @@ -180,7 +180,6 @@ #include "AliPHOSCpvRecPoint.h" #include "AliPHOSDigit.h" #include "AliPHOSDigitizer.h" -#include "AliPHOSCalibrationDB.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" #include "AliCDBEntry.h" @@ -202,7 +201,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() : { // default ctor (to be used mainly by Streamer) - InitParameters() ; fDefaultInit = kTRUE ; } @@ -218,7 +216,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(AliPHOSGeometry *geom) : { // ctor with the indication of the file where header Tree and digits Tree are stored - InitParameters() ; Init() ; fDefaultInit = kFALSE ; } @@ -277,6 +274,8 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** // Cluster will be fitted as a superposition of nPar/3 electromagnetic showers + if(!gMinuit) //it was deleted by someone else + gMinuit = new TMinuit(100) ; gMinuit->mncler(); // Reset Minuit's list of paramters gMinuit->SetPrintLevel(-1) ; // No Printout gMinuit->SetFCN(AliPHOSClusterizerv1::UnfoldingChiSquare) ; @@ -373,6 +372,8 @@ void AliPHOSClusterizerv1::Init() fgCalibData = new AliPHOSCalibData(-1); //use AliCDBManager's run number if (fgCalibData->GetCalibDataEmc() == 0) AliFatal("Calibration parameters for PHOS EMC not found. Stop reconstruction.\n"); + if (fgCalibData->GetCalibDataCpv() == 0) + AliFatal("Calibration parameters for PHOS CPV not found. Stop reconstruction.\n"); } @@ -383,25 +384,24 @@ void AliPHOSClusterizerv1::InitParameters() fNumberOfCpvClusters = 0 ; fNumberOfEmcClusters = 0 ; - const AliPHOSRecoParam* parEmc = AliPHOSReconstructor::GetRecoParamEmc(); - if(!parEmc) AliFatal("Reconstruction parameters for EMC not set!"); + const AliPHOSRecoParam* recoParam = AliPHOSReconstructor::GetRecoParam(); + if(!recoParam) AliFatal("Reconstruction parameters are not set!"); - const AliPHOSRecoParam* parCpv = AliPHOSReconstructor::GetRecoParamCpv(); - if(!parCpv) AliFatal("Reconstruction parameters for CPV not set!"); + recoParam->Print(); - fCpvClusteringThreshold = parCpv->GetClusteringThreshold(); - fEmcClusteringThreshold = parEmc->GetClusteringThreshold(); + fEmcClusteringThreshold = recoParam->GetEMCClusteringThreshold(); + fCpvClusteringThreshold = recoParam->GetCPVClusteringThreshold(); - fEmcLocMaxCut = parEmc->GetLocalMaxCut(); - fCpvLocMaxCut = parCpv->GetLocalMaxCut(); + fEmcLocMaxCut = recoParam->GetEMCLocalMaxCut(); + fCpvLocMaxCut = recoParam->GetCPVLocalMaxCut(); - fW0 = parEmc->GetLogWeight(); - fW0CPV = parCpv->GetLogWeight(); + fW0 = recoParam->GetEMCLogWeight(); + fW0CPV = recoParam->GetCPVLogWeight(); - fEmcTimeGate = 1.e-6 ; - fEcoreRadius = parEmc->GetEcoreRadius(); + fEmcTimeGate = 1.e-6 ; //10 sample steps + fEcoreRadius = recoParam->GetEMCEcoreRadius(); - fToUnfold = parEmc->ToUnfold() ; + fToUnfold = recoParam->EMCToUnfold() ; fWrite = kTRUE ; } @@ -489,7 +489,7 @@ void AliPHOSClusterizerv1::WriteRecPoints() Int_t index ; //Evaluate position, dispersion and other RecPoint properties.. Int_t nEmc = fEMCRecPoints->GetEntriesFast(); - Float_t emcMinE= AliPHOSReconstructor::GetRecoParamEmc()->GetMinE(); //Minimal digit energy + Float_t emcMinE= AliPHOSReconstructor::GetRecoParam()->GetEMCMinE(); //Minimal digit energy TVector3 fakeVtx(0.,0.,0.) ; for(index = 0; index < nEmc; index++){ AliPHOSEmcRecPoint * rp = @@ -546,14 +546,16 @@ void AliPHOSClusterizerv1::MakeClusters() fNumberOfEmcClusters = 0 ; //Mark all digits as unused yet + const Int_t maxNDigits = 3584; // There is no clusters larger than PHOS module ;) Int_t nDigits=fDigitsArr->GetEntriesFast() ; + for(Int_t i=0; iGetEnergy() > fEmcClusteringThreshold ) || - ( IsInCpv(digit) && digit->GetEnergy() > fCpvClusteringThreshold ) ) { + if (( IsInEmc(digit) && Calibrate(digit->GetEnergy(),digit->GetId()) > fEmcClusteringThreshold ) || + ( IsInCpv(digit) && Calibrate(digit->GetEnergy(),digit->GetId()) > fCpvClusteringThreshold ) ) { Int_t iDigitInCluster = 0 ; - if ( IsInEmc(digit) ) { // start a new EMC RecPoint if(fNumberOfEmcClusters >= fEMCRecPoints->GetSize()) @@ -578,7 +579,7 @@ void AliPHOSClusterizerv1::MakeClusters() fEMCRecPoints->AddAt(new AliPHOSEmcRecPoint(""), fNumberOfEmcClusters) ; clu = static_cast( fEMCRecPoints->At(fNumberOfEmcClusters) ) ; fNumberOfEmcClusters++ ; - clu->AddDigit(*digit, digit->GetEnergy()) ; + clu->AddDigit(*digit, Calibrate(digit->GetEnergy(),digit->GetId()),CalibrateT(digit->GetTime(),digit->GetId())) ; clusterdigitslist[iDigitInCluster] = digit->GetIndexInList() ; iDigitInCluster++ ; fDigitsUsed[i]=kTRUE ; @@ -590,12 +591,12 @@ void AliPHOSClusterizerv1::MakeClusters() fCPVRecPoints->AddAt(new AliPHOSCpvRecPoint(""), fNumberOfCpvClusters) ; clu = static_cast( fCPVRecPoints->At(fNumberOfCpvClusters) ) ; fNumberOfCpvClusters++ ; - clu->AddDigit(*digit, digit->GetEnergy()) ; + clu->AddDigit(*digit, Calibrate(digit->GetEnergy(),digit->GetId()),0.) ; // no timing information in CPV clusterdigitslist[iDigitInCluster] = digit->GetIndexInList() ; iDigitInCluster++ ; fDigitsUsed[i]=kTRUE ; } // else - + //Now scan remaining digits in list to find neigbours of our seed AliPHOSDigit * digitN ; @@ -604,6 +605,11 @@ void AliPHOSClusterizerv1::MakeClusters() digit = static_cast( fDigitsArr->At(clusterdigitslist[index]) ) ; index++ ; for(Int_t j=iFirst; j= maxNDigits) { + AliError(Form("The number of digits in cluster is more than %d, skip the rest of event", + maxNDigits)); + return; + } if(fDigitsUsed[j]) continue ; //look through remaining digits digitN = static_cast( fDigitsArr->At(j) ) ; @@ -615,22 +621,22 @@ void AliPHOSClusterizerv1::MakeClusters() case 0 : // not a neighbour break ; case 1 : // are neighbours - clu->AddDigit(*digitN, digitN->GetEnergy()); + clu->AddDigit(*digitN, Calibrate(digitN->GetEnergy(),digit->GetId()),CalibrateT(digitN->GetTime(),digit->GetId())) ; clusterdigitslist[iDigitInCluster] = j ; iDigitInCluster++ ; fDigitsUsed[j]=kTRUE ; break ; case 2 : // too far from each other - goto endofloop; + goto endOfLoop; } // switch } - endofloop: ; //scanned all possible neighbours for this digit + endOfLoop: ; //scanned all possible neighbours for this digit } // loop over cluster } // energy theshold - } + } } @@ -829,7 +835,7 @@ void AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc, // ratio = epar * ShowerShape(xDigit - xpar,zDigit - zpar,vIncid) / efit[iDigit] ; ratio = epar * ShowerShape(xDigit - xpar,zDigit - zpar) / efit[iDigit] ; eDigit = emcEnergies[iDigit] * ratio ; - emcRP->AddDigit( *digit, eDigit ) ; + emcRP->AddDigit( *digit, eDigit,CalibrateT(digit->GetTime(),digit->GetId()) ) ; } } @@ -1041,7 +1047,6 @@ void AliPHOSClusterizerv1::SetDistancesToBadChannels() //Author: Boris Polichtchouk if(!fgCalibData->GetNumOfEmcBadChannels()) return; - AliInfo(Form("%d bad channel(s) found.\n",fgCalibData->GetNumOfEmcBadChannels())); Int_t badIds[8000]; fgCalibData->EmcBadChannelIds(badIds); @@ -1084,3 +1089,45 @@ void AliPHOSClusterizerv1::SetDistancesToBadChannels() } } +//================================================================================== +Float_t AliPHOSClusterizerv1::Calibrate(Float_t amp, Int_t absId) const{ + // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB + + const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; + + //Determine rel.position of the cell absolute ID + Int_t relId[4]; + geom->AbsToRelNumbering(absId,relId); + Int_t module=relId[0]; + Int_t row =relId[2]; + Int_t column=relId[3]; + if(relId[1]){ //CPV + Float_t calibration = fgCalibData->GetADCchannelCpv(module,column,row); + return amp*calibration ; + } + else{ //EMC + Float_t calibration = fgCalibData->GetADCchannelEmc(module,column,row); + return amp*calibration ; + } +} +//================================================================================== +Float_t AliPHOSClusterizerv1::CalibrateT(Float_t time, Int_t absId)const{ + // Calibrate time in EMC digit + + const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; + + //Determine rel.position of the cell absolute ID + Int_t relId[4]; + geom->AbsToRelNumbering(absId,relId); + Int_t module=relId[0]; + Int_t row =relId[2]; + Int_t column=relId[3]; + if(relId[1]){ //CPV + return 0. ; + } + else{ //EMC + time += fgCalibData->GetTimeShiftEmc(module,column,row); + return time ; + } +} +