From Carlos Perez: updates to Strange Flow task and AddTask macro.
authorRedmer Alexander Bertens <rbertens@cern.ch>
Wed, 11 Dec 2013 10:09:14 +0000 (11:09 +0100)
committerRedmer Alexander Bertens <rbertens@cern.ch>
Wed, 11 Dec 2013 10:09:14 +0000 (11:09 +0100)
From Redmer: minor modifications to unfolding routines

PWG/FLOW/Tasks/AliAnalysisTaskFlowStrange.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFlowStrange.h
PWG/FLOW/Tasks/AliJetFlowTools.cxx
PWG/FLOW/Tasks/AliJetFlowTools.h
PWGCF/FLOW/macros/AddTaskFlowStrange.C

index 9f7822c..bac620f 100644 (file)
@@ -92,6 +92,7 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange() :
   fQAlevel(0),
   fReadESD(kFALSE),
   fReadMC(kFALSE),
+  fPostMatched(0),
   fAvoidExec(kFALSE),
   fSkipSelection(kFALSE),
   fSkipFlow(kFALSE),
@@ -104,6 +105,7 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange() :
   fCentPerMin(0),
   fCentPerMax(100),
   fThisCent(-1.0),
+  fVertexZcut(10.0),
   fExcludeTPCEdges(kFALSE),
   fSpecie(0),
   fOnline(kFALSE),
@@ -124,6 +126,8 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange() :
   fMassBins(0),
   fMinMass(0.0),
   fMaxMass(0.0),
+  fMinMassX(-1.0),
+  fMaxMassX(-1.0),
   fRFPFilterBit(1),
   fRFPminPt(0.2),
   fRFPmaxPt(5.0),
@@ -145,9 +149,18 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange() :
   fDecayAlpha(0.0),
   fDecayRapidity(0.0),
   fDecayProductIPXY(0.0),
+  fDecayIPneg(0.0),
+  fDecayIPpos(0.0),
+  fDecayXneg(0.0),
+  fDecayXpos(0.0),
   fDecayIDneg(-1),
   fDecayIDpos(-1),
   fDecayID(-1),
+  fDecayMatchOrigin(0.0),
+  fDecayMatchPhi(0.0),
+  fDecayMatchEta(0.0),
+  fDecayMatchPt(0.0),
+  fDecayMatchRadXY(0.0),
   fDecayMinEta(0.0),
   fDecayMaxEta(0.0),
   fDecayMinPt(0.0),
@@ -171,8 +184,14 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange() :
   fDaughterImpactParameterXY(0.0),
   fDaughterImpactParameterZ(0.0),
   fDaughterStatus(0),
+  fDaughterITScm(0),
   fDaughterNSigmaPID(0.0),
   fDaughterKinkIndex(0),
+  fDaughterMatchPhi(0.0),
+  fDaughterMatchEta(0.0),
+  fDaughterMatchPt(0.0),
+  fDaughterMatchImpactParameterXY(0.0),
+  fDaughterMatchImpactParameterZ(0.0),
   fDaughterUnTag(kTRUE),
   fDaughterMinEta(0.0),
   fDaughterMaxEta(0.0),
@@ -184,6 +203,7 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange() :
   fDaughterMinImpactParameterXY(0.0),
   fDaughterMaxNSigmaPID(0.0) {
   //ctor
+  for(Int_t i=0; i!=6; ++i) fDaughterITSConfig[i]=-1;
 }
 //=======================================================================
 AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
@@ -200,6 +220,7 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
   fQAlevel(0),
   fReadESD(kFALSE),
   fReadMC(kFALSE),
+  fPostMatched(0),
   fAvoidExec(kFALSE),
   fSkipSelection(kFALSE),
   fSkipFlow(kFALSE),
@@ -212,6 +233,7 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
   fCentPerMin(0),
   fCentPerMax(100),
   fThisCent(-1.0),
+  fVertexZcut(10.0),
   fExcludeTPCEdges(kFALSE),
   fSpecie(0),
   fOnline(kFALSE),
@@ -232,6 +254,8 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
   fMassBins(0),
   fMinMass(0.0),
   fMaxMass(0.0),
+  fMinMassX(-1.0),
+  fMaxMassX(-1.0),
   fRFPFilterBit(1),
   fRFPminPt(0.2),
   fRFPmaxPt(5.0),
@@ -253,9 +277,18 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
   fDecayAlpha(0.0),
   fDecayRapidity(0.0),
   fDecayProductIPXY(0.0),
+  fDecayIPneg(0.0),
+  fDecayIPpos(0.0),
+  fDecayXneg(0.0),
+  fDecayXpos(0.0),
   fDecayIDneg(-1),
   fDecayIDpos(-1),
   fDecayID(-1),
+  fDecayMatchOrigin(0.0),
+  fDecayMatchPhi(0.0),
+  fDecayMatchEta(0.0),
+  fDecayMatchPt(0.0),
+  fDecayMatchRadXY(0.0),
   fDecayMinEta(0.0),
   fDecayMaxEta(0.0),
   fDecayMinPt(0.0),
@@ -279,8 +312,14 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
   fDaughterImpactParameterXY(0.0),
   fDaughterImpactParameterZ(0.0),
   fDaughterStatus(0),
+  fDaughterITScm(0),
   fDaughterNSigmaPID(0.0),
   fDaughterKinkIndex(0),
+  fDaughterMatchPhi(0.0),
+  fDaughterMatchEta(0.0),
+  fDaughterMatchPt(0.0),
+  fDaughterMatchImpactParameterXY(0.0),
+  fDaughterMatchImpactParameterZ(0.0),
   fDaughterUnTag(kTRUE),
   fDaughterMinEta(0.0),
   fDaughterMaxEta(0.0),
