Getting the trigger descriptors from CDB
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDTracker.cxx
index 52ea913..56a0fcb 100644 (file)
@@ -2,7 +2,8 @@
 #include "AliHMPIDCluster.h"     //GetTrackPoint(),PropagateBack() 
 #include "AliHMPIDParam.h"       //GetTrackPoint(),PropagateBack()
 #include "AliHMPIDRecon.h"       //Recon()
-#include <AliESD.h>              //PropagateBack(),Recon()  
+#include <AliESDEvent.h>              //PropagateBack(),Recon()  
+#include <AliESDtrack.h>              //Intersect()  
 #include <AliRun.h>              //GetTrackPoint(),PropagateBack()  
 #include <AliTrackPointArray.h>  //GetTrackPoint()
 #include <AliAlignObj.h>         //GetTrackPoint()
@@ -20,8 +21,8 @@ AliHMPIDTracker::AliHMPIDTracker():AliTracker()
 // ctor. Create TObjArray of TClonesArray of AliHMPIDCluster  
 // 
 //  
-  fClu=new TObjArray(AliHMPIDDigit::kMaxCh+1);  fClu->SetOwner(kTRUE);
-  for(int i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++) fClu->AddAt(new TClonesArray("AliHMPIDCluster"),i);
+  fClu=new TObjArray(AliHMPIDParam::kMaxCh+1);  fClu->SetOwner(kTRUE);
+  for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++) fClu->AddAt(new TClonesArray("AliHMPIDCluster"),i);
 }//ctor
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
 Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
@@ -33,7 +34,7 @@ Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
 //   Returns: status of operation  if FALSE then AliReconstruction::WriteAlignmentData() do not store this point to array of points for current track. 
   if(idx<0) return kFALSE; //no MIP cluster assigned to this track in PropagateBack()
   Int_t iCham=idx/1000000; Int_t iClu=idx%1000000;
-  point.SetVolumeID(AliAlignObj::LayerToVolUID(AliAlignObj::kHMPID,iCham-1));//layer and chamber number
+  point.SetVolumeID(AliGeomManager::LayerToVolUID(AliGeomManager::kHMPID,iCham-1));//layer and chamber number
   TClonesArray *pArr=(TClonesArray*)(*fClu)[iCham];
   AliHMPIDCluster *pClu=(AliHMPIDCluster*)pArr->UncheckedAt(iClu);//get pointer to cluster
   Double_t mars[3];
@@ -49,7 +50,7 @@ Int_t AliHMPIDTracker::IntTrkCha(AliESDtrack *pTrk,Float_t &xPc,Float_t &yPc)
 //   Returns: intersected chamber ID or -1
   AliHMPIDParam *pParam=AliHMPIDParam::Instance();
   Float_t xRa=0,yRa=0,theta=0,phi=0;                                                            //track intersection at PC and angles at RAD, LORS  
