updates for differnt jet configs (including background), reduced number of UA1 Jets
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Dec 2010 12:20:49 +0000 (12:20 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Dec 2010 12:20:49 +0000 (12:20 +0000)
PWG4/JetTasks/AliAnalysisTaskJetServices.cxx
PWG4/macros/AddTaskESDFilterPWG4Train.C
PWG4/macros/AddTaskJetCluster.C
PWG4/macros/AddTaskJets.C
PWG4/macros/AnalysisTrainPWG4Jets.C

index 38cfd1c..64ace5a 100644 (file)
@@ -268,12 +268,12 @@ void AliAnalysisTaskJetServices::UserCreateOutputObjects()
      if (fDebug > 1) AliInfo("Replicating header");
      fgAODHeader = new AliAODHeader;
      AddAODBranch("AliAODHeader",&fgAODHeader,fNonStdFile.Data());
-     /*
-     if (fDebug > 1) AliInfo("Replicating vertices");
-     fgAODVertices = new TClonesArray("AliAODVertex",2);
+     if (fDebug > 1) AliInfo("Replicating primary vertices");
+
+     fgAODVertices = new TClonesArray("AliAODVertex",3);
      fgAODVertices->SetName("vertices");
-     AddAODBranch("AliAODHeader",&fgAODVertices,fNonStdFile.Data());
-     */
+     AddAODBranch("TClonesArray",&fgAODVertices,fNonStdFile.Data());
+
   }
 }
 
@@ -529,11 +529,46 @@ void AliAnalysisTaskJetServices::UserExec(Option_t */*option*/)
       Printf("%p",fgAODVertices->At(0));
       fgAODVertices->Delete();
       TClonesArray &vertices = *fgAODVertices;
-
       const AliAODVertex *vtxAOD = aod->GetPrimaryVertex();
-      AliAODVertex *primary = new (&vertices[0]) AliAODVertex();
-      primary->SetName(vtxAOD->GetName());
-      primary->SetTitle(vtxAOD->GetTitle());
+      // we only use some basic information, 
+      
+
+      Double_t pos[3];
+      Double_t covVtx[6];
+
+      vtxAOD->GetXYZ(pos); // position                                                                
+      vtxAOD->GetCovMatrix(covVtx); //covariance matrix                                                      
+      Int_t jVertices = 0;
+      AliAODVertex * vtx = new(vertices[jVertices++])
+        AliAODVertex(pos, covVtx, vtxAOD->GetChi2perNDF(), NULL, -1, AliAODVertex::kPrimary);
+      vtx->SetName(vtxAOD->GetName());
+      vtx->SetTitle(vtxAOD->GetTitle());
+
+      TString vtitle = vtxAOD->GetTitle();
+      if (!vtitle.Contains("VertexerTracks"))
+       vtx->SetNContributors(vtxAOD->GetNContributors());
+
+      // Add SPD "main" vertex                                                                    
+      const AliAODVertex *vtxS = aod->GetPrimaryVertexSPD();
+      vtxS->GetXYZ(pos); // position
+      vtxS->GetCovMatrix(covVtx); //covariance matrix                                                      
+      AliAODVertex * mVSPD = new(vertices[jVertices++])
+       AliAODVertex(pos, covVtx, vtxS->GetChi2perNDF(), NULL, -1, AliAODVertex::kMainSPD);
+      mVSPD->SetName(vtxS->GetName());
+      mVSPD->SetTitle(vtxS->GetTitle());
+      mVSPD->SetNContributors(vtxS->GetNContributors());
+      
+      // Add tpc only vertex
+      if(esd){
+       const AliESDVertex *vtxT =  esd->GetPrimaryVertexTPC();
+       vtxT->GetXYZ(pos); // position                                                    
+       vtxT->GetCovMatrix(covVtx); //covariance matrix                                               
+       AliAODVertex * mVTPC = new(vertices[jVertices++])
+         AliAODVertex(pos, covVtx, vtxT->GetChi2toNDF(), NULL, -1, AliAODVertex::kMainTPC);
+       mVTPC->SetName(vtxT->GetName());
+       mVTPC->SetTitle(vtxT->GetTitle());
+       mVTPC->SetNContributors(vtxT->GetNContributors());
+      }
     }
   }
   
