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