]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTPairCut.cxx
Particle, Particle Cut moved to ANALYSIS
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPairCut.cxx
index 64974fc66092c9942776c9678186e895eb9d81f6..4b0b38f349d27712d924706c32d4bdd9b5b69efd 100644 (file)
@@ -27,6 +27,10 @@ AliHBTPairCut::AliHBTPairCut():
   fSecondPartCut= new AliHBTEmptyParticleCut(); //empty cuts
     
   fCuts = new AliHbtBasePairCut*[fgkMaxCuts];
+  for (Int_t i = 0;i<fNCuts;i++)
+   {
+     fCuts[i] = 0x0;
+   }
 }
 /**********************************************************/
 
@@ -197,27 +201,27 @@ void AliHBTPairCut::SetQInvRange(Double_t min, Double_t max)
 void AliHBTPairCut::SetQOutCMSLRange(Double_t min, Double_t max)
 {
   // set range of accepted QOut in CMS
-  AliHBTQOutCMSLCCut* cut= (AliHBTQOutCMSLCCut*)FindCut(kHbtPairCutPropQOutCMSLC);
+  AliHBTQOutLCMSCut* cut= (AliHBTQOutLCMSCut*)FindCut(kHbtPairCutPropQOutLCMS);
   if(cut) cut->SetRange(min,max);
-  else fCuts[fNCuts++] = new AliHBTQOutCMSLCCut(min,max);
+  else fCuts[fNCuts++] = new AliHBTQOutLCMSCut(min,max);
 }
 
 /**********************************************************/
 void AliHBTPairCut::SetQSideCMSLRange(Double_t min, Double_t max)
 {
   // set range of accepted QSide in CMS
-  AliHBTQSideCMSLCCut* cut= (AliHBTQSideCMSLCCut*)FindCut(kHbtPairCutPropQSideCMSLC);
+  AliHBTQSideLCMSCut* cut= (AliHBTQSideLCMSCut*)FindCut(kHbtPairCutPropQSideLCMS);
   if(cut) cut->SetRange(min,max);
-  else fCuts[fNCuts++] = new AliHBTQSideCMSLCCut(min,max);
+  else fCuts[fNCuts++] = new AliHBTQSideLCMSCut(min,max);
 }
 
 /**********************************************************/
 void AliHBTPairCut::SetQLongCMSLRange(Double_t min, Double_t max)
 {
   // set range of accepted QLong in CMS
-  AliHBTQLongCMSLCCut* cut= (AliHBTQLongCMSLCCut*)FindCut(kHbtPairCutPropQLongCMSLC);
+  AliHBTQLongLCMSCut* cut= (AliHBTQLongLCMSCut*)FindCut(kHbtPairCutPropQLongLCMS);
   if(cut) cut->SetRange(min,max);
-  else fCuts[fNCuts++] = new AliHBTQLongCMSLCCut(min,max);
+  else fCuts[fNCuts++] = new AliHBTQLongLCMSCut(min,max);
 }
 
 /**********************************************************/
@@ -249,12 +253,20 @@ void AliHBTPairCut::SetAvSeparationRange(Double_t min, Double_t max)
 }
 /**********************************************************/
 
-void AliHBTPairCut::SetPixelSeparation(Double_t drphi, Double_t dz)
+void AliHBTPairCut::SetITSSeparation(Int_t layer, Double_t drphi, Double_t dz)
 {
   //Anti-Merging Cut for first pixel layer
-  AliHbtBasePairCut* cut= FindCut(kHbtPairCutPropPixelSepar);
-  if(cut) cut->SetRange(drphi,dz);//In this cut fMin is drphi, and fMax dz
-  else fCuts[fNCuts++] = new AliHBTPixelSeparationCut(drphi,dz);
+  AliHBTITSSeparationCut* cut= dynamic_cast<AliHBTITSSeparationCut*>(FindCut(kHbtPairCutPropPixelSepar));
+  if(cut) 
+   {
+     if (layer == cut->GetLayer())
+      {
+        cut->SetRange(drphi,dz);//In this cut fMin is drphi, and fMax dz
+        return;
+      }
+   }
+  fCuts[fNCuts++] = new AliHBTITSSeparationCut(layer,drphi,dz);
+//  Info("SetITSSeparation","Added %d at address %#x",fNCuts-1,fCuts[fNCuts-1]);
 }
 /**********************************************************/
 
