kinks Data new geom YK
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Kinks / AliAnalysisKinkESDat.cxx
index 714db9f..3a80644 100644 (file)
@@ -10,6 +10,7 @@
 //                 AliAnalysisKinkESDat class
 //       Example of an analysis task for kink topology study
 //      Kaons from kink topology are 'identified' in this code
+//     Nov 2014 : Nominal R->120-210 cm,  Rapidity kaon 0.5, eta< 0.8
 //-----------------------------------------------------------------
 
 #include "TChain.h"
@@ -58,10 +59,10 @@ AliAnalysisKinkESDat::AliAnalysisKinkESDat(const char *name)
     fradPtRpDt(0), fInvMuNuAll(0), fQtInvM(0), 
          fDCAkink(0), fPosiKink(0),  fPosiKinkK(0),fPosiKinKXZ(0), fPosiKinKYZ(0), fPosiKinKBg(0), fQtMothP(0), fTPCSgnlPtpc(0),
        fTPCMomNSgnl(0),  fMothKinkMomSgnl(0), fNSigmTPC(0),  fTPCSgnlKinkDau(0), fPtKinkPos(0), fPtKinkNeg(0),  fRadNclCln(0),
-       fRatioCrossedRows(0), fRatioCrossedRowsKink(0),fRadiusPt(0), fRadiusPtcln(0),  fInvMassMuNuPt(0), fPtCut1(0), fPtCut2(0), fPtCut3(0),
-      fAngMomKKinks(0),
+       fRatioCrossedRows(0), fRatioCrossedRowsKink(0),fRadiusPt(0), fRadiusPtcln(0),  fInvMassMuNuPt(0), fInvMassMuNuPtAll(0),fPtCut1(0), fPtCut2(0), 
+      fPtCut3(0), fAngMomKKinks(0),
  f1(0), f2(0),
