-updates (ShinIchi)
authorjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Aug 2013 10:18:21 +0000 (10:18 +0000)
committerjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Aug 2013 10:18:21 +0000 (10:18 +0000)
PWGDQ/dielectron/macrosLMEE/Config_shin_pPb.C

index e81f518..08023b9 100644 (file)
-void InitHistograms(AliDielectron *die, Int_t cutDefinition);\r
-void InitCF(AliDielectron* die, Int_t cutDefinition);\r
-\r
-void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition);\r
-\r
-AliESDtrackCuts *SetupESDtrackCuts(Int_t cutDefinition);\r
-AliDielectronPID *SetPIDcuts(Int_t cutDefinition);\r
-\r
-\r
-//start systematics\r
-TString names= ("nopid;SPDBoth+ITSNcls2+TPCTOF;SPDFisrt+ITSNcls2+TPCTOF;SPDBoth+ITSNcls3+TPCTOF;SPDFirst+ITSNcls3+TPCTOF;SPDFirst+ITSNcls3+TPCTOF+phiv;SPDFirst+ITSNcls3+TPCTOFloose+phiv");\r
-\r
-\r
-       Bool_t kRot = 0;\r
-       Bool_t kMix = 1;\r
-\r
-TObjArray *arrNames=names.Tokenize(";");\r
-const Int_t nDie=arrNames->GetEntriesFast();\r
-\r
-AliDielectron* Config_shin_pPb(Int_t cutDefinition=1)\r
-{\r
-  //\r
-  // Setup the instance of AliDielectron\r
-  //\r
-  \r
-  // create the actual framework object\r
-  TString name=Form("%02d",cutDefinition);\r
-  if (cutDefinition<arrNames->GetEntriesFast()){\r
-    name=arrNames->At(cutDefinition)->GetName();\r
-  }\r
-  AliDielectron *die =\r
-    new AliDielectron(Form("%s",name.Data()),\r
-                      Form("Track cuts: %s",name.Data()));\r
-  \r
-  \r
-  if(kRot){\r
-    AliDielectronTrackRotator *rot = new AliDielectronTrackRotator;\r
-    rot->SetConeAnglePhi(TMath::Pi());\r
-    rot->SetIterations(10);\r
-    die->SetTrackRotator(rot);\r
-  }//kRot\r
-  \r
-  \r
-  if(kMix){\r
-    AliDielectronMixingHandler *mix = new AliDielectronMixingHandler;\r
-    mix->SetMixType(AliDielectronMixingHandler::kAll);\r
-    mix->AddVariable(AliDielectronVarManager::kZvPrim,"-10., -7.5, -5., -2.5 , 0., 2.5, 5., 7.5 , 10.");\r
-    mix->SetDepth(10);\r
-    die->SetMixingHandler(mix);\r
-  }//kMix\r
-  \r
-  \r
-\r
-  SetupTrackCuts(die,cutDefinition);\r
-  SetupPairCuts(die,cutDefinition);\r
-  \r
-  // histogram setup\r
-  // only if an AliDielectronHistos object is attached to the\r
-  // dielectron framework histograms will be filled\r
-  InitHistograms(die,cutDefinition);\r
-  //  InitCF(die,cutDefinition);\r
-  \r
-\r
-  return die;\r
-\r
-}\r
-\r
-//______________________________________________________________________________________\r
-void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)\r
-{\r
-  //\r
-  // Setup the track cuts\r
-  //\r
-       //options\r
-        die->SetPreFilterAllSigns();\r
-       //pairing with TLorentzVector\r
-       die->SetUseKF(kFALSE);\r
-\r
-       AliDielectronTrackCuts *TrackCuts = new AliDielectronTrackCuts("StandardCuts","StandardCut");\r
-       //refit\r
-       TrackCuts->SetRequireTPCRefit(kTRUE);\r
-       TrackCuts->SetRequireITSRefit(kTRUE);\r
-       //SPD require\r
-       if(cutDefinition == 1|cutDefinition ==3) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kBoth);\r
-       if(cutDefinition == 0|cutDefinition ==2) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst);\r
-       if(cutDefinition > 3) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kBoth); \r
-       die->GetTrackFilter().AddCuts(TrackCuts);\r
-               \r
-       AliDielectronVarCuts *varCuts = new AliDielectronVarCuts("varCuts","varCuts");\r
-       varCuts->AddCut(AliDielectronVarManager::kPt,0.2,100.);\r
-       varCuts->AddCut(AliDielectronVarManager::kEta,-0.8,0.8);\r
-       varCuts->AddCut(AliDielectronVarManager::kImpactParZ,-3.,3.);\r
-       varCuts->AddCut(AliDielectronVarManager::kImpactParXY,-1.,1.);\r
-       varCuts->AddCut(AliDielectronVarManager::kKinkIndex0,0.);\r
-\r
-\r
-       varCuts->AddCut(AliDielectronVarManager::kNclsTPC,80.,500.);\r
-       varCuts->AddCut(AliDielectronVarManager::kNFclsTPC,100.,500.); // or NFclsTPCr?\r
-       varCuts->AddCut(AliDielectronVarManager::kTPCchi2Cl,0.,4.);\r
-       varCuts->AddCut(AliDielectronVarManager::kNFclsTPCfCross,0.5,500.);\r
-\r
-       if( cutDefinition==1 | cutDefinition ==2 ){\r
-         varCuts->AddCut(AliDielectronVarManager::kNclsITS,2.,7.);\r
-       }\r
-       else{varCuts->AddCut(AliDielectronVarManager::kNclsITS,3.,7.);}\r
-       \r
-       die->GetTrackFilter().AddCuts(varCuts);\r
-       \r
-// PID \r
-       if(cutDefinition > 0){\r
-         AliDielectronPID *pid = new AliDielectronPID("pid","pid");    \r
-         pid->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5,3.,0.2,100.,kFALSE);\r
-         pid->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,4.,0.2,100.,kTRUE);\r
-         if(cutDefinition < 6)\r
-         pid->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3.,3.,0.4, 5., kFALSE);   \r
-         if(cutDefinition==6 )\r
-           pid->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3.,3.,0.4, 2., kFALSE);\r
-         die->GetTrackFilter().AddCuts(pid);\r
-       }\r
-       \r
-}\r
-//----------------------------------Pair Cut-------------------------------------------\r
-void SetupPairCuts(AliDielectron *die, Int_t cutDefinition)\r
-{\r
-  if(cutDefinition > 4){\r
-    AliDielectronVarCuts *PhiV = new AliDielectronVarCuts("PhiV","PhiV");//mass and Phiv together\r
-    PhiV->AddCut(AliDielectronVarManager::kM, 0. , 0.05);\r
-    PhiV->AddCut(AliDielectronVarManager::kPhivPair, 2.5 , 3.2);\r
-    die->GetPairPreFilter().AddCuts(PhiV);\r
-    \r
-    //  AliDielectronTrackCuts *noconv=new AliDielectronTrackCuts("noConv","conversion tagging");\r
-    //  noconv->SetV0DaughterCut(AliPID::kElectron,kTRUE);\r
-    //  die->GetTrackFilter().AddCuts(noconv);\r
-  }\r
-}\r
-/*\r
-//______________________________________________________________________________________\r
-AliESDtrackCuts *SetupESDtrackCuts(Int_t cutDefinition)\r
-{\r
-\r
-  AliESDtrackCuts *fesdTrackCuts = new AliESDtrackCuts;\r
-\r
-\r
-  //global\r
-  \r
-  fesdTrackCuts->SetPtRange( 0.2 , 100. );\r
-  //if(cutDefinition > 1 ) fesdTrackCuts->SetPtRange( 3. , 4. );\r
-  fesdTrackCuts->SetAcceptKinkDaughters(kFALSE);\r
-  fesdTrackCuts->SetRequireSigmaToVertex(kFALSE);\r
-  fesdTrackCuts->SetDCAToVertex2D(kFALSE);\r
-  fesdTrackCuts->SetMaxDCAToVertexZ(3.);\r
-  fesdTrackCuts->SetMaxDCAToVertexXY(1.);\r
-  fesdTrackCuts->SetEtaRange( -0.8 , 0.8 );\r
-\r
-  //ITS\r
-  fesdTrackCuts->SetRequireITSRefit(kTRUE);\r
-  fesdTrackCuts->SetMinNClustersITS(3);\r
-  if(cutDefinition == 6)fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kBoth); \r
-  else fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst);\r
-\r
-\r
-  //TPC\r
-  fesdTrackCuts->SetRequireTPCRefit(kTRUE);\r
-  fesdTrackCuts->SetMinNClustersTPC(80);\r
-  fesdTrackCuts->SetMinNCrossedRowsTPC(100);\r
-  fesdTrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.5);\r
-  fesdTrackCuts->SetMaxChi2PerClusterTPC(4);\r
-  return fesdTrackCuts;\r
-\r
-\r
-}\r
-*/\r
-//______________________________________________________________________________________\r
-void InitHistograms(AliDielectron *die, Int_t cutDefinition)\r
-{\r
-  //\r
-  // Initialise the histograms\r
-  //\r
-  \r
-  //Setup histogram classes\r
-  AliDielectronHistos *histos=\r
-    new AliDielectronHistos(die->GetName(),\r
-                            die->GetTitle());\r
-  \r
-\r
-\r
-  //Initialise histogram classes\r
-  histos->SetReservedWords("Track;Pair");\r
-  \r
-  //Event class\r
-  histos->AddClass("Event");\r
-  \r
-\r
-  //Track classes\r
-  //to fill also track info from 2nd event loop until 2\r
-  for (Int_t i=0; i<2; ++i){\r
-    histos->AddClass(Form("Track_%s",AliDielectron::TrackClassName(i)));\r
-  }\r
-  \r
-  //Pair classes\r
-  // to fill also mixed event histograms loop until 10\r
-\r
-  for (Int_t i=0; i<3; ++i){\r
-    histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(i)));\r
-\r
-  }\r
-\r
-  if(kMix){\r
-  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(3))); //ME ++\r
-  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(4)));//ME -+\r
-  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(6)));//ME +-\r
-  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(7))); // ME --\r
-  }\r
-\r
-  if(kRot)histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(10)));//Rot\r
-\r
-\r
-  //add histograms to event class\r
-  histos->UserHistogram("Event","nEvents","Number of processed events after cuts;Number events",1,0,1,AliDielectronVarManager::kNevents);\r
-  histos->UserHistogram("Event","ZVertex","ZVertex;ZVertex/cm",480,-12.,12.,AliDielectronVarManager::kZvPrim);\r
-  histos->UserHistogram("Event","nESDTracks","ESD tracks;ESD tracks;Number events",100,0,200,AliDielectronVarManager::kTracks);\r
-  histos->UserHistogram("Event","Nacc","Number of accepted tracks;Number events",100,0,200,AliDielectronVarManager::kNacc);\r
-  histos->UserHistogram("Event","NVtxContrib","Number of Vertex Contributor;NVtx;Number events",100,0,100,AliDielectronVarManager::kNVtxContrib);\r
-\r
-\r
-  //add histograms to Track classes\r
-  histos->UserHistogram("Track","P","P;P [GeV];#tracks",500,0.,10.,AliDielectronVarManager::kPIn);\r
-  histos->UserHistogram("Track","Pt","Pt;Pt [GeV];#tracks",500,0.,10.,AliDielectronVarManager::kPt);\r
-  histos->UserHistogram("Track","Eta","Eta; Eta ;#tracks",100,-1.,1.,AliDielectronVarManager::kEta);\r
-  histos->UserHistogram("Track","Phi","Phi; Phi ;#tracks",640,0.,6.4,AliDielectronVarManager::kPhi);\r
-\r
-\r
-  histos->UserHistogram("Track","Eta_phi","Eta vs Phi;Eta;Phi",500,-1.,1.,320,0.,6.4,AliDielectronVarManager::kEta,AliDielectronVarManager::kPhi);\r
-  histos->UserHistogram("Track","Eta_pt","Eta vs Pt;Eta;Pt",100,-1.,1.,500,0.,10.,AliDielectronVarManager::kEta,AliDielectronVarManager::kPt);\r
-  histos->UserHistogram("Track","Phi_pt","Phi vs Pt;Phi;Pt",640,0,6.4.,500,0.,10.,AliDielectronVarManager::kPhi,AliDielectronVarManager::kPt);\r
-\r
-  //  histos->UserHistogram("Track","ImpParXY_Pt","ImpParXY_Pt; Pt; ÍmpParXY",500,0.,10.,500,-5.,5.,AliDielectronVarManager::kPt,AliDielectronVarManager::kImpactParXY);\r
-  // histos->UserHistogram("Track","ImpParZ_Pt","ImpParZ_Pt; Pt; ÍmpParZ",500,0.,10.,500,-5.,5.,AliDielectronVarManager::kPt,AliDielectronVarManager::kImpactParZ);\r
\r
-\r
-  //track checks (ITS)\r
-//  histos->UserHistogram("Track","ITSchi2Cl_Mom","ITS Chi2 vs Momentum;Mom;ITS chi2",500,0.,5.,50,0.,5.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSchi2Cl);\r
-//  histos->UserHistogram("Track","NclsITS_Mom",";Mom;kNclsITS",500,0.,5.,7,0,7,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNclsITS);\r
-\r
-  //track checks (TPC)\r
-  histos->UserHistogram("Track","TPCsignalNfrac_Mom",";fraction TPCSignalN/TPCncls vs Momentum;Mom;TPCSignalN/TPCncls",500,0.,5.,60,0.,1.2,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignalNfrac);\r
-//  histos->UserHistogram("Track","TPCchi2Cl_Mom","TPC Chi2 vs Momentum;Mom;TPC Chi2",500,0.,10.,100,0,5,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCchi2Cl);\r
-//  histos->UserHistogram("Track","TPCclsDiff_Mom","kTPCclsDiff vs Momentum;Mom;kTPCclsDiff",500,0.,10.,100,-10,10,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCclsDiff);\r
-  histos->UserHistogram("Track","FindableTPCcls_Mom","kNFclsTPC vs Momentum;Mom;kNFclsTPC",500,0.,10.,200,0.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNFclsTPC);\r
-//  histos->UserHistogram("Track","TPCcls_Mom","kNclsTPC vs Momentum;Mom;kNclsTPC",500,0.,10.,200,0.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNclsTPC);\r
-//  histos->UserHistogram("Track","kNclsSFracTPC_Mom","kNclsSFracTPC vs Momentum;Mom;kTPCclsSFrac",500,0.,10.,1000,0.,1.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNclsSFracTPC);\r
-  histos->UserHistogram("Track","kNFclsTPCrFrac_Mom","kNFclsTPCrFrac vs Momentum;Mom;kNFclsTPCrFrac",500,0.,10.,60,0.,1.2.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNFclsTPCrFrac);\r
-\r
-  //track checks (TOF)\r
-  histos->UserHistogram("Track","TOFbeta_Mom","kTOFbeta vs Momentum;Mom;TOFbeta",500,0.,5.,120,0.,1.2,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFbeta);\r
-//  histos->UserHistogram("Track","TOFPIDBit_Mom","kTOFPIDBit vs Momentum;Mom;TOFPIDbit",500,0.,5.,2,0.,1.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFPIDBit);\r
-\r
-  //track checks (PID)\r
-//  histos->UserHistogram("Track","ITSnSigma_MomPio","ITS number of sigmas Pion vs Momentum;Mom;ITSsigmaPion",500,0.,5.,1000,-20,20,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSnSigmaPio);\r
-//  histos->UserHistogram("Track","TPCnSigma_MomPio","TPC number of sigmas Pions vs Momentum;Mom;TPCsigmaPion",500,0.,5.,1000,-20,20,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaPio);\r
-\r
-//  histos->UserHistogram("Track","ITSnSigma_MomEle","ITS number of sigmas Electrons vs Momentum;Mom;ITSsigmaEle",500,0.,5.,800,-40,40,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSnSigmaEle);\r
-  histos->UserHistogram("Track","TPCnSigma_MomEle","TPC number of sigmas Electrons vs Momentum;Mom;TPCsigmaEle",1000,0.,10.,800,-40,40,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle);\r
-  histos->UserHistogram("Track","TPCnSigma_TOFnSigma","TPC number of sigmas Electrons vs TOF sigma;TOFsigma;TPCsigmaEle",800,-40.,40.,800,-40,40,AliDielectronVarManager::kTOFnSigmaEle,AliDielectronVarManager::kTPCnSigmaEle);\r
-  histos->UserHistogram("Track","TPCnSigma_Eta","TPC number of sigmas Electrons vs Eta;Eta;TPCsigmaEle",800,-0.8.,0.8.,800,-40,40,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaEle);\r
-  histos->UserHistogram("Track","TPCdEdx_Eta","TPC dEdx vs Eta;Eta;TPCsigmaEle",800,-0.8,0.8,800,0,200,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCsignal);\r
-  histos->UserHistogram("Track","TPCnSigma_Phi","TPC number of sigmas Electrons vs Phi;Phi;TPCsigmaEle",640,0.,6.4,800,-40,40,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCnSigmaEle);\r
-  histos->UserHistogram("Track","TPCdEdx_Phi","TPC dEdx vs Phi;Phi;TPCsigmaEle",640,0.,6.4,800,0,200,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCsignal);\r
-\r
-\r
-\r
-//  histos->UserHistogram("Track","TOFnSigma_MomEle","TOF number of sigmas Electrons vs Momentum;Mom;TOFsigmaEle",500,0.,5.,800,-40,40,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFnSigmaEle);\r
-\r
-//  histos->UserHistogram("Track","ITSdEdx_P","dEdx;P [GeV];ITS signal (arb units) vs Momentum;Mom;ITSsignal", 500,0,5,800,0,200,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSsignal);\r
-  histos->UserHistogram("Track","TPCdEdx_P","dEdx;P [GeV];TPC signal (arb units) vs Momentum;Mom;TPCsignal", 500,0,10.,800,0,200,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal);\r
-\r
-  //\r
-  //add histograms to Pair classes\r
-  //\r
-\r
-  histos->UserHistogram("Pair","InvMass","Inv.Mass;Inv. Mass [GeV];#pairs",\r
-                        500,0,4,AliDielectronVarManager::kM);\r
-\r
-  histos->UserHistogram("Pair","InvMass_low","Inv.Mass;Inv. Mass [GeV];#pairs",\r
-                        500,0,0.5,AliDielectronVarManager::kM);\r
-\r
-//  histos->UserHistogram("Pair","InvMass10","Inv.Mass;Inv. Mass [GeV];#pairs",\r
-//                        500,0.,5.,AliDielectronVarManager::kM);\r
-\r
-  histos->UserHistogram("Pair","kDeltaEta","kDeltaEta;kDeltaEta;#pairs",\r
-                        160,0.,1.6,AliDielectronVarManager::kDeltaEta);\r
-\r
-  histos->UserHistogram("Pair","kDeltaEta_low","kDeltaEta;kDeltaEta;#pairs",\r
-                        500,0.,0.5,AliDielectronVarManager::kDeltaEta);\r
-\r
-  histos->UserHistogram("Pair","kDeltaPhi","kDeltaPhi;kDeltaPhi;#pairs",\r
-                        320,0.,6.4,AliDielectronVarManager::kDeltaPhi);\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "kDeltaEta_kDeltaPhi","kDeltaEta_kDeltaPhi;kDeltaEta;kDeltaPhi",\r
-                        160, 0. , 1.6, 320 , 0., 6.4 ,\r
-                       AliDielectronVarManager::kDeltaEta , AliDielectronVarManager::kDeltaPhi );\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "Phi","Phi;counts;Phi",\r
-                        320, 0. , 6.4, AliDielectronVarManager::kPhi);\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "Y","Y;counts;Y",\r
-                        120, -1.2 , 1.2, AliDielectronVarManager::kY);\r
-\r
-\r
-  histos->UserHistogram("Pair","PhiV",";PhiV;#pairs",\r
-                        320,0.,6.4,AliDielectronVarManager::kPhivPair);\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "OpAngle","Opening angle;Opening angle;#pairs",\r
-                        320, 0. , 3.2, \r
-                         AliDielectronVarManager::kOpeningAngle);\r
-\r
-\r
-//   histos->UserHistogram("Pair","PhiV_Pt",";Pt;PhiV",\r
-//                      100,0.,10.,320,0.,6.4,AliDielectronVarManager::kPt,AliDielectronVarManager::kPhivPair);\r
-\r
-   histos->UserHistogram("Pair","InvMass_bin2","Inv.Mass;Inv. Mass [GeV];#pairs",\r
-       "0. , 0.025, 0.05 , 0.075 ,0.1 ,0.15 , 0.2 , 0.25 , 0.3 , \r
-       0.4 ,  0.5 , 0.6, 0.65 , 0.688 , 0.725, 0.75, 0.775, 0.8 , 0.85 ,\r
-        0.95,  0.975 , 1.0 , 1.025 , 1.05, 1.125 , 1.25 , 1.5 , 1.75 , 2.0 , \r
-       2.25, 2.5 , 2.75 , 2.85, 2.95,3.05, 3.1 , 3.15 , \r
-       3.3 , 3.5, 3.75 , 4.0",AliDielectronVarManager::kM);\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "Eta_Phi","Eta_Phi;Eta;Phi",\r
-                        360, -0.8 , 0.8., 320 , 0., 3.2. ,\r
-                       AliDielectronVarManager::kEta , AliDielectronVarManager::kPhi );\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "InvMass_Pt","InvMass_Pt;InvMass;Pt",\r
-                        500, 0. , 4., 100 , 0., 5. ,\r
-                       AliDielectronVarManager::kM , AliDielectronVarManager::kPt );\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "InvMass_PhivPair","InvMass_PhivPair;InvMass;PhivPair",\r
-                        500, 0. , 4., 320 , 0., 3.2 ,\r
-                         AliDielectronVarManager::kM , AliDielectronVarManager::kPhivPair );\r
-\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "OpAngle_InvMass","OpAngle_InvMass;Opening angle;Invariant Mass",\r
-                        320, 0. , 3.2, 500 , 0. , 4. ,\r
-                         AliDielectronVarManager::kOpeningAngle,AliDielectronVarManager::kM);\r
-\r
-  histos->UserHistogram("Pair",\r
-                        "Phi_InvMass","Phi_InvMass;Phi;Invariant Mass",\r
-                        320, 0. , 6.4, 500 , 0. , 4. ,\r
-                         AliDielectronVarManager::kPhi,AliDielectronVarManager::kM);\r
-\r
-\r
-\r
-  die->SetHistogramManager(histos);\r
-}\r
-\r
-\r
-\r
-\r
-void InitCF(AliDielectron* die, Int_t cutDefinition)\r
-{\r
-  //\r
-  // Setup the CF Manager if needed\r
-  //\r
-  \r
-  AliDielectronCF *cf=new AliDielectronCF(die->GetName(),die->GetTitle());\r
-\r
-    \r
-   //pair variables\r
-//  cf->AddVariable(AliDielectronVarManager::kM,500,0.,4.);\r
-  cf->AddVariable(AliDielectronVarManager::kM,"0. , 0.025, 0.05 , 0.075 ,0.1 ,0.15 , 0.2 , 0.25 , 0.3 , \r
-       0.4 ,  0.5 , 0.6, 0.65 , 0.688 , 0.725, 0.75, 0.775, 0.8 , 0.85 ,\r
-        0.95,  0.975 , 1.0 , 1.025 , 1.05, 1.125 , 1.25 , 1.5 , 1.75 , 2.0 , \r
-       2.25, 2.5 , 2.75 , 2.85, 2.95,3.05, 3.1 , 3.15 , \r
-       3.3 , 3.5, 3.75 , 4.0");//data\r
-  cf->AddVariable(AliDielectronVarManager::kY,20,-1.,1.);\r
-  cf->AddVariable(AliDielectronVarManager::kPhi,32, 0., 3.2);\r
-  cf->AddVariable(AliDielectronVarManager::kPt,100,0.,5.);\r
-\r
-\r
-  cf->AddVariable(AliDielectronVarManager::kOpeningAngle,62,0.,6.2);\r
-  cf->AddVariable(AliDielectronVarManager::kPhivPair,64, 0., 6.4);\r
-  cf->AddVariable(AliDielectronVarManager::kPairType,4,-0.5,3.5);\r
-  \r
-  \r
-  \r
-  //leg \r
-  cf->AddVariable(AliDielectronVarManager::kPt,100,0.,10.,kTRUE);\r
-  cf->AddVariable(AliDielectronVarManager::kPhi,36,0.,360.,kTRUE);\r
-  cf->AddVariable(AliDielectronVarManager::kEta,100,-1.,1.,kTRUE);\r
-\r
-  \r
-/*  \r
-  cf->AddVariable(AliDielectronVarManager::kTPCsignal,200,0.,200.,kTRUE);\r
-  cf->AddVariable(AliDielectronVarManager::kImpactParXY,40,-2.,2.,kTRUE);\r
-  cf->AddVariable(AliDielectronVarManager::kImpactParZ,40,-2.,2.,kTRUE);\r
-  cf->AddVariable(AliDielectronVarManager::kNclsITS,10,0.,10.,kTRUE);\r
-  cf->AddVariable(AliDielectronVarManager::kNFclsTPCrFrac,10,0.,1.,kTRUE);\r
-*/\r
-\r
-\r
-  die->SetCFManagerPair(cf);\r
-  \r
-}\r
-\r
-\r
-\r
-\r
-\r
-void SetEtaCorrection()\r
-{\r
-  if (AliDielectronPID::GetEtaCorrFunction()) return;\r
-\r
-  TString list=gSystem->Getenv("LIST");\r
-  \r
-  TFile f("$TRAIN_ROOT/jpsi_JPSI/EtaCorrMaps.root");\r
-  if (!f.IsOpen()) return;\r
-  TList *keys=f.GetListOfKeys();\r
-\r
-  for (Int_t i=0; i<keys->GetEntries(); ++i){\r
-    TString kName=keys->At(i)->GetName();\r
-    TPRegexp reg(kName);\r
-    if (reg.MatchB(list)){\r
-      printf("Using Eta Correction Function: %s\n",kName.Data());\r
-      AliDielectronPID::SetEtaCorrFunction((TF1*)f.Get(kName.Data()));\r
-    }\r
-  }\r
-}\r
-\r
-\r
-\r
+void InitHistograms(AliDielectron *die, Int_t cutDefinition);
+void InitCF(AliDielectron* die, Int_t cutDefinition);
+
+void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition);
+
+AliESDtrackCuts *SetupESDtrackCuts(Int_t cutDefinition);
+AliDielectronPID *SetPIDcuts(Int_t cutDefinition);
+
+
+//start systematics
+TString names= ("nopid;SPDBoth+ITSNcls2+TPCTOF;SPDFisrt+ITSNcls2+TPCTOF;SPDBoth+ITSNcls3+TPCTOF;SPDFirst+ITSNcls3+TPCTOF;SPDFirst+ITSNcls3+TPCTOF+phiv;SPDboth+ITSNcls3+TPCTOF+phiv;SPDFirst+ITSNcls3+TPCTOF+phiv+convtag;SPDBoth+ITSNcls3+TPCTOF+phiv+convtag");
+
+
+       Bool_t kRot = 0;
+       Bool_t kMix = 1;
+
+TObjArray *arrNames=names.Tokenize(";");
+const Int_t nDie=arrNames->GetEntriesFast();
+
+AliDielectron* Config_shin_pPb(Int_t cutDefinition=1)
+{
+  //
+  // Setup the instance of AliDielectron
+  //
+  
+  // create the actual framework object
+  TString name=Form("%02d",cutDefinition);
+  if (cutDefinition<arrNames->GetEntriesFast()){
+    name=arrNames->At(cutDefinition)->GetName();
+  }
+  AliDielectron *die =
+    new AliDielectron(Form("%s",name.Data()),
+                      Form("Track cuts: %s",name.Data()));
+  
+  
+  if(kRot){
+    AliDielectronTrackRotator *rot = new AliDielectronTrackRotator;
+    rot->SetConeAnglePhi(TMath::Pi());
+    rot->SetIterations(10);
+    die->SetTrackRotator(rot);
+  }//kRot
+  
+  
+  if(kMix){
+    AliDielectronMixingHandler *mix = new AliDielectronMixingHandler;
+    mix->SetMixType(AliDielectronMixingHandler::kAll);
+    mix->AddVariable(AliDielectronVarManager::kZvPrim,"-10., -7.5, -5., -2.5 , 0., 2.5, 5., 7.5 , 10.");
+    mix->SetDepth(10);
+    die->SetMixingHandler(mix);
+  }//kMix
+  
+  
+
+  SetupTrackCuts(die,cutDefinition);
+  SetupPairCuts(die,cutDefinition);
+  
+  // histogram setup
+  // only if an AliDielectronHistos object is attached to the
+  // dielectron framework histograms will be filled
+  InitHistograms(die,cutDefinition);
+  //  InitCF(die,cutDefinition);
+  
+
+  return die;
+
+}
+
+//______________________________________________________________________________________
+void SetupTrackCuts(AliDielectron *die, Int_t cutDefinition)
+{
+  //
+  // Setup the track cuts
+  //
+       //options
+        die->SetPreFilterAllSigns();
+       //pairing with TLorentzVector
+       die->SetUseKF(kFALSE);
+
+       AliDielectronTrackCuts *TrackCuts = new AliDielectronTrackCuts("StandardCuts","StandardCut");
+       //refit
+       TrackCuts->SetRequireTPCRefit(kTRUE);
+       TrackCuts->SetRequireITSRefit(kTRUE);
+       //SPD require
+       if(cutDefinition == 1|cutDefinition == 3 |cutDefinition == 6| cutDefinition == 8) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kBoth);
+       if(cutDefinition == 0|cutDefinition == 2| cutDefinition == 4|cutDefinition == 5 |cutDefinition==7 ) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst);
+       //      if(cutDefinition == 4|cutDefinition == 5 |cutDefinition==7) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst); 
+       //if(cutDefinition == 6| cutDefinition == 8) TrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst); 
+       die->GetTrackFilter().AddCuts(TrackCuts);
+               
+       AliDielectronVarCuts *varCuts = new AliDielectronVarCuts("varCuts","varCuts");
+       varCuts->AddCut(AliDielectronVarManager::kPt,0.2,100.);
+       varCuts->AddCut(AliDielectronVarManager::kEta,-0.8,0.8);
+       varCuts->AddCut(AliDielectronVarManager::kImpactParZ,-3.,3.);
+       varCuts->AddCut(AliDielectronVarManager::kImpactParXY,-1.,1.);
+       varCuts->AddCut(AliDielectronVarManager::kKinkIndex0,0.);
+
+
+       varCuts->AddCut(AliDielectronVarManager::kNclsTPC,80.,500.);
+       varCuts->AddCut(AliDielectronVarManager::kNFclsTPCr,100.,500.); // or NFclsTPCr?
+       varCuts->AddCut(AliDielectronVarManager::kTPCchi2Cl,0.,4.);
+       varCuts->AddCut(AliDielectronVarManager::kNFclsTPCfCross,0.5,500.);
+
+       if( cutDefinition==1 | cutDefinition ==2 ){
+         varCuts->AddCut(AliDielectronVarManager::kNclsITS,2.,7.);
+       }
+       else{varCuts->AddCut(AliDielectronVarManager::kNclsITS,3.,7.);}
+       
+       die->GetTrackFilter().AddCuts(varCuts);
+       
+// PID 
+       if(cutDefinition > 0){
+         AliDielectronPID *pid = new AliDielectronPID("pid","pid");    
+         pid->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5,3.,0.2,100.,kFALSE);
+         pid->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-100.,3.,0.2,100.,kTRUE);
+         // if(cutDefinition < 6)
+         pid->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3.,3.,0.4, 5., kFALSE);   
+         //  if(cutDefinition==6 )
+         //  pid->AddCut(AliDielectronPID::kTOF,AliPID::kElectron,-3.,3.,0.4, 2., kFALSE);
+         die->GetTrackFilter().AddCuts(pid);
+       }
+       
+}
+//----------------------------------Pair Cut-------------------------------------------
+void SetupPairCuts(AliDielectron *die, Int_t cutDefinition)
+{
+  if(cutDefinition > 4){
+    AliDielectronVarCuts *PhiV = new AliDielectronVarCuts("PhiV","PhiV");//mass and Phiv together
+    PhiV->AddCut(AliDielectronVarManager::kM, 0. , 0.05);
+    PhiV->AddCut(AliDielectronVarManager::kPhivPair, 2.5 , 3.2);
+    die->GetPairPreFilter().AddCuts(PhiV);
+    if(cutDefinition >6){
+      AliDielectronTrackCuts *noconv=new AliDielectronTrackCuts("noConv","conversion tagging");
+      noconv->SetV0DaughterCut(AliPID::kElectron,kTRUE);
+      die->GetTrackFilter().AddCuts(noconv);
+    }
+  }
+}
+/*
+//______________________________________________________________________________________
+AliESDtrackCuts *SetupESDtrackCuts(Int_t cutDefinition)
+{
+
+  AliESDtrackCuts *fesdTrackCuts = new AliESDtrackCuts;
+
+
+  //global
+  
+  fesdTrackCuts->SetPtRange( 0.2 , 100. );
+  //if(cutDefinition > 1 ) fesdTrackCuts->SetPtRange( 3. , 4. );
+  fesdTrackCuts->SetAcceptKinkDaughters(kFALSE);
+  fesdTrackCuts->SetRequireSigmaToVertex(kFALSE);
+  fesdTrackCuts->SetDCAToVertex2D(kFALSE);
+  fesdTrackCuts->SetMaxDCAToVertexZ(3.);
+  fesdTrackCuts->SetMaxDCAToVertexXY(1.);
+  fesdTrackCuts->SetEtaRange( -0.8 , 0.8 );
+
+  //ITS
+  fesdTrackCuts->SetRequireITSRefit(kTRUE);
+  fesdTrackCuts->SetMinNClustersITS(3);
+  if(cutDefinition == 6)fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kBoth); 
+  else fesdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst);
+
+
+  //TPC
+  fesdTrackCuts->SetRequireTPCRefit(kTRUE);
+  fesdTrackCuts->SetMinNClustersTPC(80);
+  fesdTrackCuts->SetMinNCrossedRowsTPC(100);
+  fesdTrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.5);
+  fesdTrackCuts->SetMaxChi2PerClusterTPC(4);
+  return fesdTrackCuts;
+
+
+}
+*/
+//______________________________________________________________________________________
+void InitHistograms(AliDielectron *die, Int_t cutDefinition)
+{
+  //
+  // Initialise the histograms
+  //
+  
+  //Setup histogram classes
+  AliDielectronHistos *histos=
+    new AliDielectronHistos(die->GetName(),
+                            die->GetTitle());
+  
+
+
+  //Initialise histogram classes
+  histos->SetReservedWords("Track;Pair");
+  
+  //Event class
+  histos->AddClass("Event");
+  
+
+  //Track classes
+  //to fill also track info from 2nd event loop until 2
+  for (Int_t i=0; i<2; ++i){
+    histos->AddClass(Form("Track_%s",AliDielectron::TrackClassName(i)));
+  }
+  
+  //Pair classes
+  // to fill also mixed event histograms loop until 10
+
+  for (Int_t i=0; i<3; ++i){
+    histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(i)));
+
+  }
+
+  if(kMix){
+  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(3))); //ME ++
+  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(4)));//ME -+
+  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(6)));//ME +-
+  histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(7))); // ME --
+  }
+
+  if(kRot)histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(10)));//Rot
+
+
+  //add histograms to event class
+  histos->UserHistogram("Event","nEvents","Number of processed events after cuts;Number events",1,0,1,AliDielectronVarManager::kNevents);
+  histos->UserHistogram("Event","ZVertex","ZVertex;ZVertex/cm",480,-12.,12.,AliDielectronVarManager::kZvPrim);
+  histos->UserHistogram("Event","nESDTracks","ESD tracks;ESD tracks;Number events",100,0,200,AliDielectronVarManager::kTracks);
+  histos->UserHistogram("Event","Nacc","Number of accepted tracks;Number events",100,0,200,AliDielectronVarManager::kNacc);
+  histos->UserHistogram("Event","NVtxContrib","Number of Vertex Contributor;NVtx;Number events",100,0,100,AliDielectronVarManager::kNVtxContrib);
+
+
+  //add histograms to Track classes
+  histos->UserHistogram("Track","P","P;P [GeV];#tracks",500,0.,10.,AliDielectronVarManager::kPIn);
+  histos->UserHistogram("Track","Pt","Pt;Pt [GeV];#tracks",500,0.,10.,AliDielectronVarManager::kPt);
+  histos->UserHistogram("Track","Eta","Eta; Eta ;#tracks",100,-1.,1.,AliDielectronVarManager::kEta);
+  histos->UserHistogram("Track","Phi","Phi; Phi ;#tracks",640,0.,6.4,AliDielectronVarManager::kPhi);
+
+
+  histos->UserHistogram("Track","Eta_phi","Eta vs Phi;Eta;Phi",500,-1.,1.,320,0.,6.4,AliDielectronVarManager::kEta,AliDielectronVarManager::kPhi);
+  histos->UserHistogram("Track","Eta_pt","Eta vs Pt;Eta;Pt",100,-1.,1.,500,0.,10.,AliDielectronVarManager::kEta,AliDielectronVarManager::kPt);
+  histos->UserHistogram("Track","Phi_pt","Phi vs Pt;Phi;Pt",640,0,6.4.,500,0.,10.,AliDielectronVarManager::kPhi,AliDielectronVarManager::kPt);
+
+  //  histos->UserHistogram("Track","ImpParXY_Pt","ImpParXY_Pt; Pt; ÍmpParXY",500,0.,10.,500,-5.,5.,AliDielectronVarManager::kPt,AliDielectronVarManager::kImpactParXY);
+  // histos->UserHistogram("Track","ImpParZ_Pt","ImpParZ_Pt; Pt; ÍmpParZ",500,0.,10.,500,-5.,5.,AliDielectronVarManager::kPt,AliDielectronVarManager::kImpactParZ);
+
+  //track checks (ITS)
+//  histos->UserHistogram("Track","ITSchi2Cl_Mom","ITS Chi2 vs Momentum;Mom;ITS chi2",500,0.,5.,50,0.,5.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSchi2Cl);
+//  histos->UserHistogram("Track","NclsITS_Mom",";Mom;kNclsITS",500,0.,5.,7,0,7,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNclsITS);
+
+  //track checks (TPC)
+  histos->UserHistogram("Track","TPCsignalNfrac_Mom",";fraction TPCSignalN/TPCncls vs Momentum;Mom;TPCSignalN/TPCncls",500,0.,5.,60,0.,1.2,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignalNfrac);
+//  histos->UserHistogram("Track","TPCchi2Cl_Mom","TPC Chi2 vs Momentum;Mom;TPC Chi2",500,0.,10.,100,0,5,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCchi2Cl);
+//  histos->UserHistogram("Track","TPCclsDiff_Mom","kTPCclsDiff vs Momentum;Mom;kTPCclsDiff",500,0.,10.,100,-10,10,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCclsDiff);
+  histos->UserHistogram("Track","FindableTPCcls_Mom","kNFclsTPC vs Momentum;Mom;kNFclsTPC",500,0.,10.,200,0.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNFclsTPC);
+//  histos->UserHistogram("Track","TPCcls_Mom","kNclsTPC vs Momentum;Mom;kNclsTPC",500,0.,10.,200,0.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNclsTPC);
+//  histos->UserHistogram("Track","kNclsSFracTPC_Mom","kNclsSFracTPC vs Momentum;Mom;kTPCclsSFrac",500,0.,10.,1000,0.,1.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNclsSFracTPC);
+  histos->UserHistogram("Track","kNFclsTPCrFrac_Mom","kNFclsTPCrFrac vs Momentum;Mom;kNFclsTPCrFrac",500,0.,10.,60,0.,1.2.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kNFclsTPCrFrac);
+
+  //track checks (TOF)
+  histos->UserHistogram("Track","TOFbeta_Mom","kTOFbeta vs Momentum;Mom;TOFbeta",500,0.,5.,120,0.,1.2,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFbeta);
+//  histos->UserHistogram("Track","TOFPIDBit_Mom","kTOFPIDBit vs Momentum;Mom;TOFPIDbit",500,0.,5.,2,0.,1.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFPIDBit);
+
+  //track checks (PID)
+//  histos->UserHistogram("Track","ITSnSigma_MomPio","ITS number of sigmas Pion vs Momentum;Mom;ITSsigmaPion",500,0.,5.,1000,-20,20,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSnSigmaPio);
+//  histos->UserHistogram("Track","TPCnSigma_MomPio","TPC number of sigmas Pions vs Momentum;Mom;TPCsigmaPion",500,0.,5.,1000,-20,20,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaPio);
+
+//  histos->UserHistogram("Track","ITSnSigma_MomEle","ITS number of sigmas Electrons vs Momentum;Mom;ITSsigmaEle",500,0.,5.,800,-40,40,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSnSigmaEle);
+  histos->UserHistogram("Track","TPCnSigma_MomEle","TPC number of sigmas Electrons vs Momentum;Mom;TPCsigmaEle",1000,0.,10.,800,-40,40,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle);
+  histos->UserHistogram("Track","TPCnSigma_TOFnSigma","TPC number of sigmas Electrons vs TOF sigma;TOFsigma;TPCsigmaEle",800,-40.,40.,800,-40,40,AliDielectronVarManager::kTOFnSigmaEle,AliDielectronVarManager::kTPCnSigmaEle);
+  histos->UserHistogram("Track","TPCnSigma_Eta","TPC number of sigmas Electrons vs Eta;Eta;TPCsigmaEle",800,-0.8.,0.8.,800,-40,40,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaEle);
+  histos->UserHistogram("Track","TPCdEdx_Eta","TPC dEdx vs Eta;Eta;TPCsigmaEle",800,-0.8,0.8,800,0,200,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCsignal);
+  histos->UserHistogram("Track","TPCnSigma_Phi","TPC number of sigmas Electrons vs Phi;Phi;TPCsigmaEle",640,0.,6.4,800,-40,40,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCnSigmaEle);
+  histos->UserHistogram("Track","TPCdEdx_Phi","TPC dEdx vs Phi;Phi;TPCsigmaEle",640,0.,6.4,800,0,200,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCsignal);
+
+
+
+//  histos->UserHistogram("Track","TOFnSigma_MomEle","TOF number of sigmas Electrons vs Momentum;Mom;TOFsigmaEle",500,0.,5.,800,-40,40,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTOFnSigmaEle);
+
+//  histos->UserHistogram("Track","ITSdEdx_P","dEdx;P [GeV];ITS signal (arb units) vs Momentum;Mom;ITSsignal", 500,0,5,800,0,200,AliDielectronVarManager::kPIn,AliDielectronVarManager::kITSsignal);
+  histos->UserHistogram("Track","TPCdEdx_P","dEdx;P [GeV];TPC signal (arb units) vs Momentum;Mom;TPCsignal", 500,0,10.,800,0,200,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal);
+
+  //
+  //add histograms to Pair classes
+  //
+
+  histos->UserHistogram("Pair","InvMass","Inv.Mass;Inv. Mass [GeV];#pairs",
+                        500,0,4,AliDielectronVarManager::kM);
+
+  histos->UserHistogram("Pair","InvMass_low","Inv.Mass;Inv. Mass [GeV];#pairs",
+                        500,0,0.5,AliDielectronVarManager::kM);
+
+//  histos->UserHistogram("Pair","InvMass10","Inv.Mass;Inv. Mass [GeV];#pairs",
+//                        500,0.,5.,AliDielectronVarManager::kM);
+
+  histos->UserHistogram("Pair","kDeltaEta","kDeltaEta;kDeltaEta;#pairs",
+                        160,0.,1.6,AliDielectronVarManager::kDeltaEta);
+
+  histos->UserHistogram("Pair","kDeltaEta_low","kDeltaEta;kDeltaEta;#pairs",
+                        500,0.,0.5,AliDielectronVarManager::kDeltaEta);
+
+  histos->UserHistogram("Pair","kDeltaPhi","kDeltaPhi;kDeltaPhi;#pairs",
+                        320,0.,6.4,AliDielectronVarManager::kDeltaPhi);
+
+  histos->UserHistogram("Pair",
+                        "kDeltaEta_kDeltaPhi","kDeltaEta_kDeltaPhi;kDeltaEta;kDeltaPhi",
+                        160, 0. , 1.6, 320 , 0., 6.4 ,
+                       AliDielectronVarManager::kDeltaEta , AliDielectronVarManager::kDeltaPhi );
+
+  histos->UserHistogram("Pair",
+                        "Phi","Phi;counts;Phi",
+                        320, 0. , 6.4, AliDielectronVarManager::kPhi);
+
+  histos->UserHistogram("Pair",
+                        "Y","Y;counts;Y",
+                        120, -1.2 , 1.2, AliDielectronVarManager::kY);
+
+
+  histos->UserHistogram("Pair","PhiV",";PhiV;#pairs",
+                        320,0.,6.4,AliDielectronVarManager::kPhivPair);
+
+  histos->UserHistogram("Pair",
+                        "OpAngle","Opening angle;Opening angle;#pairs",
+                        320, 0. , 3.2, 
+                         AliDielectronVarManager::kOpeningAngle);
+
+
+//   histos->UserHistogram("Pair","PhiV_Pt",";Pt;PhiV",
+//                      100,0.,10.,320,0.,6.4,AliDielectronVarManager::kPt,AliDielectronVarManager::kPhivPair);
+
+   histos->UserHistogram("Pair","InvMass_bin2","Inv.Mass;Inv. Mass [GeV];#pairs",
+       "0. , 0.025, 0.05 , 0.075 ,0.1 ,0.15 , 0.2 , 0.25 , 0.3 , 
+       0.4 ,  0.5 , 0.6, 0.65 , 0.688 , 0.725, 0.75, 0.775, 0.8 , 0.85 ,
+        0.95,  0.975 , 1.0 , 1.025 , 1.05, 1.125 , 1.25 , 1.5 , 1.75 , 2.0 , 
+       2.25, 2.5 , 2.75 , 2.85, 2.95,3.05, 3.1 , 3.15 , 
+       3.3 , 3.5, 3.75 , 4.0",AliDielectronVarManager::kM);
+
+  histos->UserHistogram("Pair",
+                        "Eta_Phi","Eta_Phi;Eta;Phi",
+                        360, -0.8 , 0.8., 320 , 0., 3.2. ,
+                       AliDielectronVarManager::kEta , AliDielectronVarManager::kPhi );
+
+  histos->UserHistogram("Pair",
+                        "InvMass_Pt","InvMass_Pt;InvMass;Pt",
+                        500, 0. , 4., 100 , 0., 5. ,
+                       AliDielectronVarManager::kM , AliDielectronVarManager::kPt );
+  histos->UserHistogram("Pair",
+                        "InvMass_deltaphi","InvMass_deltaphi;InvMass;deltaphi",
+                        500, 0. , 4., 320 , 0., 6.4 ,
+                       AliDielectronVarManager::kM , AliDielectronVarManager::kDeltaPhi );
+
+
+  histos->UserHistogram("Pair",
+                        "InvMass_PhivPair","InvMass_PhivPair;InvMass;PhivPair",
+                        500, 0. , 4., 320 , 0., 3.2 ,
+                         AliDielectronVarManager::kM , AliDielectronVarManager::kPhivPair );
+
+
+  histos->UserHistogram("Pair",
+                        "OpAngle_InvMass","OpAngle_InvMass;Opening angle;Invariant Mass",
+                        320, 0. , 3.2, 500 , 0. , 4. ,
+                         AliDielectronVarManager::kOpeningAngle,AliDielectronVarManager::kM);
+
+  histos->UserHistogram("Pair",
+                        "Phi_InvMass","Phi_InvMass;Phi;Invariant Mass",
+                        320, 0. , 6.4, 500 , 0. , 4. ,
+                         AliDielectronVarManager::kPhi,AliDielectronVarManager::kM);
+
+
+
+  die->SetHistogramManager(histos);
+
+}
+
+
+
+
+void InitCF(AliDielectron* die, Int_t cutDefinition)
+{
+  //
+  // Setup the CF Manager if needed
+  //
+  
+  AliDielectronCF *cf=new AliDielectronCF(die->GetName(),die->GetTitle());
+
+    
+   //pair variables
+//  cf->AddVariable(AliDielectronVarManager::kM,500,0.,4.);
+  cf->AddVariable(AliDielectronVarManager::kM,"0. , 0.025, 0.05 , 0.075 ,0.1 ,0.15 , 0.2 , 0.25 , 0.3 , 
+       0.4 ,  0.5 , 0.6, 0.65 , 0.688 , 0.725, 0.75, 0.775, 0.8 , 0.85 ,
+        0.95,  0.975 , 1.0 , 1.025 , 1.05, 1.125 , 1.25 , 1.5 , 1.75 , 2.0 , 
+       2.25, 2.5 , 2.75 , 2.85, 2.95,3.05, 3.1 , 3.15 , 
+       3.3 , 3.5, 3.75 , 4.0");//data
+  cf->AddVariable(AliDielectronVarManager::kY,20,-1.,1.);
+  cf->AddVariable(AliDielectronVarManager::kPhi,32, 0., 3.2);
+  cf->AddVariable(AliDielectronVarManager::kPt,100,0.,5.);
+
+
+  cf->AddVariable(AliDielectronVarManager::kOpeningAngle,62,0.,6.2);
+  cf->AddVariable(AliDielectronVarManager::kPhivPair,64, 0., 6.4);
+  cf->AddVariable(AliDielectronVarManager::kPairType,4,-0.5,3.5);
+  
+  
+  
+  //leg 
+  cf->AddVariable(AliDielectronVarManager::kPt,100,0.,10.,kTRUE);
+  cf->AddVariable(AliDielectronVarManager::kPhi,36,0.,360.,kTRUE);
+  cf->AddVariable(AliDielectronVarManager::kEta,100,-1.,1.,kTRUE);
+
+  
+/*  
+  cf->AddVariable(AliDielectronVarManager::kTPCsignal,200,0.,200.,kTRUE);
+  cf->AddVariable(AliDielectronVarManager::kImpactParXY,40,-2.,2.,kTRUE);
+  cf->AddVariable(AliDielectronVarManager::kImpactParZ,40,-2.,2.,kTRUE);
+  cf->AddVariable(AliDielectronVarManager::kNclsITS,10,0.,10.,kTRUE);
+  cf->AddVariable(AliDielectronVarManager::kNFclsTPCrFrac,10,0.,1.,kTRUE);
+*/
+
+
+  die->SetCFManagerPair(cf);
+  
+}
+
+
+
+
+
+