@@ -346,9 +358,9 @@ void AliHBTEmptyPairCut::Streamer(TBuffer &b)
 ClassImp(AliHbtBasePairCut)
 ClassImp(AliHBTQInvCut)
 ClassImp(AliHBTKtCut)
-ClassImp(AliHBTQSideCMSLCCut)
-ClassImp(AliHBTQOutCMSLCCut)
-ClassImp(AliHBTQLongCMSLCCut)
+ClassImp(AliHBTQSideLCMSCut)
+ClassImp(AliHBTQOutLCMSCut)
+ClassImp(AliHBTQLongLCMSCut)
 
 /******************************************************************/
 ClassImp(AliHBTAvSeparationCut)
@@ -373,10 +385,40 @@ Double_t AliHBTAvSeparationCut::GetValue(AliHBTPair* pair) const
   return tpts1->AvarageDistance(*tpts2);
 }
 /******************************************************************/
+ClassImp(AliHBTSeparationCut)
+    
+Double_t AliHBTSeparationCut::GetValue(AliHBTPair* pair) const 
+{
+  //chacks if avarage distance of two tracks is in given range
+  AliHBTTrackPoints* tpts1 = pair->Particle1()->GetTrackPoints();
+  if ( tpts1 == 0x0)
+   {//it could be simulated pair
+//     Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
+     return -1.0;
+   }
+
+  AliHBTTrackPoints* tpts2 = pair->Particle2()->GetTrackPoints();
+  if ( tpts2 == 0x0)
+   {
+//     Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
+     return -1.0;
+   }
+  Float_t x1=0,y1=0,z1=0; 
+  Float_t x2=0,y2=0,z2=0;
+  
+  tpts1->PositionAt(fPoint,x1,y1,z1);
+  tpts2->PositionAt(fPoint,x2,y2,z2);
+  Double_t dx1 = x1 - x2;
+  Double_t dy1 = y1 - y2;
+  Double_t dz1 = z1 - z2;
+  Double_t d = TMath::Sqrt(dx1*dx1 + dy1*dy1 + dz1*dz1);
+  return d;
+}
+/******************************************************************/
 
-ClassImp(AliHBTPixelSeparationCut)
+ClassImp(AliHBTITSSeparationCut)
 
-Bool_t AliHBTPixelSeparationCut::Pass(AliHBTPair* pair) const
+Bool_t AliHBTITSSeparationCut::Pass(AliHBTPair* pair) const
 {
  //Checks if two tracks do not cross first pixels too close to each other
  //If two tracks use the same cluster in pixels they are given
@@ -400,8 +442,8 @@ Bool_t AliHBTPixelSeparationCut::Pass(AliHBTPair* pair) const
      return kTRUE;//reject 
    }
   Float_t  x1=0.0,y1=0.0,z1=0.0,x2=0.0,y2=0.0,z2=0.0;
-  tpts1->PositionAt(0,x1,y1,z1);
-  tpts2->PositionAt(0,x2,y2,z2);
+  tpts1->PositionAt(fLayer,x1,y1,z1);
+  tpts2->PositionAt(fLayer,x2,y2,z2);
   
 //  Info("Pass","rphi %f z %f",fMin,fMax);
 //  Info("Pass","P1: %f %f %f", x1,y1,z1);
@@ -453,7 +495,7 @@ Bool_t AliHBTOutSideSameSignCut::Pass(AliHBTPair *p) const
 {
   //returns kTRUE if pair DO NOT meet cut criteria
   
-  if ( p->GetQOutCMSLC()*p->GetQSideCMSLC() > 0 ) 
+  if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 ) 
    {
      return kFALSE;//accpeted
    }
@@ -467,7 +509,7 @@ Bool_t AliHBTOutSideDiffSignCut::Pass(AliHBTPair *p) const
 {
   //returns kTRUE if pair DO NOT meet cut criteria
   
-  if ( p->GetQOutCMSLC()*p->GetQSideCMSLC() > 0 ) 
+  if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 ) 
    {
      return kTRUE;//rejected
    }