]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Merging changes from GSI train
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Mar 2011 22:10:51 +0000 (22:10 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Mar 2011 22:10:51 +0000 (22:10 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx
PWG4/GammaConv/AliAnalysisTaskGammaConversion.h
PWG4/GammaConv/AliV0Reader.cxx
PWG4/GammaConv/AliV0Reader.h
PWG4/macros/ConfigGammaConversion.C

index 8302160d1bec61df58c5ddf0846ea3b8fc3039c7..02a75f09006abd7fe559f23c5f81a7bf443ee853 100644 (file)
@@ -147,7 +147,8 @@ AliAnalysisTaskSE(),
   fUseMultiplicity(0), 
   fUseMultiplicityBin(0),
   fUseCentrality(0), 
-  fUseCentralityBin(0)
+  fUseCentralityBin(0),
+  fRandom(0)
 {
   // Default constructor
 
@@ -244,7 +245,8 @@ AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name)
   fUseMultiplicity(0), 
   fUseMultiplicityBin(0),
   fUseCentrality(0), 
-  fUseCentralityBin(0)
+  fUseCentralityBin(0),
+  fRandom(0)
 {
   // Common I/O in slot 0, don't define when inheriting from AnalysisTaskSE
   // DefineInput (0, TChain::Class());  
@@ -2906,7 +2908,6 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
   }
 
   if(fDoRotation == kTRUE){
-    TRandom3 *random = new TRandom3(0);
 
     for(Int_t iCurrent=0;iCurrent<currentEventV0s->GetEntriesFast();iCurrent++){
       AliKFParticle currentEventGoodV0 = *(AliKFParticle *)(currentEventV0s->At(iCurrent)); 
@@ -2921,7 +2922,7 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
            AliKFParticle *backgroundCandidateProb = new AliKFParticle(currentEventGoodV0,currentEventGoodV02);
            backgroundCandidateProb->GetMass(massBGprob,widthBGprob);
            if(massBGprob>0.1 && massBGprob<0.14){
-             if(random->Rndm()>bgHandler->GetBGProb(zbin,mbin)){
+             if(fRandom.Rndm()>bgHandler->GetBGProb(zbin,mbin)){
                delete backgroundCandidateProb;
                continue;
              }
@@ -2930,8 +2931,8 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
          }
        
          Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180;
-         
-         Double_t rotationValue = random->Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
+
+         Double_t rotationValue = fRandom.Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
          
          RotateKFParticle(&currentEventGoodV02,rotationValue);
 
@@ -3028,7 +3029,6 @@ void AliAnalysisTaskGammaConversion::CalculateBackground(){
        }
       }
     }
-    delete random;
   }
   else{ // means no rotation
     AliGammaConversionBGHandler::GammaConversionVertex *bgEventVertex = NULL;
index da0d792a7287ce2fab086a34de6b921d9dd84513..3ba359e36c8f4a156ed7e5eb19e9085a4fe065d8 100644 (file)
@@ -14,7 +14,8 @@
 #include <vector>
 #include "AliV0Reader.h"
 #include "AliGammaConversionBGHandler.h"
-//#include "TRandom3.h"
+#include "TRandom3.h"
+#include "TF1.h"
 //#include "AliCFManager.h"  // for CF
 //#include "AliCFContainer.h"   // for CF
 
@@ -39,6 +40,7 @@ class AliTriggerAnalysis;
 class AliCFManager; // for CF
 class AliCFContainer; // for CF
 class TRandom3;
+class TF1;
 
 class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
 {
@@ -314,7 +316,8 @@ class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE
   Int_t fUseMultiplicityBin;
   Int_t fUseCentrality;
   Int_t fUseCentralityBin;
-  ClassDef(AliAnalysisTaskGammaConversion, 17); // Analysis task for gamma conversions
+  TRandom3 fRandom;
+  ClassDef(AliAnalysisTaskGammaConversion, 18); // Analysis task for gamma conversions
 };
 
 #endif //ALIANALYSISTASKGAMMA_H
index f080cc535c5b0e97513782de2517e82bb4ac19db..ed84fbc2636f05265baaf84ff35a3aa814ca689f 100644 (file)
 #include "AliESDpid.h"
 #include "AliGammaConversionBGHandler.h"
 #include "AliESDtrackCuts.h"
-
+#include "TRandom3.h"
 
 class iostream;
 class AliESDv0;
 class TFormula;
+class TRandom3;
 
 using namespace std;
 
@@ -107,7 +108,8 @@ AliV0Reader::AliV0Reader() :
   fPIDnSigmaBelowElectronLine(-100),
   fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
   fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
-  fPIDnSigmaAbovePionLine(-100), 
+  fPIDnSigmaAbovePionLine(-100),
+  fPIDnSigmaAbovePionLineHighPt(-100),
   fPIDMinPnSigmaAbovePionLine(100), 
   fPIDMaxPnSigmaAbovePionLine(100), 
   fDoKaonRejectionLowP(kFALSE),
@@ -147,7 +149,15 @@ AliV0Reader::AliV0Reader() :
   fUseChargedTrackMultiplicityForBG(kTRUE),
   fNumberOfGoodV0s(0),
   fIsHeavyIon(0),
-  fUseCorrectedTPCClsInfo(kFALSE)
+  fUseCorrectedTPCClsInfo(kFALSE),
+  fPBremSmearing(1.),
+  fPSigSmearing(0.),
+  fPSigSmearingCte(0.),
+  fRandom(0),
+  fBrem(NULL),
+  fDoPhotonAsymmetryCut(0),
+  fMinPPhotonAsymmetryCut(100.),
+  fMinPhotonAsymmetry(0.)
 {
   //fESDpid = new AliESDpid;   
 }
@@ -212,6 +222,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fTofPIDnSigmaAboveElectronLine(original.fTofPIDnSigmaAboveElectronLine), // RRnewTOF
   fTofPIDnSigmaBelowElectronLine(original.fTofPIDnSigmaBelowElectronLine), // RRnewTOF
   fPIDnSigmaAbovePionLine(original.fPIDnSigmaAbovePionLine), 
+  fPIDnSigmaAbovePionLineHighPt(original.fPIDnSigmaAbovePionLineHighPt), 
   fPIDMinPnSigmaAbovePionLine(original.fPIDMinPnSigmaAbovePionLine), 
   fPIDMaxPnSigmaAbovePionLine(original.fPIDMaxPnSigmaAbovePionLine), 
   fDoKaonRejectionLowP(original.fDoKaonRejectionLowP),
@@ -251,7 +262,15 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) :
   fUseChargedTrackMultiplicityForBG(original.fUseChargedTrackMultiplicityForBG),
   fNumberOfGoodV0s(original.fNumberOfGoodV0s),
   fIsHeavyIon(original.fIsHeavyIon),
-  fUseCorrectedTPCClsInfo(original.fUseCorrectedTPCClsInfo)
+  fUseCorrectedTPCClsInfo(original.fUseCorrectedTPCClsInfo),
+  fPBremSmearing(original.fPBremSmearing),
+  fPSigSmearing(original.fPSigSmearing),
+  fPSigSmearingCte(original.fPSigSmearingCte),
+  fRandom(original.fRandom),
+  fBrem(original.fBrem),
+  fDoPhotonAsymmetryCut(original.fDoPhotonAsymmetryCut),
+  fMinPPhotonAsymmetryCut(original.fMinPPhotonAsymmetryCut),
+  fMinPhotonAsymmetry(original.fMinPhotonAsymmetry)
 {
        
 }
@@ -360,6 +379,19 @@ void AliV0Reader::Initialize(){
   fV0Pindex.clear();
   fV0Nindex.clear();
 
+  if(gRandom != NULL){
+    delete gRandom;
+    gRandom= new TRandom3(0);
+  }
+
+
+  if (fBrem == NULL){
+    fBrem = new TF1("fBrem","pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
+    // tests done with 1.0e-14
+    fBrem->SetParameter(0,fPBremSmearing);
+    fBrem->SetNpx(100000);
+  }
+
   if(fCalculateBackground == kTRUE){
     if(fBGEventInitialized == kFALSE){
 
@@ -675,6 +707,41 @@ Bool_t AliV0Reader::NextV0(){
          continue;
        }
       }
+
+      // High Pt
+      if( fCurrentPositiveESDTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
+       if(fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+          fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+          fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
+         //      iResult=kFALSE;
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+      
+      if( fCurrentNegativeESDTrack->P()>fPIDMaxPnSigmaAbovePionLine){
+       if(fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+          fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+          fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
+         //      iResult=kFALSE;
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+
+
       if(fDoCF){
        fCFManager->GetParticleContainer()->Fill(containerInput,kStepdEdxPionrejection);               // for CF
       }
@@ -821,6 +888,41 @@ Bool_t AliV0Reader::NextV0(){
        }
     }   // RRnew end
 
+    if(fDoPhotonAsymmetryCut == kTRUE){
+      if( fNegativeTrackLorentzVector->P()>fMinPPhotonAsymmetryCut ){
+       Double_t trackNegAsy=0;
+       if (fCurrentMotherKFCandidate->GetP()!=0.){
+         trackNegAsy= fNegativeTrackLorentzVector->P()/fMotherCandidateLorentzVector->P();
+       }
+       if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutPhotonAsymmetry_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+
+      if( fPositiveTrackLorentzVector->P()>fMinPPhotonAsymmetryCut ){
+       Double_t trackPosAsy=0;
+       if (fCurrentMotherKFCandidate->GetP()!=0.){
+         trackPosAsy= fPositiveTrackLorentzVector->P()/fMotherCandidateLorentzVector->P();
+       }
+       if( trackPosAsy<fMinPhotonAsymmetry ||trackPosAsy>(1.- fMinPhotonAsymmetry)){
+         if(fHistograms != NULL){
+           fHistograms->FillHistogram("ESD_CutPhotonAsymmetry_InvMass",GetMotherCandidateMass());
+           // to avoid filling the other cut histograms. So in this case fUpdateV0AlreadyCalled also serves as a flag for the histogram filling
+           // it will anyway be set to true at the end of the UpdateV0Information function, and there are no return until the end
+           //fUpdateV0AlreadyCalled = kTRUE;
+         }
+         fCurrentV0IndexNumber++;
+         continue;
+       }
+      }
+    }
     //checks if we have a prim vertex
     //if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) { 
     if(GetNumberOfContributorsVtx()<=0) { 
@@ -1021,6 +1123,15 @@ Bool_t AliV0Reader::NextV0(){
 
     //    fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate);
 
+    if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){
+      fCurrentMotherKFCandidate->E()=fCurrentMotherKFCandidate->GetP();
+    }
+
+    if(fDoMC&& fUseMCPSmearing>0){
+      SmearKFParticle(fCurrentMotherKFCandidate);
+
+    }          
+
     new((*fCurrentEventGoodV0s)[fCurrentEventGoodV0s->GetEntriesFast()])  AliKFParticle(*fCurrentMotherKFCandidate);
     fV0Pindex.push_back(fCurrentV0->GetPindex());
     fV0Nindex.push_back(fCurrentV0->GetNindex());
@@ -1773,3 +1884,33 @@ Int_t AliV0Reader::GetFirstTPCRow(Double_t radius){
 
   return firstTPCRow;
 }
+void AliV0Reader::SmearKFParticle(AliKFParticle * kfParticle)
+{
+  Double_t facPBrem = 1.;
+  Double_t facPSig = 0.;
+
+  Double_t phi=0.;
+  Double_t theta=0.;
+  Double_t P=0.;
+
+  P=kfParticle->GetP();
+  phi=kfParticle->GetPhi();
+  if( kfParticle->GetP()!=0){
+    theta=acos( kfParticle->Pz()/ kfParticle->GetP());
+  }
+
+  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){ 
+    facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
+  }
+  
+  if( fPBremSmearing != 1.){
+    if(fBrem!=NULL){
+      facPBrem = fBrem->GetRandom();
+    }
+  }
+
+  kfParticle->Px() = facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) ;
+  kfParticle->Py() = facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ;
+  kfParticle->Pz() = facPBrem* (1+facPSig)* P*cos(theta) ;
+  kfParticle->E() = kfParticle->GetP();
+}
index ded3c1d57988bbbae1ae3b2ccf2cdaa2a111685b..2705df197a05e103e868d508d64da9234f7f8877 100644 (file)
@@ -21,6 +21,8 @@
 #include "AliCFManager.h"
 #include "AliGammaConversionBGHandler.h"
 #include "AliESDpid.h"
+#include "TF1.h"
+#include "TRandom3.h"
 
 class TClonesArray; 
 class TFormula;
@@ -42,6 +44,8 @@ class AliCFManager;   // for CF
 class AliCFContainer;  // for CF
 //class AliESDpid; // for dEdx cut based on nSigma to particle lines 
 class AliESDtrackCuts; 
+class TF1;
+class TRandom3;
 
 class AliV0Reader : public TObject {
        
@@ -670,6 +674,11 @@ class AliV0Reader : public TObject {
    */
   void SetPIDnSigmaAbovePionLine(Double_t nSigmaAbovePion){fPIDnSigmaAbovePionLine=nSigmaAbovePion;}
 
+  /*
+   * Sets the PIDnSigmaAbovePion cut value for the tracks.
+   */
+  void SetPIDnSigmaAbovePionLineHighPt(Double_t nSigmaAbovePionHighPt){fPIDnSigmaAbovePionLineHighPt=nSigmaAbovePionHighPt;}
+
   /*
    * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
    */
@@ -701,7 +710,10 @@ class AliV0Reader : public TObject {
 
   void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
   void SetDoTOFsigmaCut( Bool_t doTOFsigmaCut){fDoTOFsigmaCut=doTOFsigmaCut;} //RRnewTOF
+  void SetDoPhotonAsymmetryCut( Bool_t doPhotonAsymmetryCut){fDoPhotonAsymmetryCut=doPhotonAsymmetryCut;}
 
+  void SetMinPPhotonAsymmetryCut(Double_t minPPhotonAsymmetryCut){fMinPPhotonAsymmetryCut=minPPhotonAsymmetryCut;}
+  void SetMinPhotonAsymmetry(Double_t minPhotonAsymmetry){fMinPhotonAsymmetry=minPhotonAsymmetry;}
   /*
    * Sets the flag to enable/disable the cut dedx N sigma for Kaon Rejection at low p 
    */
@@ -855,6 +867,12 @@ class AliV0Reader : public TObject {
   void SetUseCorrectedTPCClsInfo(Bool_t flag){fUseCorrectedTPCClsInfo = flag;}
   Bool_t GetUseCorrectedTPCClsInfo() const {return fUseCorrectedTPCClsInfo;}
 
+  void SetUseMCPSmearing(Int_t useMCPSmearing) {fUseMCPSmearing=useMCPSmearing;}
+  void SetPBremSmearing(Double_t pBremSmearing){fPBremSmearing=pBremSmearing;}
+  void SetPSigSmearing(Double_t pSigSmearing){fPSigSmearing=pSigSmearing;}
+  void SetPSigSmearingCte(Double_t pSigSmearingCte){fPSigSmearingCte=pSigSmearingCte;}
+  void SmearKFParticle(AliKFParticle * kfParticle);
+
  private:
   AliStack * fMCStack;           // pointer to MonteCarlo particle stack 
   //  AliMCEventHandler* fMCTruth;   // for CF    pointer to the MC object
@@ -932,6 +950,7 @@ class AliV0Reader : public TObject {
   Double_t fTofPIDnSigmaAboveElectronLine; // sigma cut RRnewTOF
   Double_t fTofPIDnSigmaBelowElectronLine; // sigma cut RRnewTOF 
   Double_t fPIDnSigmaAbovePionLine;     // sigma cut
+  Double_t fPIDnSigmaAbovePionLineHighPt;     // sigma cut
   Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
   Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut
   Double_t fDoKaonRejectionLowP;   // Kaon rejection at low p
@@ -987,8 +1006,16 @@ class AliV0Reader : public TObject {
   Int_t fNumberOfGoodV0s; // number of good V0s
   Int_t fIsHeavyIon; // flag
   Bool_t fUseCorrectedTPCClsInfo;
-
-  ClassDef(AliV0Reader,20) // RRnew
+  Int_t fUseMCPSmearing;
+  Double_t fPBremSmearing;
+  Double_t fPSigSmearing;
+  Double_t fPSigSmearingCte;
+  TRandom3 fRandom;
+  TF1 * fBrem; 
+  Bool_t   fDoPhotonAsymmetryCut; // flag to use the PhotonAsymetryCut
+  Double_t fMinPPhotonAsymmetryCut;
+  Double_t fMinPhotonAsymmetry;
+  ClassDef(AliV0Reader,22) // RRnewTOF
 };
 
 inline void AliV0Reader::InitESDpid(Int_t type)
index d6d8328ed9d01526a3c94c337e4f7c372fa0b172..e256cedc76f95551b131e754ff845844f0d90d7d 100644 (file)
@@ -15,7 +15,7 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-const int c_array_size = 27; // RRnewTOF c_array_size was increased to 27 in order to put a TOF PID cut on electrons
+const int c_array_size = 29; // RRnewTOF c_array_size was increased to 27 in order to put a TOF PID cut on electrons
 
 class AliAnalysisDataContainer;
 class AliGammaConversionHistograms;
@@ -48,7 +48,7 @@ Bool_t kGCdoBGProbability=kFALSE;
 //Svein 
 Bool_t kGCRunGammaJetTask = kFALSE;
 /** ---------------------------------- define cuts here ------------------------------------*/
-TString kGCAnalysisCutSelectionId="900356204010033210220000000"; // do not change here, use -set-cut-selection in argument instead
+TString kGCAnalysisCutSelectionId="90035620401003321022000000011"; // do not change here, use -set-cut-selection in argument instead
 
 Int_t kGCNEventsForBGCalculation=20;
 
@@ -111,7 +111,11 @@ Int_t kGCIsHeavyIon = 0;
 Int_t kGCUseCentrality = 0;
 Int_t kGCUseCentralityBin = 0;
 Int_t kGCUseCorrectedTPCClsInfo = 0;
+Int_t kGCUseMCPSmearing=0;
 
+Double_t kGCPBremSmearing=1.;
+Double_t kGCPSigSmearing=0.;
+Double_t kGCPSigSmearingCte=0.;
 
 /** ---------------------------------- define pi0 dalitz cuts here ------------------------------------*/
 
@@ -490,6 +494,7 @@ Bool_t kGCplotESDCutLine          = kTRUE;
 Bool_t kGCplotESDCutZ             = kTRUE;
 Bool_t kGCplotESDCutMinClsTPC     = kTRUE;
 Bool_t kGCplotESDCutMinClsTPCToF  = kTRUE;
+Bool_t kGCplotESDCutPhotonAsymmetry  = kTRUE;
 Bool_t kGCplotESDGoodV0s          = kTRUE;
 Bool_t kGCplotESDAllV0s           = kTRUE;
 Bool_t kGCplotESDAllV0sCurrentFinder = kTRUE;
@@ -939,6 +944,7 @@ Double_t kGCPIDnSigmaBelowElectronLine=-3;
 Double_t kGCPIDnSigmaAbovePionLine=0;
 Double_t kGCPIDMinPnSigmaAbovePionLine=1.;
 Double_t kGCPIDMaxPnSigmaAbovePionLine=3.;
+Double_t kGCPIDnSigmaAbovePionLineHighPt=0;
 
 Bool_t    kGCuseTOFpid = kFALSE; // RRnewTOF start //////////
 Double_t  kGCtofPIDnSigmaBelowElectronLine=-100;
@@ -965,6 +971,10 @@ Bool_t kGCdoHighPtQtGammaSelection=kFALSE; // RRnew
 Double_t kGCHighPtQtMax=100.;             // RRnew
 Double_t kGCPtBorderForQt=100.;                   // RRnew
 
+/**----Flag to apply cut on the photon asymmetry -----*/
+Bool_t  kGCdoPhotonAsymmetryCut= kTRUE;
+Double_t kGCMinPPhotonAsymmetryCut=100.;
+Double_t kGCMinPhotonAsymmetry=0.;
 
 
 Bool_t scanArguments(TString arguments){
@@ -1495,6 +1505,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   v0Reader->SetPIDnSigmaAboveElectronLine(kGCPIDnSigmaAboveElectronLine);
   v0Reader->SetPIDnSigmaBelowElectronLine(kGCPIDnSigmaBelowElectronLine);
   v0Reader->SetPIDnSigmaAbovePionLine(kGCPIDnSigmaAbovePionLine);
+  v0Reader->SetPIDnSigmaAbovePionLineHighPt(kGCPIDnSigmaAbovePionLineHighPt);
   v0Reader->SetPIDMinPnSigmaAbovePionLine(kGCPIDMinPnSigmaAbovePionLine);
   v0Reader->SetPIDMaxPnSigmaAbovePionLine(kGCPIDMaxPnSigmaAbovePionLine);
   v0Reader->SetOnFlyFlag(kGCUseOnFlyV0Finder);
@@ -1520,6 +1531,12 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   v0Reader->SetQtMax(kGCQtMax);
   v0Reader->SetHighPtQtMax(kGCHighPtQtMax); // RRnew
   v0Reader->SetPtBorderForQt(kGCPtBorderForQt); // RRnew
+
+  v0Reader->SetDoPhotonAsymmetryCut(kGCdoPhotonAsymmetryCut);
+  v0Reader->SetMinPPhotonAsymmetryCut(kGCMinPPhotonAsymmetryCut);
+  v0Reader->SetMinPhotonAsymmetry(kGCMinPhotonAsymmetry);
+
+
   kGCNEventsForBGCalculation= kGCnumberOfRotationEventsForBG;
   cout<< "number of Events used for mixing::"<<kGCNEventsForBGCalculation<<endl;
   v0Reader->SetNEventsForBG(kGCNEventsForBGCalculation);
@@ -1605,8 +1622,10 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal
   if(kGCUseCentrality){
     gammaconversion->SetUseCentralityBin(kGCUseCentralityBin);
   }
-
-
+  v0Reader->SetUseMCPSmearing(kGCUseMCPSmearing);
+  v0Reader->SetPBremSmearing(kGCPBremSmearing);
+  v0Reader->SetPSigSmearing(kGCPSigSmearing);
+  v0Reader->SetPSigSmearingCte(kGCPSigSmearingCte);
 
 
   // for CF
@@ -2255,6 +2274,7 @@ void AddHistograms(AliGammaConversionHistograms *histograms){
     if(kGCplotESDCutZ == kTRUE){histograms->AddHistogram("ESD_CutZ_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutMinClsTPC == kTRUE){histograms->AddHistogram("ESD_CutMinNClsTPC_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDCutMinClsTPCToF == kTRUE){histograms->AddHistogram("ESD_CutMinNClsTPCToF_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
+    if(kGCplotESDCutPhotonAsymmetry== kTRUE){histograms->AddHistogram("ESD_CutPhotonAsymmetry_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
 
     if(kGCplotESDGoodV0s == kTRUE){histograms->AddHistogram("ESD_GoodV0s_InvMass" ,"Good V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
     if(kGCplotESDAllV0s == kTRUE){histograms->AddHistogram("ESD_AllV0s_InvMass" ,"All V0s" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass,"","");}
@@ -2605,7 +2625,12 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   Int_t useCentrality=array[24];
   Int_t centralityBin=array[25];
   Int_t TOFelectronPID=array[26]; // RRnewTOF
+  Int_t useMCPSmearing=array[27];
+  Int_t doPhotonAsymmetryCut=array[28];
 
+  cout<<"doPhotonAsymmetryCut::"<<doPhotonAsymmetryCut<<endl;
+  cout<<"useMCPSmearing::"<<useMCPSmearing<<endl;
+  cout<<"TOFelectronPID: "<<TOFelectronPID<<endl; // RRnewTOF
   cout<<"CentralityBin::"<< centralityBin <<endl;
   cout<<"Use Centrality::"<< useCentrality <<endl;
   cout<<"Heavy Ion::"<< isHeavyIon<<endl;
@@ -2632,7 +2657,7 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   cout<<"eProbCut: "<< eProbCut<<endl;
   cout<<"v0FinderType: "<<v0FinderType <<endl;
   cout<<"goodId: "<<goodId <<endl;
-  cout<<"TOFelectronPID: "<<TOFelectronPID<<endl; // RRnewTOF
+
 
   if(goodId !=9){
     cout<<"Analysis Cut Selection too short or does not start with 9"<<endl;
@@ -2691,23 +2716,40 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
   switch(pidedxSigmaCut){
   case 0:  // -10
     kGCPIDnSigmaAbovePionLine=-10;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
     break;
   case 1:   // 0
     kGCPIDnSigmaAbovePionLine=0;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
     break;
   case 2:  // 1
     kGCPIDnSigmaAbovePionLine=1;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
     break;
   case 3:  // 1
     kGCPIDnSigmaAbovePionLine=-1;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
     break;
   case 4:  // 1
     kGCPIDnSigmaAbovePionLine=-1.5;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
     break;
   case 5:  // 1
     kGCPIDnSigmaAbovePionLine=2.;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
+    break;
+  case 6:  // 1
+    kGCPIDnSigmaAbovePionLine=2.;
+    kGCPIDnSigmaAbovePionLineHighPt=0.5;
+    break;
+  case 7:  // 1
+    kGCPIDnSigmaAbovePionLine=3.5;
+    kGCPIDnSigmaAbovePionLineHighPt=-10;
+    break;
+  case 8:  // 1
+    kGCPIDnSigmaAbovePionLine=2.;
+    kGCPIDnSigmaAbovePionLineHighPt=1.;
     break;
-
   default:
     return iResult;
   }
@@ -3277,6 +3319,91 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){
     return iResult;
   } //////////////////////// RRnewTOF end //////////////////////////////////////////////////////////////////////////
 
+  switch(useMCPSmearing){
+  case 0:
+    kGCUseMCPSmearing=0;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.;
+    kGCPSigSmearingCte=0.;
+    break;
+  case 1:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.0e-14;
+    kGCPSigSmearing=0.;
+    kGCPSigSmearingCte=0.;
+    break;
+  case 2:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.0e-15;
+    kGCPSigSmearing=0.0;
+    kGCPSigSmearingCte=0.;
+    break;
+  case 3:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.003;
+    kGCPSigSmearingCte=0.002;
+    break;
+ case 4:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.003;
+    kGCPSigSmearingCte=0.007;
+    break;
+  case 5:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.003;
+    kGCPSigSmearingCte=0.016;
+    break;
+  case 6:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.007;
+    kGCPSigSmearingCte=0.016;
+    break;
+  case 7:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.0e-16;
+    kGCPSigSmearing=0.0;
+    kGCPSigSmearingCte=0.;
+    break;
+  case 8:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.007;
+    kGCPSigSmearingCte=0.014;
+    break;
+  case 9:
+    kGCUseMCPSmearing=1;
+    kGCPBremSmearing=1.;
+    kGCPSigSmearing=0.007;
+    kGCPSigSmearingCte=0.011;
+    break;
+
+   default:
+    return iResult;
+  }
+  switch(doPhotonAsymmetryCut){
+  case 0:
+    kGCdoPhotonAsymmetryCut=0;
+    kGCMinPPhotonAsymmetryCut=100.;
+    kGCMinPhotonAsymmetry=0.;
+    break;
+  case 1:
+    kGCdoPhotonAsymmetryCut=1;
+    kGCMinPPhotonAsymmetryCut=3.5;
+    kGCMinPhotonAsymmetry=0.04;
+    break;
+  case 2:
+    kGCdoPhotonAsymmetryCut=1;
+    kGCMinPPhotonAsymmetryCut=3.5;
+    kGCMinPhotonAsymmetry=0.06;
+    break;
+   default:
+    return iResult;
+  }
+
   iResult = 1;
   return iResult;
 
@@ -3314,6 +3441,8 @@ void string2array(const std::string& number, int a[c_array_size])
         ASSIGNARRAY(24);
         ASSIGNARRAY(25);
         ASSIGNARRAY(26); // RRnewTOF
+        ASSIGNARRAY(27); 
+        ASSIGNARRAY(28); 
   }
 }