A Few Recent Updates To DANA - PowerPoint PPT Presentation

About This Presentation
Title:

A Few Recent Updates To DANA

Description:

Run though all events. app.Run(&myproc, 10); Command line takes ... Tags can be used to distinguish two factories which produce the same data type. For example: ... – PowerPoint PPT presentation

Number of Views:12
Avg rating:3.0/5.0
Slides: 12
Provided by: andyko
Learn more at: https://userweb.jlab.org
Category:
Tags: dana | few | recent | run | up | updates

less

Transcript and Presenter's Notes

Title: A Few Recent Updates To DANA


1
A Few Recent Updates To DANA
  • GlueX Software meeting
  • July 26, 2005
  • David Lawrence

2
Shared Objects
  • DANA can use shared objects for
  • Event Sources
  • Factories

It does this using the libdl library (dlopen,
dlsym, )
3
Shared Objects
  • Command line
  • Attaching a single object
  • hd_ana --solibhddm_shlib.a hdgeant.hddm
  • Attaching all objects in a directory
  • hd_ana --sodir/tmp/myshlibs hdgeant.hddm
  • sodir can be a relative or full path
  • filenames of the form lib.so will be attached

4
Shared Objects
  • Creating a shared object
  • Makefile

PACKAGES ROOTDANA MODULE_NAME
hddm_shlib include (HALLD_HOME)/src/BMS/Makefile
.shlib
Makes the file libhddm_shlib.so from all files in
directory.
5
Shared Objects
  • Source code for shared object

include DApplication.h extern "C" extern
GetDEventSourceType_t GetDEventSourceType extern
MakeDEventSource_t MakeDEventSource extern
InitFactories_t InitFactories const char
GetDEventSourceType(void)return
"DEventSourceHDDM" DEventSource
MakeDEventSource(const char name) return new
DEventSourceHDDM(name) void
InitFactories(DEventLoop eventLoop) eventLoop-
gtAddFactory(new DFactory_DBCALHit())
6
Shared Objects
  • Using shared objects can be dangerous!
  • The shared object mechanism in DANA is not
    intended for normal use.
  • It could potentially provide a lot of benefit
    during code development or in certain
    circumstances, a more convenient path to legacy
    compatibility.

7
Using Multiple Threads
  • Command Line
  • hd_ana --nthreads4 hdgeant.hddm
  • C Source

// Instantiate a DApplication object DApplication
app(narg, argv) // Run though all
events app.Run(myproc, 10)
Command line takes precedence!
8
Using Multiple Threads
  • Writing thread-safe code
  • Dont use static or global variables
  • Wrap ROOT calls in TThreadLock() and
    TThreadUnLock()
  • Dont wrap your whole routine (or even a single
    factory) with a mutex!!

9
Factory Tags
  • Tags can be used to distinguish two factories
    which produce the same data type.
  • For example

vectorltconst DParticlegt particles vectorltconst
DParticlegt kaons loop-gtGet(particles) loop-gtGe
t(kaons, kaons)
10
Factory Tags
  • Tagging a factory
  • in the factorys header file
  • DFactory_Kaon.h

const char Tag(void)return kaons"
11
Class Creation Scripts
located in HALLD_HOME/scripts
  • mkclass - makes a class
  • myclass.h
  • myclass.cc
  • mkfactory - makes a factory
  • mydata.h
  • DFactory_mydata.h
  • DFactory_mydata.cc
  • mkprocessor - makes an event processor
  • DEventProcessor_name.h
  • DEventProcessor_name.cc
Write a Comment
User Comments (0)
About PowerShow.com