-      fListOfHistos(0),fLowMulcut(-1),fUpMulcut(-1), fKinkRadUp(200), fKinkRadLow(130), fCutsMul(0),  fMaxDCAtoVtxCut(0),  fPIDResponse(0)
+      fListOfHistos(0),fLowMulcut(-1),fUpMulcut(-1), fKinkRadUp(210), fKinkRadLow(120), fLowCluster(20), fLowQt(.12), fRapiK(0.5),  fCutsMul(0),   fMaxDCAtoVtxCut(0),  fPIDResponse(0)
 {
   // Constructor
 
@@ -116,10 +117,17 @@ void AliAnalysisKinkESDat::UserCreateOutputObjects()
    f2->SetParameter(2,TMath::Pi());
    //Open file  1= CAF 
     //OpenFile(1); 
+/*
    Double_t gPt7K0[45] = {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8,0.9,1.0,
                         1.1, 1.2, 1.3, 1.4, 1.5, 1.6,1.7,1.8,1.9,  2.0,
                          2.2, 2.4, 2.6, 2.8,  3.0,   3.3, 3.6, 3.9,   
                          4.2, 4.6,5.0, 5.4, 5.9,  6.5,   7.0,7.5, 8.0,8.5,  9.2, 10., 11., 12., 13.5,15.0 };  // David K0
+*/
+ Double_t gPt7Comb[48] = {
+0.25,0.30,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0, 1.1, 1.2,
+1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
+3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8,5.0, 5.5, 6
+ };  // 25/11/2013 from Francesco
 
    Double_t gPt7TOF[47] = { 0.2,0.25, 0.3,0.35,  0.4,0.45,  0.5,0.55,  0.6,0.65,  0.7,0.75,  0.8, 0.85, 0.9, 0.95, 1.0,
                         1.1, 1.2, 1.3, 1.4, 1.5, 1.6,1.7,1.8,1.9,  2.0,
@@ -147,8 +155,10 @@ void AliAnalysisKinkESDat::UserCreateOutputObjects()
   fKinkKaon= new TH1F("fKinkKaon", "P_{T}Kaon kinks identi",300, 0.0,15.0); 
   fKinKRbn= new TH1F("fKinKRbn", "p_{t}Kaon kinks identi[GeV/c],Entries",46,gPt7TOF); 
   fKinkKaonBg= new TH1F("fKinkKaonBg", "P_{T}Kaon kinks backgr",300, 0.0,15.0); 
-  fM1kaon= new TH1F("fM1kaon","Invar m(kaon) from kink->mu+netrino decay",180,0.10, 1.0); 
-  fPtKink= new TH1F("fPtKink", "P_{T}Kaon Kink  distribution, counts",44, gPt7K0); 
+  //fM1kaon= new TH1F("fM1kaon","Invar m(kaon) from kink->mu+netrino decay",180,0.10, 1.0); 
+  fM1kaon= new TH1F("fM1kaon","Invar m(kaon) from kink->mu+netrino decay",600,0.10, 0.7); //  23/8/2013
+  //fPtKink= new TH1F("fPtKink", "P_{T}Kaon Kink  distribution, counts",44, gPt7K0); 
+  fPtKink= new TH1F("fPtKink", "P_{T}Kaon Kink  distribution, counts",47, gPt7Comb); 
   fptKink= new TH1F("fptKink", "P_{T}Kaon Kink  bution",300, 0.0,15.0); 
   fAngMomK= new TH2F("fAngMomK","Decay angle vrs Mother Mom,K",100,0.0,5.0,80,0.,80.);
   fAngMomPi= new TH2F("fAngMomPi","Decay angle vrs Mother Mom,Pi",100,0.0,5.0,80,0.,80.);
@@ -178,7 +188,8 @@ void AliAnalysisKinkESDat::UserCreateOutputObjects()
   flifetime= new TH1F("flifetime", "ct study of K-kinks",100,0.,1000.); 
   fradLK= new TH1F("fradLK", "Length of   K generated",100,0.,1000.); 
   fradPtRpDt=new TH3F("fradPtRpDt","rad pt rap dat",28,100.,240., 20, 0., 5., 20, -1., 1. );
-  fInvMuNuAll= new TH1F("fInvMuNuAll", " Inv Mass MuNu all kink",180,0.1,1.0); 
+  //fInvMuNuAll= new TH1F("fInvMuNuAll", " Inv Mass MuNu all kink",180,0.1,1.0); 
+  fInvMuNuAll= new TH1F("fInvMuNuAll", " Inv Mass MuNu all kink",600,0.1,0.7); //  23/8/2013
   fQtInvM= new TH2F("fQtInvM", "Q_{T} Versus Inv MuNu ",80, 0., 0.80 , 100 , 0., 0.300); 
     fDCAkink = new TH1F("fDCAkink ", "DCA kink vetrex ",50, 0.0,1.0);
   fPosiKink= new TH2F("fPosiKink", "Y vrx kink Vrex ",100, -300.0,300.0,100, -300, 300.);
@@ -192,14 +203,17 @@ void AliAnalysisKinkESDat::UserCreateOutputObjects()
     fMothKinkMomSgnl  = new TH2F("fMothKinkMomSgnl","TPC signal de/dx Mom TPC,Kink  ",100,0.0,250.0,100, 0., 250.    );
     fNSigmTPC    = new TH1F("fNSigmTPC","TPC Nsigma  de/dx  TPC,K  ", 30 , -7.5, 7.5);
     fTPCSgnlKinkDau = new TH2F("fTPCSgnlKinkDau","TPC signal de/dx Mom,K",500,0.0,10.0,100,0.,250.);
-  fPtKinkPos= new TH1F("fPtKinkPos", "Pos P_{T}Kaon Kink  distribution, counts",44, gPt7K0); 
-  fPtKinkNeg= new TH1F("fPtKinkNeg", "Neg P_{T}Kaon Kink  distribution, counts",44, gPt7K0); 
+  //fPtKinkPos= new TH1F("fPtKinkPos", "Pos P_{T}Kaon Kink  distribution, counts",44, gPt7K0); 
+  fPtKinkPos= new TH1F("fPtKinkPos", "Pos P_{T}Kaon Kink  distribution, counts",47, gPt7Comb ); 
+  fPtKinkNeg= new TH1F("fPtKinkNeg", "Neg P_{T}Kaon Kink  distribution, counts",47, gPt7Comb ); 
   fRadNclCln = new TH2F("fRadNclCln","kink radius vrs Nclust,K Clean ",75,100.,250., 80,0, 160);
   fRatioCrossedRows = new TH1F("fRatioCrossedRows","Ratio crossed rows  in TPC",20,0.0,1.0);
   fRatioCrossedRowsKink = new TH1F("fRatioCrossedRowsKink","Ratio crossed rows  in TPC for kinks",20,0.0,1.0);
   fRadiusPt =new TH2F("fRadiusPt","radius vs pt  ",80, 90.,250.,100, 0.,10.              );
   fRadiusPtcln =new TH2F("fRadiusPtcln","radius vs pt clean ",80, 90.,250.,100, 0.,10.              );
-  fInvMassMuNuPt =new TH2F("fInvMassMuNuPt","Invariant mass-munu  vs pt  ",180, 0.10, 1.00, 100, 0.0, 10.0  );
+  //fInvMassMuNuPt =new TH2F("fInvMassMuNuPt","Invariant mass-munu  vs pt  ",180, 0.10, 1.00, 100, 0.0, 10.0  );
+  fInvMassMuNuPt =new TH2F("fInvMassMuNuPt","Invariant mass-munu  vs pt  ",600, 0.10, 0.7, 100, 0.0, 10.0  );// 23/8/2013
+  fInvMassMuNuPtAll =new TH2F("fInvMassMuNuPtAll","Invariant mass-munu  vs pt  ",600, 0.10, 0.7, 100, 0.0, 10.0  );// 23/8/2013
   fPtCut1 = new TH1F("fPtCut1", "P_{T}Kaon distribution",300, 0.0,15.0); 
   fPtCut2 = new TH1F("fPtCut2", "P_{T}Kaon distribution",300, 0.0,15.0); 
   fPtCut3 = new TH1F("fPtCut3", "P_{T}Kaon distribution",300, 0.0,15.0); 
@@ -277,6 +291,7 @@ void AliAnalysisKinkESDat::UserCreateOutputObjects()
    fListOfHistos->Add(fRadiusPt);
    fListOfHistos->Add(fRadiusPtcln);
    fListOfHistos->Add(fInvMassMuNuPt);
+   fListOfHistos->Add(fInvMassMuNuPtAll);
    fListOfHistos->Add(fPtCut1);
    fListOfHistos->Add(fPtCut2);
    fListOfHistos->Add(fPtCut3);
@@ -350,7 +365,7 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
   
      
  Int_t nESDTracK = 0;
- Int_t nESDTrKink = 0;
+// Int_t nESDTrKink = 0;
 
    Int_t nGoodTracks =  esd->GetNumberOfTracks();
     fESDMult->Fill(nGoodTracks);
@@ -358,9 +373,9 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
        Double_t nsigmall = 100.0;
        Double_t nsigma = 100.0;
        Double_t nsigmaPion =-100.0;
-       Double_t nsigmaDau  =-100.0;
+  //     Double_t nsigmaDau  =-100.0;
        Double_t dEdxKinkDau =0.0;
-       Double_t KinkDauCl   =0.0;
+ //      Double_t KinkDauCl   =0.0;
 // apo Eftihi 
                   if(!fPIDResponse) {
     AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
@@ -386,7 +401,7 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
     labelD = TMath::Abs(labelD);
    nsigmaPion     = (fPIDResponse->NumberOfSigmasTPC(trackD  , AliPID::kPion));// 26/10 eftihis
      dEdxKinkDau =  (trackD->GetTPCsignal()  )  ;  //  daughter kink  dEdx 
-   KinkDauCl=(trackD->GetTPCclusters(0)  )  ;
+//   KinkDauCl=(trackD->GetTPCclusters(0)  )  ;
  }
 //if((indexKinkDau >0)&& (nsigmaPion>1.2)) fTPCSgnlKinkDau->Fill(trackD->P(), (trackD->GetTPCsignal()  ) ) ;  //  daughter kink 
 // Ayto mexri 26/11/2012     if(indexKinkDau >0) fTPCSgnlKinkDau->Fill(trackD->P(), (trackD->GetTPCsignal()  ) ) ;  //  daughter kink 
@@ -476,8 +491,6 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
 //          continue;   //    allagi  23Jul11
 
                     if (!fMaxDCAtoVtxCut->AcceptTrack(track)) continue;
-// Float_t MaxDCAxy =       fMaxDCAtoVtxCut->GetMaxDCAToVertexXYPtDep(track );
-   //       if (MaxDCAxy > 2.4 )  continue ; 
 
     fdcatoVxXY->Fill(dcaToVertexXYpos);
 //
@@ -526,7 +539,7 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
           Float_t qT=kink->GetQt();
             Float_t motherPt=motherMfromKink.Pt();
 // Kink  mother momentum 
-     Double_t trMomTPCKink=motherMfromKink.Mag();        
+//     Double_t trMomTPCKink=motherMfromKink.Mag();        
 // TPC mother momentun
      Double_t trMomTPC=track->GetTPCmomentum();      
   //     fTPCSgnlKinkDau->Fill( daughterMKink.Mag(), dEdxKinkDau  ) ;  //  daughter kink 
@@ -538,12 +551,16 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
            Float_t kinkAngle=TMath::RadToDeg()*kink->GetAngle(2);
 
 //   rapiditya nd pt selection 
-          if(  (TMath::Abs(rapiditK )) > 0.7 ) continue;
+          //  if(  (TMath::Abs(rapiditK )) > 0.7 ) continue;
+          //  if(  (TMath::Abs(rapiditK )) > 0.5 ) continue; //  allagh  Nov. 2014 , better acceptance 
+          if(  (TMath::Abs(rapiditK )) > fRapiK ) continue; //  allagh  Nov. 2014 , better acceptance 
         if ( (track->Pt())<.200)continue;  // new Feb 2012
+//              eta selection 
+        if ( TMath::Abs(trackEta) > 0.8) continue;  // new  NOv   2014 
 
                 fQtMothP->Fill( track->P(), qT);
 
-        if ( qT> 0.04)  fHistQt1  ->Fill(qT) ;  //  Qt   distr
+        if ( qT> fLowQt )  fHistQt1  ->Fill(qT) ;  //  Qt   distr
 
 
 
@@ -579,19 +596,21 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
          Double_t invariantMassKmu= TMath::Sqrt((energyDaughterMu+p3Daughter)*(energyDaughterMu+p3Daughter)-motherMfromKink.Mag()*motherMfromKink.Mag());
            fQtInvM -> Fill ( invariantMassKmu,  qT);
            fInvMuNuAll->Fill(invariantMassKmu);
+           fInvMassMuNuPtAll ->Fill(invariantMassKmu,  trackPt);
 //
          fRadiusPt->Fill( kink->GetR(), trackPt); // 
  //  radius and Minv selection 
        //if( ( kink->GetR()> 120 ) && ( kink->GetR() < 210 )  )  {
        if( ( kink->GetR()> fKinkRadLow ) && ( kink->GetR() <fKinkRadUp   )  )  {
     //  for systematics   if( ( kink->GetR()> 130 ) && ( kink->GetR() < 200 )  )  {
-      if (qT>0.12)  fAngMomKC->Fill(track->P(), kinkAngle); 
-          if ( qT>0.12) fM1kaon->Fill(invariantMassKmu);
-             if ( qT > 0.12) 
+      if (qT>fLowQt )  fAngMomKC->Fill(track->P(), kinkAngle); 
+          if ( qT> fLowQt ) fM1kaon->Fill(invariantMassKmu);
+             if ( qT > fLowQt) 
          fRadiusNcl->Fill( (kink->GetR()) ,(track->GetTPCclusters(0)  ) ) ;
   }    
 //  tails cleaning
-             if(  ( tpcNCl<20) ) continue;  // test 27 feb 2012 ,, OK
+               if(  ( tpcNCl<fLowCluster) ) continue;  // test 27 feb 2012 ,, OK
+          //  edw iatn !!!    if(  ( tpcNCl<50 ) ) continue;  // test 15 March  13,, OK
 // cleaning BG in tails
       Int_t tpcNClHigh = -51.67+ (11./12.)  *( kink->GetR() ) ;  
                if ( tpcNCl > tpcNClHigh) continue;   
@@ -604,7 +623,9 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
                fHistPtKPDG->Fill(track->Pt());  // ALL  K-candidates until now                 
     //  if((kinkAngle>maxDecAngpimu)&&(qT>0.12)&&(qT<0.30)&&((kink->GetR()>=120.)&&(kink->GetR()<=210.))&&(TMath::Abs(rapiditK)<0.7)&&(invariantMassKmu<0.6)){
      //if((kinkAngle>maxDecAngpimu)&&(qT>0.12)&&(qT<0.30)&&((kink->GetR()>=120.)&&(kink->GetR()<=210.))&&(TMath::Abs(rapiditK)<0.7)&&(invariantMassKmu<0.8)){
-     if((kinkAngle>maxDecAngpimu)&&(qT>0.12)&&(qT<0.30)&&((kink->GetR()>= fKinkRadLow )&&(kink->GetR()<= fKinkRadUp ))&&(TMath::Abs(rapiditK)<0.7)&&(invariantMassKmu<0.8)){
+     //if((kinkAngle>maxDecAngpimu)&&(qT>0.04)&&(qT<0.30)&&((kink->GetR()>= fKinkRadLow )&&(kink->GetR()<= fKinkRadUp ))&&(TMath::Abs(rapiditK)<0.7)&&(invariantMassKmu<0.8)){
+     if((kinkAngle>maxDecAngpimu)&&(qT>fLowQt)&&(qT<0.30)&&((kink->GetR()>= fKinkRadLow )&&(kink->GetR()<= fKinkRadUp ))&&(TMath::Abs(rapiditK)<fRapiK  )&&(invariantMassKmu<0.8)){
+     //          if((kinkAngle>maxDecAngpimu)&&(qT>fLowQt)&&(qT<0.30)&&((kink->GetR()>= fKinkRadLow )&&(kink->GetR()<= fKinkRadUp ))&&(TMath::Abs(rapiditK)<0.7)&&(invariantMassKmu<0.8)){
   // systematics   if((kinkAngle>maxDecAngpimu)&&(qT>0.12)&&(qT<0.30)&&((kink->GetR()>=130.)&&(kink->GetR()<=200.))&&(TMath::Abs(rapiditK)<0.7)&&(invariantMassKmu<0.8)){
 //
         fAngMomKKinks->Fill(track->P(), kinkAngle); 
@@ -618,7 +639,7 @@ void AliAnalysisKinkESDat::UserExec(Option_t *)
            fTPCSgnlPa->Fill( track->GetInnerParam()->GetP() ,(track->GetTPCsignal()  ) ) ;
 //
             //  NO dEdx cut test 9/2/13               if ( nsigma               > 3.5) continue;
-            // system               if ( nsigma               > 4.0) continue;   // gia systamatic error
+                     if ( nsigma               > 3.5) continue; 
 // 
 //  next plots for the identified kaons by the kink analysis