1 / 25

Experience in ALICE – Analysis Framework and Train

Experience in ALICE – Analysis Framework and Train. Andreas Morsch CERN. Analysis in ALICE. Three main analysis modes Prompt data processing (calibration, alignment, reconstruction, analysis) @CERN with PROOF Analysis with local PROOF clusters Batch Analysis on the GRID infrastructure.

ldryden
Télécharger la présentation

Experience in ALICE – Analysis Framework and Train

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Experience in ALICE – Analysis Framework and Train Andreas Morsch CERN

  2. Analysis in ALICE • Three main analysis modes • Prompt data processing (calibration, alignment, reconstruction, analysis) @CERN with PROOF • Analysis with local PROOF clusters • Batch Analysis on the GRID infrastructure

  3. Plans for Scheduled Analysis • Most efficient way for many analysis tasks to read and process the full data set. • In particular if resources are sparse. • Optimise CPU/IO ratio • But also • Helps to develop a common well tested framework for analysis. • Develops common knowledge base and terminology. • Helps documenting the analysis procedure and makes results reproducible.

  4. Plans for scheduled analysis: Analysis train producing AODs Acceptance and Efficiency Correction Services Monte Carlo Truth ESD/AOD TASK 1 TASK 2 TASK… TASK N AOD

  5. What the Analysis Framework does in ALICE • Transparent access to all resources with the same code • Usage: Local, AliEn grid, CAF/PROOF • Transparent access to different inputs • ESD, AOD, Kinematics tree (MC truth) • Allow for „scheduled“ analysis • Common and well tested environment to run several tasks

  6. Solutions • Transparent access to computing resources • Hide computing scheme dependent code in one Manager Class • Transparent access to data • Make intensive use of interfaces • VEventHandler • VEvent • VTrack

  7. CONT 0 CONT 1 INPUT 0 INPUT 1 AliAnalysisTask OUTPUT 0 CONT 2 AliAnalysis… Framework • Data-oriented model composed of independent tasks • Task execution triggered by data readiness • Tasks are owned and managed by AliAnalysisManager • Parallel execution and event loop done via TSelector functionality • Mandatory for usage with PROOF N.B.: The analysis framework itself has a very general design, not bound to ALICE software A. Gheata

  8. AliAnalysisManager and PROOF:The Manager in Disguise AliAnalysisManager TSelector Delegates Creates AliAnalysisSelector AliAnalysisManager

  9. TSelector AM AM AM AM Analysis Manager AM AM AliAnalysisSelector AM task1 task1 task1 task1 task1 task1 task1 task2 task2 task2 task2 task2 task2 task2 Input list Outputs Outputs Outputs Outputs Outputs Outputs Outputs Inputs Inputs Inputs Input chain Inputs Inputs Inputs task3 task3 task3 task3 task3 task3 task3 taskN taskN taskN taskN taskN taskN taskN AliAnalysisManager – PROOF mode CLIENT PROOF AM->StartAnalysis(“proof”) MyAnalysis.C Master O1 Worker Worker SlaveBegin() Worker AM Worker Process() Worker SlaveTerminate() O1 O2 Terminate() O2 Output list O On O On O

  10. Tasks and event loop AliAnalysisSelector AliAnalysisManager TObjArray *fContainers TObjArray *fTasks Top cont Chain->Process() Top level tasks and containers (“Train”) task1 task2 ESD chain output1 output2 POST EVENT LOOP Task Fit task4 EVENT LOOP result result

  11. AliAnalysisManager AliVEventHandler AliMCEventHandler AliAODHandler (Output) AliESDInputHandler (AliAODInputHandler) I/O via slots Tasks Data AliVEvent AliESDEvent (AliAODEvent) AliMCEvent AliAODEvent AliVParticle AliAnalysisTask AliESDtrack AliMCParticle AliAODtrack AliAnalysisTask AliAnalysisTask AliAnalysisTask Tasks and Common I/O

  12. AliAnalysisTask • ConnectInputData() • Define which data is connected to which slot • CreateOutPutObjects() • Create Histograms • Init(),LocalInit() • Optional, e.g. read parameters • Exec() • The event loop • Terminate() • Called at the end, can draw e.g. a histogram

  13. AliVirtualEventHandler AliAnalysisManager AliESDInputHandler AliESDEvent Common ESD Access Handling AliESDInputHandler* inpHandler = new AliESDInputHandler(); inpHandler->SetInactiveBranches(“ Calo FMD “); AliAnalysisManager *mgr = new AliAnalysisManager(‘Analysis Train’, ‘Test’); mgr->SetInputEventHandler(inpHandler);

  14. Common ESD Access Handling void AliAnalysisTaskXYZ::ConnectInputData(Option_t* option) { // Connect the input data AliESDInputHandler* esdH = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager()) ->GetInputEventHandler()); fESD = esdH->GetEvent(); }

  15. AliVirtualEventHandler AliAnalysisManager AliAODHandler AliAODEvent Common AOD Access Handling AliAODHandler* aodHandler = new AliAODHandler(); aodHandler->SetOutputFileName("aod.root"); AliAnalysisManager *mgr = new AliAnalysisManager(‘Analysis Train’, ‘Test’); mgr->SetOutputEventHandler(aodHandler); AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(‘AODTree’, TTree::Class(), AliAnalysisManager::kOutputContainer, "default");

  16. User Analysis Code: Output Data void AliAnalysisTaskXYZ::CreateOutputObjects() { // Create the output container // // Default AOD AliAODHandler* handler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager()) ->GetOutputEventHandler()); fAOD = handler->GetAOD(); }

  17. AliVirtualEventHandler AliVEvent AliAnalysisManager AliMCEventHandler AliMCEvent AliMCEventHandler* mcHandler = new AliMCEventHandler(); AliAnalysisManager *mgr = new AliAnalysisManager(‘Analysis Train’, ‘Test’); mgr->SetMCtruthEventHandler(mcHandler);

  18. User Analysis Code: MC truth void AliAnalysisTaskXYZ::Exec(Option_t* option ) { // During Analysis AliMCEvent* mc = mgr->GetMCEventHandler()->MCEvent(); Int_t ntrack = mc->GetNumberOfTracks(); for (Int_t i = 0; i < ntrack; i++) { AliVParticle* particle = mc->GetTrack(i); Double_t pt = particle->Pt(); } }

  19. (Recommended) Integration of User Analysis Code AliAnalysisTask Steers Delegates AliAnalysisUserTask User AnalysisCode Implements Interface Deals with AliAODEvent Documents selection and analysis parameters Factory

  20. Example: Gamma Analysis Task AliAnalysisGammaTask AliAnaGamma AliGammaReader AliGammaDataReader AliGammaMCReader AliGammaMCDataReader AliAnaGammaDirect AliAnaGammaCorrelation AliAnaGammaParton AliAnaGammaHadron AliAnaGammaJetLeadCone AliAnaGammaJetFinder

  21. CAF Related Issues • We produce large output trees which are currently memory resident on the worker side. • Need urgently the TProofFile/TFileMeger mechanism to handle file resident trees. • Future challenges • Event mixing with nested event loops • Repeating loops (calibration, s. M. Ivanov)

  22. Integration of User Tasks • Relatively smooth so far • Needs user support to scrutinize (in particular for CAF/PROOF): • Memory requirements (leaks) • Correct data member initialization • On client and workers

  23. Analysis train producing AOD Tested LOCAL, on GRID and PROOF modes on p-p and Pb-Pb events Monte Carlo Truth ESD/AOD ESD FILTERING JET ANALYSIS GAMMA TASK Others to come … AOD

  24. Summary • ALICE Offline has developed an analysis framework that hides computing scheme dependences from the user. The same user code runs on • Local PC • CAF/PROOF • Grid • Framework manages a list of independent tasks: • Execution triggered by data readiness • Sequential execution of the top level task (train) driven by input chain • Common I/O is managed by event handlers • Run-time configuration of Tasks and Handlers

  25. Thanks to … A. Gheata M. Gheata J.-F. Grosse-Oetringhaus Ch, Klein-Boesing M. Oldenburg F. Carminati Y. Schutz G. Conesa and many others

More Related