]>
Commit | Line | Data |
---|---|---|
ef0426e6 | 1 | AliAnalysisTask *AddTask_jbook_JPsi(TString prod="", Bool_t gridconf=kFALSE) { |
8c06b662 | 2 | //get the current analysis manager |
3 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
4 | if (!mgr) { | |
5 | Error("AddTask_jbook_JPsi", "No analysis manager found."); | |
6 | return 0; | |
7 | } | |
d6aec652 | 8 | |
8c06b662 | 9 | //Do we have an MC handler? |
2d7910f3 | 10 | Bool_t hasMC = kFALSE; |
11 | TString list = gSystem->Getenv("LIST"); | |
12 | if( list.IsNull()) list=prod; | |
13 | if( list.Contains("LHC10h") || list.Contains("LHC11h") ) hasMC=kFALSE; | |
14 | if( list.Contains("LHC11a10") || list.Contains("LHC12a17") ) hasMC=kTRUE; | |
2d7910f3 | 15 | |
8c06b662 | 16 | //Do we have an AOD handler? |
17 | Bool_t isAOD=(mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class() ? kTRUE : kFALSE); | |
94c26f30 | 18 | |
d6aec652 | 19 | // set AOD debug levels |
20 | if(isAOD) { | |
21 | mgr->AddClassDebug("AliAODTrack", AliLog::kFatal); | |
ef0426e6 | 22 | mgr->AddClassDebug("AliAODpidUtil", AliLog::kInfo); |
d6aec652 | 23 | } |
ef0426e6 | 24 | |
8c06b662 | 25 | //set config file name |
94c26f30 | 26 | TString configFile(""); |
27 | printf("%s \n",gSystem->pwd()); | |
28 | TString trainRoot=gSystem->Getenv("TRAIN_ROOT"); | |
29 | if (!trainRoot.IsNull()) | |
30 | configFile="$TRAIN_ROOT/jbook_jpsi/ConfigJpsi_jb_PbPb.C"; // gsi config | |
31 | else if(!gSystem->Exec("alien_cp alien:///alice/cern.ch/user/j/jbook/PWGDQ/dielectron/macrosJPSI/ConfigJpsi_jb_PbPb.C .")) | |
32 | configFile=Form("%s/ConfigJpsi_jb_PbPb.C",gSystem->pwd()); // alien config | |
33 | else | |
34 | configFile="$ALICE_ROOT/PWGDQ/dielectron/macrosJPSI/ConfigJpsi_jb_PbPb.C"; // aliroot config | |
35 | ||
36 | if(!gridconf) | |
37 | configFile="$ALICE_ROOT/PWGDQ/dielectron/macrosJPSI/ConfigJpsi_jb_PbPb.C"; // aliroot config | |
8c06b662 | 38 | |
8c06b662 | 39 | //create task and add it to the manager |
51efbccb | 40 | AliAnalysisTaskMultiDielectron *task; |
94c26f30 | 41 | |
51efbccb | 42 | // trigger selection |
43 | ULong64_t triggers[]={AliVEvent::kCentral , AliVEvent::kSemiCentral , AliVEvent::kMB, | |
44 | AliVEvent::kCentral | AliVEvent::kSemiCentral | AliVEvent::kMB}; | |
45 | const char* triggerNames[]={"Central","SemiCentral","MB","MB+Cent+SemiCent"}; | |
8c06b662 | 46 | |
51efbccb | 47 | // loop over trigger classes |
48 | for(Int_t j=0; j<4; j++) { | |
49 | task = new AliAnalysisTaskMultiDielectron((Form("MultiDieData_%s",triggerNames[j]))); | |
50 | task->SetTriggerMask(triggers[j]); | |
94c26f30 | 51 | |
51efbccb | 52 | //task->SetTriggerMask(AliVEvent::kMB+AliVEvent::kCentral+AliVEvent::kSemiCentral); |
53 | if (!hasMC) task->UsePhysicsSelection(); | |
54 | mgr->AddTask(task); | |
8c06b662 | 55 | |
51efbccb | 56 | //load dielectron configuration file |
57 | TString checkconfig="ConfigJpsi_jb_PbPb"; | |
58 | if (!gROOT->GetListOfGlobalFunctions()->FindObject(checkconfig.Data())) | |
59 | gROOT->LoadMacro(configFile.Data()); | |
8c06b662 | 60 | |
51efbccb | 61 | //add dielectron analysis with different cuts to the task |
62 | for (Int_t i=0; i<6; ++i) { //nDie defined in config file | |
63 | AliDielectron *jpsi=ConfigJpsi_jb_PbPb(i,list); | |
64 | if (jpsi ) task->AddDielectron(jpsi); | |
65 | if (jpsi ) printf("add: %s\n",jpsi->GetName()); | |
66 | } | |
67 | ||
68 | //Add event filter | |
69 | AliDielectronEventCuts *eventCuts=new AliDielectronEventCuts("eventCuts","Vertex Track && |vtxZ|<10 && ncontrib>0"); | |
70 | if (isAOD) eventCuts->SetVertexType(AliDielectronEventCuts::kVtxAny); | |
71 | eventCuts->SetRequireVertex(); | |
72 | eventCuts->SetMinVtxContributors(1); | |
73 | eventCuts->SetVertexZ(-10.,10.); | |
74 | eventCuts->SetCentralityRange(0.0,80.0); | |
75 | task->SetEventFilter(eventCuts); | |
76 | ||
77 | //create output container | |
78 | /* AliAnalysisDataContainer *coutput1 = | |
79 | mgr->CreateContainer("jbook_tree", | |
80 | TTree::Class(), | |
81 | AliAnalysisManager::kExchangeContainer, | |
82 | "jbook_default"); | |
83 | */ | |
84 | AliAnalysisDataContainer *cOutputHist1 = | |
85 | mgr->CreateContainer(Form("jbook_QA_%s",triggerNames[j]), | |
86 | TList::Class(), | |
87 | AliAnalysisManager::kOutputContainer, | |
88 | "jbook.root"); | |
89 | ||
90 | AliAnalysisDataContainer *cOutputHist2 = | |
91 | mgr->CreateContainer(Form("jbook_CF_%s",triggerNames[j]), | |
92 | TList::Class(), | |
93 | AliAnalysisManager::kOutputContainer, | |
94 | "jbook.root"); | |
95 | ||
96 | AliAnalysisDataContainer *cOutputHist3 = | |
97 | mgr->CreateContainer(Form("jbook_EventStat_%s",triggerNames[j]), | |
98 | TH1D::Class(), | |
99 | AliAnalysisManager::kOutputContainer, | |
100 | "jbook.root"); | |
8c06b662 | 101 | |
51efbccb | 102 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); |
103 | // mgr->ConnectOutput(task, 0, coutput1 ); | |
104 | mgr->ConnectOutput(task, 1, cOutputHist1); | |
105 | mgr->ConnectOutput(task, 2, cOutputHist2); | |
106 | mgr->ConnectOutput(task, 3, cOutputHist3); | |
107 | ||
108 | return task; | |
109 | } | |
8c06b662 | 110 | |
8c06b662 | 111 | } |