Add setting for selection but (Gian Michele)
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Feb 2012 15:06:19 +0000 (15:06 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Feb 2012 15:06:19 +0000 (15:06 +0000)
PWGHF/vertexingHF/macros/AddTaskDs.C

index 733410c1afbe54e8e4c241a2e360b3fefa00a81f..75cdc14f732d2c6d8f9e9cce3f3a2048afd63874 100644 (file)
@@ -1,87 +1,88 @@
-AliAnalysisTaskSEDs *AddTaskDs(Int_t storeNtuple=0,Bool_t readMC=kFALSE,
-                                    TString filename="DstoKKpiCuts.root")
-{
-  //                                                                                                                                    
-  // Test macro for the AliAnalysisTaskSE for Ds candidates 
-
-  //Invariant mass histogram and                                                 
-  // association with MC truth (using MC info in AOD)                                                                                   
-  // Origin: R. Bala, bala@to.infn.it         
-  // Modified for Ds meson: G.M. Innocenti innocent@to.infn.it
-  // Get the pointer to the existing analysis manager via the static access method.                                                     
-  //==============================================================================                                                      
-
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  if (!mgr) {
-    ::Error("AddTaskDs", "No analysis manager to connect to.");
-  }
-
-
-  TFile* filecuts=TFile::Open(filename.Data());
-  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){
-    cout<<"Error: Input file not found!"<<endl;
-    return 0;
-  }
-  
-  
-  //Analysis Task
-
-  
-  AliRDHFCutsDstoKKpi* analysiscuts=new AliRDHFCutsDstoKKpi();
-  analysiscuts = (AliRDHFCutsDstoKKpi*)filecuts->Get("AnalysisCuts");
-
-  AliRDHFCutsDstoKKpi* prodcuts=new AliRDHFCutsDstoKKpi();
-  prodcuts = (AliRDHFCutsDstoKKpi*)filecuts->Get("ProdCuts");
-  
-  //AliRDHFCutsDstoKKpi *prodcuts = (AliRDHFCutsDstoKKpi*)fileCuts->Get("ProdCuts");
-  //AliRDHFCutsDstoKKpi *analysiscuts = (AliRDHFCutsDstoKKpi*)fileCuts->Get("AnalysisCuts");
-
-  AliAnalysisTaskSEDs *dsTask = new AliAnalysisTaskSEDs("DsAnalysis",prodcuts,analysiscuts,storeNtuple);
-  dsTask->SetReadMC(readMC);
-  //dsTask->SetDoLikeSign(kTRUE);
-  //  dsTask->SetUseTPCpid(kTRUE);
-  //dsTask->SetUseTOFpid(kTRUE);
-  dsTask->SetDebugLevel(10);
-  //dsTask->SetMassLimits(0.2);
-  mgr->AddTask(dsTask);
-  
-  // Create containers for input/output 
-  
-  AliAnalysisDataContainer *cinputDs = mgr->CreateContainer("cinputDs",TChain::Class(),
-                                                              AliAnalysisManager::kInputContainer);
-  TString outputfile = AliAnalysisManager::GetCommonFileName();
-  outputfile += ":PWG3_D2H_InvMassDs";
-  
-  AliAnalysisDataContainer *coutputDsCuts = mgr->CreateContainer("coutputDsCuts",TList::Class(),
-                                                                   AliAnalysisManager::kOutputContainer,
-                                                                   outputfile.Data());
-  
-  AliAnalysisDataContainer *coutputDs = mgr->CreateContainer("coutputDs",TList::Class(),
-                                                               AliAnalysisManager::kOutputContainer,
-                                                               outputfile.Data());
-  AliAnalysisDataContainer *coutputDsNorm = mgr->CreateContainer("coutputDsNorm",AliNormalizationCounter::Class(),
-                                                               AliAnalysisManager::kOutputContainer,
-                                                               outputfile.Data());
-  
-   if(storeNtuple){
-    AliAnalysisDataContainer *coutputDs2 = mgr->CreateContainer("coutputDs2",TNtuple::Class(),
-                                                                  AliAnalysisManager::kOutputContainer,
-                                                                  "InvMassDs_nt1.root");
-    
-    coutputDs2->SetSpecialOutput();
-  }
-  
-  mgr->ConnectInput(dsTask,0,mgr->GetCommonInputContainer());
-  
-  mgr->ConnectOutput(dsTask,1,coutputDs);
-  
-  mgr->ConnectOutput(dsTask,2,coutputDsCuts);
-
-  mgr->ConnectOutput(dsTask,3,coutputDsNorm);  
-  
-  if(storeNtuple){
-    mgr->ConnectOutput(dsTask,4,coutputDs2);
-  }
-  
-  return dsTask;
-}
+AliAnalysisTaskSEDs *AddTaskDs(Int_t storeNtuple=0,Bool_t readMC=kFALSE,\r
+                                    TString filename="DstoKKpiCuts.root")\r
+{\r
+  //                                                                                                                                    \r
+  // Test macro for the AliAnalysisTaskSE for Ds candidates \r
+\r
+  //Invariant mass histogram and                                                 \r
+  // association with MC truth (using MC info in AOD)                                                                                   \r
+  // Origin: R. Bala, bala@to.infn.it         \r
+  // Modified for Ds meson: G.M. Innocenti innocent@to.infn.it\r
+  // Get the pointer to the existing analysis manager via the static access method.                                                     \r
+  //==============================================================================                                                      \r
+\r
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
+  if (!mgr) {\r
+    ::Error("AddTaskDs", "No analysis manager to connect to.");\r
+  }\r
+\r
+\r
+  TFile* filecuts=TFile::Open(filename.Data());\r
+  if(!filecuts ||(filecuts&& !filecuts->IsOpen())){\r
+    cout<<"Error: Input file not found!"<<endl;\r
+    return 0;\r
+  }\r
+  \r
+  \r
+  //Analysis Task\r
+\r
+  \r
+  AliRDHFCutsDstoKKpi* analysiscuts=new AliRDHFCutsDstoKKpi();\r
+  analysiscuts = (AliRDHFCutsDstoKKpi*)filecuts->Get("AnalysisCuts");\r
+\r
+  AliRDHFCutsDstoKKpi* prodcuts=new AliRDHFCutsDstoKKpi();\r
+  prodcuts = (AliRDHFCutsDstoKKpi*)filecuts->Get("ProdCuts");\r
+  \r
+  //AliRDHFCutsDstoKKpi *prodcuts = (AliRDHFCutsDstoKKpi*)fileCuts->Get("ProdCuts");\r
+  //AliRDHFCutsDstoKKpi *analysiscuts = (AliRDHFCutsDstoKKpi*)fileCuts->Get("AnalysisCuts");\r
+\r
+  AliAnalysisTaskSEDs *dsTask = new AliAnalysisTaskSEDs("DsAnalysis",prodcuts,analysiscuts,storeNtuple);\r
+  dsTask->SetReadMC(readMC);\r
+  //dsTask->SetDoLikeSign(kTRUE);\r
+  //  dsTask->SetUseTPCpid(kTRUE);\r
+  //dsTask->SetUseTOFpid(kTRUE);\r
+  dsTask->SetDebugLevel(10);\r
+  dsTask->SetUseSelectionBit(kTRUE);\r
+  //dsTask->SetMassLimits(0.2);\r
+  mgr->AddTask(dsTask);\r
+  \r
+  // Create containers for input/output \r
+  \r
+  AliAnalysisDataContainer *cinputDs = mgr->CreateContainer("cinputDs",TChain::Class(),\r
+                                                              AliAnalysisManager::kInputContainer);\r
+  TString outputfile = AliAnalysisManager::GetCommonFileName();\r
+  outputfile += ":PWG3_D2H_InvMassDs";\r
+  \r
+  AliAnalysisDataContainer *coutputDsCuts = mgr->CreateContainer("coutputDsCuts",TList::Class(),\r
+                                                                   AliAnalysisManager::kOutputContainer,\r
+                                                                   outputfile.Data());\r
+  \r
+  AliAnalysisDataContainer *coutputDs = mgr->CreateContainer("coutputDs",TList::Class(),\r
+                                                               AliAnalysisManager::kOutputContainer,\r
+                                                               outputfile.Data());\r
+  AliAnalysisDataContainer *coutputDsNorm = mgr->CreateContainer("coutputDsNorm",AliNormalizationCounter::Class(),\r
+                                                               AliAnalysisManager::kOutputContainer,\r
+                                                               outputfile.Data());\r
+  \r
+   if(storeNtuple){\r
+    AliAnalysisDataContainer *coutputDs2 = mgr->CreateContainer("coutputDs2",TNtuple::Class(),\r
+                                                                  AliAnalysisManager::kOutputContainer,\r
+                                                                  "InvMassDs_nt1.root");\r
+    \r
+    coutputDs2->SetSpecialOutput();\r
+  }\r
+  \r
+  mgr->ConnectInput(dsTask,0,mgr->GetCommonInputContainer());\r
+  \r
+  mgr->ConnectOutput(dsTask,1,coutputDs);\r
+  \r
+  mgr->ConnectOutput(dsTask,2,coutputDsCuts);\r
+\r
+  mgr->ConnectOutput(dsTask,3,coutputDsNorm);  \r
+  \r
+  if(storeNtuple){\r
+    mgr->ConnectOutput(dsTask,4,coutputDs2);\r
+  }\r
+  \r
+  return dsTask;\r
+}\r