d84fd5c8480c60b75c02ed6e61b3731af0424217
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDTracker.cxx
1 #include "AliHMPIDTracker.h"     //class header
2 #include "AliHMPIDtrack.h"       //class header
3 #include "AliHMPIDCluster.h"     //GetTrackPoint(),PropagateBack() 
4 #include "AliHMPIDParam.h"       //GetTrackPoint(),PropagateBack()
5 #include "AliHMPIDPid.h"         //Recon(),reconHTA()
6 #include "AliHMPIDRecon.h"       //Recon()
7 #include "AliHMPIDReconHTA.h"    //ReconHTA()
8 #include <AliESDEvent.h>         //PropagateBack(),Recon()  
9 #include <AliESDtrack.h>         //Intersect()  
10 #include <AliRun.h>              //GetTrackPoint(),PropagateBack()  
11 #include <AliTrackPointArray.h>  //GetTrackPoint()
12 #include <AliAlignObj.h>         //GetTrackPoint()
13 #include <AliCDBManager.h>       //PropageteBack()
14 #include <AliCDBEntry.h>         //PropageteBack()
15 //.
16 // HMPID base class fo tracking
17 //.
18 //.
19 //.
20 ClassImp(AliHMPIDTracker)
21 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 AliHMPIDTracker::AliHMPIDTracker():
23   AliTracker(),
24   fClu(new TObjArray(AliHMPIDParam::kMaxCh+1))  
25 {
26 // ctor. Create TObjArray of TClonesArray of AliHMPIDCluster  
27 // 
28 //  
29   fClu->SetOwner(kTRUE);
30   for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++) fClu->AddAt(new TClonesArray("AliHMPIDCluster"),i);
31 }//ctor
32 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
33 Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
34 {
35 // Interface callback methode invoked from AliReconstruction::WriteAlignmentData() to get position of MIP cluster in MARS associated to a current track.
36 // MIP cluster is reffered by index which is stored in AliESDtrack  ???????
37 // Arguments: idx- cluster index which is stored by HMPID in AliESDtrack
38 //            point- reference to the object where to store the point     
39 //   Returns: status of operation  if FALSE then AliReconstruction::WriteAlignmentData() do not store this point to array of points for current track. 
40   if(idx<0) return kFALSE; //no MIP cluster assigned to this track in PropagateBack()
41   Int_t iCham=idx/1000000; Int_t iClu=idx%1000000;
42   point.SetVolumeID(AliGeomManager::LayerToVolUID(AliGeomManager::kHMPID,iCham-1));//layer and chamber number
43   TClonesArray *pArr=(TClonesArray*)(*fClu)[iCham];
44   AliHMPIDCluster *pClu=(AliHMPIDCluster*)pArr->UncheckedAt(iClu);//get pointer to cluster
45   Double_t mars[3];
46   AliHMPIDParam::Instance()->Lors2Mars(iCham,pClu->X(),pClu->Y(),mars);
47   point.SetXYZ(mars[0],mars[1],mars[2]);
48   return kTRUE;
49 }//GetTrackPoint()
50 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
51 Int_t AliHMPIDTracker::IntTrkCha(AliESDtrack *pTrk,Float_t &xPc,Float_t &yPc,Float_t &xRa,Float_t &yRa,Float_t &theta,Float_t &phi)
52 {
53 // Static method to find intersection in between given track and HMPID chambers
54 // Arguments: pTrk- ESD track; xPc,yPc- track intersection with PC in LORS [cm]
55 //   Returns: intersected chamber ID or -1
56   AliHMPIDParam *pParam=AliHMPIDParam::Instance();
57   for(Int_t i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++){                              //chambers loop
58     Double_t p1[3],n1[3]; pParam->Norm(i,n1); pParam->Point(i,p1,AliHMPIDParam::kRad);          //point & norm  for middle of radiator plane
59     Double_t p2[3],n2[3]; pParam->Norm(i,n2); pParam->Point(i,p2,AliHMPIDParam::kPc);           //point & norm  for entrance to PC plane
60     if(pTrk->Intersect(p1,n1,-GetBz())==kFALSE) continue;                                       //try to intersect track with the middle of radiator
61     if(pTrk->Intersect(p2,n2,-GetBz())==kFALSE) continue;                                       //try to intersect track with PC
62     pParam->Mars2LorsVec(i,n1,theta,phi);                                                       //track angles at RAD
63     pParam->Mars2Lors   (i,p1,xRa,yRa);                                                         //TRKxRAD position
64     pParam->Mars2Lors   (i,p2,xPc,yPc);                                                         //TRKxPC position
65     if(AliHMPIDParam::IsInside(xPc,yPc,pParam->DistCut())==kTRUE) return i;                     //return intersected chamber  
66   }                                                                                             //chambers loop
67   return -1;                                                                                    //no intersection with HMPID chambers
68 }//IntTrkCha()
69 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
70 Int_t AliHMPIDTracker::IntTrkCha(Int_t ch,AliHMPIDtrack *pTrk,Float_t &xPc,Float_t &yPc,Float_t &xRa,Float_t &yRa,Float_t &theta,Float_t &phi)
71 {
72 // Static method to find intersection in between given track and HMPID chambers
73 // Arguments: pTrk- HMPID track; xPc,yPc- track intersection with PC in LORS [cm]
74 //   Returns: intersected chamber ID or -1
75     AliHMPIDParam *pParam=AliHMPIDParam::Instance();
76     Double_t p1[3],n1[3]; 
77     pParam->Norm(ch,n1); 
78     pParam->Point(ch,p1,AliHMPIDParam::kRad);                                                    //point & norm  for middle of radiator plane
79     Double_t p2[3],n2[3]; 
80     pParam->Norm(ch,n2); 
81     pParam->Point(ch,p2,AliHMPIDParam::kPc);                                                     //point & norm  for entrance to PC plane
82     if(pTrk->Intersect(pTrk,p1,n1)==kFALSE) return -1;                                           //try to intersect track with the middle of radiator
83     if(pTrk->Intersect(pTrk,p2,n2)==kFALSE) return -1;   
84     pParam->Mars2LorsVec(ch,n1,theta,phi);                                                       //track angles at RAD
85     pParam->Mars2Lors   (ch,p1,xRa,yRa);                                                         //TRKxRAD position
86     pParam->Mars2Lors   (ch,p2,xPc,yPc);                                                         //TRKxPC position
87     if(AliHMPIDParam::IsInside(xPc,yPc,pParam->DistCut())==kTRUE) return ch;                     //return intersected chamber  
88   return -1;                                                                                     //no intersection with HMPID chambers
89 }//IntTrkCha()
90 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
91 Int_t AliHMPIDTracker::LoadClusters(TTree *pCluTree)
92 {
93 // Interface callback methode invoked from AliReconstruction::RunTracking() to load HMPID clusters before PropagateBack() gets control. Done once per event.
94 // Arguments: pCluTree- pointer to clusters tree got by AliHMPIDLoader::LoadRecPoints("read") then AliHMPIDLoader::TreeR()
95 //   Returns: error code (currently ignored in AliReconstruction::RunTraking())    
96   for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++) pCluTree->SetBranchAddress(Form("HMPID%d",i),&((*fClu)[i]));
97   pCluTree->GetEntry(0);
98   return 0;  
99 }//LoadClusters()
100 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
101 Int_t AliHMPIDTracker::PropagateBack(AliESDEvent *pEsd)
102 {
103 // Interface pure virtual in AliTracker. Invoked from AliReconstruction::RunTracking() after invocation of AliTracker::LoadClusters() once per event
104 // Agruments: pEsd - pointer to ESD
105 //   Returns: error code    
106   AliCDBEntry *pNmeanEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Nmean"); //contains TObjArray of 42 TF1 + 1 EPhotMean
107   AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre"); //contains TObjArray of 42 (7ch * 6sec) TF1
108   if(!pNmeanEnt) AliError("No Nmean C6F14 ");
109   if(!pQthreEnt) AliError("No Qthre");
110     
111   return Recon(pEsd,fClu,(TObjArray*)pNmeanEnt->GetObject(),(TObjArray*)pQthreEnt->GetObject());  
112 }//PropagateBack()
113 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
114 Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmean, TObjArray *pQthre)
115 {
116 // Static method to reconstruct Theta Ckov for all valid tracks of a given event.
117 // Arguments: pEsd- pointer ESD; pClu- pointer to clusters for all chambers; pNmean - pointer to all function Nmean=f(time)
118 //   Returns: error code, 0 if no errors   
119   
120   AliHMPIDRecon recon;                                                                           //instance of reconstruction class, nothing important in ctor
121   Float_t xPc,yPc,xRa,yRa,theta,phi;
122   Double_t cluLORS[2]={0},cluMARS[3]={0},trkMARS[3]={0};
123 //  Double_t bestcluMARS[3]={0,0,0};
124   Double_t radClu,radInitTrk;   
125   Int_t nMipClusTot=0;
126   Double_t d3d=0,dmin=999999,bz=0;
127   Bool_t isMatched=kFALSE;
128   Int_t cluSiz=0;
129   Double_t qthre = 0;   Double_t nmean=0; Int_t cham=0; Int_t hvsec=0;
130   Int_t index=0;                                                                                //index of the "best" matching cluster
131   Double_t bestChi2=-1;                                                                         //Chi2 of the "best" matching cluster
132   Double_t chi2=0;   
133   Int_t nClusCh[AliHMPIDParam::kMaxCh+1];
134   Bool_t isOkQcut=kFALSE;
135   Bool_t isOkDcut=kFALSE;
136   
137   AliHMPIDParam *pParam = AliHMPIDParam::Instance();                                             //Instance of AliHMPIDParam
138   
139   for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){                                        //loop on the ESD tracks in the event
140     isMatched=kFALSE;dmin=999999;bestChi2=99999;chi2=99999;cluSiz=0;                              //init. track matching params
141     isOkQcut = kFALSE;
142     AliHMPIDCluster *bestHmpCluster=0x0;                                                          //the best matching cluster
143     AliESDtrack *pTrk = pEsd->GetTrack(iTrk);                                                     //get reconstructed track    
144     AliHMPIDtrack *hmpTrk = new AliHMPIDtrack(*pTrk);                                             //create a hmpid track to be used for propagation and matching 
145     bz=AliTracker::GetBz();  
146     
147     Int_t ipCh=IntTrkCha(pTrk,xPc,yPc,xRa,yRa,theta,phi);                                        //find the intersected chamber for this track 
148     if(ipCh<0) {                                                                                 //no intersection at all, go after next track
149       pTrk->SetHMPIDtrk(0,0,0,0);                                                                //no intersection found
150       pTrk->SetHMPIDcluIdx   (99,99999);                                                         //chamber not found, mip not yet considered
151       pTrk->SetHMPIDsignal(AliHMPIDRecon::kNotPerformed);                                        //ring reconstruction not yet performed
152       continue;                                                                         
153     }
154     
155 // track intersects the chamber ipCh: find the MIP          
156     
157     TClonesArray *pMipCluLst=(TClonesArray *)pClus->At(ipCh);                                   //get the list of clusters
158     nMipClusTot = pMipCluLst->GetEntries();                                                     //total number of clusters in the given chamber
159     nClusCh[ipCh] = nMipClusTot;
160     
161     for (Int_t iClu=0; iClu<nMipClusTot;iClu++) {                                               //clusters loop
162       
163       AliHMPIDCluster *pClu=(AliHMPIDCluster*)pMipCluLst->UncheckedAt(iClu);                    //get the cluster
164 // evaluate qThre
165       if(pQthre->GetEntriesFast()==pParam->kMaxCh+1) {                                             // just for backward compatibility
166         qthre=((TF1*)pQthre->At(pClu->Ch()))->Eval(pEsd->GetTimeStamp());                          //
167       } else {                                                                                     // in the past just 1 qthre
168         hvsec = pParam->InHVSector(pClu->Y());                                              //  per chamber
169         if(hvsec>=0)
170           qthre=((TF1*)pQthre->At(6*cham+hvsec))->Eval(pEsd->GetTimeStamp());                      //
171       }                                                                                            //
172 //
173       if(pClu->Q()<qthre) continue;                                                                      //charge compartible with MIP clusters      
174       isOkQcut = kTRUE;
175
176       cluLORS[0]=pClu->X(); cluLORS[1]=pClu->Y();                                            //get the LORS coordinates of the cluster
177       pParam->Lors2Mars(ipCh,cluLORS[0],cluLORS[1],cluMARS);              //convert cluster coors. from LORS to MARS
178       radClu=TMath::Sqrt(cluMARS[0]*cluMARS[0]+cluMARS[1]*cluMARS[1]);                       //radial distance of candidate cluster in MARS                                          
179       Double_t trkx0[3]; 
180       hmpTrk->GetXYZ(trkx0);                                                                 //get track position in MARS
181       radInitTrk=TMath::Sqrt(trkx0[0]*trkx0[0]+trkx0[1]*trkx0[1]);
182       hmpTrk->PropagateToR(radClu,10);
183       hmpTrk->GetXYZ(trkx0);                                                                   //get track position in MARS
184       hmpTrk->GetXYZAt(radClu,bz,trkMARS);                                                     //get the track coordinates at the rad distance after prop. 
185       d3d=TMath::Sqrt((cluMARS[0]-trkMARS[0])*(cluMARS[0]-trkMARS[0])+(cluMARS[1]-trkMARS[1])*(cluMARS[1]-trkMARS[1])+(cluMARS[2]-trkMARS[2])*(cluMARS[2]-trkMARS[2]));
186       chi2=hmpTrk->GetPredictedChi2(pClu);
187       if(dmin > d3d ) {                                                                         //to be saved for the moment...
188         cluSiz = pClu->Size();
189         dmin=d3d;
190         bestHmpCluster=pClu;
191         index=iClu;
192         bestChi2=chi2;
193         cluLORS[0]=pClu->X(); cluLORS[1]=pClu->Y();
194 //        pParam->Lors2Mars(ipCh,cluLORS[0],cluLORS[1],bestcluMARS); 
195       }//global dmin cut 
196     }//clus loop
197
198     pTrk->SetHMPIDmip(0,0,0,0);                                                                //store mip info in any case 
199    
200     if(!isOkQcut) {
201       pTrk->SetHMPIDcluIdx(ipCh,9999);                                                          
202       pTrk->SetHMPIDsignal(pParam->kMipQdcCut);
203       continue;                                                                     
204     }
205     
206     if(dmin < pParam->DistCut()) {
207       isOkDcut = kTRUE;
208     }
209
210     if(!isOkDcut) {
211       pTrk->SetHMPIDmip(bestHmpCluster->X(),bestHmpCluster->Y(),(Int_t)bestHmpCluster->Q(),0);  //store mip info in any case 
212       pTrk->SetHMPIDcluIdx(ipCh,index+1000*cluSiz);                                             //set chamber, index of cluster + cluster size
213       pTrk->SetHMPIDsignal(pParam->kMipDistCut);                                                //closest cluster with enough charge is still too far from intersection
214     }
215     
216     if(isOkQcut*isOkDcut) isMatched = kTRUE;                                                    // MIP-Track matched !!    
217     
218     if(!isMatched) continue;                                                                    // If matched continue...
219     
220     Int_t indexAll = 0;
221     for(Int_t iC=0;iC<ipCh;iC++) indexAll+=nClusCh[iC]; indexAll+=index;                        //to be verified...
222
223     Bool_t isOk = hmpTrk->Update(bestHmpCluster,bestChi2,indexAll);
224     if(!isOk) continue;
225     pTrk->SetOuterParam(hmpTrk,AliESDtrack::kHMPIDout);                 
226
227 //    cham=IntTrkCha(ipCh,hmpTrk,xPc,yPc,xRa,yRa,theta,phi);
228     cham=IntTrkCha(pTrk,xPc,yPc,xRa,yRa,theta,phi);
229     if(cham<0) {                                                                                  //no intersection at all, go after next track
230       pTrk->SetHMPIDtrk(0,0,0,0);                                                                //no intersection found
231       pTrk->SetHMPIDcluIdx   (99,99999);                                                         //chamber not found, mip not yet considered
232       pTrk->SetHMPIDsignal(AliHMPIDRecon::kNotPerformed);                                        //ring reconstruction not yet performed
233       continue;                                                                         
234     }
235
236     pTrk->SetHMPIDtrk(xRa,yRa,theta,phi);                                                        //store initial infos
237     //evaluate nMean
238     if(pNmean->GetEntries()==21) {                                                              //for backward compatibility
239       nmean=((TF1*)pNmean->At(3*cham))->Eval(pEsd->GetTimeStamp());                             //C6F14 Nmean for this chamber
240     } else {
241       Int_t iRad     = pParam->Radiator(yRa);                                                   //evaluate the radiator involved
242       if(iRad < 0) {
243         nmean = -1;
244       } else {
245       Double_t tLow  = ((TF1*)pNmean->At(6*cham+2*iRad  ))->Eval(pEsd->GetTimeStamp());         //C6F14 low  temp for this chamber
246       Double_t tHigh = ((TF1*)pNmean->At(6*cham+2*iRad+1))->Eval(pEsd->GetTimeStamp());         //C6F14 high temp for this chamber
247       Double_t tExp  = pParam->FindTemp(tLow,tHigh,yRa);                                        //estimated temp for that chamber at that y
248       nmean = pParam->NIdxRad(AliHMPIDParam::Instance()->GetEPhotMean(),tExp);                  //mean ref idx @ a given temp
249       }
250       if(nmean < 0){                                                                            //track didn' t pass through the radiator
251          pTrk->SetHMPIDsignal(AliHMPIDRecon::kNoRad);                                           //set the appropriate flag
252          pTrk->SetHMPIDcluIdx(ipCh,index+1000*cluSiz);                                          //set index of cluster
253          continue;
254       }
255     }
256     //
257     recon.SetImpPC(xPc,yPc);                                                                     //store track impact to PC
258     recon.CkovAngle(pTrk,(TClonesArray *)pClus->At(cham),index,nmean);                           //search for Cerenkov angle of this track
259     
260     AliHMPIDPid pID;
261     Double_t prob[5];
262     pID.FindPid(pTrk,5,prob);
263     pTrk->SetHMPIDpid(prob);
264 //      Printf(" Prob e- %6.2f mu %6.2f pi %6.2f k %6.2f p %6.2f",prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100);
265
266   }//iTrk
267
268   return 0; // error code: 0=no error;
269 }//Recon()
270 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
271 Int_t AliHMPIDTracker::ReconHiddenTrk(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmean, TObjArray *pQthre)
272 {
273 // Static method to reconstruct Theta Ckov for all valid tracks of a given event.
274 // Arguments: pEsd- pointer ESD; pClu- pointer to clusters for all chambers; pNmean - pointer to all function Nmean=f(time), pQthre - pointer to all function Qthre=f(time)
275 //   Returns: error code, 0 if no errors
276   
277   AliHMPIDReconHTA reconHTA;                                                                     //instance of reconstruction class, nothing important in ctor
278   
279   AliHMPIDParam *pParam = AliHMPIDParam::Instance();                                             //Instance of AliHMPIDParam
280   
281   for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){                                        //loop on the ESD tracks in the event
282     
283     AliESDtrack *pTrk = pEsd->GetTrack(iTrk);                                                     //here it is simulated or just empty track
284     Int_t ipCh;
285     ipCh = pTrk->GetHMPIDcluIdx();ipCh/=1000000;
286     if(ipCh<0) continue;
287
288     TClonesArray *pMipCluLst=(TClonesArray *)pClus->At(ipCh);                                   //get the list of clusters
289     Int_t nMipClusTot = pMipCluLst->GetEntries();                                               //total number of clusters in the given chamber
290     
291     Double_t qMip=-1;
292     Int_t chMip=-1;    
293     Double_t xMip = 0;
294     Double_t yMip = 0;
295     Int_t indMip  = 0;
296     Int_t cluMipSiz = 0;
297
298     for (Int_t iClu=0; iClu<nMipClusTot;iClu++) {                                               //clusters loop
299       
300       AliHMPIDCluster *pClu=(AliHMPIDCluster*)pMipCluLst->UncheckedAt(iClu);                    //get the cluster
301       Double_t qClus = pClu->Q();
302       if(qClus>qMip) {
303         qMip  = qClus;
304         chMip = pClu->Ch();
305         xMip = pClu->X();
306         yMip = pClu->Y();
307         indMip = iClu;
308         cluMipSiz = pClu->Size();
309       }
310     }//clus loop
311
312     if(chMip<0) return 1;    
313     
314     Int_t hvsec;
315     Double_t qthre=0;
316 // evaluate qThre
317     if(pQthre->GetEntriesFast()==pParam->kMaxCh+1) {                                              // just for backward compatibility
318       qthre=((TF1*)pQthre->At(chMip))->Eval(pEsd->GetTimeStamp());                                //
319     } else {                                                                                      // in the past just 1 qthre
320       hvsec = pParam->InHVSector(yMip);                                                           //  per chamber
321       if(hvsec>=0) qthre=((TF1*)pQthre->At(6*chMip+hvsec))->Eval(pEsd->GetTimeStamp());           //
322     }
323 //
324     if(qMip<qthre) {
325       pTrk->SetHMPIDmip(xMip,yMip,(Int_t)qMip,0);                                                        //store mip info in any case 
326       pTrk->SetHMPIDcluIdx(chMip,indMip+1000*cluMipSiz);                                                          
327       pTrk->SetHMPIDsignal(pParam->kMipQdcCut);
328       return 1;                                                                                   //charge compatible with MIP clusters      
329     }
330       
331     pTrk->SetHMPIDmip(xMip,yMip,(Int_t)qMip,0);                                                   //store mip info in any case 
332     pTrk->SetHMPIDcluIdx(chMip,indMip+1000*cluMipSiz);                                                          
333
334     Double_t yRa = yMip;                                                                        //just an approx...
335     Double_t nmean;
336     //evaluate nMean
337     if(pNmean->GetEntries()==21) {                                                              //for backward compatibility
338       nmean=((TF1*)pNmean->At(3*chMip))->Eval(pEsd->GetTimeStamp());                            //C6F14 Nmean for this chamber
339     } else {
340       Int_t iRad     = pParam->Radiator(yRa);                                                   //evaluate the radiator involved
341       if(iRad < 0) {
342         nmean = -1;
343       } else {
344       Double_t tLow  = ((TF1*)pNmean->At(6*chMip+2*iRad  ))->Eval(pEsd->GetTimeStamp());        //C6F14 low  temp for this chamber
345       Double_t tHigh = ((TF1*)pNmean->At(6*chMip+2*iRad+1))->Eval(pEsd->GetTimeStamp());        //C6F14 high temp for this chamber
346       Double_t tExp  = pParam->FindTemp(tLow,tHigh,yRa);                                        //estimated temp for that chamber at that y
347       nmean = pParam->NIdxRad(AliHMPIDParam::Instance()->GetEPhotMean(),tExp);                  //mean ref idx @ a given temp
348       }
349       if(nmean < 0){                                                                            //track didn' t pass through the radiator
350          pTrk->SetHMPIDsignal(AliHMPIDRecon::kNoRad);                                           //set the appropriate flag
351          return 1;
352       }
353     }
354     //
355     if(!reconHTA.CkovHiddenTrk(pTrk,(TClonesArray *)pClus->At(ipCh),indMip,nmean)) {                 //search for track parameters and Cerenkov angle of this track
356       AliHMPIDPid pID;
357       Double_t prob[5];
358       pID.FindPid(pTrk,5,prob);
359       pTrk->SetHMPIDpid(prob);
360     }
361 //      Printf(" Prob e- %6.2f mu %6.2f pi %6.2f k %6.2f p %6.2f",prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100);
362   }//iTrk
363
364   return 0; // error code: 0=no error;
365
366 }//Recon()
367 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
368 void AliHMPIDTracker::FillClusterArray(TObjArray* array) const {
369   
370  // Publishes all pointers to clusters known to the tracker into the
371   // passed object array.
372   // The ownership is not transfered - the caller is not expected to delete
373   // the clusters
374  
375   for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){    
376     TClonesArray *pCluArr=(TClonesArray*)(*fClu)[iCh];
377     for (Int_t iClu=0; iClu<pCluArr->GetEntriesFast();iClu++){
378       AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluArr->UncheckedAt(iClu);    
379       array->AddLast(pClu);
380     }//cluster loop in iCh
381     pCluArr->Delete();
382   }//Ch loop
383     
384   return;
385 }
386 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++