Presentation is loading. Please wait.

Presentation is loading. Please wait.

The DANA Analysis Framework David Lawrence Jlab Jan. 19, 2006 .

Similar presentations


Presentation on theme: "The DANA Analysis Framework David Lawrence Jlab Jan. 19, 2006 ."— Presentation transcript:

1 The DANA Analysis Framework David Lawrence Jlab Jan. 19, 2006 .

2 DANA uses a factory model to deliver data “on demand”

3 Factories and Data Objects
Factory: Implements an algorithm to create one type of object using input from other type(s) of object(s). Data Object:Object produced by a factory. It may have persistence through a file.

4 Factories are accessed via the type of data they produce
vector<const DCDCHit*> cdchits; eventLoop->Get(cdchits); for(int i=0; i<cdchits.size(); i++){ float x = cdchits[i]->x; float y = cdchits[i]->y; }

5 Factory Tags Two factories producing data of the same type may be distinguished via their “tag”s Example: One factory may provide a list of objects that is a subset of the objects produced by another factory.

6 Factory Tags vector<const DParticle*> particles;
vector<const DParticle*> kaons; eventLoop->Get(particles); eventLoop->Get(kaons, “Kaon”);

7 DEventProcessor Programs are made by deriving from the DEventProcessor class DEventProcessor defines a set of callback methods that are called at the appropriate times during the data processing

8 DEventProcessor Callback Methods
class DEventProcessor{ public: virtual derror_t init(void); virtual derror_t brun(DEventLoop *eventLoop, int runnumber); virtual derror_t evnt(DEventLoop *eventLoop, int eventnumber); virtual derror_t erun(void); virtual derror_t fini(void); }

9 Multi-threading Multi-core processors are on the near horizon. To fully leverage the next generation of CPUs, processes must be multi-threaded Data analysis is a natural application for multi-threading where events are dispatched to processing threads.

10 Threads

11 Multi-threaded Event Processing
GlueX Pattern Finding on 2.4GHz Quad Opteron 1 thread 2 threads 3 threads 4 threads 5 threads 20 threads 357 Hz 680 Hz 994 Hz 1348 Hz 1155 Hz 1087 Hz 177 Hz 346 Hz 512 Hz 663 Hz 632 Hz 584 Hz

12 DEventSource Event sources inherit from DEventSource which defines the API for extracting data This way, the framework is divorced from the specific file format New file formats (or online sources) may be added by defining a new DEventSource-based class

13 Shared Objects DANA supports shared objects for implementing factories and DEventSource objects Factories and Event Sources obtained from shared objects are given precedence over statically linked ones.

14 Configuration Parameters
Parameters used to control the behavior of the algorithms (e.g. minimum number of hits per track) Kept as key/value pairs in DApplication with standard way of setting and retrieving NOT calibration constants

15 Configuration Parameters
A configuration parameter can be used as the factory “tag” (switchyard) string TRACKHIT_SOURCE = "MC"; dparms.SetDefaultParameter("TRK:TRACKHIT_SOURCE", TRACKHIT_SOURCE); loop->Get(trackhits, TRACKHIT_SOURCE.c_str());

16 Object Identifiers All Data Objects have a member:
identifier_t id (identifier_t is typedef’d as int) Identifiers are used to reference one object from another in a way that can be stored and retrieved from a file.

17 Object Identifiers vector<const DTrackCandidate*> trackcandidates; vector<const DTrack*> tracks; loop->Get(trackcandidates); loop->Get(tracks); for(unsigned int i=0;i<tracks.size();i++){ const DTrackCandidate *trackcandidate = GetByID(trackcandidates, tracks[i]->candidateid); }

18 Example main() routine
#include "MyProcessor.h" #include "DApplication.h" int main(int narg, char *argv[]) { // Instantiate our event processor MyProcessor myproc; // Instantiate an event loop object DApplication app(narg, argv); // Run though all events, calling our event processor's methods app.Run(&myproc, 4); return 0; }

19 Nightly Generated DOxygen documentation


Download ppt "The DANA Analysis Framework David Lawrence Jlab Jan. 19, 2006 ."

Similar presentations


Ads by Google