-  for(Int_t i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++){                              //chambers loop
+  for(Int_t i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++){                              //chambers loop
     Double_t p1[3],n1[3]; pParam->Norm(i,n1); pParam->Point(i,p1,AliHMPIDParam::kRad);          //point & norm  for middle of radiator plane
     Double_t p2[3],n2[3]; pParam->Norm(i,n2); pParam->Point(i,p2,AliHMPIDParam::kPc);           //point & norm  for entrance to PC plane
     if(pTrk->Intersect(p1,n1,-GetBz())==kFALSE) continue;                                       //try to intersect track with the middle of radiator
@@ -57,7 +58,7 @@ Int_t AliHMPIDTracker::IntTrkCha(AliESDtrack *pTrk,Float_t &xPc,Float_t &yPc)
     pParam->Mars2LorsVec(i,n1,theta,phi);                                                       //track angles at RAD
     pParam->Mars2Lors   (i,p1,xRa,yRa);                                                         //TRKxRAD position
     pParam->Mars2Lors   (i,p2,xPc,yPc);                                                         //TRKxPC position
-    if(AliHMPIDDigit::IsInside(xPc,yPc,pParam->DistCut())==kFALSE) continue;                    //not in active area  
+    if(AliHMPIDParam::IsInside(xPc,yPc,pParam->DistCut())==kFALSE) continue;                    //not in active area  
     pTrk->SetHMPIDtrk      (xRa,yRa,theta,phi);                                                 //store track intersection info
     pTrk->SetHMPIDcluIdx   (i,0);
     return i;
@@ -70,12 +71,12 @@ Int_t AliHMPIDTracker::LoadClusters(TTree *pCluTree)
 // Interface callback methode invoked from AliReconstruction::RunTracking() to load HMPID clusters before PropagateBack() gets control. Done once per event.
 // Arguments: pCluTree- pointer to clusters tree got by AliHMPIDLoader::LoadRecPoints("read") then AliHMPIDLoader::TreeR()
 //   Returns: error code (currently ignored in AliReconstruction::RunTraking())    
-  for(int i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++) pCluTree->SetBranchAddress(Form("HMPID%d",i),&((*fClu)[i]));
+  for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++) pCluTree->SetBranchAddress(Form("HMPID%d",i),&((*fClu)[i]));
   pCluTree->GetEntry(0);
   return 0;  
 }//LoadClusters()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::PropagateBack(AliESD *pEsd)
+Int_t AliHMPIDTracker::PropagateBack(AliESDEvent *pEsd)
 {
 // Interface pure virtual in AliTracker. Invoked from AliReconstruction::RunTracking() after invocation of AliTracker::LoadClusters() once per event
 // Agruments: pEsd - pointer to ESD
@@ -88,7 +89,7 @@ Int_t AliHMPIDTracker::PropagateBack(AliESD *pEsd)
   return Recon(pEsd,fClu,(TObjArray*)pNmeanEnt->GetObject());  
 }//PropagateBack()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::Recon(AliESD *pEsd,TObjArray *pClus,TObjArray *pNmean)
+Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmean)
 {
 // Static method to reconstruct Theta Ckov for all valid tracks of a given event.
 // Arguments: pEsd- pointer ESD; pClu- pointer to clusters for all chambers; pNmean - pointer to all function Nmean=f(time)
@@ -106,16 +107,15 @@ Int_t AliHMPIDTracker::Recon(AliESD *pEsd,TObjArray *pClus,TObjArray *pNmean)
   return 0; // error code: 0=no error;
 }//Recon()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::ReconHiddenTrk(Int_t iCh,AliESDtrack *pTrk,TObjArray *pClusObj,TObjArray *pNmean)
+Int_t AliHMPIDTracker::ReconHiddenTrk(Int_t iCh,AliESDtrack *pTrk,TClonesArray *pCluLst,TObjArray *pNmean)
 {
 // Static method to reconstruct Theta Ckov for all valid tracks of a given event.
 // Arguments: pEsd- pointer ESD; pClu- pointer to clusters for all chambers; pNmean - pointer to all function Nmean=f(time)
 //   Returns: error code, 0 if no errors
   AliHMPIDRecon recon;                                                                          //instance of reconstruction class, nothing important in ctor
   Double_t nmean=((TF1*)pNmean->At(3*iCh))->Eval(0);                                            //C6F14 Nmean for this chamber
-  TClonesArray *pCluLst = (TClonesArray *)pClusObj->At(iCh);
   if(pCluLst->GetEntriesFast()<4) return 1;                                                     //min 4 clusters (3 + 1 mip) to find a ring! 
-  return recon.CkovHiddenTrk(pTrk,pCluLst,nmean);                                               //search for track parameters and Cerenkov angle of this track
-                                                                                                // error code: 0=no error,1=fit not performed;
+  if(recon.CkovHiddenTrk(pTrk,pCluLst,nmean)) return 0;                                         //search for track parameters and Cerenkov angle of this track
+  else return 1;                                                                                // error code: 0=no error,1=fit not performed;
 }//Recon()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++