Event mixing
Some details about the official framework to perform event mixing can be found here:
Offline event mixing page
Event mixing example code (courtesy of Dariusz Miskowiec
The following example gives an idea on how one can perform event mixing on the GRID. The events are grouped based on their multiplicity.
Please note that the example hasn't been tested!!! Feel free to test it and provide any feedback.
AliEventPoolOTF* pool = new
AliEventPoolOTF("event pool", "ESD");
if (TGrid::Connect("alien://")) return;
TChain *tr =
CreateChainFromTags("wn.xml", "ESD");
TAlienCollection* coll =
TAlienCollection::Open("wn.xml");
TGridResult* tagResult = coll->GetGridResult("",0,0);
pool->SetGridResult(tagResult);
pool->SetMultiplicityBin(0, 300, 10);
pool->Init();
AliMultiEventInputHandler* inpHandler = new
AliMultiEventInputHandler(2, 0);
AliAnalysisManager *mgr = new
AliAnalysisManager("Test Manager", "Test Manager");
mgr->SetInputEventHandler(inpHandler);
mgr->SetEventPool(pool);
inpHandler->SetEventPool(pool);
mgr->AddTask(mytask);
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *cdummy = mgr->CreateContainer("tree", TTree::Class(),AliAnalysisManager::kExchangeContainer, "default");
mgr->ConnectInput (mytask,0,cinput);
mgr->ConnectOutput(mytask,0,cdummy);
mgr->InitAnalysis();
mgr->PrintStatus();
mgr->StartAnalysis("mix",tr);
--
PanosChristakoglou - 05 Aug 2008