@@ -292,6 +331,7 @@ AliAnalysisTaskFlowStrange::AliAnalysisTaskFlowStrange(const char *name) :
   fDaughterMinImpactParameterXY(0.0),
   fDaughterMaxNSigmaPID(0.0) {
   //ctor
+  for(Int_t i=0; i!=6; ++i) fDaughterITSConfig[i]=-1;
   DefineInput( 0,TChain::Class());
   DefineOutput(1,TList::Class());
   DefineOutput(2,AliFlowEventSimple::Class()); // TPC object
@@ -325,6 +365,22 @@ void AliAnalysisTaskFlowStrange::UserCreateOutputObjects() {
   cc->SetMassMin(fMinMass);
   cc->SetMassMax(fMaxMass);
 
+  if(fMinMassX<0) {
+    if(fSpecie==0) {
+      fMinMassX = 0.494;
+      fMaxMassX = 0.502;
+      //      double lowEdge[14]={0.398, 0.420, 0.444, 0.468, 0.486,
+      //                         0.490, 0.494, 0.498, 0.502, 0.506, 
+      //                         0.524, 0.548, 0.572, 0.598};
+    } else {
+      fMinMassX = 1.114;
+      fMaxMassX = 1.118;
+      //      double lowEdge[13]={1.084, 1.094, 1.104, 1.110, 1.114,
+      //                         1.116, 1.118, 1.122, 1.128, 1.138,
+      //                         1.148, 1.158, 1.168};} else {
+    }
+  }
+
   //loading pid response
   AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
   AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
@@ -418,6 +474,8 @@ void AliAnalysisTaskFlowStrange::AddMakeQSpy() {
   tList->SetOwner();
   tH1D = new TH1D("RFPTPC","TPC Refrence Multiplicity;multiplicity",3000,0,3000);     tList->Add( tH1D );
   tH1D = new TH1D("RFPVZE","VZERO Reference Multiplicity;multiplicity",3000,0,30000); tList->Add( tH1D );
+  tH1D = new TH1D("QmTPC","TPC Normalized Q vector;|Q|/M",3000,0,1);   tList->Add( tH1D );
+  tH1D = new TH1D("QmVZE","VZERO Normalized Q vector;|Q|/M",3000,0,1); tList->Add( tH1D );
   tH2D = new TH2D("TPCAllPhiEta","TPCall;Phi;Eta",180,0,TMath::TwoPi(),80,-0.9,+0.9); tList->Add( tH2D );
   tH2D = new TH2D("VZEAllPhiEta","VZEall;Phi;Eta",20,0,TMath::TwoPi(),40,-4.0,+6.0);  tList->Add( tH2D );
   tH1D = new TH1D("TPCPSI","TPCPSI;PSI",72,0,TMath::Pi()); tList->Add( tH1D );
@@ -481,19 +539,25 @@ void AliAnalysisTaskFlowStrange::AddQACandidates() {
   }
   //match
   if(fReadMC) {
-    tList=new TList(); tList->SetName("RecMth"); tList->SetOwner(); AddCandidatesSpy(tList); fList->Add(tList);
-    tH1D = new TH1D("MCOrigin", "MCOrigin;Rad2",1000,0,100); tList->Add(tH1D);
-    tH2D = new TH2D("PTRes", "PTRes;MCPt;DAT-MC/MC",  100,   0,  20,100,-0.2,+0.2); tList->Add(tH2D);
-    tH2D = new TH2D("ETARes","ETARes;MCETA;DAT-MC/MC", 16,   0, 0.8,100,-0.5,+0.5); tList->Add(tH2D);
-    tH2D = new TH2D("RXYRes","RXYRes;MCRXY;DAT-MC/MC",100,   0,  20,100,-1,1);      tList->Add(tH2D);
-    tH2D = new TH2D("DLERes","DLERes;MCDLE;DAT-MC/MC",100,   0,  20,100,-1,1);      tList->Add(tH2D);
-    tH2D = new TH2D("RAPRes","RAPRes;MCRAP;DAT-MC/MC", 10,   0, 0.5,100,-0.5,+0.5); tList->Add(tH2D);
-    tH2D = new TH2D("APARes","APARes;MCAPA;DAT-MC/MC", 24,-1.2, 1.2,100,-0.5,+0.5); tList->Add(tH2D);
-    tH2D = new TH2D("APQRes","APQRes;MCAPQ;DAT-MC/MC", 25,   0,0.25,100,-0.3,+0.3); tList->Add(tH2D);
+    tList=new TList(); tList->SetName("STATMC"); tList->SetOwner(); fList->Add(tList);
+    tH1D = new TH1D("Events", "Events",5,0.5,5.5); tList->Add(tH1D);
+    tH1D->GetXaxis()->SetBinLabel(1,"Selected events");
+    tH1D->GetXaxis()->SetBinLabel(2,"Stack found");
+    tH1D->GetXaxis()->SetBinLabel(3,"Daughters in stack");
+    tH1D->GetXaxis()->SetBinLabel(4,"Correspond to decay");
+    tH1D->GetXaxis()->SetBinLabel(5,"Decay has mother");
+
+    tList=new TList(); tList->SetName("RecMth"); tList->SetOwner(); AddCandidatesSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("TrkMth"); tList->SetOwner(); AddTracksSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("RecUNMth"); tList->SetOwner(); AddCandidatesSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("TrkUNMth"); tList->SetOwner(); AddTracksSpy(tList,true); fList->Add(tList);
+
+    tList=new TList(); tList->SetName("NegNegMth"); tList->SetOwner(); AddCandidatesSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("NegPosMth"); tList->SetOwner(); AddCandidatesSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("TrkNegMth"); tList->SetOwner(); AddTracksSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("TrkPosMth"); tList->SetOwner(); AddTracksSpy(tList,true); fList->Add(tList);
+    tList=new TList(); tList->SetName("MthFDW"); tList->SetOwner(); AddCandidatesSpy(tList,true); fList->Add(tList);
 
-    tList=new TList(); tList->SetName("TrkMth"); tList->SetOwner(); AddTracksSpy(tList); fList->Add(tList);
-    tList=new TList(); tList->SetName("MthFDW"); tList->SetOwner(); AddCandidatesSpy(tList); fList->Add(tList);
-    tH1D = new TH1D("MCOrigin", "MCOrigin;Rad2",1000,0,100); tList->Add(tH1D);
   }
   //stack
   if(fReadMC) {
@@ -558,7 +622,7 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptAAEvent(AliESDEvent *tESD) {
   fThisCent = cent->GetCentralityPercentile( mycent );
   acceptEvent = (fThisCent<fCentPerMin||fThisCent>fCentPerMax)?kFALSE:acceptEvent;
   acceptEvent = TMath::Abs(tTPCVtxZ-tSPDVtxZ)>0.5?kFALSE:acceptEvent;
-  acceptEvent = TMath::Abs(tTPCVtxZ)>10.0?kFALSE:acceptEvent;
+  acceptEvent = TMath::Abs(tTPCVtxZ)>fVertexZcut?kFALSE:acceptEvent;
   if(fQAlevel>0) ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("VTXZ"))->Fill( tTPCVtxZ, tSPDVtxZ );
   if(fQAlevel>0) ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("CCCC"))->Fill( cc1, cc2 );
   // EndOfCuts
@@ -604,7 +668,7 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptAAEvent(AliAODEvent *tAOD) {
 
   acceptEvent = (fThisCent<fCentPerMin||fThisCent>fCentPerMax)?kFALSE:acceptEvent;
   acceptEvent = TMath::Abs(tVtxZ-tSPDVtxZ)>0.5?kFALSE:acceptEvent;
-  acceptEvent = TMath::Abs(tVtxZ)>10.0?kFALSE:acceptEvent;
+  acceptEvent = TMath::Abs(tVtxZ)>fVertexZcut?kFALSE:acceptEvent;
   if(fQAlevel>0) {
     ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("VTXZ"))->Fill( tVtxZ, tSPDVtxZ );
     ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("CCCC"))->Fill( cc1, cc2 );
@@ -633,7 +697,7 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptPPEvent(AliAODEvent *tAOD) {
   //for pp i use fCentPerXXX to select on multiplicity
   acceptEvent = (fThisCent<fCentPerMin||fThisCent>fCentPerMax)?kFALSE:acceptEvent;
   acceptEvent = TMath::Abs(tVtxZ-tSPDVtxZ)>0.5?kFALSE:acceptEvent;
-  acceptEvent = TMath::Abs(tVtxZ)>10.0?kFALSE:acceptEvent;
+  acceptEvent = TMath::Abs(tVtxZ)>fVertexZcut?kFALSE:acceptEvent;
   if(fQAlevel>0) ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("VTXZ"))->Fill( tVtxZ, tSPDVtxZ );
   if(fQAlevel>0) ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("CCCC"))->Fill( cc1, cc2 );
   // EndOfCuts
@@ -691,7 +755,7 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptPAEvent(AliAODEvent *tAOD) {
   if(fCentMethod.Contains("V0MTRK")) fCentMethod = "V0M";
   fThisCent = cent->GetCentralityPercentile( fCentMethod );
   acceptEvent = (fThisCent<fCentPerMin||fThisCent>fCentPerMax)?kFALSE:acceptEvent;
-  acceptEvent = TMath::Abs(tTPCVtxZ)>10.0?kFALSE:acceptEvent;
+  acceptEvent = TMath::Abs(tTPCVtxZ)>fVertexZcut?kFALSE:acceptEvent;
   // EndOfCuts
   if(fQAlevel>0) ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("VTXZ"))->Fill( tTPCVtxZ, tSPDVtxZ );
   if(fQAlevel>0) ((TH2D*)((TList*)fList->FindObject("EventSpy"))->FindObject("CCCC"))->Fill( cc1, cc2 );
@@ -1072,7 +1136,7 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
     ieT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
     fDaughterImpactParameterXY = ip[0];
     fDaughterImpactParameterZ = ip[1];
-    Double_t dD0P = fDaughterImpactParameterXY; //ieT.GetD(pos[0], pos[1], tAOD->GetMagneticField());
+    fDecayIPpos = fDaughterImpactParameterXY; //ieT.GetD(pos[0], pos[1], tAOD->GetMagneticField());
     if(!AcceptDaughter()) continue;
 
     jT=(AliAODTrack*) myV0->GetDaughter(iNeg); // negative
@@ -1085,14 +1149,14 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
     jeT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
     fDaughterImpactParameterXY = ip[0];
     fDaughterImpactParameterZ = ip[1];
-    Double_t dD0N = fDaughterImpactParameterXY; //jeT.GetD(pos[0], pos[1], tAOD->GetMagneticField());
+    fDecayIPneg = fDaughterImpactParameterXY; //jeT.GetD(pos[0], pos[1], tAOD->GetMagneticField());
     if(!AcceptDaughter()) continue;
+
     if( fExcludeTPCEdges ) {
       if( IsAtTPCEdge(iT->Phi(),iT->Pt(),+1,tAOD->GetMagneticField()) ) continue;
       if( IsAtTPCEdge(jT->Phi(),jT->Pt(),-1,tAOD->GetMagneticField()) ) continue;
     }
-    Double_t xa, xb;
-    ieT.GetDCA(&jeT,tAOD->GetMagneticField(),xa,xb);
+    ieT.GetDCA(&jeT,tAOD->GetMagneticField(),fDecayXpos,fDecayXneg);
     /*
     // cutting out population close to TPC edges :: strange excess saw in 2010
     if( fExcludeTPCEdges ) {
@@ -1113,7 +1177,7 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
     fDecayPt = myV0->Pt();
     fDecayPhi = myV0->Phi();
     fDecayEta = myV0->Eta();
-    fDecayProductIPXY = dD0P*dD0N;
+    fDecayProductIPXY = fDecayIPpos*fDecayIPneg;
     fDecayQt = myV0->PtArmV0();
     fDecayAlpha = myV0->AlphaV0(); // AlphaV0 -> AODRecoDecat::Alpha -> return 1.-2./(1.+QlProng(0)/QlProng(1));
     if(myV0->ChargeProng(iPos)<0) fDecayAlpha = -fDecayAlpha; // protects for a change in convention
@@ -1141,8 +1205,6 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
       else FillCandidateSpy("RecAllIP");
     }
     FillCandidateSpy("RecAll");
-    ((TH2D*)((TList*)fList->FindObject("RecAll"))->FindObject("D0PD0N"))->Fill( dD0P, dD0N );
-    ((TH2D*)((TList*)fList->FindObject("RecAll"))->FindObject("XPOSXNEG"))->Fill( xa, xb );
     if(!AcceptCandidate()) continue;
     //PID for lambda::proton
     if( fSpecie>0 )
@@ -1158,11 +1220,15 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
       else FillCandidateSpy("RecSelIP");
     }
     FillCandidateSpy("RecSel");
-    ((TH2D*)((TList*)fList->FindObject("RecSel"))->FindObject("D0PD0N"))->Fill( dD0P, dD0N );
-    ((TH2D*)((TList*)fList->FindObject("RecSel"))->FindObject("XPOSXNEG"))->Fill( xa, xb );
-    fDecayIDneg = iT->GetID();
-    fDecayIDpos = jT->GetID();
-    MakeTrack();
+    // ============================
+    // Posting for FlowAnalysis
+    if(!fPostMatched) {
+      fDecayIDneg = iT->GetID();
+      fDecayIDpos = jT->GetID();
+      MakeTrack();
+    }
+    // ============================
+
     LoadTrack(&ieT,iT->Chi2perNDF());
     ieT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
     fDaughterImpactParameterXY = ip[0];
@@ -1173,18 +1239,18 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
     fDaughterImpactParameterXY = ip[0];
     fDaughterImpactParameterZ = ip[1];
     FillTrackSpy("TrkDau");
-    //===== BEGIN OF MCMATCH                                                                                                                         
+    //===== BEGIN OF MCMATCH
+    if(fReadMC) ((TH1D*)((TList*)fList->FindObject("STATMC"))->FindObject("Events"))->Fill( 1 ); // Selected event
     if(mcArray) {
+      ((TH1D*)((TList*)fList->FindObject("STATMC"))->FindObject("Events"))->Fill( 2 ); // Stack found
       bool matched = false;
       bool feeddown = false;
       Int_t labelpos = iT->GetLabel();
       Int_t labelneg = jT->GetLabel();
-      Double_t rOri=-1;
-      Double_t mcPt=-1, mcEta=-1, mcRap=-1, mcRxy=-1, mcDle=-1, mcApa=-100, mcApq=-1;
-      Double_t resPt=-1, resEta=-1, resRap=-1, resRxy=-1, resDle=-1, resApa=-1, resApq=-1;
-      if( labelpos>0 && labelneg>0 ) {
-        AliAODMCParticle *mcpos = (AliAODMCParticle*) mcArray->At( labelpos );
-        AliAODMCParticle *mcneg = (AliAODMCParticle*) mcArray->At( labelneg );
+      AliAODMCParticle *mcpos = (AliAODMCParticle*) mcArray->At( TMath::Abs(labelpos) );
+      AliAODMCParticle *mcneg = (AliAODMCParticle*) mcArray->At( TMath::Abs(labelneg) );
+      if( mcpos && mcneg ) {
+        ((TH1D*)((TList*)fList->FindObject("STATMC"))->FindObject("Events"))->Fill( 3 ); // Daughters in stack
         Int_t pdgRecPos = mcpos->GetPdgCode();
         Int_t pdgRecNeg = mcneg->GetPdgCode();
         int pospdg=211, negpdg=211;
@@ -1199,72 +1265,88 @@ void AliAnalysisTaskFlowStrange::ReadFromAODv0(AliAODEvent *tAOD) {
           }
         }
         if( TMath::Abs(pdgRecPos)==pospdg&&TMath::Abs(pdgRecNeg)==negpdg )
-          if(mcpos->GetMother()>0)
+          if(mcpos->GetMother()>-1)
             if( mcpos->GetMother()==mcneg->GetMother() ) {
               AliAODMCParticle *mcmot = (AliAODMCParticle*) mcArray->At( mcpos->GetMother() );
-              rOri = TMath::Sqrt( mcmot->Xv()*mcmot->Xv() + mcmot->Yv()*mcmot->Yv() );
-              mcPt = mcmot->Pt();
-              mcEta = TMath::Abs( mcmot->Eta() );
-              mcRap = TMath::Abs( mcmot->Y() );
-              if(!TMath::AreEqualAbs(mcPt,0,1e-6))  resPt = (fDecayPt - mcPt) / mcPt;
-              if(!TMath::AreEqualAbs(mcEta,0,1e-6)) resEta = (fDecayEta - mcEta) / mcEta;
-              if(!TMath::AreEqualAbs(mcRap,0,1e-6)) resRap = (fDecayRapidity - mcRap) / mcRap;
+              fDecayMatchOrigin = TMath::Sqrt( mcmot->Xv()*mcmot->Xv() + mcmot->Yv()*mcmot->Yv() );
+              fDecayMatchPt = mcmot->Pt();
+              fDecayMatchEta = mcmot->Eta();
+              fDecayMatchPhi = mcmot->Phi();
               if( TMath::Abs(mcmot->GetPdgCode())==mompdg) {
                 if(mcmot->GetNDaughters()==2) {
+                 ((TH1D*)((TList*)fList->FindObject("STATMC"))->FindObject("Events"))->Fill( 4 ); // Correspond to decay
                   matched=true;
                   Double_t dx = mcmot->Xv() - mcpos->Xv();
                   Double_t dy = mcmot->Yv() - mcpos->Yv();
-                  Double_t dz = mcmot->Zv() - mcpos->Zv();
-                  Double_t mcGamma = mcmot->E() / mcmot->GetCalcMass();
-                  mcRxy = TMath::Sqrt( dx*dx + dy*dy );
-                  mcDle = TMath::Sqrt(dx*dx+dy*dy+dz*dz)/mcGamma;
-                  if(!TMath::AreEqualAbs(mcRxy,0,1e-6)) resRxy = (fDecayRadXY - mcRxy) / mcRxy;
-                  if(!TMath::AreEqualAbs(mcDle,0,1e-6)) resDle = (fDecayDecayLength - mcDle) / mcDle;
-                  TVector3 momPos(mcpos->Px(),mcpos->Py(),mcpos->Pz());
-                  TVector3 momNeg(mcneg->Px(),mcneg->Py(),mcneg->Pz());
-                  TVector3 momTot(mcmot->Px(),mcmot->Py(),mcmot->Pz());
-                  Double_t qlpos = momPos.Dot(momTot)/momTot.Mag();
-                  Double_t qlneg = momNeg.Dot(momTot)/momTot.Mag();
-                  mcApq = momPos.Perp(momTot);
-                  mcApa = 1.-2./(1.+qlpos/qlneg);
-                  if(!TMath::AreEqualAbs(mcApq,0,1e-6)) resApq = (fDecayQt - mcApq) / mcApq;
-                  if(!TMath::AreEqualAbs(mcApa,0,1e-6)) resApa = (fDecayAlpha - mcApa) / mcApa;
+                  fDecayMatchRadXY = TMath::Sqrt( dx*dx + dy*dy );
                 }
-                if(mcmot->GetMother()>0) {
+                if(mcmot->GetMother()>-1) {
+                 ((TH1D*)((TList*)fList->FindObject("STATMC"))->FindObject("Events"))->Fill( 5 ); // Decay has mother
                   AliAODMCParticle *mcfdw = (AliAODMCParticle*) mcArray->At( mcmot->GetMother() );
                   if( TMath::Abs(mcfdw->GetPdgCode())==fdwpdg)
                     feeddown=true;
                 } // k0/lda have mother
               } // mother matches k0/lda
             } // both have same mother
-      } // match to MCparticles
+      }
       if(matched) {
-        FillCandidateSpy("RecMth");
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("D0PD0N"))->Fill( dD0P,dD0N );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("XPOSXNEG"))->Fill( xa, xb );
-        ((TH1D*)((TList*)fList->FindObject("RecMth"))->FindObject("MCOrigin"))->Fill( rOri );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("PTRes"))->Fill( mcPt, resPt );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("ETARes"))->Fill( mcEta, resEta );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("RAPRes"))->Fill( mcRap, resRap );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("RXYRes"))->Fill( mcRxy, resRxy );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("DLERes"))->Fill( mcDle, resDle );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("APARes"))->Fill( mcApa, resApa );
-        ((TH2D*)((TList*)fList->FindObject("RecMth"))->FindObject("APQRes"))->Fill( mcApq, resApq );
+        FillCandidateSpy("RecMth",true);
+       if(fPostMatched>0) {
+         fDecayIDneg = iT->GetID();
+         fDecayIDpos = jT->GetID();
+         MakeTrack();
+       }
+       if(labelpos<0&&labelneg<0) {
+         FillCandidateSpy("NegNegMth",true);
+       } else if(labelpos*labelneg<0) {
+         FillCandidateSpy("NegPosMth",true);
+       }
         LoadTrack(&ieT,iT->Chi2perNDF());
+       fDaughterMatchPhi=mcpos->Phi();
+       fDaughterMatchEta=mcpos->Eta();
+       fDaughterMatchPt=mcpos->Pt();
         ieT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
         fDaughterImpactParameterXY = ip[0];
         fDaughterImpactParameterZ = ip[1];
-        FillTrackSpy("TrkMth");
+        FillTrackSpy("TrkMth",true);
+       if(labelpos<0||labelneg<0) FillTrackSpy("TrkNegMth",true);
+       else FillTrackSpy("TrkPosMth",true);
         LoadTrack(&jeT,jT->Chi2perNDF());
+       fDaughterMatchPhi=mcneg->Phi();
+       fDaughterMatchEta=mcneg->Eta();
+       fDaughterMatchPt=mcneg->Pt();
         jeT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
         fDaughterImpactParameterXY = ip[0];
         fDaughterImpactParameterZ = ip[1];
-        FillTrackSpy("TrkMth");
+        FillTrackSpy("TrkMth",true);
+       if(labelpos<0||labelneg<0) FillTrackSpy("TrkNegMth",true);
+       else FillTrackSpy("TrkPosMth",true);
+      } else {
+        FillCandidateSpy("RecUNMth",true);
+       if(fPostMatched<0) {
+         fDecayIDneg = iT->GetID();
+         fDecayIDpos = jT->GetID();
+         MakeTrack();
+       }
+        LoadTrack(&ieT,iT->Chi2perNDF());
+       fDaughterMatchPhi=mcpos->Phi();
+       fDaughterMatchEta=mcpos->Eta();
+       fDaughterMatchPt=mcpos->Pt();
+        ieT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
+        fDaughterImpactParameterXY = ip[0];
+        fDaughterImpactParameterZ = ip[1];
+        FillTrackSpy("TrkUNMth",true);
+        LoadTrack(&jeT,jT->Chi2perNDF());
+       fDaughterMatchPhi=mcneg->Phi();
+       fDaughterMatchEta=mcneg->Eta();
+       fDaughterMatchPt=mcneg->Pt();
+        jeT.GetDZ(pos[0], pos[1], pos[2], tAOD->GetMagneticField(), ip);
+        fDaughterImpactParameterXY = ip[0];
+        fDaughterImpactParameterZ = ip[1];
+        FillTrackSpy("TrkUNMth",true);
       }
       if(feeddown) {
-        FillCandidateSpy("MthFDW");
-        ((TH2D*)((TList*)fList->FindObject("MthFDW"))->FindObject("D0PD0N"))->Fill( dD0P,dD0N );
-        ((TH1D*)((TList*)fList->FindObject("MthFDW"))->FindObject("MCOrigin"))->Fill( rOri );
+        FillCandidateSpy("MthFDW",true);
       }
     }
     //===== END OF MCMATCH
@@ -1511,11 +1593,13 @@ void AliAnalysisTaskFlowStrange::MakeQVectors() {
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("VZEPSIA"))->Fill( psivzea );
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("VZEPSIB"))->Fill( psivzeb );
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("RFPVZE"))->Fill( vzew );
+  ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("QmVZE"))->Fill( TMath::Sqrt(vqx*vqx+vqy*vqy)/vzew );
   //------
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("TPCPSI"))->Fill( psitpc );
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("TPCPSIA"))->Fill( psitpca );
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("TPCPSIB"))->Fill( psitpcb );
   ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("RFPTPC"))->Fill( tpcw );
+  ((TH1D*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("QmTPC"))->Fill( TMath::Sqrt(tqx*tqx+tqy*tqy)/tpcw );
   //------
   ((TProfile*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("TPCQ"))->Fill( 1., tpcqay/tpcqaw, tpcqaw );
   ((TProfile*)((TList*)fList->FindObject("MakeQSpy"))->FindObject("TPCQ"))->Fill( 2., tpcqax/tpcqaw, tpcqaw );
@@ -1742,7 +1826,7 @@ void AliAnalysisTaskFlowStrange::MakeQTPC(AliAODEvent *tAOD,
     eta = track->Eta();
     w = 1;
     //=>subevents
-    if(eta<0) {
+    if(eta<0.5*(fRFPminEta+fRFPminEta)) {
       qxa += w*TMath::Cos(2*phi);
       qya += w*TMath::Sin(2*phi);
       qwa += w;
@@ -1802,11 +1886,13 @@ void AliAnalysisTaskFlowStrange::MakeQTPC(AliESDEvent *tESD,
 void AliAnalysisTaskFlowStrange::AddMCParticleSpy(TList *me) {
   TH1D *tH1D;
   TH2D *tH2D;
+  TProfile *tPro;
   tH1D = new TH1D("Pt",   "Pt",   100,0.0,20);  me->Add(tH1D);
   tH1D = new TH1D("Phi",  "Phi",  100,0,TMath::TwoPi()); me->Add(tH1D);
   tH1D = new TH1D("Eta",  "Eta",  100,-1,+1);   me->Add(tH1D);
   tH1D = new TH1D("Rad2", "Rad2", 1000,0,+100); me->Add(tH1D);
   tH2D = new TH2D("Dphi", "phi-MCEP;pt;dphi",100,0,20, 72,0,TMath::Pi()); me->Add(tH2D);
+  tPro = new TProfile("Cos2dphi","Cos2dphi",100,0,20); me->Add(tPro);
   return;
 }
 //=======================================================================
@@ -1817,6 +1903,7 @@ void AliAnalysisTaskFlowStrange::FillMCParticleSpy(TString listName, AliAODMCPar
   ((TH1D*)((TList*)fList->FindObject(listName.Data()))->FindObject("Rad2" ))->Fill( TMath::Sqrt( p->Xv()*p->Xv() +
                                                                                                 p->Yv()*p->Yv() ) );
   ((TH1D*)((TList*)fList->FindObject(listName.Data()))->FindObject("Dphi" ))->Fill( p->Pt(), GetMCDPHI(p->Phi()) );
+  ((TProfile*)((TList*)fList->FindObject(listName.Data()))->FindObject("Cos2dphi" ))->Fill( p->Pt(), TMath::Cos( 2*GetMCDPHI(p->Phi()) ), 1 );
   return;
 }
 //=======================================================================
@@ -1836,8 +1923,11 @@ void AliAnalysisTaskFlowStrange::FillMCParticleSpy(TString listName, TParticle *
   return;
 }
 //=======================================================================
-void AliAnalysisTaskFlowStrange::AddCandidatesSpy(TList *me) {
+void AliAnalysisTaskFlowStrange::AddCandidatesSpy(TList *me,Bool_t res) {
+  TH1D *tH1D;
   TH2D *tH2D;
+  TProfile *tPro;
+  TProfile2D *tPro2;
   tH2D = new TH2D("PhiEta",  "PhiEta;Phi;Eta", 100,0,TMath::TwoPi(),100,-1,+1); me->Add(tH2D);
   tH2D = new TH2D("PtRAP",   "PtRAP;Pt;Y",          100,0,20,100,-2.0,+2.0);  me->Add(tH2D);
   tH2D = new TH2D("PtDCA",   "PtDCA;Pt;DCA",        100,0,20,100,0,10);       me->Add(tH2D);
@@ -1850,11 +1940,24 @@ void AliAnalysisTaskFlowStrange::AddCandidatesSpy(TList *me) {
   tH2D = new TH2D("APPOS",   "APPOS;alphaPOS;QtPOS",100,-2,+2,100,0,0.3);     me->Add(tH2D);
   tH2D = new TH2D("D0PD0N",  "D0PD0N;D0P;D0N",      200,-10,+10,200,-10,+10); me->Add(tH2D);
   tH2D = new TH2D("XPOSXNEG","XPOSXNEG;XPOS;XNEG",  200,-50,+50,200,-50,+50); me->Add(tH2D);
-  tH2D = new TH2D("PTDPHIMC","PtDPHIMC;Pt;PHI-MCEP",100,0,20,72,0,TMath::Pi()); me->Add(tH2D);
+
+  if(fReadMC) {
+    if(res) {
+      tH1D = new TH1D("MCOrigin", "MCOrigin;Rad2",1000,0,50); me->Add(tH1D);
+      tH2D = new TH2D("PHIRes","PHIRes;PHI;MC-DAT", 72,   0, TMath::TwoPi(),100,-0.12,+0.12); me->Add(tH2D);
+      tH2D = new TH2D("ETARes","ETARes;ETA;MC-DAT", 16,-0.8,           +0.8,100,-0.2,+0.2);   me->Add(tH2D);
+      tH2D = new TH2D("PTRes", "PTRes;Pt;MC-DAT",  100,   0,             20,100,-0.4,+0.4);   me->Add(tH2D);
+      tH2D = new TH2D("RXYRes","RXYRes;RXY;MC-DAT",100,   0,             50,100,-4.0,+4.0);   me->Add(tH2D);
+    }
+    tH2D = new TH2D("PTDPHIMC","PtDPHIMC;Pt;PHI-MCEP",100,0,20,72,0,TMath::Pi()); me->Add(tH2D);
+    tPro = new TProfile("Cos2dphiMC",  "Cos2dphiMC",100,0,20); me->Add(tPro);
+    tPro = new TProfile("Cos2dphiMCPK","Cos2dphiMC PK",100,0,20); me->Add(tPro);
+    tPro2=new TProfile2D("C2DPHIMCMASS","C2DPHIMCMASS",100,0,20,fMassBins,fMinMass,fMaxMass); me->Add(tPro2);
+  }
   return;
 }
 //=======================================================================
-void AliAnalysisTaskFlowStrange::FillCandidateSpy(TString listName) {
+void AliAnalysisTaskFlowStrange::FillCandidateSpy(TString listName, Bool_t fillRes) {
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PhiEta"))->Fill( fDecayPhi, fDecayEta );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PtRAP" ))->Fill( fDecayPt, fDecayRapidity );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PtDCA" ))->Fill( fDecayPt, fDecayDCAdaughters );
@@ -1864,7 +1967,23 @@ void AliAnalysisTaskFlowStrange::FillCandidateSpy(TString listName) {
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PtDL"  ))->Fill( fDecayPt, fDecayDecayLength );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PtMASS"))->Fill( fDecayPt, fDecayMass );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("APPOS" ))->Fill( fDecayAlpha, fDecayQt );
-  ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PTDPHIMC" ))->Fill( fDecayPt, GetMCDPHI( fDecayPhi ) );
+  ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("D0PD0N"))->Fill( fDecayIPpos, fDecayIPneg );
+  ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("XPOSXNEG"))->Fill( fDecayXpos, fDecayXneg );
+  if(fReadMC) {
+    ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PTDPHIMC" ))->Fill( fDecayPt, GetMCDPHI( fDecayPhi ) );
+    ((TProfile*)((TList*)fList->FindObject(listName.Data()))->FindObject("Cos2dphiMC" ))->Fill( fDecayPt, TMath::Cos( 2*GetMCDPHI(fDecayPhi) ), 1 );
+    if( fDecayMass>fMinMassX && fDecayMass<fMaxMassX ) {
+      ((TProfile*)((TList*)fList->FindObject(listName.Data()))->FindObject("Cos2dphiMCPK" ))->Fill( fDecayPt, TMath::Cos( 2*GetMCDPHI(fDecayPhi) ), 1 );
+    }
+    ((TProfile2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("C2DPHIMCMASS" ))->Fill(fDecayPt,fDecayMass,TMath::Cos(2*GetMCDPHI(fDecayPhi)), 1 );
+    if(fillRes) {
+      ((TH1D*)((TList*)fList->FindObject(listName.Data()))->FindObject("MCOrigin"))->Fill( fDecayMatchOrigin );
+      ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PHIRes"))->Fill( fDecayPhi, fDecayMatchPhi-fDecayPhi );
+      ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("ETARes"))->Fill( fDecayEta, fDecayMatchEta-fDecayEta );
+      ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PTRes"))->Fill( fDecayPt, fDecayMatchPt-fDecayPt );
+      ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("RXYRes"))->Fill( fDecayRadXY, fDecayMatchRadXY-fDecayRadXY );
+    }
+  }
 }
 //=======================================================================
 Bool_t AliAnalysisTaskFlowStrange::AcceptCandidate() {
@@ -1875,7 +1994,6 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptCandidate() {
   if(fDecayDCAdaughters>fDecayMaxDCAdaughters) return kFALSE;
   if(fDecayCosinePointingAngleXY<fDecayMinCosinePointingAngleXY) return kFALSE;
   if(fDecayRadXY<fDecayMinRadXY) return kFALSE;
-  if(fDecayDecayLength>fDecayMaxDecayLength*2.6842) return kFALSE;
   if(TMath::Abs(fDecayRapidity)>fDecayMaxRapidity) return kFALSE;
   if(fSpecie==0) {
     if(fDecayAPCutPie) {
@@ -1883,37 +2001,67 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptCandidate() {
     } else {
       if(fDecayQt<fDecayMinQt) return kFALSE;
     }
+    if(fDecayDecayLength>fDecayMaxDecayLength*2.6842) return kFALSE;
+  } else {
+    if(fDecayDecayLength>fDecayMaxDecayLength*7.89) return kFALSE;
   }
   if(fSpecie==1) if(fDecayAlpha>0) return kFALSE;
   if(fSpecie==2) if(fDecayAlpha<0) return kFALSE;
   return kTRUE;
 }
 //=======================================================================
-void AliAnalysisTaskFlowStrange::AddTracksSpy(TList *me) {
+void AliAnalysisTaskFlowStrange::AddTracksSpy(TList *me,Bool_t res) {
   TH2D *tH2D;
   tH2D = new TH2D("PHIETA",       "PHIETA;PHI;ETA",               100,0,TMath::TwoPi(),100,-2,2); me->Add(tH2D);
   tH2D = new TH2D("IPXYIPZ",      "IPXYIPZ;IPXY;IPZ",             1000,-20,+20,1000,-20,+20); me->Add(tH2D);
   tH2D = new TH2D("PTTPCNCLS",    "PTTPCNCLS;PT;NCLS",            100,0,20,170,0,170);  me->Add(tH2D);
+  tH2D = new TH2D("PTITSLAY",     "PTITSLAY;PT;ITSLAYER",         100,0,20,6,-0.5,+5.5);me->Add(tH2D);
+  tH2D = new TH2D("PTITSTPCrefit","PTITSTPCrefit;PT",             100,0,20,2,-0.5,+1.5);me->Add(tH2D);
+  tH2D->GetYaxis()->SetBinLabel(1,"ITS refit");
+  tH2D->GetYaxis()->SetBinLabel(2,"TPC refit");
+
   tH2D = new TH2D("POSTPCNCLCHI2","POSTPCNCLCHI2;NCLS;CHI2/NCLS", 170,0,170,100,0,8);   me->Add(tH2D);
   tH2D = new TH2D("POSTPCNFCLNXR","POSTPCNFCLNXR;NFCLS;NXR",      170,0,170,170,0,170); me->Add(tH2D);
   tH2D = new TH2D("POSTPCNCLNFCL","POSTPCNCLNFCL;NCLS;NFCLS",     170,0,170,170,0,170); me->Add(tH2D);
   tH2D = new TH2D("POSTPCNCLNSCL","POSTPCNCLNSCL;NCLS;NSCLS",     170,0,170,170,0,170); me->Add(tH2D);
+
   tH2D = new TH2D("NEGTPCNCLCHI2","NEGTPCNCLCHI2;NCLS;CHI2/NCLS", 170,0,170,100,0,8);   me->Add(tH2D);
   tH2D = new TH2D("NEGTPCNFCLNXR","NEGTPCNFCLNXR;NFCLS;NXR",      170,0,170,170,0,170); me->Add(tH2D);
   tH2D = new TH2D("NEGTPCNCLNFCL","NEGTPCNCLNFCL;NCLS;NFCLS",     170,0,170,170,0,170); me->Add(tH2D);
   tH2D = new TH2D("NEGTPCNCLNSCL","NEGTPCNCLNSCL;NCLS;NSCLS",     170,0,170,170,0,170); me->Add(tH2D);
+
+  if(res) {
+    tH2D = new TH2D("PHIRes", "PHIRes;PHI;MC-DAT",   72,   0, TMath::TwoPi(),100,-0.12,+0.12); me->Add(tH2D);
+    tH2D = new TH2D("ETARes", "ETARes;ETA;MC-DAT",   16,-0.8,           +0.8,100,-0.2,+0.2);   me->Add(tH2D);
+    tH2D = new TH2D("PTRes",  "PTRes;Pt;MC-DAT",    100,   0,             20,100,-0.4,+0.4);   me->Add(tH2D);
+  }
 }
 //=======================================================================
-void AliAnalysisTaskFlowStrange::FillTrackSpy(TString listName) {
+void AliAnalysisTaskFlowStrange::FillTrackSpy(TString listName,Bool_t res) {
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PHIETA" ))->Fill( fDaughterPhi, fDaughterEta );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "IPXYIPZ" ))->Fill( fDaughterImpactParameterXY, fDaughterImpactParameterZ );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTTPCNCLS" ))->Fill( fDaughterPt, fDaughterNClsTPC );
+  if( TESTBIT(fDaughterITScm,0) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSLAY" ))->Fill( fDaughterPt, 0 );
+  if( TESTBIT(fDaughterITScm,1) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSLAY" ))->Fill( fDaughterPt, 1 );
+  if( TESTBIT(fDaughterITScm,2) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSLAY" ))->Fill( fDaughterPt, 2 );
+  if( TESTBIT(fDaughterITScm,3) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSLAY" ))->Fill( fDaughterPt, 3 );
+  if( TESTBIT(fDaughterITScm,4) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSLAY" ))->Fill( fDaughterPt, 4 );
+  if( TESTBIT(fDaughterITScm,5) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSLAY" ))->Fill( fDaughterPt, 5 );
+  if( (fDaughterStatus&AliESDtrack::kITSrefit) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSTPCrefit" ))->Fill( fDaughterPt, 0 );
+  if( (fDaughterStatus&AliESDtrack::kTPCrefit) ) ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( "PTITSTPCrefit" ))->Fill( fDaughterPt, 1 );
+
   TString ch="NEG";
   if(fDaughterCharge>0) ch="POS";
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( Form("%sTPCNCLCHI2",ch.Data()) ))->Fill( fDaughterNClsTPC, fDaughterChi2PerNClsTPC );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( Form("%sTPCNFCLNXR",ch.Data()) ))->Fill( fDaughterNFClsTPC, fDaughterXRows );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( Form("%sTPCNCLNFCL",ch.Data()) ))->Fill( fDaughterNClsTPC, fDaughterNFClsTPC );
   ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject( Form("%sTPCNCLNSCL",ch.Data()) ))->Fill( fDaughterNClsTPC, fDaughterNSClsTPC );
+
+  if(res) {
+    ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PHIRes"))->Fill( fDaughterPhi, fDaughterMatchPhi-fDaughterPhi );
+    ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("ETARes"))->Fill( fDaughterEta, fDaughterMatchEta-fDaughterEta );
+    ((TH2D*)((TList*)fList->FindObject(listName.Data()))->FindObject("PTRes"))->Fill( fDaughterPt, fDaughterMatchPt-fDaughterPt );
+  }
 }
 //=======================================================================
 void AliAnalysisTaskFlowStrange::LoadTrack(AliESDtrack *myTrack, Double_t aodChi2NDF) {
@@ -1929,6 +2077,7 @@ void AliAnalysisTaskFlowStrange::LoadTrack(AliESDtrack *myTrack, Double_t aodChi
   }
   myTrack->GetImpactParameters(fDaughterImpactParameterXY,fDaughterImpactParameterZ);
   fDaughterStatus = myTrack->GetStatus();
+  fDaughterITScm = myTrack->GetITSClusterMap();
   fDaughterPhi = myTrack->Phi();
   fDaughterEta = myTrack->Eta();
   fDaughterPt = myTrack->Pt();
@@ -1947,6 +2096,14 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptDaughter() {
   if(fDaughterChi2PerNClsTPC>fDaughterMaxChi2PerNClsTPC) return kFALSE;
   if(TMath::Abs(fDaughterImpactParameterXY)<fDaughterMinImpactParameterXY) return kFALSE;
   if(fDaughterXRows<fDaughterMinXRowsOverNClsFTPC*fDaughterNFClsTPC) return kFALSE;
+  for(Int_t lay=0; lay!=6; ++lay)
+    if(fDaughterITSConfig[lay]>-0.5) {
+      if(fDaughterITSConfig[lay]) {
+       if(!TESTBIT(fDaughterITScm,lay)) return kFALSE;
+      } else {
+       if(TESTBIT(fDaughterITScm,lay)) return kFALSE;
+      }
+    }
   return kTRUE;
 }
 //=======================================================================
index 1540aad..f54a562 100644 (file)
@@ -57,11 +57,13 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   void SetCentralityRange(TString val, Int_t m, Int_t M) {fCentMethod=val; fCentPerMin=m; fCentPerMax=M;}
   void SetReadESD(Bool_t val) {fReadESD=val;}
   void SetReadMC(Bool_t val) {fReadMC=val;}
+  void SetPostMatched(Int_t val) {fPostMatched=val;}
   void SetAvoidExec(Bool_t val) {fAvoidExec=val;}
   void SetSkipSelection(Bool_t val) {fSkipSelection=val;}
   void SetSkipFlow(Bool_t val) {fSkipFlow=val;}
   void SetUseFlowPackage(Bool_t val) {fUseFP=val;}
   void SetExtraEventRejection(Bool_t val) {fExtraEventRejection=val;}
+  void SetVertexZcut(Double_t val) {fVertexZcut=val;}
 
   void SetWhichPsi(Int_t val) {fWhichPsi=val;}
   void SetStoreVZEResponse(Bool_t val) {fVZEsave=val;}
@@ -82,6 +84,7 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   void SetDauMinXRows(Int_t val) {fDaughterMinXRows=val;}
   void SetDauMaxChi2PerNClsTPC(Double_t val) {fDaughterMaxChi2PerNClsTPC=val;}
   void SetDauMinXRowsOverNClsFTPC(Double_t val) {fDaughterMinXRowsOverNClsFTPC=val;}
+  void SetDauITSLayer(Int_t layer, Int_t config) {fDaughterITSConfig[layer]=config;}
   void SetDauMinEta(Double_t val) {fDaughterMinEta=val;}
   void SetDauMaxEta(Double_t val) {fDaughterMaxEta=val;}
   void SetDauMinPt(Double_t val) {fDaughterMinPt=val;}
@@ -151,11 +154,11 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   void FillMCParticleSpy(TString listName, AliAODMCParticle *par);
   void FillMCParticleSpy(TString listName, TParticle *par);
 
-  void AddCandidatesSpy(TList *val);
-  void FillCandidateSpy(TString listName);
+  void AddCandidatesSpy(TList *val, Bool_t fillRes=kFALSE);
+  void FillCandidateSpy(TString listName, Bool_t fillRes=kFALSE);
 
-  void AddTracksSpy(TList *val);
-  void FillTrackSpy(TString listName);
+  void AddTracksSpy(TList *val, Bool_t fillRes=kFALSE);
+  void FillTrackSpy(TString listName, Bool_t fillRes=kFALSE);
 
   void MakeFilterBits();
   Bool_t PassesFilterBit(AliESDtrack *me);
@@ -197,6 +200,7 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
 
   Bool_t fReadESD;       // move back to ESD
   Bool_t fReadMC;        // read MC files
+  Int_t fPostMatched;    // post only (un)matched particles
   Bool_t fAvoidExec;     // avoids Exec
   Bool_t fSkipSelection; // skip decay finder
   Bool_t fSkipFlow;      // skip flow-wise code
@@ -210,6 +214,8 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   Int_t    fCentPerMax; // CC
   Double_t fThisCent;   // CC
 
+  Double_t fVertexZcut; // cut on main vertex Z
+
   Bool_t fExcludeTPCEdges; // exclude TPC edges from single track selection
 
   Int_t  fSpecie;   // K0=>0 L0=>1
@@ -235,6 +241,8 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   Int_t    fMassBins; // opens
   Double_t fMinMass;  // mass
   Double_t fMaxMass;  // window
+  Double_t fMinMassX; // HP window
+  Double_t fMaxMassX; // HP window
 
   Int_t fRFPFilterBit;    // RFP TPC
   Double_t fRFPminPt;     // RFP TPC
@@ -258,10 +266,20 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   Double_t fDecayAlpha;                 // DECAY
   Double_t fDecayRapidity;              // DECAY
   Double_t fDecayProductIPXY;           // DECAY
+  Double_t fDecayIPneg;                 // DECAY
+  Double_t fDecayIPpos;                 // DECAY
+  Double_t fDecayXneg;                  // DECAY
+  Double_t fDecayXpos;                  // DECAY
   Int_t    fDecayIDneg;                 // DECAY
   Int_t    fDecayIDpos;                 // DECAY
   Int_t    fDecayID;                    // DECAY
 
+  Double_t fDecayMatchOrigin;  // MC DECAY
+  Double_t fDecayMatchPhi;     // MC DECAY
+  Double_t fDecayMatchEta;     // MC DECAY
+  Double_t fDecayMatchPt;      // MC DECAY
+  Double_t fDecayMatchRadXY;   // MC DECAY
+
   Double_t fDecayMinEta;                   // DECAY CUTS
   Double_t fDecayMaxEta;                   // DECAY CUTS
   Double_t fDecayMinPt;                    // DECAY CUTS
@@ -278,6 +296,7 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   Double_t fDaughterEta;               // DAUGHTER
   Double_t fDaughterPt;                // DAUGHTER
   Int_t    fDaughterNClsTPC;           // DAUGHTER
+  Int_t    fDaughterITSConfig[6];      // DAUGHTER
   Int_t    fDaughterCharge;            // DAUGHTER
   Int_t    fDaughterNFClsTPC;          // DAUGHTER
   Int_t    fDaughterNSClsTPC;          // DAUGHTER
@@ -286,9 +305,16 @@ class AliAnalysisTaskFlowStrange : public AliAnalysisTaskSE {
   Float_t  fDaughterImpactParameterXY; // DAUGHTER
   Float_t  fDaughterImpactParameterZ;  // DAUGHTER
   UInt_t   fDaughterStatus;            // DAUGHTER
+  UChar_t  fDaughterITScm;             // DAUGHTER
   Double_t fDaughterNSigmaPID;         // DAUGHTER
   Int_t    fDaughterKinkIndex;         // DAUGHTER
 
+  Double_t fDaughterMatchPhi;               // MC DAUGHTER
+  Double_t fDaughterMatchEta;               // MC DAUGHTER
+  Double_t fDaughterMatchPt;                // MC DAUGHTER
+  Float_t  fDaughterMatchImpactParameterXY; // MC DAUGHTER
+  Float_t  fDaughterMatchImpactParameterZ;  // MC DAUGHTER
+
   Bool_t   fDaughterUnTag;             // UNTAG PROCEDURE
 
   Double_t fDaughterMinEta;               // DAUGHTER CUTS
index e9b2759..9e1b57e 100644 (file)
@@ -952,7 +952,7 @@ Bool_t AliJetFlowTools::PrepareForUnfolding()
         if(normalizeToFullSpectrum) fEventCount = -1;
     }
     // extract the delta pt matrices
-    TString deltaptName(Form("fHistDeltaPtDeltaPhi2_%i", fCentralityBin));
+    TString deltaptName(Form("fHistDeltaPtDeltaPhi2ExLJ_%i", fCentralityBin));
     fDeltaPtDeltaPhi = ((TH2D*)fInputList->FindObject(deltaptName.Data()));
     if(!fDeltaPtDeltaPhi) {
         printf(" Couldn't find delta pt matrix %s ! \n", deltaptName.Data());
@@ -1121,7 +1121,7 @@ TH2D* AliJetFlowTools::ResizeYaxisTH2D(TH2D* histo, TArrayD* x, TArrayD* y, TStr
     return resized;
 }
 //_____________________________________________________________________________
-TH2D* AliJetFlowTools::NormalizeTH2D(TH2D* histo) {
+TH2D* AliJetFlowTools::NormalizeTH2D(TH2D* histo, Bool_t noError) {
     // general method to normalize all vertical slices of a th2 to unity
     // i.e. get a probability matrix
     if(!histo) {
@@ -1140,7 +1140,8 @@ TH2D* AliJetFlowTools::NormalizeTH2D(TH2D* histo) {
         for(Int_t j(0); j < binsY; j++) {
             if (weight <= 0 ) continue;
             histo->SetBinContent(1+i, j+1, histo->GetBinContent(1+i, j+1)/weight);
-            histo->SetBinError(  1+i, j+1, histo->GetBinError(  1+i, j+1)/weight);
+            if(noError) histo->SetBinError(  1+i, j+1, 0.);
+            else histo->SetBinError(  1+i, j+1, histo->GetBinError(  1+i, j+1)/weight);
         }
     }
     return histo;
@@ -1189,6 +1190,7 @@ TH2D* AliJetFlowTools::MatrixMultiplication(TH2D* a, TH2D* b, TString name)
                val += a->GetBinContent(x1, y1) * b->GetBinContent(x2, y2);
             }
             c->SetBinContent(x2, y1, val);
+            c->SetBinError(x2, y1, 0.);
         }
     }
     if(strcmp(name.Data(), "")) c->SetNameTitle(name.Data(), name.Data());
@@ -1639,16 +1641,27 @@ void AliJetFlowTools::PostProcess(TString def, TString in, TString out, Int_t co
        }
    }
    TFile output(out.Data(), "RECREATE");
+   SavePadToPDF(canvasIn);
    canvasIn->Write();
+   SavePadToPDF(canvasOut);
    canvasOut->Write();
+   SavePadToPDF(canvasRatioMeasuredRefoldedIn);
    canvasRatioMeasuredRefoldedIn->Write();
+   SavePadToPDF(canvasRatioMeasuredRefoldedOut);
    canvasRatioMeasuredRefoldedOut->Write();
+   SavePadToPDF(canvasSpectraIn);
    canvasSpectraIn->Write();
+   SavePadToPDF(canvasSpectraOut);
    canvasSpectraOut->Write();
+   SavePadToPDF(canvasRatio);
    canvasRatio->Write();
+   SavePadToPDF(canvasV2);
    canvasV2->Write();
+   SavePadToPDF(canvasMasterIn);
    canvasMasterIn->Write();
+   SavePadToPDF(canvasMasterIn);
    canvasMasterOut->Write();
+   SavePadToPDF(canvasMISC);
    canvasMISC->Write();
    output.Write();
    output.Close();
index f738053..c988bc1 100644 (file)
@@ -132,7 +132,7 @@ class AliJetFlowTools {
         // static const helper functions, mainly histogram manipulation
         static TH1D*    ResizeXaxisTH1D(TH1D* histo, Int_t low, Int_t up, TString suffix = "");
         static TH2D*    ResizeYaxisTH2D(TH2D* histo, TArrayD* x, TArrayD* y, TString suffix = "");
-        static TH2D*    NormalizeTH2D(TH2D* histo);
+        static TH2D*    NormalizeTH2D(TH2D* histo, Bool_t noError = kTRUE);
         static TH1D*    RebinTH1D(TH1D* histo, TArrayD* bins, TString suffix = "", Bool_t kill = kTRUE);
         TH2D*           RebinTH2D(TH2D* histo, TArrayD* binsTrue, TArrayD* binsRec, TString suffix = "");
         static TH2D*    MatrixMultiplication(TH2D* a, TH2D* b, TString name = "CombinedResponse");
@@ -152,6 +152,7 @@ class AliJetFlowTools {
         static void     Style(TH1* h, EColor col = kBlue, histoType = kEmpty);
         static void     Style(TGraph* h, EColor col = kBlue, histoType = kEmpty);
         static TLegend* AddLegend(TVirtualPad* p)       {return p->BuildLegend(.27, .61, .88, .88);}
+        static void     SavePadToPDF(TVirtualPad* pad)  {pad->SaveAs(Form("%s.pdf", pad->GetName()));}
         // interface to AliUnfolding, not necessary but nice to have all parameters in one place
         static void     SetMinuitStepSize(Float_t s)    {AliUnfolding::SetMinuitStepSize(s);}
         static void     SetMinuitPrecision(Float_t s)   {AliUnfolding::SetMinuitPrecision(s);}
index 6bdb8ed..06ac2d1 100644 (file)
@@ -64,6 +64,8 @@ Int_t SFT_gbV0ARingMin;
 Int_t SFT_gbV0ARingMax;
 
 Bool_t SFT_gbUntagDaughter;
+Int_t SFT_gbPostMatched;
+Bool_t SFT_gbVertexZcut;
 
 void AddTaskFlowStrange(TString configFile, TString alienaddress,
                        Int_t VZECm=0, Int_t VZECM=3, Int_t VZEAm=0, Int_t VZEAM=3) {
@@ -122,6 +124,7 @@ void AddTaskFlowStrange() {
   AliAnalysisTaskFlowStrange *taskSel = new AliAnalysisTaskFlowStrange(Form("FS_%s",SFT_gbStamp.Data()) );
   taskSel->SelectCollisionCandidates(SFT_gbTrigger);
   taskSel->SetReadESD(SFT_gbReadESD);
+  taskSel->SetPostMatched(SFT_gbPostMatched);
   taskSel->SetReadMC(SFT_gbReadMC);
   taskSel->SetAvoidExec(SFT_gbAvoidExec);
   taskSel->SetSkipSelection(SFT_gbSkipSelection);
@@ -149,6 +152,7 @@ void AddTaskFlowStrange() {
   taskSel->SetRFPMinTPCCls(SFT_gbRFPTPCncls);
 
   taskSel->SetDauUnTagProcedure(SFT_gbUntagDaughter);
+  taskSel->SetVertexZcut(SFT_gbVertexZcut);
 
   taskSel->SetDauMinNClsTPC(SFT_gbMinNClsTPC);
   taskSel->SetDauMinXRows(SFT_gbMinXRows);
@@ -207,17 +211,22 @@ void AddTaskFlowStrange() {
   if( (!SFT_gbQCTPC) && (!SFT_gbSPVZE) && (!SFT_gbSPTPC) ) return;
   //-------------------FLOWPACKAGE TASKS----------------------------
   AliFlowTrackSimpleCuts *filter[20], *filterhf[20][2]; // MASS BANDS
-  for(int mb=0; mb!=SFT_MassBands(SFT_gbSpecie); ++mb) {
+  int mbs = SFT_MassBands(SFT_gbSpecie);
+  if(SFT_gbPostMatched) mbs = 1;
+  for(int mb=0; mb!=mbs; ++mb) {
     filter[mb] = new AliFlowTrackSimpleCuts( Form("Filter_MB%d",mb) );
     filter[mb]->SetEtaMin( -0.8 ); filter[mb]->SetEtaMax( +0.8 );
-    filter[mb]->SetMassMin( SFT_MassBandLowEdge(SFT_gbSpecie,mb) ); filter[mb]->SetMassMax( SFT_MassBandLowEdge(SFT_gbSpecie,mb+1) );
+    Double_t minmass = SFT_MassBandLowEdge(SFT_gbSpecie,mb);
+    Double_t maxmass = SFT_MassBandLowEdge(SFT_gbSpecie,mb+1);
+    if(SFT_gbPostMatched) maxmass = SFT_MassBandLowEdge(SFT_gbSpecie,SFT_MassBands(SFT_gbSpecie));
+    filter[mb]->SetMassMin( minmass ); filter[mb]->SetMassMax( maxmass );
     //half window for POIs
     filterhf[mb][0] = new AliFlowTrackSimpleCuts( Form("Filterhf0_MB%d",mb) );
     filterhf[mb][0]->SetEtaMin( +0.0 ); filterhf[mb][0]->SetEtaMax( +0.8 );
-    filterhf[mb][0]->SetMassMin( SFT_MassBandLowEdge(SFT_gbSpecie,mb) ); filterhf[mb][0]->SetMassMax( SFT_MassBandLowEdge(SFT_gbSpecie,mb+1) );
+    filterhf[mb][0]->SetMassMin( minmass ); filterhf[mb][0]->SetMassMax( maxmass );
     filterhf[mb][1] = new AliFlowTrackSimpleCuts( Form("Filterhf1_MB%d",mb) );
     filterhf[mb][1]->SetEtaMin( -0.8 ); filterhf[mb][1]->SetEtaMax( -0.0 );
-    filterhf[mb][1]->SetMassMin( SFT_MassBandLowEdge(SFT_gbSpecie,mb) ); filterhf[mb][1]->SetMassMax( SFT_MassBandLowEdge(SFT_gbSpecie,mb+1) );
+    filterhf[mb][1]->SetMassMin( minmass ); filterhf[mb][1]->SetMassMax( maxmass );
     if(SFT_gbQCTPC) {
       SFT_AddQCmethod( Form("QCTPCMB%d",mb), exc_TPC, filter[mb]); // QC TPC
     }
@@ -289,6 +298,8 @@ void SFT_AddSPmethod(char *name, AliAnalysisDataContainer *flowEvent, AliFlowTra
   mgr->ConnectOutput(tskSP,1,outSP);
 }
 double SFT_MassBandLowEdge( int nv0, int mb ) {
+  if(nv0>10&&mb==0) return -5;
+  if(nv0>10&&mb==1) return +5;
   switch(nv0) {
   case(0):
     double lowEdge[14]={0.398, 0.420, 0.444, 0.468, 0.486,
@@ -301,8 +312,6 @@ double SFT_MassBandLowEdge( int nv0, int mb ) {
                        1.148, 1.158, 1.168};
     break;
   }
-  if(nv0>10&&mb==0) return -5;
-  if(nv0>10&&mb==1) return +5;
   return lowEdge[mb];
 }
 int SFT_MassBands( int nv0 ) {
@@ -346,10 +355,12 @@ void SFT_PrintConfig() {
   printf("* AVOIDEXEC  %3d                  *\n", SFT_gbAvoidExec );
   printf("* ESD  %3d                        *\n", SFT_gbReadESD );
   printf("* MC  %3d                         *\n", SFT_gbReadMC );
+  printf("* POSTMATCHED  %3d                *\n", SFT_gbPostMatched );
   printf("* EXTRAEVENTCUT  %3d              *\n", SFT_gbExtraEventCut );
   printf("* CENTMETHOD  %8s                 *\n", SFT_gbCentMethod.Data() );
   printf("* CENTPERMIN  %3d                 *\n", SFT_gbCentPerMin );
   printf("* CENTPERMAX  %3d                 *\n", SFT_gbCentPerMax );
+  printf("* VERTEXZ  %3d                    *\n", SFT_gbVertexZcut );
   printf("* SPECIE  %3d                     *\n", SFT_gbSpecie );
   printf("* HOMEMADE  %3d                   *\n", SFT_gbHomemade );
   printf("* ONLINE  %3d                     *\n", SFT_gbOnline );
@@ -490,7 +501,7 @@ void SFT_ReadConfig(TString ipf) {
     } else if(!varname.CompareTo("QCTPC")) {
       input >> SFT_gbQCTPC;
     } else if(!varname.CompareTo("SHRINKFP")) {
-      input >> SFT_ShrinkFP;
+      input >> SFT_gbShrinkFP;
     } else if(!varname.CompareTo("RFFILTERBIT")) {
       input >> SFT_gbRFPFilterBit;
     } else if(!varname.CompareTo("RFMINPT")) {
@@ -521,6 +532,10 @@ void SFT_ReadConfig(TString ipf) {
       input >> SFT_gbAllCC;
     } else if(!varname.CompareTo("UNTAG")) {
       input >> SFT_gbUntagDaughter;
+    } else if(!varname.CompareTo("POSTMATCHED")) {
+      input >> SFT_gbPostMatched;
+    } else if(!varname.CompareTo("VERTEXZ")) {
+      input >> SFT_gbVertexZcut;
     } else {
       printf("I dont understand %s\n",varname.Data());
     }
@@ -586,5 +601,7 @@ void SFT_ResetVars() {
   SFT_gbVZEmb=0;
   SFT_gbVZEpdisk=0;
   SFT_gbUntagDaughter=kTRUE;
+  SFT_gbPostMatched=kFALSE;
   SFT_gbShrinkFP=kTRUE;
+  SFT_gbVertexZcut=10.0;
 }