]>
Commit | Line | Data |
---|---|---|
f53e4bfa | 1 | AliAnalysisTask *AddTask_sweber_JPsi_pPb_TRDtrigger(){ |
2 | //get the current analysis manager | |
3 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
4 | if (!mgr) { | |
5 | Error("AddTask_sweber_JPsi_pPb_TRDtrigger", "No analysis manager found."); | |
6 | return 0; | |
7 | } | |
8 | ||
9 | ||
10 | //Do we have an MC handler? | |
11 | Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0); | |
12 | ||
13 | //Get the current train configuration | |
14 | TString trainConfig=gSystem->Getenv("CONFIG_FILE"); | |
15 | ||
16 | //set config file name | |
17 | // TString configFile("$TRAIN_ROOT/mwinn_jpsiCorr/ConfigJpsi2eeData.C"); | |
18 | TString configFile("$ALICE_ROOT/PWGDQ/dielectron/macrosJPSI/ConfigJpsi_sweber_pPb_TRDtrigger.C"); | |
19 | //TString configFile("$TRAIN_ROOT/jpsi_JPSI/ConfigJpsiStandard.C"); | |
20 | // if ( trainConfig.Contains("PbPb") ) configFile="$TRAIN_ROOT/jpsi_JPSI/ConfigJpsi2eePbPb.C"; | |
21 | ||
22 | //if (mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class()){ | |
23 | // ::Info("AddTaskJPSI", "Using AOD configuration"); | |
24 | // configFile="$TRAIN_ROOT/util/dielectron/dielectron/macros/ConfigJpsi2eeDataAOD.C"; | |
25 | // } | |
26 | ||
27 | TString list=gSystem->Getenv("LIST"); | |
28 | //create task and add it to the manager | |
ab38bc9c | 29 | AliAnalysisTaskMultiDielectron *task=new AliAnalysisTaskMultiDielectron("MultiDieDataTRDtrigger"); |
f53e4bfa | 30 | if (!hasMC ) task->UsePhysicsSelection();//taking out for testing |
31 | task->SetTriggerMask(AliVEvent::kTRD); | |
ab38bc9c | 32 | //task->SetTRDtrigger(3); |
33 | task->SetFiredTriggerName("CINT7WUHJT-B-NOPF-CENT",kTRUE);//take not kTRUE in order not to get both triggers, exclude (since not yet otherwise possible) | |
34 | // | |
35 | //not yet implemented to get a logical or of 2 different trigger classes, therefore exclude HJT, not exactly what I want... | |
f53e4bfa | 36 | // if (list.Contains("LHC11d")) task->SetTriggerMask(AliVEvent::kEMCEJE+AliVEvent::kEMC7+AliVEvent::kEMCEGA); |
37 | //if (list.Contains("LHC12h")) task->SetTRDtrigger(1+2); | |
38 | mgr->AddTask(task); | |
39 | ||
40 | ||
41 | //load dielectron configuration file | |
42 | gROOT->LoadMacro(configFile.Data()); | |
43 | ||
44 | //add dielectron analysis with different cuts to the task | |
45 | cout << "!!!!!!!!!!!! nDie = " << nDie << endl; | |
46 | for (Int_t i=0; i<nDie; ++i){ //nDie defined in config file | |
47 | AliDielectron *jpsi=ConfigJpsi_sweber_pPb_TRDtrigger(i); | |
48 | if (!jpsi) continue; | |
49 | task->AddDielectron(jpsi); | |
50 | // printf("add: %s\n",jpsi->GetName()); | |
51 | } | |
52 | ||
53 | //Add event filter | |
54 | AliDielectronEventCuts *eventCuts=new AliDielectronEventCuts("eventCuts","Vertex Track && |vtxZ|<10 && ncontrib>0"); | |
55 | eventCuts->SetRequireVertex();//NOTE: all of these cuts can for some reasons not be applied to self-filtered AODs by mwinn in | |
56 | //(list/hera/alice/mwinn/mwinn/train/lists/...) | |
57 | eventCuts->SetMinVtxContributors(1); | |
58 | eventCuts->SetVertexZ(-10.,10.); | |
59 | // eventCuts->SetVertexType(AliDielectronEventCuts::kVtxTracksOrSPD); | |
60 | // eventCuts->SetRequireV0and(); | |
61 | // if ( trainConfig=="PbPb" ){ | |
62 | // eventCuts->SetCutOnMultipicityITSTPC(); | |
63 | // } | |
64 | task->SetEventFilter(eventCuts); | |
65 | ||
66 | // task->SetTriggerOnV0AND(); | |
67 | if ( trainConfig=="pp" ) task->SetRejectPileup(); | |
68 | ||
69 | //create output container | |
cb35c26f | 70 | TString containerName = "AnalysisResults.root"; |
f53e4bfa | 71 | AliAnalysisDataContainer *coutput1 = |
72 | mgr->CreateContainer("sweber_tree", | |
73 | TTree::Class(), | |
74 | AliAnalysisManager::kExchangeContainer, | |
75 | containerName.Data()); | |
76 | ||
77 | AliAnalysisDataContainer *cOutputHist1 = | |
78 | mgr->CreateContainer("sweber_QA", | |
79 | TList::Class(), | |
80 | AliAnalysisManager::kOutputContainer, | |
81 | containerName.Data()); | |
82 | ||
83 | AliAnalysisDataContainer *cOutputHist2 = | |
84 | mgr->CreateContainer("sweber_CF", | |
85 | TList::Class(), | |
86 | AliAnalysisManager::kOutputContainer, | |
87 | containerName.Data()); | |
88 | ||
89 | AliAnalysisDataContainer *cOutputHist3 = | |
90 | mgr->CreateContainer("sweber_EventStat", | |
91 | TH1D::Class(), | |
92 | AliAnalysisManager::kOutputContainer, | |
93 | containerName.Data()); | |
94 | ||
95 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
96 | mgr->ConnectOutput(task, 0, coutput1 ); | |
97 | mgr->ConnectOutput(task, 1, cOutputHist1); | |
98 | mgr->ConnectOutput(task, 2, cOutputHist2); | |
99 | mgr->ConnectOutput(task, 3, cOutputHist3); | |
100 | ||
101 | return task; | |
102 | } |