#include "AliHMPIDParam.h" //FillEsd()
#include <AliCDBEntry.h> //ctor
#include <AliCDBManager.h> //ctor
-#include <AliESD.h> //FillEsd()
+#include <AliESDEvent.h> //FillEsd()
#include <AliRawReader.h> //Reconstruct() for raw digits
ClassImp(AliHMPIDReconstructor)
//
//ctor
//
-
- fClu=new TObjArray(AliHMPIDDigit::kMaxCh+1); fClu->SetOwner(kTRUE);
- fDig=new TObjArray(AliHMPIDDigit::kMaxCh+1); fDig->SetOwner(kTRUE);
-
- for(int i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++){
+ AliHMPIDParam::Instance(); //geometry loaded for reconstruction
+ fUserCut = new Int_t[7];
+ fClu=new TObjArray(AliHMPIDParam::kMaxCh+1); fClu->SetOwner(kTRUE);
+ fDig=new TObjArray(AliHMPIDParam::kMaxCh+1); fDig->SetOwner(kTRUE);
+
+ for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++){
fDig->AddAt(new TClonesArray("AliHMPIDDigit"),i);
TClonesArray *pClus = new TClonesArray("AliHMPIDCluster");
pClus->SetUniqueID(i);
}
AliCDBEntry *pUserCutEnt =AliCDBManager::Instance()->Get("HMPID/Calib/UserCut"); //contains TObjArray of 14 TObject with n. of sigmas to cut charge
- if(!pUserCutEnt) return; //No request from User to apply a more severe cut on pad charge
-
- fUserCut = pUserCutEnt->GetObject()->GetUniqueID();
+ if(pUserCutEnt) {
+ TObjArray *pUserCut = (TObjArray*)pUserCutEnt->GetObject();
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){ //chambers loop
+ fUserCut[iCh] = pUserCut->At(iCh)->GetUniqueID();
+ Printf("HMPID: UserCut successfully loaded for chamber %i -> %i ",iCh,fUserCut[iCh]);
+ }
+ }
- Printf(" usercut %i ",fUserCut);
- AliCDBEntry *pDaqCutEnt =AliCDBManager::Instance()->Get("HMPID/Calib/DaqSigCut"); //contains TObjArray of 14 TObject with n. of sigmas to cut charge
- if(!pDaqCutEnt) AliFatal("No pedestal sigmas cut!");
- TObjArray *pDaqCut = (TObjArray*)pDaqCutEnt->GetObject();
-
-
- for(Int_t ddl=0;ddl<14;ddl++){
- if(fUserCut<=(Int_t)pDaqCut->At(ddl)->GetUniqueID()) continue;
- AliCDBEntry *pDaqSigEnt =AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig"); //contains TObjArray of TObjArray 14 TMatrixF sigmas values for pads
- if(!pDaqSigEnt) AliFatal("No pedestals from DAQ!");
- TObjArray *pDaqSig = (TObjArray*)pDaqSigEnt->GetObject();
- SigConv(pDaqSig);
- break;
+ AliCDBEntry *pDaqSigEnt =AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig"); //contains TObjArray of TObjArray 14 TMatrixF sigmas values for pads
+ if(!pDaqSigEnt) AliFatal("No pedestals from DAQ!");
+ fDaqSig = (TObjArray*)pDaqSigEnt->GetObject();
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){ //chambers loop
+ Printf(" HMPID: DaqSigCut successfully loaded for chamber %i -> %i ",iCh,(Int_t)fDaqSig->At(iCh)->GetUniqueID());
}
}//AliHMPIDReconstructor
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDReconstructor::SigConv(TObjArray *pDaqSig)
-{
-// Conversion from the pedestal objects in to 7 TMatrixF(padX,padY)
-//Arguments: pDaqSig pointer to the pedestal objects from OCDB
-// Returs: none
-//
- fDaqSig = new TObjArray(AliHMPIDDigit::kMaxCh+1);fDaqSig->SetOwner(kTRUE);
-
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++) fDaqSig->AddAt(new TMatrixF(1,10,0,47),iCh);
-
- AliHMPIDDigit dig;
-
- for(Int_t ddl=0;ddl<=13;ddl++){
- for(Int_t row=1;row<=24;row++)
- for(Int_t dil=1;dil<=10;dil++)
- for(Int_t adr=0;adr<=47;adr++){
- TObjArray *pDdl = (TObjArray*)pDaqSig->At(ddl);
- TObjArray *pRow = (TObjArray*)pDdl->At(row-1);
- TMatrixF *pM = (TMatrixF*)pRow;
- Float_t sigma = (*pM)(dil,adr);
- dig.Raw(ddl,row,dil,adr);
- TMatrixF* pMConv = (TMatrixF*)(fDaqSig->At(dig.Ch()));
- (*pMConv)(dig.PadChX(),dig.PadChY()) = sigma;
- }
- }
-}//SigConv()
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void AliHMPIDReconstructor::Dig2Clu(TObjArray *pDigAll,TObjArray *pCluAll,Bool_t isTryUnfold)
{
// Finds all clusters for a given digits list provided not empty. Currently digits list is a list of all digits for a single chamber.
// pCluAll - list of clusters for all chambers
// isTryUnfold - flag to choose between CoG and Mathieson fitting
// Returns: none
- TMatrixF padMap(AliHMPIDDigit::kMinPx,AliHMPIDDigit::kMaxPcx,AliHMPIDDigit::kMinPy,AliHMPIDDigit::kMaxPcy); //pads map for single chamber 0..159 x 0..143
+ TMatrixF padMap(AliHMPIDParam::kMinPx,AliHMPIDParam::kMaxPcx,AliHMPIDParam::kMinPy,AliHMPIDParam::kMaxPcy); //pads map for single chamber 0..159 x 0..143
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++){ //chambers loop
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){ //chambers loop
TClonesArray *pDigCur=(TClonesArray*)pDigAll->At(iCh); //get list of digits for current chamber
if(pDigCur->GetEntriesFast()==0) continue; //no digits for current chamber
Int_t cnt=0,cx[4],cy[4];
- if(pDig->PadPcX() != AliHMPIDDigit::kMinPx){cx[cnt]=pDig->PadChX()-1; cy[cnt]=pDig->PadChY() ;cnt++;} //left
- if(pDig->PadPcX() != AliHMPIDDigit::kMaxPx){cx[cnt]=pDig->PadChX()+1; cy[cnt]=pDig->PadChY() ;cnt++;} //right
- if(pDig->PadPcY() != AliHMPIDDigit::kMinPy){cx[cnt]=pDig->PadChX() ; cy[cnt]=pDig->PadChY()-1;cnt++;} //down
- if(pDig->PadPcY() != AliHMPIDDigit::kMaxPy){cx[cnt]=pDig->PadChX() ; cy[cnt]=pDig->PadChY()+1;cnt++;} //up
+ if(pDig->PadPcX() != AliHMPIDParam::kMinPx){cx[cnt]=pDig->PadChX()-1; cy[cnt]=pDig->PadChY() ;cnt++;} //left
+ if(pDig->PadPcX() != AliHMPIDParam::kMaxPx){cx[cnt]=pDig->PadChX()+1; cy[cnt]=pDig->PadChY() ;cnt++;} //right
+ if(pDig->PadPcY() != AliHMPIDParam::kMinPy){cx[cnt]=pDig->PadChX() ; cy[cnt]=pDig->PadChY()-1;cnt++;} //down
+ if(pDig->PadPcY() != AliHMPIDParam::kMaxPy){cx[cnt]=pDig->PadChX() ; cy[cnt]=pDig->PadChY()+1;cnt++;} //up
for (Int_t i=0;i<cnt;i++){//neighbours loop
if((pDig=UseDig(cx[i],cy[i],pDigLst,pDigMap))) FormClu(pClu,pDig,pDigLst,pDigMap); //check if this neighbour pad fired and mark it as taken
// pCluTree - poitner to Cluster tree
// Returns: none
AliDebug(1,"Start.");
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++) {
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
pCluTree->Branch(Form("HMPID%d",iCh),&((*fClu)[iCh]),4000,0);
pDigTree->SetBranchAddress(Form("HMPID%d",iCh),&((*fDig)[iCh]));
}
Dig2Clu(fDig,fClu); //cluster finder
pCluTree->Fill(); //fill tree for current event
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++){
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
fDig->At(iCh)->Clear();
fClu->At(iCh)->Clear();
}
// Returns: none
AliDebug(1,"Start.");
AliHMPIDDigit dig; //tmp digit, raw digit will be converted to it
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++) {
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
pDigTree->Branch(Form("HMPID%d",iCh),&((*fDig)[iCh]),4000,0);
pRR->Select("HMPID",2*iCh,2*iCh+1);//select only DDL files for the current chamber
Int_t iDigCnt=0;
UInt_t w32=0;
- while(pRR->ReadNextInt(w32)){//raw records loop (in selected DDL files)
+ while(pRR->ReadNextInt(w32)){//raw records loop (in selected DDL files)
UInt_t ddl=pRR->GetDDLID(); //returns 0,1,2 ... 13
- if (!dig.Raw(w32,ddl,pRR)) continue;
+ if(!dig.Raw(w32,ddl,pRR)) continue;
AliDebug(1,Form("Ch=%i DDL=%i raw=0x%x digit=(%3i,%3i,%3i,%3i) Q=%5.2f",iCh,ddl,w32,dig.Ch(),dig.Pc(),dig.PadPcX(),dig.PadPcY(),dig.Q()));
if(!IsDigSurvive(&dig)) continue; //sigma cut test
new((*((TClonesArray*)fDig->At(iCh)))[iDigCnt++]) AliHMPIDDigit(dig); //add this digit to the tmp list
pRR->Reset();
}//chambers loop
pDigTree->Fill();
- for(Int_t iCh=AliHMPIDDigit::kMinCh;iCh<=AliHMPIDDigit::kMaxCh;iCh++)fDig->At(iCh)->Clear();
+ for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++)fDig->At(iCh)->Clear();
AliDebug(1,"Stop.");
}//Reconstruct digits from raw digits
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDReconstructor::FillESD(AliRunLoader *, AliESD *pESD) const
+void AliHMPIDReconstructor::FillESD(AliRunLoader *, AliESDEvent *pESD) const
{
// Calculates probability to be a electron-muon-pion-kaon-proton
// from the given Cerenkov angle and momentum assuming no initial particle composition