updated jet response taks (B. Bathen)
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Jul 2011 12:27:34 +0000 (12:27 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Jul 2011 12:27:34 +0000 (12:27 +0000)
PWG4/macros/AddTaskJetResponseV2.C

index ea4bdb7..e1605cc 100644 (file)
@@ -1,4 +1,13 @@
-AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Char_t* type = "clusters", Char_t* jf = "FASTKT", Float_t radius = 0.4, UInt_t filterMask = 256 , Float_t ptTrackMin = 0.15, Int_t iBack = 1, Int_t eventClassMin = 1, Int_t eventClassMax = 4, Int_t reactionPlaneBin = -1){
+
+
+AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Char_t* type = "clusters", Char_t* jf = "FASTKT", Float_t radius = 0.4, UInt_t filterMask = 256 , Float_t ptTrackMin = 0.15, Int_t iBack = 1, Int_t eventClassMin = 0, Int_t eventClassMax = 4){
+
+   return AddTaskJetResponseV2(kTRUE, type, jf, radius, filterMask, ptTrackMin, iBack, eventClassMin, eventClassMax);
+
+}
+
+
+AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Bool_t emb = kTRUE, Char_t* type = "clusters", Char_t* jf = "FASTKT", Float_t radius = 0.4, UInt_t filterMask = 256 , Float_t ptTrackMin = 0.15, Int_t iBack = 1, Int_t eventClassMin = 0, Int_t eventClassMax = 4){
 
   Printf("adding task jet response\n");
 
@@ -12,28 +21,57 @@ AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Char_t* type = "clusters", Ch
        return NULL;
     }
 
-    TString suffix = "";
-    suffix += Form("_%s", jf);
-    suffix += Form("%02d", (int)((radius+0.01)*10.));
-    suffix += Form("_B0");                                // no background subtraction for extra-only
-    suffix += Form("_Filter%05d", filterMask);
-    suffix += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
-    if(type=="clusters") suffix += Form("_Skip00");
-
-    TString suffix2 = "";
-    suffix2 += Form("_%s", jf);
-    suffix2 += Form("%02d", (int)((radius+0.01)*10.));
-    suffix2 += Form("_B%d", iBack);
-    suffix2 += Form("_Filter%05d", filterMask);
-    suffix2 += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
-    if(type=="clusters") suffix2 += Form("_Skip00");
-
-    AliAnalysisTaskJetResponseV2 *task = new AliAnalysisTaskJetResponseV2(Form("JetResponseV2%s", suffix2.Data()));
-
-    TString branch1 = Form("%sAODextraonly%s",type, suffix.Data());
+   TString branch1 = "";
+   TString branch2 = "";
+   TString suffix  = "";
+   TString suffix2 = "";
+    
+   if(emb){
+
+      // embedding in HI event
+      
+      suffix += Form("_%s", jf);
+      suffix += Form("%02d", (int)((radius+0.01)*10.));
+      suffix += Form("_B0");                                // no background subtraction for extra-only
+      suffix += Form("_Filter%05d", filterMask);
+      suffix += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
+      if(type=="clusters") suffix += Form("_Skip00");
+      
+      suffix2 += Form("_%s", jf);
+      suffix2 += Form("%02d", (int)((radius+0.01)*10.));
+      suffix2 += Form("_B%d", iBack);
+      suffix2 += Form("_Filter%05d", filterMask);
+      suffix2 += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
+      if(type=="clusters") suffix2 += Form("_Skip00");
+    
+      branch1 = Form("%sAODextraonly%s",type, suffix.Data());
+      branch2 = Form("%sAODextra%s",type, suffix2.Data());
+      
+   } else {
+   
+      // p-p detector response
+      suffix += Form("_%s", jf);
+      suffix += Form("%02d", (int)((radius+0.01)*10.));
+      suffix += Form("_B0");                        
+      suffix += Form("_Filter%05d", filterMask);
+      suffix += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
+      if(type=="clusters") suffix += Form("_Skip00");
+      
+      suffix2 += Form("_%s", jf);
+      suffix2 += Form("%02d", (int)((radius+0.01)*10.));
+      suffix2 += Form("_B0");
+      suffix2 += Form("_Filter%05d", filterMask);
+      suffix2 += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
+      if(type=="clusters") suffix2 += Form("_Skip02");
+      
+      branch1 = Form("%sAODMC2%s",type, suffix.Data()); // MC truth
+      branch2 = Form("%sAOD%s",type, suffix2.Data());    // MC reconstucted
+         
+   }
+   
+   AliAnalysisTaskJetResponseV2 *task = new AliAnalysisTaskJetResponseV2(Form("JetResponseV2%s", suffix2.Data()));
+    
     Printf("Branch1: %s",branch1.Data());
-
-    TString branch2 = Form("%sAODextra%s",type, suffix2.Data());
     Printf("Branch2: %s",branch2.Data());
  
     task->SetBranchNames(branch1,branch2);
@@ -43,24 +81,20 @@ AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Char_t* type = "clusters", Ch
     task->SetEvtClassMax(eventClassMax);
     task->SetCentMin(0.);
     task->SetCentMax(100.);
-    //task->SetJetDeltaEta(0.2);
-    //task->SetJetDeltaPhi(0.2);
-
-    task->SetReactionPlaneBin(reactionPlaneBin);
    
     task->SetJetPtMin(0.);   // min jet pt is implicit a cut on delta pT!!
-    //task->SetJetEtaMin(-.4); // reduced tracking acceptance in
-    //task->SetJetEtaMax(.4);  // LHC10h pass1
 
     //task->SetNMatchJets(1); // leading jets only
 
+    if(!emb){
+       task->SetIsPbPb(kFALSE);
+       task->SetJetPtFractionMin(0.01);
+       task->SetNMatchJets(999);
+    }
 
-    mgr->AddTask(task);
 
+    mgr->AddTask(task);
 
-    if(reactionPlaneBin>=0){
-        suffix2 += Form("_rp%d", reactionPlaneBin);
-    }
 
     AliAnalysisDataContainer *coutputJetResponseV2 = mgr->CreateContainer(
          Form("jetresponseV2_%s%s", type,suffix2.Data()), TList::Class(), AliAnalysisManager::kOutputContainer,