Magnetic field properly set in display.
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Apr 2007 17:33:36 +0000 (17:33 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Apr 2007 17:33:36 +0000 (17:33 +0000)
HMPID/AliHMPIDRecon.cxx
HMPID/AliHMPIDSelector.C
HMPID/Hdisp.C

index 7287f3e..ea34d26 100644 (file)
@@ -68,7 +68,6 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t n
 
   Float_t xRa,yRa,th,ph;       
   pTrk->GetHMPIDtrk(xRa,yRa,th,ph);        //initialize this track: th and ph angles at middle of RAD 
-//  ph-=TMath::Pi();                                                                            // right XYZ local orientation
   SetTrack(xRa,yRa,th,ph);
   
   fRadNmean=nmean;
index bf765d0..f53c732 100644 (file)
@@ -58,7 +58,7 @@ void AliHMPIDSelector::SlaveBegin(TTree *tree)
    fCkovP    = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]", 150,   0,  7  ,500, 0, 1); 
    fSigP     = new TH2F("SigP"  ,"#sigma_{#theta_c}"          , 150,   0,  7  ,100, 0, 1e20);
    fMipXY    = new TH2F("MipXY" ,"mip position"               , 260,   0,130  ,252,0,126); 
-   fDifX     = new TH1F("DifX" ,"diff"                       , 200, -5, 5);
+   fDifX     = new TH1F("DifX" ,"diff"                       , 100, -2.5, 2.5);
       
    fProb[0] = new TH1F("PidE" ,"PID: e yellow #mu magenta"  ,100,0,1); fProb[0]->SetLineColor(kYellow);
    fProb[1] = new TH1F("PidMu","pid of #mu"                 ,100,0,1); fProb[1]->SetLineColor(kMagenta);
@@ -75,7 +75,7 @@ void AliHMPIDSelector::Init(TTree *pTr)
   if ( !pTr )  return ;
   fChain = pTr ;
   fChain->SetBranchAddress("ESD", &fEsd) ;
