Download presentation
Presentation is loading. Please wait.
Published byNickolas Martin Modified over 8 years ago
1
Proposal for extension of GaudiAlgorithm and GaudiTool classes Vanya Belyaev CERN & ITEP/Moscow
2
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 2 Known base classes ITCheckAlgorithm ITCheckAlgorithm ITCheckers ITCheckers OTMonitorAlgorithm OTMonitorAlgorithm OTAlgorithms OTAlgorithms RichAlgBase RichAlgBase RichUtils RichUtils TrAlgorithm TrAlgorithm TrKernel TrKernel TrgAlgorithm (?) TrgAlgorithm (?) ? CaloAlgorithm CaloAlgorithm CaloKernel CaloKernel DaVinciAlgorithm DaVinciAlgorithm DaVinciTools DaVinciTools LoKi::Algo LoKi::Algo LoKi LoKi GaudiAlgorithm GaudiAlgorithm GaudiAlg GaudiAlg What else? What else? GiGaTool GiGaTool GiGa RichToolBase RichToolBase RichUtils “Gaudies” “Gaudies” CaloTool CaloTool CaloKernel GaudiTool GaudiTool GaudiTools Try to identify “common” methods and implement them into “standard” base classes GaudiAlgorithm and GaudiTool
3
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 3 Proposal for extended common base(s) http://agenda.cern.ch/age?a04189 Initial proposal have been based mainly on CaloAlgorithm and LoKi::Algo classes Initial proposal have been based mainly on CaloAlgorithm and LoKi::Algo classes (Unexpectedly) active discussion through (Unexpectedly) active discussion through lhcb-soft-talk@cern.ch Thanks to Chris, Matt, Marco, Jose Angel, Olivier, Philippe and “heavy gun” Markus Thanks to Chris, Matt, Marco, Jose Angel, Olivier, Philippe and “heavy gun” Markus 2 iterations of proposal 2 iterations of proposal Attacked problems Attacked problems Error/Warning handling Error/Warning handling Easy/efficient printout Easy/efficient printout The largest discussion, Not addressed in the initial proposal. Data retrieval Data retrieval No feedback at all Location of services/tools Location of services/tools Histograms Histograms N-tuples N-tuples General class hierarchy GaudiAlgorithm/GaudiTool GaudiAlgorithm/GaudiTool GaudiHistoAlg GaudiHistoAlg GaudiTupleAlg GaudiTupleAlg
4
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 4 Error/Warning handling Interface: StatusCode Error( message,code, max print ) const ; Code: if(a<0){return Error(“a < 0”);} If(a>0){ Warning(“a>0”); } Statistics at the end of job: MyAlg SUCCESS Exceptions/Errors/Warning 0/1/1 MyAlg SUCCESS #ERRORS =551 Message=’a<0’ MyAlg SUCCESS #WARNING =145 Message=‘a>0’ Maximal number of printouts Maximal number of printouts Error codes, file name and line number appears in the message Error codes, file name and line number appears in the message Statistics at the end of the job Statistics at the end of the job Handling of assertions and exceptions in a similar way Handling of assertions and exceptions in a similar way
5
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 5 Easy/Efficient printout Interface: bool msgLevel( MSG::Level lev ) const ; MsgStream& err() const ; Code: if( msgLevel( MSG::DEBUG ) ) { /* do something */ } err() << “ Error message” << endreq; The largest discussion, solutions are not perfect The largest discussion, solutions are not perfect Any printout is a just matter of taste Few aspects: Few aspects: avoid extra creation of MsgStream, avoid extra formatting conversion from numeric types to string type easy formatting for e.g extension of error messages Use msgLevel( MSG::Level ) Use msgLevel( MSG::Level ) Chris Chris Use predefined streams: Use predefined streams: err(), info(), debug()… Markus Markus Use lexical_cast Use lexical_cast Use boost::format Use boost::format
6
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 6 Data handling Interface: template template DATA* get(IDataProviderSvc* s,const std::string& addr) const ; template template DATA* get( const std::string& address ) const StatusCode put ( DataObject*, const std::string& addr ) const; Code: MCParticles* p = get ( MCParticlesLocation::Default ); put( new MCVertices(), “MC/MyNonStandardVertices” ); Guaranteed to return valid data (no checks are necessary) Guaranteed to return valid data (no checks are necessary) No discussion at all No discussion at all No interest ? Is it just perfect?
7
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 7 Location of Services and tools Interface: template template TOOL* tool( type, name, parent, createIf ) const ; Template Template TOOL* tool (typename, parent, createIf ) const ; Template Template SVC* svc ( name, createIf ) const Code: const IMyTool* m1 = tool ( “MyToolType/MyToolName” ) ; IMyTool* m2 = tool (“MyToolType”, “MuToolName”, this ); IGiGaSvc* gs = svc ( “GiGa” ); No need to release tools/services acquired with these methods No need to release tools/services acquired with these methods Additional methods for forced manual release of acquired tools Additional methods for forced manual release of acquired tools
8
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 8 Histograms Interface:AIDA::IHistogram1D* plot( value, title, low, high, #bins, weight ) const AIDA::IHistogram1D* plot( value, ID, title, low, high, #bins weight ) const ; Code: plot( pt /GeV, “ PT “, 0, 10 ); plot( mass / GeV, 10, “ Mass ”, 0, 5 ); // with implicit loop plot( PT, p->begin(), p->end(), “ PT_1 ”, 0, 10 ); Book on-demand, but pre-booking is possible Book on-demand, but pre-booking is possible Directory: “TopDir”/”Dir”, both are properties of algorithm, Directory: “TopDir”/”Dir”, both are properties of algorithm, Default value is “AlgName”
9
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 9 Tuples Interface: Tuple ntuple ( title, CLID = CLID_ColumnWise ) const ; Tuple ntuple ( ID, title, CLID = CLID_ColumnWise ) const ; Code: Tuple tuple = ntuple(“MyN-tuple”); tuple->column(“mass”, mass / GeV ); tuple->column(“PT”, pt / GeV ); tuple->fill(“PX,PY,PZ”, PX,PY,PZ); // for array-like columns Tuple->farray( … ); Basic types float and long (to allow the analysis in PAW) Basic types float and long (to allow the analysis in PAW) Column-Wise and Row-Wise tuples are available Column-Wise and Row-Wise tuples are available Array-like columns only for Column-Wise tuples Book on-demand, but pre-booking is possible Book on-demand, but pre-booking is possible Shortcuts for HepVector3D, HepLorentzVector, etc. Shortcuts for HepVector3D, HepLorentzVector, etc. By product: the same technique/class for Event Tag Collections By product: the same technique/class for Event Tag Collections
10
19 Jan'2k+4 Vanya Belyaev CERN & ITEP/Moscow 10 Time scale and summary A lot of very useful suggestions A lot of very useful suggestions Up to now there are no show-stoppers Up to now there are no show-stoppers Are we close to the consensus ? Are we close to the consensus ? 90% of proposed functionality is implemented 90% of proposed functionality is implemented Scattered a bit through different places Scattered a bit through different places Rich, OT/IT, Calo, LoKi, … Rich, OT/IT, Calo, LoKi, … Remaining 10% is easy to implement Remaining 10% is easy to implement Few minor fixes in Gaudi itself, namely “hash” and few others Few minor fixes in Gaudi itself, namely “hash” and few others Timescale few weeks seems to be realistic Timescale few weeks seems to be realistic Before start of pre-production surprises Before start of pre-production surprises Gaudi v14r1 can be a goal Gaudi v14r1 can be a goal Nobody is forced to modify the existing code Nobody is forced to modify the existing code All “old” features are still available All “old” features are still available For new code the usage of new features is recommended For new code the usage of new features is recommended Smooth transition Smooth transition
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.