enabling usage of several jet finders within one train (UE), changing cone radius...
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Dec 2009 07:17:08 +0000 (07:17 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Dec 2009 07:17:08 +0000 (07:17 +0000)
PWG4/macros/AddTaskJets.C
PWG4/macros/AddTaskUE.C

index 7fca31d..0c05745 100644 (file)
@@ -59,8 +59,8 @@ Int_t AddTaskJetsDelta(char *nonStdFile,UInt_t filterMask,Bool_t kUseAODMC){
 \r
 \r
   const char *cJF[9]        = {"UA1","UA1","UA1","CDF","DA","SISCONE","FASTJET","FASTKT","UA1LO"};\r
-  const Float_t radius[9]   = {  0.4,  0.7,  1.0,  0.7, 0.7,      0.4,      0.4,     0.4,    0.4};\r
-  UInt_t  flag[9]           = {    6,    7,    7,    7,   7,        7,        7,       7,       7};\r
+  const Float_t radius[9]   = {  0.4,  0.7,  1.0,  0.7, 0.7,      0.4,      0.4,     0.4,    0.7};\r
+  UInt_t  flag[9]           = {    6,    7,    7,    7,   7,        7,        7,       7,      7};\r
   // flag[5] = 0; // set siscone to 0 for proof mode...\r
   // flag first bit AOD, second bit AODMC2 third bit AODMC2\r
   // i.e. 7 all, 6 only MC2 and MC\r
index c958188..e337bc3 100644 (file)
@@ -1,7 +1,11 @@
 \r
-void ConfigTaskUE(AliAnalysisTaskUE * ueana); // common config, extend with different cases\r
-                  \r
-AliAnalysisTaskUE *AddTaskUE(char *jetBranch = "")\r
+\r
+void ConfigTaskUE(AliAnalysisTaskUE * ueana );          // common config, extend with different cases\r
+void SetTrackCuts(AliAnalysisTaskUE * ueana, Char_t *ct);              //can be extended                 \r
+void SetAnaTopology(AliAnalysisTaskUE * ueana, Char_t *at);    //can be extended                  \r
+void SetRegionType(AliAnalysisTaskUE * ueana, Char_t *rt);     //can be extended                  \r
+\r
+AliAnalysisTaskUE *AddTaskUE(Char_t *jetBranch = "jets",Char_t *cuts = "ALICE", Char_t *anaTopology="LJ", Char_t *regionType="TRANSV")\r
 {\r
 // Creates a jet fider task, configures it and adds it to the analysis manager.\r
 \r
@@ -23,15 +27,26 @@ AliAnalysisTaskUE *AddTaskUE(char *jetBranch = "")
    // Create the task and configure it.\r
    //===========================================================================\r
    \r
-   AliAnalysisTaskUE* ueana = new  AliAnalysisTaskUE("Underlying Event");\r
-   ConfigTaskUE(ueana);\r
-\r
    TString jb(jetBranch);\r
+   TString ct(cuts);\r
+   TString at(anaTopology);\r
+   TString rt(regionType);\r
+   TString name(Form("%s_%s_%s_%s",jb.Data(),ct.Data(),at.Data(),rt.Data()));\r
+   \r
+   AliAnalysisTaskUE* ueana = new  AliAnalysisTaskUE(Form("UEAnalysis_%s",name.Data()));\r
+   ueana->SelectAODBranch(jb.Data());\r
+   ConfigTaskUE(ueana);\r
+   SetTrackCuts(ueana,cuts);\r
+   SetAnaTopology(ueana,anaTopology);\r
+   SetRegionType(ueana,regionType);\r
 \r
+   //  ***** to be fixed *******\r
+   /*\r
    if(jb.Length()>0){\r
      ueana->ReadDeltaAOD(kTRUE);\r
      ueana->SelectDeltaAODBranch(jb.Data());\r
    }\r
+   */\r
 \r
    mgr->AddTask(ueana);\r
    \r
@@ -40,7 +55,7 @@ AliAnalysisTaskUE *AddTaskUE(char *jetBranch = "")
    //==============================================================================\r
    AliAnalysisDataContainer *coutput1_UE = 0;\r
    if(jb.Length()==0)coutput1_UE = mgr->CreateContainer("histosUE", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_UE",AliAnalysisManager::GetCommonFileName()));\r
-   else coutput1_UE = mgr->CreateContainer(Form("histosUE_%s",jb.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_UE_%s",AliAnalysisManager::GetCommonFileName(),jb.Data()));\r
+   else coutput1_UE = mgr->CreateContainer(Form("histosUE_%s",name.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_UE_%s",AliAnalysisManager::GetCommonFileName(),name.Data()));\r
    \r
    mgr->ConnectInput  (ueana, 0, mgr->GetCommonInputContainer());\r
    mgr->ConnectOutput (ueana,     0, coutput1_UE );\r
@@ -49,24 +64,74 @@ AliAnalysisTaskUE *AddTaskUE(char *jetBranch = "")
 }\r
 \r
 void ConfigTaskUE(AliAnalysisTaskUE * ueana){\r
-  // common config, extend with different cases\r
-  Int_t anaType =1; \r
-  Int_t regType =1;\r
-  Double_t jetEtaCut=0.5;\r
-  Double_t trackPtCut=0.1;\r
-  Double_t trackEtaCut= 0.9;\r
-  Double_t rad=0.4;\r
-  Double_t deltaPhiCut = 2.616;\r
+  // common config,\r
   ueana->SelectTrigger(AliAnalysisHelperJetTasks::kMB1);\r
-  ueana->SetFilterBit(16);\r
   ueana->SetDebugLevel(0); \r
   ueana->SetPtRangeInHist(25, 0., 50.);\r
-  ueana->SetAnaTopology(anaType);      \r
-  ueana->SetRegionType(regType);        \r
-  ueana->SetJet1EtaCut(jetEtaCut);     \r
-  ueana->SetTrackPtCut(trackPtCut); \r
   ueana->SetPtSumOrdering(2);\r
-  ueana->SetConeRadius(rad);   \r
-  ueana->SetTrackEtaCut(trackEtaCut);\r
-  ueana->SetJet2DeltaPhiCut(deltaPhiCut);\r
 }\r
+\r
+//------------------------------------------------------------------------\r
+SetTrackCuts(AliAnalysisTaskUE * ueana, Char_t *ct){\r
+  \r
+  ueana->SetFilterBit(16); // ITS refit\r
+\r
+  switch (ct) {\r
+       case "ALICE":\r
+       ueana->SetTrackPtCut(0.1);\r
+       ueana->SetTrackEtaCut(0.9);\r
+       break;\r
+  \r
+       case "CDF":\r
+       ueana->SetTrackPtCut(0.4);\r
+       ueana->SetTrackEtaCut(1.2); // meaningful only for pure MC\r
+        break;\r
+\r
+       default:\r
+       Printf("\n >>>>>>> AddTaskUE Error Wrong Set of Track Cuts selected\n");\r
+       break;\r
+  }\r
+}\r
+\r
+//------------------------------------------------------------------------\r
+//------------------------------------------------------------------------\r
+SetAnaTopology(AliAnalysisTaskUE * ueana, Char_t *at){\r
+\r
+  switch (at) {\r
+       case "LJ":  // leading jet\r
+        ueana->SetAnaTopology(1);      \r
+        ueana->SetJet1EtaCut(0.5);     \r
+       break;\r
+  \r
+       case "BB":  // back-to-back\r
+        ueana->SetAnaTopology(2);      \r
+        ueana->SetJet1EtaCut(0.5);     \r
+        ueana->SetJet2DeltaPhiCut(2.616);\r
+        break;\r
+\r
+       default:\r
+       Printf("\n >>>>>>> AddTaskUE Error Wrong Analysis Topology selected\n");\r
+       break;\r
+  }\r
+\r
+}\r
+\r
+//------------------------------------------------------------------------\r
+SetRegionType(AliAnalysisTaskUE * ueana, Char_t *rt){\r
+\r
+  switch (rt) {\r
+       case "TRANSV":  \r
+        ueana->SetRegionType(1);        \r
+       break;\r
+  \r
+       case "CONE":\r
+        ueana->SetRegionType(2);        \r
+        ueana->SetConeRadius(0.4);   \r
+        break;\r
+\r
+       default:\r
+       Printf("\n >>>>>>> AddTaskUE Error Wrong Region Type selected\n");\r
+       break;\r
+  }\r
+}  \r
+\r