Download presentation
Presentation is loading. Please wait.
Published byJodie Weaver Modified over 9 years ago
2
Advanced Athena Tutorial ADL/StoreGate ADL Exercises CERN, May/Mai 5, 2002
3
31/05/02Advanced Athena Tutorial ADL Exercises 2 AAT - ADL Exercises ### login, start CMT and go to working directory source setup.sh cd maxidisk/Athena source setup_tut.csh ### Setup_tut.csh script: create empty packages for the Tutorial and checks out ADL and TestRelease: #cmt co -r dictionary-02-02-00 Control/dictionary #cmt co TestRelease #cmt create Example1 Example1-00-00-01 TutorialMay02 #cmt create Example2 Example2-00-00-01 TutorialMay02 #cmt create LArCell LArCell-00-00-01 TutorialMay02 #cmt create TileCell TileCell-00-00-01 TutorialMay02 #cmt create CaloCell CaloCell-00-00-01 TutorialMay02 #cmt create tutAlg tutAlg-00-00-01 TutorialMay02 ### check pwd #--> /afs/cern.ch/user/a/atltrx/maxidisk/Athena ls #--> Control TestRelease TutorialMay02 Let’s Go !
4
31/05/02Advanced Athena Tutorial ADL Exercises 3 AAT - ADL Exercises Steps of Exercise 1: DataObject 1.Describe your Data: diagrams 2.Write corresponding ADL 3.Put ADL file in standard include directory 4.Edit “requirements“ for package Example1 and run “gmake“ locally 5.Look at the result: what was automatically generated
5
31/05/02Advanced Athena Tutorial ADL Exercises 4 AAT - ADL Exercises Your Diagram: CaloCell DataObject CaloCell double energy double time double eta double phi double x double y double z double quality double et() ADL Language Interface declaration interface or DataObject or ContainedObject or CollectionObject Attribute declaration [persistent] [readonly] [ ] attribute ; Method declaration ( [ [(, )*] ]); Exercise 1: DataObject - 1
6
31/05/02Advanced Athena Tutorial ADL Exercises 5 AAT - ADL Exercises Your Diagram: CaloCell DataObject CaloCell double energy double time double eta double phi double x double y double z double quality double et() Exercise 1: DataObject - 2 ADL code for CaloCell DataObject CaloCell { persistent attribute double energy; persistent attribute double time; persistent attribute double eta; persistent attribute double phi; persistent attribute double x; persistent attribute double y; persistent attribute double z; persistent attribute double quality; double et(); };
7
31/05/02Advanced Athena Tutorial ADL Exercises 6 AAT - ADL Exercises Exercise 1: DataObject - 3 ### create standard include directory (PkgName) cd TutorialMay02/Example1/Example1-00-00-01 mkdir Example1 cd Example1 vi CaloCell.adl #--> code: you did it ( previous slide )
8
31/05/02Advanced Athena Tutorial ADL Exercises 7 AAT - ADL Exercises Exercise 1: DataObject- 4 ### edit Example1 requirements cd../cmt vi requirements #--> add this: ### compile ADL (TestRelease NOT needed yet) cd../cmt gmake #--> don’t worry about some error messages ! use CxxFeatures CxxFeatures-00-* Utilities use GaudiInterface GaudiInterface-01-* External use AtlasPolicy AtlasPolicy-01-* use StoreGate StoreGate-02-* Control use dictionary dictionary-02-02-* Control apply_pattern adl_dual_use_library \ adl_files="*.adl" \ src_files="*.cxx"
9
31/05/02Advanced Athena Tutorial ADL Exercises 8 AAT - ADL Exercises Exercise 1: DataObject - 5 ### what happened … look: cd../Example1 ls #--> CaloCell.adl CaloCell.h CaloCellInclude.h # automatic creation of correct include files cat CaloCell.h # automatic CLID cd../src ls #--> CaloCell.cxx cat CaloCell.cxx # automatic creation of.cxx with Constructor/Destructor and print of the attributes cd../autogen ls #--> naiveobjy pythonshadow tmp transient # internal and “hidden“ (don’t touch) directories and codes
10
31/05/02Advanced Athena Tutorial ADL Exercises 9 AAT - ADL Exercises Steps of Exercise 2: interface (inheritance) 1.Describe your Data: diagrams 2.Write corresponding ADL 3.Put ADL file in standard include directory 4.Edit “requirements“ for package Example2 and run “gmake“ locally 5.SG Part I
11
31/05/02Advanced Athena Tutorial ADL Exercises 10 AAT - ADL Exercises Exercise 2: interface (inheritance) - 1 Your Diagram: CaloCell interface LArCell DataObject CaloCell void add_energy() long sampling() double deltaR(in LArCell other) ADL Language Interface declaration interface or DataObject or ContainedObject or CollectionObject Preprocessor directives: like C++ #include, #define, #ifdef #ifndef, #else, #endif, #undef
12
31/05/02Advanced Athena Tutorial ADL Exercises 11 AAT - ADL Exercises Exercise 2: interface (inheritance) - 2 Your Diagrams: CaloCell, LArCell interface LArCell DataObject CaloCell void add_energy(in double e) long sampling() double deltaR(in LArCell other) ADL code for CaloCell no change ADL code for LArCell #include "CaloCell.adl" interface LArCell : CaloCell { void add_energy(in double e); long sampling(); double deltaR(in LArCell other); }; Bug: #include "CaloCell/CaloCell.adl"
13
31/05/02Advanced Athena Tutorial ADL Exercises 12 AAT - ADL Exercises Exercise 2: interface (inheritance) - 3 ### create standard include directory (PkgName) cd $HOME/maxidisk/Athena cd TutorialMay02/Example2/Example2-00-00-01 mkdir Example2 cd Example2 vi LArCell.adl #--> code: you did it ( previous slide ) ### edit Example2 requirements cd../cmt vi requirements #--> same as for Example1 #--> AND add this: gmake #--> WARNING: should generate 1 error (fixed in next release) #--> Work around: add to../LArCell/LArCellInclude.h this: #--> and rerun “gmake“ class LArCell; use Example1 Example1-00-* TutorialMay02
14
31/05/02Advanced Athena Tutorial ADL Exercises 13 AAT - ADL Exercises At this point you have fully functional objects ready to use in Athena. You can: –Implement Ctors & Dtors (look for #warning) –Implement Method bodys (look for #error) Changing *.adl will not modify/overwrite hand- coded files. Treat these classes as normally in Algorithms & StoreGate.
15
31/05/02Advanced Athena Tutorial ADL Exercises 14 StoreGate Tutorial See SG Tutorial Part 1 (Slides 1->14)
16
Advanced Athena Tutorial ADL/StoreGate ADL Exercises II CERN, May/Mai 5, 2002
17
31/05/02Advanced Athena Tutorial ADL Exercises 16 AAT - ADL Exercises Steps of Exercise 3: ContainedObject&Collection 1.Describe your Data: diagrams 2.Write corresponding ADL package CaloCell ContainedObject CaloCell package LArCell interface LArCell CollectionObject LArCellCollection 3.Put ADL file in standard include directory 4.Edit “requirements“ for packages CaloCell, LArCell and run “gmake“ locally
18
31/05/02Advanced Athena Tutorial ADL Exercises 17 AAT - ADL Exercises ADL Language Interface declaration interface or DataObject or ContainedObject or CollectionObject Exercise 3: ContainedObject&Collection - 1 Your Diagrams: CaloCell, LArCell, LArCellCollection ContainedObject CaloCell interface LArCell LArCell CollectionObject LArCellCollection
19
31/05/02Advanced Athena Tutorial ADL Exercises 18 AAT - ADL Exercises Exercise 3: ContainedObject&Collection - 2 Your Diagram: CaloCell interface LArCell DataObject CaloCell void add_energy() long sampling() double deltaR(in LArCell other) Your Diagrams: CaloCell, LArCell, LArCellCollection ContainedObject CaloCell interface LArCell LArCell CollectionObject LArCellCollection ADL code for CaloCell ADL code for LArCell no change ADL code for LArCellCollection ContainedObject CaloCell #include "LArCell.adl" CollectionObject LArCellCollection { readonly attribute long number; };
20
31/05/02Advanced Athena Tutorial ADL Exercises 19 AAT - ADL Exercises Exercise 3: ContainedObject&Collection - 3 ### create standard include directory (PkgName) cd $HOME/maxidisk/Athena cd TutorialMay02/CaloCell/CaloCell-00-00-01 mkdir CaloCell cd CaloCell vi CaloCell.adl #--> code: ( previous slide ) ### edit CaloCell requirements cd../cmt vi requirements #--> same as for Example1 gmake
21
31/05/02Advanced Athena Tutorial ADL Exercises 20 AAT - ADL Exercises Exercise 3: ContainedObject&Collection - 4 ### create standard include directory (PkgName) cd $HOME/maxidisk/Athena cd TutorialMay02/LArCell/LArCell-00-00-01 mkdir LArCell cd LArCell vi LArCell.adl #--> code: copy it from Example2 vi LArCellCollection.adl #--> code: previous slide ### edit LArCell requirements cd../cmt vi requirements #--> same as for Example1 #--> and add this: gmake use CaloCell CaloCell-00-* TutorialMay02
22
31/05/02Advanced Athena Tutorial ADL Exercises 21 AAT - ADL Exercises Steps of Exercise 4: polymorphic Container 1.Describe your Data: diagrams 2.Write corresponding ADL package TileCell: same as for LArCell package CaloCell DataObject CaloCellContainer 3.Put ADL file in standard include directory 4.Edit “requirements“ for packages TileCell and run “gmake“ locally 5.SG Part II
23
31/05/02Advanced Athena Tutorial ADL Exercises 22 AAT - ADL Exercises ADL Language Interface declaration interface or DataObject or ContainedObject or CollectionObject Exercise 4: polymorphic Container - 1 Your Diagrams: CaloCell, LArCell, LArCellCollection + same for Tile + CaloCellContainer ContainedObject CaloCell DataObject CaloCellContainer LArCell CollectionObject LArCellCollection interface LArCell TileCell CollectionObject TileCellCollection interface TileCell
24
31/05/02Advanced Athena Tutorial ADL Exercises 23 AAT - ADL Exercises Exercise 4: polymorphic Container - 2 Your Diagrams: CaloCell, LArCell, LArCellCollection + same for Tile + CaloCellContainer ContainedObject CaloCell DataObject CaloCellContainer LArCell CollectionObject LArCellCollection interface LArCell TileCell CollectionObject TileCellCollection interface TileCell ADL code for LArxxx no change ADL code for Tilexxx same as for LArxxx = change “LAr“ to “Tile“ everywhere (TileCell.adl and TileCellCollection.adl) ADL code for CaloCellContainer #include "CaloCell.adl" typedef sequence ListCaloCell; DataObject CaloCellContainer { readonly attribute ListCaloCell cells; };
25
31/05/02Advanced Athena Tutorial ADL Exercises 24 AAT - ADL Exercises Exercise 4: polymorphic Container - 3 ### create standard include directory (PkgName) cd $HOME/maxidisk/Athena cd TutorialMay02/CaloCell/CaloCell-00-00-01 cd CaloCell vi CaloCellContainer.adl #--> code: ( previous slide ) cd../cmt gmake #--> WARNING: 1 error at compile time (fixed in next release) #--> Work around: edit../src/CaloCellContainer.cxx #--> and Change this: #--> To this: outStream << " " << *itr1.print() << endl; outStream print() << endl;
26
31/05/02Advanced Athena Tutorial ADL Exercises 25 ### create standard include directory (PkgName) cd $HOME/maxidisk/Athena cd TutorialMay02/TileCell/TileCell-00-00-01 … do exactly same steps as for LArCell (Exercise 3) gmake AAT - ADL Exercises Exercise 4: ContainedObject&Collection - 4
27
31/05/02Advanced Athena Tutorial ADL Exercises 26 StoreGate Exercises See SG Tutorial Part 2 (Slides 15->20)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.