-  fChain->SetBranchStatus("*", 0);
+  fChain->SetBranchStatus("*", 1);
   fChain->SetBranchStatus("fTracks.*", 1);
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -83,32 +83,28 @@ Bool_t AliHMPIDSelector::Process(Long64_t entry)
 {
   AliHMPIDParam *pParam=AliHMPIDParam::Instance();
   fChain->GetTree()->GetEntry(entry);
-
   for(Int_t iTrk=0;iTrk<fEsd->GetNumberOfTracks();iTrk++){
-     AliESDtrack *pTrk=fEsd->GetTrack(iTrk);
+    AliESDtrack *pTrk=fEsd->GetTrack(iTrk);
      
 //     if(pTrk->GetHMPIDsignal()==-1) continue;
      
-     fCkovP->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal()) ; 
-     fSigP ->Fill(pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
+    fCkovP->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal()) ; 
+    fSigP ->Fill(pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
      
-   Float_t xClu,yClu; Int_t q,np;  
-   Float_t xPc,yPc;  
-   pTrk->GetHMPIDmip(xClu,yClu,q,np);  
-   fMipXY->Fill(xClu,yClu); //mip info
-   Float_t xRad,yRad,th,ph;        
-   pTrk->GetHMPIDtrk(xRad,yRad,th,ph); 
-   Int_t iCh=pTrk->GetHMPIDcluIdx();iCh/=1000000;
-   Double_t p1[3],n1[3]; pParam->Norm(iCh,n1); pParam->Lors2Mars(iCh,0,0,p1,AliHMPIDParam::kPc);  //point & norm  for RAD
-   Printf(" pointer ESD %x ",fEsd);
-   Double_t bField=fEsd->GetMagneticField();
-   
-   Printf(" B field %f ",bField);
-   if(pTrk->Intersect(p1,n1,bField)==kFALSE) continue;                              //try to intersect track with the middle of radiator
-   pParam->Mars2Lors   (iCh,p1,xPc,yPc);                                                          //TRKxPC position
-   fDifX->Fill(xPc-xClu); //track info 
+    Float_t xClu,yClu; Int_t q,np;  
+    Float_t xPc,yPc;  
+    pTrk->GetHMPIDmip(xClu,yClu,q,np);  
+    fMipXY->Fill(xClu,yClu); //mip info
+    Float_t xRad,yRad,th,ph;        
+    pTrk->GetHMPIDtrk(xRad,yRad,th,ph); 
+    Int_t iCh=pTrk->GetHMPIDcluIdx();iCh/=1000000;
+    Double_t p1[3],n1[3]; pParam->Norm(iCh,n1); pParam->Lors2Mars(iCh,0,0,p1,AliHMPIDParam::kPc);      //point & norm  for PC
+    if(pTrk->Intersect(p1,n1,fEsd->GetMagneticField())==kFALSE) continue;                              //try to intersect track with PC
+    pParam->Mars2Lors   (iCh,p1,xPc,yPc);                                                              //TRKxPC position
+    fDifX->Fill(xPc-xClu); //track info 
      
-     Double_t pid[5];  pTrk->GetHMPIDpid(pid); for(Int_t i =0;i<5;i++) fProb[i]->Fill(pid[i]);
+    Double_t pid[5];  pTrk->GetHMPIDpid(pid); for(Int_t i =0;i<5;i++) fProb[i]->Fill(pid[i]);
   }//tracks loop 
      
   return kTRUE;
index 3920349..1340fb9 100644 (file)
@@ -23,6 +23,8 @@ void Hdisp(Int_t cosRun=44)                                                    /
       gMaxEvt=gAL->GetNumberOfEvents()-1;
       gHL->LoadHits(); gHL->LoadSDigits(); gHL->LoadDigits(); gHL->LoadRecPoints();
 
+      AliHMPIDTracker::SetFieldMap(gAL->GetAliRun()->Field(),kTRUE);
+      
       TFile *pEsdFl=TFile::Open("AliESDs.root"); gEsdTr=(TTree*) pEsdFl->Get("esdTree"); gEsdTr->SetBranchAddress("ESD", &gEsd);
       pAll->cd(7); TButton *pBtn=new TButton("Next","ReadEvt()",0,0,0.2,0.1);   pBtn->Draw();
                    TButton *pHitBtn=new TButton("Print hits","PrintHits()",0,0.2,0.3,0.3);   pHitBtn->Draw();
@@ -163,6 +165,9 @@ void DrawCh(Int_t iCh)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void DrawEvt(TClonesArray *pHitLst,TObjArray *pDigLst,TObjArray *pCluLst,AliESD *pEsd)
 {//draws all the objects of current event in given canvas
+  
+  AliHMPIDParam *pParam=AliHMPIDParam::Instance();
+  
   AliHMPIDRecon rec;  
   TPolyMarker *pTxC[7], *pRin[7]; TMarker *pMip,*pCko,*pFee,*pDig,*pClu;
   pMip=new TMarker; pMip->SetMarkerColor(kRed);  pMip->SetMarkerStyle(kOpenTriangleUp);
@@ -181,11 +186,19 @@ void DrawEvt(TClonesArray *pHitLst,TObjArray *pDigLst,TObjArray *pCluLst,AliESD
     if(ch<0) continue; //this track does not hit HMPID
     ch/=1000000; 
     Float_t th,ph,xRad,yRad; pTrk->GetHMPIDtrk(xRad,yRad,th,ph);//get info on current track
-//    pTxC[ch]->SetNextPoint(xPc,yPc);                          //add new intersection point  TEMPORARLY DISABLED...no more available in ESD!
-    
+//
+//Find again intersection of track with PC--> it is not stored in ESD!
+//    
+    Float_t xPc=0,yPc=0;                                                                                               //track intersection point with PC  
+    Double_t pMom[3],nCh[3]; pTrk->GetPxPyPz(pMom);pParam->Norm(ch,nCh); pParam->Lors2Mars(ch,0,0,pMom,AliHMPIDParam::kPc);  //point & norm  for PC
+    if(pTrk->Intersect(pMom,nCh,-AliHMPIDTracker::GetBz())==kTRUE){                                                      //try to intersect track with PC
+      pParam->Mars2Lors   (ch,pMom,xPc,yPc);                                                                             //TRKxPC position
+      pTxC[ch]->SetNextPoint(xPc,yPc);
+    }
+// end of point intersection @ PC    
     Float_t ckov=pTrk->GetHMPIDsignal();  Float_t err=TMath::Sqrt(pTrk->GetHMPIDchi2());
     if(ckov>0){
-      Printf("theta %f phi %f ckov %f",th*TMath::RadToDeg(),ph*TMath::RadToDeg(),ckov);
+//      Printf("theta %f phi %f ckov %f",th*TMath::RadToDeg(),ph*TMath::RadToDeg(),ckov);
       rec.SetTrack(xRad,yRad,th,ph);
       for(Int_t j=0;j<100;j++){ 
         TVector2 pos;