@@ -551,6 +586,7 @@ AliAnalysisTaskJetServices::~AliAnalysisTaskJetServices(){
     fgAODVertices->Delete();
     delete fgAODVertices;
   }
+  if(fgAODHeader)delete fgAODHeader;
 }
 
 
index 710a862..e752530 100644 (file)
@@ -108,6 +108,10 @@ AliAnalysisTaskESDfilter *AddTaskESDFilter(Bool_t useKineFilter=kTRUE,
    esdTrackCutsH4->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
    esdTrackCutsH4->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst);
 
+   // TPC only tracks
+   AliESDtrackCuts* esdTrackCutsTPCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+   esdTrackCutsTPCOnly->SetMinNClustersTPC(70);
+
    // Compose the filter
    AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
    // 1, 1<<0
@@ -128,7 +132,9 @@ AliAnalysisTaskESDfilter *AddTaskESDFilter(Bool_t useKineFilter=kTRUE,
    trackFilter->AddCuts(esdTrackCutsH3);
    // 128 1<<7
    trackFilter->AddCuts(esdTrackCutsH4);
+   // 256 1<<8
+   trackFilter->AddCuts(esdTrackCutsTPCOnly);
+   esdfilter->SetTPCOnlyFilterMask(1<<8);
    // Filter with cuts on V0s
    AliESDv0Cuts*   esdV0Cuts = new AliESDv0Cuts("Standard V0 Cuts pp", "ESD V0 Cuts");
    esdV0Cuts->SetMinRadius(0.2);
@@ -138,10 +144,10 @@ AliAnalysisTaskESDfilter *AddTaskESDFilter(Bool_t useKineFilter=kTRUE,
    esdV0Cuts->SetMaxDcaV0Daughters(1.5);
    esdV0Cuts->SetMinCosinePointingAngle(0.99);
    AliAnalysisFilter* v0Filter = new AliAnalysisFilter("v0Filter");
-   //  v0Filter->AddCuts(esdV0Cuts);
+   v0Filter->AddCuts(esdV0Cuts);
 
    esdfilter->SetTrackFilter(trackFilter);
-   //  esdfilter->SetV0Filter(v0Filter);
+   esdfilter->SetV0Filter(v0Filter);
 
    // Enable writing of Muon AODs
    //   esdmuonfilter->SetWriteMuonAOD(writeMuonAOD);
index 46df495..5520747 100644 (file)
@@ -1,64 +1,73 @@
-AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec = "AOD",char* bGen = "",UInt_t filterMask = 16, UInt_t iPhysicsSelectionFlag = AliVEvent::kMB,Char_t *jf = "KT", Float_t radius = 0.4,Int_t nSkip = 0,Int_t kWriteAOD = kFALSE,char* deltaFile = "");\r
-\r
-\r
-AliAnalysisTaskJetCluster *AddTaskJetClusterDelta(UInt_t filterMask = 16,Bool_t kUseAODMC = kFALSE,UInt_t iPhysicsSelectionFlag = AliVEvent::kMB,Char_t *jf = "KT", UInt_t iFlag){\r
-  AliAnalysisTaskJetCluster *js = 0;\r
-  if(kUseAODMC&&false){// do not use the MC info yet\r
-    if(iFlag&(1<<0))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.00001);\r
-    if(iFlag&(1<<1))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.1);\r
-    if(iFlag&(1<<2))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.2);\r
-    if(iFlag&(1<<4))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.4);\r
-    if(iFlag&(1<<6))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.6);\r
-    if(iFlag&(1<<8))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.8);\r
-    if(iFlag&(1<<10))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,1.0);\r
-  }\r
-  else{\r
-    if(iFlag&(1<<0))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.00001);\r
-    if(iFlag&(1<<1))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.1);\r
-    if(iFlag&(1<<2))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.2);\r
-    if(iFlag&(1<<4))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.4);\r
-    if(iFlag&(1<<6))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.6);\r
-    if(iFlag&(1<<8))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.8);\r
-    if(iFlag&(1<<10))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,1.0);\r
-  }\r
-  \r
-  return js;\r
-}\r
-\r
-\r
-AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filterMask,UInt_t iPhysicsSelectionFlag,Char_t *jf,Float_t radius,Int_t nSkip,Int_t kWriteAOD,char *deltaFile)\r
-{\r
-// Creates a jet fider task, configures it and adds it to the analysis manager.\r
-  TString outputFile(deltaFile);\r
-   // Get the pointer to the existing analysis manager via the static access method.\r
-   //==============================================================================\r
-   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-   if (!mgr) {\r
-      ::Error("AddTaskJetCluster", "No analysis manager to connect to.");\r
-      return NULL;\r
-   }  \r
-   \r
-   // Check the analysis type using the event handlers connected to the analysis manager.\r
-   //==============================================================================\r
-   if (!mgr->GetInputEventHandler()) {\r
-     ::Error("AddTaskJetCluster", "This task requires an input event handler");\r
-      return NULL;\r
+ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec = "AOD",char* bGen = "",UInt_t filterMask = 16, UInt_t iPhysicsSelectionFlag = AliVEvent::kMB,Char_t *jf = "KT", Float_t radius = 0.4,Int_t nSkip = 0,Int_t kWriteAOD = kFALSE,char* deltaFile = "",Float_t ptTrackCut = 0.15);\r
+\r
+ Int_t kBackGroundMode = 0;\r
+ Float_t kPtTrackCut = 0.15;\r
+\r
+ AliAnalysisTaskJetCluster *AddTaskJetClusterDelta(UInt_t filterMask = 16,Bool_t kUseAODMC = kFALSE,UInt_t iPhysicsSelectionFlag = AliVEvent::kMB,Char_t *jf = "KT", UInt_t iFlag){\r
+   AliAnalysisTaskJetCluster *js = 0;\r
+   if(kUseAODMC&&false){// do not use the MC info yet\r
+     if(iFlag&(1<<0))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.00001);\r
+     if(iFlag&(1<<1))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.1);\r
+     if(iFlag&(1<<2))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.2);\r
+     if(iFlag&(1<<4))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.4);\r
+     if(iFlag&(1<<6))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.6);\r
+     if(iFlag&(1<<8))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,0.8);\r
+     if(iFlag&(1<<10))js = AddTaskJetCluster("AOD","AODMC",filterMask,iPhysicsSelectionFlag,jf,1.0);\r
+   }\r
+   else{\r
+     if(iFlag&(1<<0))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.00001);\r
+     if(iFlag&(1<<1))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.1);\r
+     if(iFlag&(1<<2))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.2);\r
+     if(iFlag&(1<<4))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.4);\r
+     if(iFlag&(1<<6))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.6);\r
+     if(iFlag&(1<<8))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,0.8);\r
+     if(iFlag&(1<<10))js = AddTaskJetCluster("AOD","",filterMask,iPhysicsSelectionFlag,jf,1.0);\r
    }\r
 \r
