]>
Commit | Line | Data |
---|---|---|
fbe4a5ad | 1 | #ifndef __CINT__//| |
2 | #include <AliAnalysisManager.h>//| | |
3 | #include <AliMultiInputEventHandler.h>//| | |
4 | #include <EventMixing/EventMixing/AliMixEventPool.h>//| | |
5 | #include <EventMixing/EventMixing/AliMixEventCutObj.h>//| | |
6 | #include <EventMixing/EventMixing/AliMixInputEventHandler.h>//| | |
7 | #include <AliVEvent.h>//| | |
8 | #endif//| | |
9 | ||
e4720541 | 10 | void AddMixingHandler(Double_t centMin = 70, Double_t centMax = 80, Double_t centStep = 2, Bool_t bAOD = kTRUE, Bool_t useMC = kFALSE, Bool_t usePhysSel = kTRUE, Bool_t bCentralTrigger = kFALSE, TString opts = "") |
fbe4a5ad | 11 | { |
cb1426c4 | 12 | |
13 | AliESDInputHandler *esdInputHandler = 0; | |
14 | AliAODInputHandler *aodInputHandler = 0; | |
15 | AliMCEventHandler *mcInputHandler = 0; | |
16 | ||
17 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
18 | ||
19 | AliMultiInputEventHandler *multiInputHandler = new AliMultiInputEventHandler(); | |
20 | mgr->SetInputEventHandler(multiInputHandler); | |
21 | ||
22 | if (!bAOD) { | |
23 | esdInputHandler = new AliESDInputHandler(); | |
24 | multiInputHandler->AddInputEventHandler(esdInputHandler); | |
25 | //centralityInputHandler = new AliCentralityInputHandler(); | |
26 | //multiInputHandler->AddInputEventHandler(centralityInputHandler); | |
27 | if (bMCtruth) { | |
28 | mcInputHandler = new AliMCEventHandler(); | |
29 | multiInputHandler->AddInputEventHandler(mcInputHandler); | |
30 | // Not reading track references | |
31 | mchandler->SetReadTR(kFALSE); | |
32 | } | |
33 | } else if (bAOD) { | |
34 | aodInputHandler = new AliAODInputHandler(); | |
35 | multiInputHandler->AddInputEventHandler(aodInputHandler); | |
36 | } else { | |
37 | Printf("Error: Only ESD and AOD input format is supported !!!"); | |
e4720541 | 38 | return; |
cb1426c4 | 39 | } |
fbe4a5ad | 40 | |
41 | if (!multiInputHandler) return; | |
42 | ||
fbe4a5ad | 43 | const Int_t bufferSize = 1; |
44 | const Int_t mixNum = 5; | |
45 | AliMixInputEventHandler *mixHandler = new AliMixInputEventHandler(bufferSize, mixNum); | |
46 | mixHandler->SetInputHandlerForMixing(dynamic_cast<AliMultiInputEventHandler*>(mgr->GetInputEventHandler())); | |
47 | AliMixEventPool *evPool = new AliMixEventPool(); | |
48 | ||
49 | //AliMixEventCutObj *multi = new AliMixEventCutObj(AliMixEventCutObj::kMultiplicity, 2, 10002, 10000); | |
50 | AliMixEventCutObj *zvertex = new AliMixEventCutObj(AliMixEventCutObj::kZVertex, -10, 10, 5); | |
51 | ||
52 | AliMixEventCutObj *centrality = new AliMixEventCutObj(AliMixEventCutObj::kCentrality, centMin, centMax, centStep, "V0M"); | |
53 | ||
54 | evPool->AddCut(centrality); | |
55 | //evPool->AddCut(multi); | |
56 | evPool->AddCut(zvertex); | |
57 | ||
58 | // adds event pool (comment it and u will have default mixing) | |
59 | mixHandler->SetEventPool(evPool); | |
60 | ||
61 | // only use events with physics selection | |
e4720541 | 62 | if (usePhysSel){ |
63 | if (bCentralTrigger){ | |
64 | mixHandler->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral); | |
65 | } | |
66 | else{ | |
67 | mixHandler->SelectCollisionCandidates(AliVEvent::kMB); | |
68 | } | |
69 | } | |
70 | ||
fbe4a5ad | 71 | multiInputHandler->AddInputEventHandler(mixHandler); |
72 | ||
73 | } |