]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/correlationHF/macros/AddTaskDxHFECorrelationME.C
bugfix: filling correct histogram; extension of argument options for configuring...
[u/mrichter/AliRoot.git] / PWGHF / correlationHF / macros / AddTaskDxHFECorrelationME.C
CommitLineData
7162a4fd 1//-*- Mode: C++ -*-
2// $Id$
3
4#ifndef __CINT__
5//#include "AliESDtrackCuts.h"
6//#include "AliAnalysisCuts.h"
7//#include "AliFlowTrackSimple.h" // added as hint for hidden library dependency to libPWGflowBase
8//#include "AliFlowCandidateTrack.h" // added as hint for hidden library dependency to libPWGflowTasks
9//#include "AliCFContainer.h" // added as hint for hidden library dependency to libCORRFW
10//#include "AliAODRecoDecayHF2Prong.h" // added as hint for hidden library dependency to libPWGHFvertexingHF
11#include "AliAnalysisTaskDxHFECorrelation.h"
12#include "AliDxHFECorrelation.h"
13#include "AliAnalysisManager.h"
14#include "AliAnalysisDataContainer.h"
15#include "AliHFEcuts.h"
16#include "AliLog.h"
17#include "TObject.h"
18#include "TClass.h"
19#include "TDirectory.h"
20#include "TROOT.h"
21#include "AliRDHFCutsD0toKpi.h"
22#include "AliHFAssociatedTrackCuts.h"
23using namespace std;
24#endif
25
26
27/// @file AddTaskDxHFECorrelation.C
28/// @author Matthias.Richter@ift.uib.no, Hege.Erdal@ift.uib.no
29/// @date 2013-02-12
30/// @brief Add two instances of D0-HFE correlation task to the manager, SE and ME
31///
32int AddTaskDxHFECorrelationME(TString configuration="")
33{
b4779749 34 //First check to see if user wants to see help
35 if (configuration.BeginsWith("help") ||
36 configuration.BeginsWith("--help") ||
37 configuration.BeginsWith("-h") ||
38 configuration.BeginsWith("options") ) {
39 cout <<"\n\n============================================" << endl;
40 cout << "Keywords for AddTaskDxHFECorrelationME.C:\n"
41 << "file= - Filename to store output in\n"
42 << "name= - Name of analysis, will correspond to directory inside the file \n"
43 << "cutname= - Filename where information on event pool for event-mixing is stored (if use external file)\n"
44 << "runD0MassReference - If you also want to include D2H task for D0selection (for comparison purposes)\n"
45 << "mc - Run on MC\n"
46 << "usekine - To run on kinematical level \n"
47 << "PbPb - To run on PbPb \n"
48 << "trigger=D/D0/electron - Which particle to trigger on \n"
49 << "\nD0 settings: \n"
50 << "fillD0scheme=both/D0/D0bar - Which fillsheme to use for D0\n"
51 << "\nelectron settings: \n"
52 << "useinvmasscut - If you want to use invariant mass cut (default is 100MeV/c)\n"
53 << "invmasscut= - If you want to specify a different invariant mass cut \n"
54 << "extraname= - extraname for directory and list if you run several tasks at once\n"
55 << "tpcclusters= - How many TPC clusters to use on single track cuts for electrons (default=120)\n"
56 << "itsclusters= - How many itsclusters to be used in single track cuts for electrons (default=4) \n"
57 << "itsreq= - (kFirst,kAny,kNone) Which ITSpixel requirement you want to impose\n"
58 << "elmcreco= - (aftertrackcuts/aftertofpid/afterfullpid) Where you want to stop in track selection to look for electrons for mc \n\n";
59 return;
60 }
7162a4fd 61
62 TString taskOptions="";
63 Bool_t nameset=kFALSE;
64 Bool_t triggerset=kFALSE;
b4779749 65 Int_t system=0;
7162a4fd 66 // look for configuration arguments if nothing specified
67 // in the function call
68 if (configuration.IsNull() && gDirectory) {
69 const char* confObjectName="run_single_task_configuration";
70 TObject* confObject=gDirectory->FindObject(confObjectName);
71 if (confObject) {
72 configuration=confObject->GetTitle();
73 }
74 }
75
76 // argument scan
77 // TODO: currently the name and trigger type are fixed, this requirement
78 // can be loosened later
79 TString delimiter(" ");
80 TStringToken configurationToken(configuration, delimiter);
81 while (configurationToken.NextToken()) {
82 TString argument=configurationToken;
83 if (argument.BeginsWith("name=")) {
84 //To remove various instances of name, and force directory to be DxHFE
85 if(!nameset){
b4779749 86 taskOptions+=" "+argument;
7162a4fd 87 nameset=kTRUE;
88 }
89 }
90 //At the moment: Make sure trigger is D0
91 else if (argument.BeginsWith("trigger=")) {
92 if(!triggerset){
93 taskOptions+=" trigger=D0";
94 triggerset=kTRUE;
95 }
96 }
b4779749 97 else if(argument.BeginsWith("PbPb") ||
cc7d7d54 98 argument.BeginsWith("system=1") ||
99 argument.BeginsWith("Pb-Pb")){
b4779749 100 system=1;
ea4660f7 101 taskOptions+=" PbPb";
b4779749 102 }
7162a4fd 103 else {
104 // simply pass argument
105 taskOptions+=" "+argument;
106 }
107 }
b4779749 108 TString path;
ea4660f7 109 path="AddTaskDxHFECorrelation.C";
b4779749 110
111 if (gSystem->AccessPathName(path)!=0) {
112 // first try local macro, than AliRoot default path
ea4660f7 113 path="$ALICE_ROOT/PWGHF/correlationHF/macros/AddTaskDxHFECorrelation.C";
b4779749 114 }
115
116 gROOT->LoadMacro(path);
117
7162a4fd 118 if (!nameset) taskOptions+=" name=DxHFE";
119 if (!taskOptions) taskOptions+=" trigger=D0";
120
ea4660f7 121 if(!AddTaskDxHFECorrelation(taskOptions)) {
122 printf("Problem setting up the single event correlation task, returning\n");
123 return 0;
7162a4fd 124 }
ea4660f7 125
126 taskOptions+=" event-mixing";
127 if(!AddTaskDxHFECorrelation(taskOptions)) {
128 printf("Problem setting up the mixed event correlation task, returning\n");
b4779749 129 return 0;
7162a4fd 130 }
ea4660f7 131
7162a4fd 132 return 1;
133}
134