-   TString type = mgr->GetInputEventHandler()->GetDataType();\r
-   TString typeRec(bRec);\r
-   TString typeGen(bGen);\r
-   typeGen.ToUpper();\r
-   typeRec.ToUpper();\r
-   // Create the task and configure it.\r
-   //===========================================================================\r
-\r
-\r
-   char *cRadius = "";\r
-   if(radius>0)cRadius = Form("%02d",(int)((radius+0.01)*10.));\r
-\r
-   \r
-   AliAnalysisTaskJetCluster* pwg4spec = new  AliAnalysisTaskJetCluster(Form("JetCluster_%s_%s_skip%d",jf,cRadius,nSkip));\r
+   return js;\r
+ }\r
+\r
+\r
+ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filterMask,UInt_t iPhysicsSelectionFlag,Char_t *jf,Float_t radius,Int_t nSkip,Int_t kWriteAOD,char *deltaFile,Float_t ptTrackCut)\r
+ {\r
+ // Creates a jet fider task, configures it and adds it to the analysis manager.\r
+   kPtTrackCut = ptTrackCut;\r
+\r
+   TString outputFile(deltaFile);\r
+    // Get the pointer to the existing analysis manager via the static access method.\r
+    //==============================================================================\r
+    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
+    if (!mgr) {\r
+       ::Error("AddTaskJetCluster", "No analysis manager to connect to.");\r
+       return NULL;\r
+    }  \r
+\r
+    // Check the analysis type using the event handlers connected to the analysis manager.\r
+    //==============================================================================\r
+    if (!mgr->GetInputEventHandler()) {\r
+      ::Error("AddTaskJetCluster", "This task requires an input event handler");\r
+       return NULL;\r
+    }\r
+\r
+    TString type = mgr->GetInputEventHandler()->GetDataType();\r
+    TString typeRec(bRec);\r
+    TString typeGen(bGen);\r
+    typeGen.ToUpper();\r
+    typeRec.ToUpper();\r
+    // Create the task and configure it.\r
+    //===========================================================================\r
+\r
+\r
+\r
+\r
+    TString cAdd = "";\r
+    cAdd += Form("%02d_",(int)((radius+0.01)*10.));\r
+    cAdd += Form("B%d",(int)kBackgroundMode);\r
+    cAdd += Form("_Filter%05d",filterMask);\r
+    cAdd += Form("_Cut%05d",(int)(1000.*kPtTrackCut));\r
+    cAdd += Form("_Skip%02d",nSkip);\r
+    Printf("%s %E",cAdd.Data(),kPtTrackCut);\r
+    AliAnalysisTaskJetCluster* pwg4spec = new  AliAnalysisTaskJetCluster(Form("JetCluster_%s%s",jf,cAdd.Data()));\r
       \r
    // or a config file\r
    // pwg4spec->SetAnalysisType(AliAnalysisTaskJetCluster::kAnaMC);\r
@@ -84,7 +93,7 @@ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filte
    }\r
    else if (typeRec.Contains("AOD")) {\r
      pwg4spec->SetTrackTypeRec(AliAnalysisTaskJetCluster::kTrackAOD);\r
-     pwg4spec->SetTrackPtCut(0.15);\r
+     pwg4spec->SetTrackPtCut(kPtTrackCut);\r
    }\r
 \r
 \r
