1 / 18

Use of Gaudi in Reconstruction

Use of Gaudi in Reconstruction. Weidong Li 23/06/2004. Video Lectures. Video Lectures in my machine: IP address: 202.122.35.59 Gaudi Tutorials GaudiAthena AthenaRec C++ Tutorial C++ training Software Engineering Software training. Reconstruction Dataflow. MDC digits. MDC digits.

bailey
Download Presentation

Use of Gaudi in Reconstruction

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. Use of Gaudi in Reconstruction Weidong Li 23/06/2004

  2. Video Lectures • Video Lectures in my machine: • IP address: 202.122.35.59 • Gaudi Tutorials • GaudiAthena • AthenaRec • C++ Tutorial • C++ training • Software Engineering • Software training

  3. Reconstruction Dataflow MDC digits MDC digits Transient Event Data Store MDC Tracking Tracks Tracks Calorimeter Digits Calorimeter Clustering Calorimeter showers Showers Tracks, Showers Electron/photon Identification Apparent dataflow Electron/photon Real dataflow Electrons/photons

  4. ISvcLocator ApplicationMgr IDataProviderSvc IProperty IAlgorithm EventDataSvc Concrete Algorithm IDataProviderSvc DetectorDataSvc IHistogramSvc HistogramSvc Obj_A Obj_B MessageSvc IMessageSvc IParticlePropertySvc ParticlePropertySvc Algorithm • Users write concrete Algorithms derived from base class Algorithm • Implements - at least - three methods in addition to the constructor and destructor • initialize(), execute(), finalize() • execute is called once per physics event

  5. Algorithm’s Properties • Algorithm’s properties can be declared in the constructor: MdcHough::MdcHough(const std::string& name, ISvcLocator* pSvcLocator) : Algorithm(name, pSvcLocator) { // Declare the properties declareProperty("FittingMethod", m_fittingMethod = 2); declareProperty("ConfigFile", m_configFile = "MDCConfig.xml"); } • Algorithm’s properties are configured through jobOption file: MdcHough. FittingMethod = 3; MdcHough. ConfigFile = "MDCConfig.xml";

  6. Accessing Services • Within the Algorithm services are readily accessible. • The most common are: • msgSvc( ) [or messageService( )] • eventSvc( ) [or eventDataService( )] • histoSvc( ) [or histogramDataService( )] • ntupleSvc( ) [or ntupleService( )] • detSvc( ) [or detDataService( )] • service<T>(…) generalized access to Services • serviceLocator( ) • Other registered services are accessible once their header file is included in the Algorithm

  7. Retrieving Event Data (1) StatusCode MdcHough::execute() { // Part 1: Get the event header, print out event and run number SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event"); if (!eventHeader) { log << MSG::FATAL << "Could not find Event Header" << endreq; return( StatusCode::FAILURE); } //Part 2: Print out MDC digi SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc(),"/Event/Digi/MdcDigiCol"); OR DataObject * mdcDigiCol; StatusCode sc = eventSvc()->retrieveObject("/Event/Digi/MdcDigiCol“, mdcDigiCol);

  8. Retrieving Event Data (2) if (!mdcDigiCol) { log << MSG::FATAL << "Could not find event" << endreq; return( StatusCode::FAILURE); } MdcDigiCol::iterator iter = mdcDigiCol->begin(); for (;iter != mdcDigiCol->end(); iter++, digiId++) { } return StatusCode::SUCCESS; }

  9. Data Service (3) Request load (2) Search in Store PersistencyService Request dispatcherObjy, ROOT,.. (5) Register Conversion Service (4) Request creation Data Store Converter Converter Converter Converter Loading from Data Store Unsuccessful ifrequested object is not present Algorithm (1) Retrieve object

  10. Storing Data Object MdcDigiCol * mdcDigiCol = new MdcDigiCol(); StatusCode sc = eventSvc()-> registerObject("/Event/Digi/MdcDigiCol“, mdcDigiCol);

  11. Service IMdcGeomSvc.h class IMdcGeomSvc : virtual public IInterface { public: virtual const MdcGeoWire * const Wire(unsigned id) = 0; virtual const MdcGeoLayer * const Layer(unsigned id) = 0; virtual const MdcGeoSuper * const SuperLayer(unsigned id) = 0; virtual void Dump() = 0; }; ClientAlgoritm.cpp #include “MDCGeomSvc/IMdcGeomSvc.h” ClientAlgotihm::myMethod() { IMdcGeomSvc* mdcGeomSvc; service(“MdcGeomSvc”, mdcGeomSvc ); mdcGeomSvc -> Dump(); }

  12. Patterns for libraries • Helper packages These packages create a shared library that is designed to be linked against. library XxxCode <list of files> apply_pattern installed_library Orapply_pattern installed_library =*.cxx • Algorithm and Service packages a) component_library - for simple component libraries b) dual_use_library - for Algorithms or Services that are capable of being inherited from. • A package that uses the dual_use_library pattern creates two separate shared libraries • libXxxAlgs.so which contains the component factories and needs to be setup at run-time in the job options file, and • libXxxAlgsLib.so which is a linkable shared library containing the component code which allows inheritance.

  13. Component Library <PackageName>_entries.cxx #include “GaudiKernel/DeclareFactoryEntries.h” DECLARE_FACTORY_ENTRIES ( <PackageName> ) { DECLARE_ALGORITH( MyAlgorithm ) DECLARE_SERVICE( MyService ) } Your components need to be added here <PackageName>_load.cxx #include “GaudiKernel/LoadFactoryEntries.h” LOAD_FACTORY_ENTRIES ( <PackageName> ) Substitute with your package name

  14. Set CVSROOT setenv CVSROOT :pserver:liwd@koala.ihep.ac.cn:/bes/bes Setup CMT source /bes/tool/CMT/v1r14p20031120/mgr/setup.csh Set CVSIGNORE setenv CVSIGNORE 'setup.* cleanup.* *.make Makefile Linux* *~' # set the SITEROOT set SITEROOT "/bes/sw/boss" # set the offset in cvs repository set CMTCVSOFFSET "BossCvs" # Setup the CMT search path for work area, distribution area and Gaudi area macro WorkArea "${HOME}/work" macro home_dir "${HOME}" path_remove CMTPATH "${home_dir}" path_prepend CMTPATH "$(WorkArea)" Setup Environment /home/liwd/setupCVS.csh /home/liwd/setupCMT.csh /home/liwd/BossEnv/requirements

  15. // Event Persistency Service and Conversion Service ApplicationMgr.DLLs += {"AsciiFileCnv"}; ApplicationMgr.ExtSvc += { "EvtPersistencySvc/EventPersistencySvc" }; ApplicationMgr.ExtSvc += { "AsciiFileCnvSvc","AsciiFileEventSelector/EventSelector"}; EventPersistencySvc.CnvServices = { "AsciiFileCnvSvc" }; // Reconstruction Algorithm and Geometry Service ApplicationMgr.DLLs += {"MdcDummyAlg", "MdcGeomSvc"}; ApplicationMgr.TopAlg = { "MdcDummy" }; ApplicationMgr.ExtSvc += { "MdcGeomSvc" }; MessageSvc.OutputLevel = 2; ApplicationMgr.EvtMax = 2; Job Options /home/liwd/work/TestRelease/TestRelease-00-00-01/run/jobOptions_MDCHough.txt /home/liwd/work/TestRelease/TestRelease-00-00-01/run/Ascii.txt

  16. Running Job (1) • Get TestRelease • cmt co TestRelease • Modify TestRelease requirements file to list the packages being checked out emacs TestRelease/<release-version>/cmt/requirements & And add this line to the requirements file use MdcDummyAlg MdcDummyAlg-* Reconstruction /home/liwd/work/TestRelease/TestRelease-00-00-01/requirements

  17. Running Job (2) • Building MdcDummyAlg • cd TestRelease/<version>/cmt • source setup.sh • cmt broadcast cmt config • cmt broadcast gmake • From /run directory • boss.exe jobOptions_MdcDummy.txt

  18. 谢谢大家!

More Related