-void AliHMPIDReconstructor::Reconstruct(AliRunLoader *pAL,AliRawReader* pRR)const
-{
-//Invoked by AliReconstruction to convert raw digits from DDL files to clusters
-//Arguments: pAL - ALICE run loader pointer
-// pRR - ALICE raw reader pointer
-// Returns: none
- AliLoader *pRL=pAL->GetDetectorLoader("HMPID"); AliHMPID *pRich=(AliHMPID*)pAL->GetAliRun()->GetDetector("HMPID");//get pointers for HMPID and HMPID loader
-
- AliHMPIDDigit dig; //tmp digit, raw digit will be converted to it
-
- TObjArray digLst; Int_t iDigCnt[7]; for(Int_t i=0;i<7;i++){digLst.AddAt(new TClonesArray("AliHMPIDDigit"),i); iDigCnt[i]=0;} //tmp list of digits for allchambers
-
- Int_t iEvtN=0;
- while(pRR->NextEvent()){//events loop
- pAL->GetEvent(iEvtN++);
- pRL->MakeTree("R"); pRich->MakeBranch("R");
-
- for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
- pRR->Select("HMPID",2*iCh,2*iCh+1);//select only DDL files for the current chamber
- UInt_t w32=0;
- while(pRR->ReadNextInt(w32)){//raw records loop (in selected DDL files)
- UInt_t ddl=pRR->GetDDLID(); //returns 0,1,2 ... 13
- dig.Raw(w32,ddl);
- 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()));
- new((*((TClonesArray*)digLst.At(iCh)))[iDigCnt[iCh]++]) AliHMPIDDigit(dig); //add this digit to the tmp list
- }//raw records loop
- pRR->Reset();
- }//chambers loop
-
- Dig2Clu(&digLst,pRich->CluLst());//cluster finder for all chambers
- for(Int_t i=0;i<7;i++){digLst.At(i)->Delete(); iDigCnt[i]=0;} //clean up list of digits for all chambers
-
- pRL->TreeR()->Fill(); //fill tree for current event
- pRL->WriteRecPoints("OVERWRITE");//write out clusters for current event
- pRich->CluReset();
- }//events loop
- pRL->UnloadRecPoints();
-}//Reconstruct raw data
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++