]>
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 | ||
10 | void AddMixingHandler(Double_t centMin = 70, Double_t centMax = 80, Double_t centStep = 2, AliMultiInputEventHandler* multiInputHandler, Bool_t useMC = kFALSE, Bool_t usePhysSel = kFALSE,TString opts = "") | |
11 | { | |
12 | ||
13 | if (!multiInputHandler) return; | |
14 | ||
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | const Int_t bufferSize = 1; | |
17 | const Int_t mixNum = 5; | |
18 | AliMixInputEventHandler *mixHandler = new AliMixInputEventHandler(bufferSize, mixNum); | |
19 | mixHandler->SetInputHandlerForMixing(dynamic_cast<AliMultiInputEventHandler*>(mgr->GetInputEventHandler())); | |
20 | AliMixEventPool *evPool = new AliMixEventPool(); | |
21 | ||
22 | //AliMixEventCutObj *multi = new AliMixEventCutObj(AliMixEventCutObj::kMultiplicity, 2, 10002, 10000); | |
23 | AliMixEventCutObj *zvertex = new AliMixEventCutObj(AliMixEventCutObj::kZVertex, -10, 10, 5); | |
24 | ||
25 | AliMixEventCutObj *centrality = new AliMixEventCutObj(AliMixEventCutObj::kCentrality, centMin, centMax, centStep, "V0M"); | |
26 | ||
27 | evPool->AddCut(centrality); | |
28 | //evPool->AddCut(multi); | |
29 | evPool->AddCut(zvertex); | |
30 | ||
31 | // adds event pool (comment it and u will have default mixing) | |
32 | mixHandler->SetEventPool(evPool); | |
33 | ||
34 | // only use events with physics selection | |
35 | if (usePhysSel) mixHandler->SelectCollisionCandidates(AliVEvent::kMB); | |
36 | ||
37 | multiInputHandler->AddInputEventHandler(mixHandler); | |
38 | ||
39 | } |