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