@@ -123,7 +132,7 @@ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filte
    \r
    if(kWriteAOD){\r
      if(outputFile.Length())pwg4spec->SetJetOutputFile(outputFile);\r
-     pwg4spec->SetJetOutputBranch(Form("clusters%s_%s%s",bRec,jf,cRadius));\r
+     pwg4spec->SetJetOutputBranch(Form("clusters%s_%s%s",bRec,jf,cAdd.Data()));\r
      pwg4spec->SetJetOutputMinPt(0); // store only jets / clusters above a certain threshold\r
    }\r
 \r
@@ -136,7 +145,7 @@ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filte
    // Create ONLY the output containers for the data produced by the task.\r
    // Get and connect other common input/output containers via the manager as below\r
    //==============================================================================\r
-   AliAnalysisDataContainer *coutput1_Spec = mgr->CreateContainer(Form("pwg4cluster_%s_%s_%s_%s_skip%d",bRec,bGen,jf,cRadius,nSkip), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_cluster_%s_%s_%s_%s_skip%d",AliAnalysisManager::GetCommonFileName(),bRec,bGen,jf,cRadius,nSkip));\r
+   AliAnalysisDataContainer *coutput1_Spec = mgr->CreateContainer(Form("pwg4cluster_%s_%s_%s%s",bRec,bGen,jf,cAdd.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_cluster_%s_%s_%s%s",AliAnalysisManager::GetCommonFileName(),bRec,bGen,jf,cAdd.Data()));\r
 \r
    mgr->ConnectInput  (pwg4spec, 0, mgr->GetCommonInputContainer());\r
    mgr->ConnectOutput (pwg4spec, 0, mgr->GetCommonOutputContainer());\r
index 25d4cd2..de50905 100644 (file)
@@ -1,10 +1,14 @@
 AliJetReader *CreateJetReader(Char_t *jr,UInt_t filterMask); // Common config\r
 AliJetFinder *CreateJetFinder(Char_t *jf,Float_t radius = -1);\r
 \r
-AliAnalysisTaskJets *AddTaskJets(Char_t *jr, Char_t *jf,Float_t radius = -1,UInt_t filterMask = 0); // for the new AF\r
+AliAnalysisTaskJets *AddTaskJets(Char_t *jr, Char_t *jf,Float_t radius = -1,UInt_t filterMask = 0,Float_t ptTrackMin = 0.15,Int_t iBack = 0); // for the new AF\r
 Int_t AddTaskJetsDelta(char *nonStdFile = "",UInt_t filterMask = 0,Bool_t kUseAODMC = kTRUE,UInt_t runFlag = 1|4|32|128|256);     \r
 AliAnalysisTaskJets *AddTaskJets(UInt_t filterMask = 0);\r
 \r
+Float_t kPtTrackMin = 0.15;\r
+Int_t kBackgroundMode = 0;\r
+\r
+\r
 AliAnalysisTaskJets *AddTaskJets(UInt_t filterMask ){\r
   // fills the standard "jets" branch in the AOD\r
   // need the ESDFilter to run before, to access the AODtracks\r
@@ -92,79 +96,85 @@ Int_t AddTaskJetsDelta(char *nonStdFile,UInt_t filterMask,Bool_t kUseAODMC,UInt_
 \r
 \r
 \r
-AliAnalysisTaskJets *AddTaskJets(Char_t *jr, Char_t *jf, Float_t radius,UInt_t filterMask)\r
+AliAnalysisTaskJets *AddTaskJets(Char_t *jr, Char_t *jf, Float_t radius,UInt_t filterMask,float ptTrackMin,int iBack)\r
 {\r
   // Creates a jet finder task, configures it and adds it to the analysis manager.\r
 \r
-   // Get the pointer to the existing analysis manager via the static access method.\r
-   //==============================================================================\r
-   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-   if (!mgr) {\r
-      ::Error("AddTaskJets", "No analysis manager to connect to.");\r
-      return NULL;\r
-   }  \r
-   \r
-   // Check the analysis type using the event handlers connected to the analysis manager.\r
-   //==============================================================================\r
-   if (!mgr->GetInputEventHandler()) {\r
-      ::Error("AddTaskJets", "This task requires an input event handler");\r
-      return NULL;\r
+  kPtTrackMin = ptTrackMin;\r
+  kBackgroundMode = iBack;\r
+  // Get the pointer to the existing analysis manager via the static access method.\r
+  //==============================================================================\r
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
+  if (!mgr) {\r
+    ::Error("AddTaskJets", "No analysis manager to connect to.");\r
+    return NULL;\r
+  }  \r
+  \r
+  // Check the analysis type using the event handlers connected to the analysis manager.\r
+  //==============================================================================\r
+  if (!mgr->GetInputEventHandler()) {\r
+    ::Error("AddTaskJets", "This task requires an input event handler");\r
+    return NULL;\r
    }\r
-\r
+  \r
   AliAODHandler *aodh = (AliAODHandler*)mgr->GetOutputEventHandler();\r
   if (!aodh) {\r
     ::Error("AddTaskJets", "This task needs an output event handler");\r
     return NULL;\r
   }   \r
+  \r
 \r
-\r
-   // Create the task and configure it.\r
-   //===========================================================================\r
-   AliAnalysisTaskJets *jetana;\r
+  // Create the task and configure it.\r
+  //===========================================================================\r
+  AliAnalysisTaskJets *jetana;\r
    AliJetReader *er = CreateJetReader(jr,filterMask);\r
-    // Define jet header and jet finder\r
+   // Define jet header and jet finder\r
    AliJetFinder *jetFinder = CreateJetFinder(jf,radius);\r
 \r
    if (jetFinder){\r
        if (er) jetFinder->SetJetReader(er);\r
    }\r
 \r
-   char *cRadius = "";\r
-   if(radius>0)cRadius = Form("%02d",(int)((radius+0.01)*10.));\r
 \r
-   jetana = new AliAnalysisTaskJets(Form("JetAnalysis%s_%s%s",jr,jf,cRadius));\r
 \r
    TString cAdd = "";\r
+   cAdd += Form("%02d",(int)((radius+0.01)*10.));\r
+   cAdd += Form("_B%d",(int)((kBackgroundMode)));\r
    cAdd += Form("_Filter%05d",filterMask);\r
+   cAdd += Form("_Cut%05d",(int)((1000.*kPtTrackMin)));\r
+   Printf("%s",cAdd.Data());\r
+   jetana = new AliAnalysisTaskJets(Form("JetAnalysis%s_%s%s",jr,jf,cAdd.Data()));\r
+\r
 \r
    TString c_jr(jr);\r
    c_jr.ToLower();\r
    TString c_jf(jf);\r
    c_jf.ToLower();\r
 \r
+   /*\r
    if(c_jf.CompareTo("ua1")==0 && TMath::Abs(radius-0.4) < 0.01 && c_jr.CompareTo("aod") == 0){\r
      // do nothing, this is the standard jet finder R = 0.4, UA1 on AOD\r
    }\r
    else{\r
-     TString bName =  Form("jets%s_%s%s%s",jr,jf,cRadius,cAdd.Data());\r
-     jetana->SetNonStdBranch(bName.Data());\r
-     Printf("Set jet branchname \"%s\"",bName.Data());\r
+\r
      \r
  }\r
+   */\r
+   TString bName =  Form("jets%s_%s%s",jr,jf,cAdd.Data());\r
+   jetana->SetNonStdBranch(bName.Data());\r
+   Printf("Set jet branchname \"%s\"",bName.Data());\r
 \r
 \r
    AliAnalysisDataContainer *cout_jet = mgr->CreateContainer(\r
-                                                            Form("jethist_%s_%s%s%s",\r
+                                                            Form("jethist_%s_%s%s",\r
                                                                  c_jr.Data(),\r
                                                                  c_jf.Data(),\r
-                                                                 cRadius,\r
                                                                  cAdd.Data()), \r
                                                             TList::Class(),\r
                                                             AliAnalysisManager::kOutputContainer, \r
                                                             Form("%s:PWG4_jethist_%s_%s%s",AliAnalysisManager::GetCommonFileName(),\r
                                                                  c_jr.Data(),\r
                                                                  c_jf.Data(),\r
-                                                                 cRadius,\r
                                                                  cAdd.Data()));\r
 \r
    // Connect jet finder to task.\r
@@ -281,7 +291,7 @@ AliJetFinder *CreateJetFinder(Char_t *jf,Float_t radius){
     jh->BackgMode(0);\r
     jh->SetRadius(0.4);\r
     if(radius>0)jh->SetRadius(radius);\r
-    jh->SetEtSeed(2.);\r
+    jh->SetEtSeed(4.);\r
     jh->SetNAcceptJets(6);\r
     jh->SetLegoNbinPhi(432);\r
     jh->SetLegoNbinEta(274);\r
@@ -290,6 +300,7 @@ AliJetFinder *CreateJetFinder(Char_t *jf,Float_t radius){
     jh->SetMinJetEt(5.);\r
     jh->SetJetEtaMax(1.5);\r
     jh->SetJetEtaMin(-1.5);\r
+    jh->BackgMode(kBackgroundMode);\r
 \r
     jetFinder = new AliUA1JetFinderV1();\r
     if (jh) jetFinder->SetJetHeader(jh);\r
@@ -309,6 +320,7 @@ AliJetFinder *CreateJetFinder(Char_t *jf,Float_t radius){
     jh->SetMinJetEt(1.);\r
     jh->SetJetEtaMax(1.5);\r
     jh->SetJetEtaMin(-1.5);\r
+    jh->BackgMode(kBackgroundMode);\r
 \r
     jetFinder = new AliUA1JetFinderV1();\r
     if (jh) jetFinder->SetJetHeader(jh);\r
@@ -331,6 +343,7 @@ AliJetFinder *CreateJetFinder(Char_t *jf,Float_t radius){
     jh->SetMinJetEt(5.);\r
     jh->SetJetEtaMax(1.5);\r
     jh->SetJetEtaMin(-1.5);\r
+    jh->BackgMode(kBackgroundMode);\r
     jetFinder = new AliUA1JetFinderV1();\r
     if (jh) jetFinder->SetJetHeader(jh);\r
     break;\r
@@ -345,7 +358,7 @@ AliJetFinder *CreateJetFinder(Char_t *jf,Float_t radius){
 \r
 AliJetReader *CreateJetReader(Char_t *jr,UInt_t filterMask){\r
   AliJetReader *er = 0;\r
-  const Float_t ptCut  = 0.15 ; // cut on track p_T\r
+  Float_t ptCut  = kPtTrackMin ; // cut on track p_T\r
   switch (jr) {\r
   case "MC":\r
     AliJetKineReaderHeader *jrh = new AliJetKineReaderHeader();\r
@@ -385,7 +398,7 @@ AliJetReader *CreateJetReader(Char_t *jr,UInt_t filterMask){
   case "AOD":\r
     AliJetAODReaderHeader *jrh = new AliJetAODReaderHeader();\r
     jrh->SetComment("AOD Reader");\r
-    jrh->SetPtCut(0.15); // set low p_T cut of to 150 MeV\r
+    jrh->SetPtCut(ptCut); // set low p_T cut of to 150 MeV\r
     jrh->SetTestFilterMask(32); // Change this one for a different set of cuts\r
     if(filterMask>0)jrh->SetTestFilterMask(filterMask); \r
     // Define reader and set its header\r
index 0d1c27a..46db041 100644 (file)
@@ -387,8 +387,8 @@ void AnalysisTrainPWG4Jets(const char *analysis_mode="local",
 
      // has to run before AOD filter
      gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskCentralitySelection.C");
-     const char* file1="$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_137161_v4.root";
-     const char* file2="$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_137161_v4.root";
+     const char* file1="$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_137161_v5.root";
+     const char* file2="$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_137366_v3.root";
      AliCentralitySelectionTask *taskC = AddTaskCentralitySelection(file1,file2);
       if (!taskC) ::Warning("AnalysisTrainPWG4Jets", "AliCentralitySelectionTask cannot run for this train conditions - EXCLUDED");
    }
@@ -421,10 +421,25 @@ void AnalysisTrainPWG4Jets(const char *analysis_mode="local",
    if (iJETAN) {
       gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskJets.C");
       AliAnalysisTaskJets *taskjets = 0;
-      if(iJETAN&1)taskjets = AddTaskJets(kHighPtFilterMask); 
+      if(iJETAN&1){
+       /*
+       taskjets = AddTaskJets(kHighPtFilterMask); 
+       taskjets->SetName("StandardJets");
+       taskjets->SetNonStdBranch("");
+       */
+      }
       if(iJETAN&2){
-       UInt_t selection = 0;
-       if(!kFillAOD){
+       // Set only few jet finders  backgroudn subtraction w an wo 
+       
+       taskjets = AddTaskJets("AOD","UA1",0.4,kHighPtFilterMask,0.15,0); // low p_T no background subtraction
+       taskjets = AddTaskJets("AOD","UA1",0.4,kHighPtFilterMask,0.15,1); // low p_T background subtraction
+       taskjets = AddTaskJets("AOD","UA1",0.4,kHighPtFilterMask,1,0);     // high p_T no abackground subtraction
+       taskjets = AddTaskJets("AOD","UA1",0.4,kHighPtFilterMask,1,1);     // high p_T abackground subtraction
+
+
+       /*
+         UInt_t selection = 0;
+         if(!kFillAOD){
          selection = 0xffffff&~(1<<13)&~(1<<5)&~(1<<6); // switch OFF DA and all R = 0.7 to save processing time
          selection &= ~(1<<1)&~(1<<2)&~(1<<4)&~(1<<6)&~(1<<8)&~(1<<10)&~(1<<12);
        }
@@ -434,6 +449,7 @@ void AnalysisTrainPWG4Jets(const char *analysis_mode="local",
        }
        AddTaskJetsDelta(kDeltaAODJetName.Data(),kHighPtFilterMask,kUseAODMC,selection); 
        AddTaskJets("AOD","FASTKT",0.2,kHighPtFilterMask); 
+       */
       }
       if (!taskjets) ::Warning("AnalysisTrainPWG4Jets", "AliAnalysisTaskJets cannot run for this train conditions - EXCLUDED");
        if(kDeltaAODJetName.Length()>0)mgr->RegisterExtraFile(kDeltaAODJetName.Data()); 
@@ -451,28 +467,67 @@ void AnalysisTrainPWG4Jets(const char *analysis_mode="local",
      if(iPWG4Cluster&1){
 
        if(kIsPbPb){
-        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.2,0,1, kDeltaAODJetName.Data()); // this one is for the background random jets
+
+        /*
+        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.2,0,1, kDeltaAODJetName.Data(),0.15); // this one is for the background and random jets
         taskCl->SetBackgroundCalc(kTRUE);       
         taskCl->SetGhostEtamax(0.9);
         taskCl->SetCentralityCut(fCenLo,fCenUp);
-        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.4,0,1, kDeltaAODJetName.Data()); // this one is for the background random jets
+        */
+
+        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.4,0,1, kDeltaAODJetName.Data(),0.15); // this one is for the background and random jets
+        taskCl->SetBackgroundCalc(kTRUE);
+        taskCl->SetCentralityCut(fCenLo,fCenUp);
+        taskCl->SetGhostEtamax(0.9);
+
+        taskCl = AddTaskJetCluster("AOD","",256,iPhysicsSelectionFlag,"KT",0.4,0,1, kDeltaAODJetName.Data(),0.15); // this one is for the background and random jets
         taskCl->SetBackgroundCalc(kTRUE);
         taskCl->SetCentralityCut(fCenLo,fCenUp);
         taskCl->SetGhostEtamax(0.9);
+
+
+        /*
+        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.2,0,1, kDeltaAODJetName.Data()); // this one is for the background and random jets
+        taskCl->SetBackgroundCalc(kTRUE);       
+        taskCl->SetGhostEtamax(0.9);
+        taskCl->SetCentralityCut(fCenLo,fCenUp);
+        */
+
+        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.4,0,1, kDeltaAODJetName.Data(),1.); // this one is for the background and random jets
+        taskCl->SetBackgroundCalc(kTRUE);
+        taskCl->SetCentralityCut(fCenLo,fCenUp);
+        taskCl->SetGhostEtamax(0.9);
+
+
        }
        else{
         taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"KT",0.6,0,1,kDeltaAODJetName.Data()); // this one is for the background jets
         taskCl->SetBackgroundCalc(kTRUE);
        }
 
+       /*
        taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"ANTIKT",0.2,0,1,kDeltaAODJetName.Data()); 
        taskCl->SetCentralityCut(fCenLo,fCenUp);
        taskCl->SetBackgroundBranch("jeteventbackground_clustersAOD_KT04");
+       */
+
 
-       taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"ANTIKT",0.4,0,1,kDeltaAODJetName.Data());
+       taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"ANTIKT",0.4,0,1,kDeltaAODJetName.Data(),0.15);
        taskCl->SetCentralityCut(fCenLo,fCenUp);
        taskCl->SetJetTriggerPtCut(40.);//
-       taskCl->SetBackgroundBranch("jeteventbackground_clustersAOD_KT04");
+       taskCl->SetBackgroundBranch("jeteventbackground_clustersAOD_KT04_B1_Filter00144_Cut0150_Skip00");
+
+
+       taskCl = AddTaskJetCluster("AOD","",256,iPhysicsSelectionFlag,"ANTIKT",0.4,0,1,kDeltaAODJetName.Data(),0.15);
+       taskCl->SetCentralityCut(fCenLo,fCenUp);
+       taskCl->SetJetTriggerPtCut(40.);//
+       taskCl->SetBackgroundBranch("jeteventbackground_clustersAOD_KT04_B1_Filter00256_Cut0150_Skip00");
+
+
+
+       taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelectionFlag,"ANTIKT",0.4,0,1,kDeltaAODJetName.Data(),1);
+       taskCl->SetCentralityCut(fCenLo,fCenUp);
+       taskCl->SetBackgroundBranch("jeteventbackground_clustersAOD_KT04_B1_Filter00144_Cut01000_Skip00");
 
 
 
@@ -1224,6 +1279,7 @@ Bool_t LoadCommonLibraries(const char *mode)
             success &= LoadLibrary("AOD", mode, kTRUE);
             success &= LoadLibrary("ANALYSIS", mode, kTRUE);
             success &= LoadLibrary("ANALYSISalice", mode, kTRUE);
+            success &= LoadLibrary("EventMixing", mode,kTRUE);
             success &= LoadLibrary("CORRFW", mode, kTRUE);
          } else {   
             success &= LoadLibrary("libSTEERBase.so", mode);
@@ -1231,6 +1287,7 @@ Bool_t LoadCommonLibraries(const char *mode)
             success &= LoadLibrary("libAOD.so", mode);
             success &= LoadLibrary("libANALYSIS.so", mode);
             success &= LoadLibrary("libANALYSISalice.so", mode);
+            success &= LoadLibrary("libEventMixing.so", mode);
             success &= LoadLibrary("libCORRFW.so", mode);
             gROOT->ProcessLine(".include $ALICE_ROOT/include");
          }   
@@ -1244,6 +1301,7 @@ Bool_t LoadCommonLibraries(const char *mode)
             success &= LoadLibrary("AOD", mode);
             success &= LoadLibrary("ANALYSIS", mode);
             success &= LoadLibrary("ANALYSISalice", mode);
+            success &= LoadLibrary("EventMixing", mode);
             success &= LoadLibrary("CORRFW", mode);
          } else { 
             ires = gProof->EnablePackage(kProofAFversion);