Presentation is loading. Please wait.

Presentation is loading. Please wait.

Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example Based on original by S. Rajagopalan BNL.

Similar presentations


Presentation on theme: "Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example Based on original by S. Rajagopalan BNL."— Presentation transcript:

1 Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example Based on original by S. Rajagopalan BNL

2 Athena Tutorial: Liquid Argon Example Example 6: LAr Reconstruction A stripped down version of the LAr Reconstruction that works in PASO is available The goal is to modify the code to make it work in the new framework Files: –LArG3CellBuilder.cxx, LArG3CellBuilder.h –** LArG3Escale.cxx, LArG3Escale.h –LArCellContainer.cxx, LArCellContainer.h –LArCell.cxx, LArCell.h –LArPrint.cxx, LArPrint.h ** (You don’t have to touch this, but see last slide)

3 Athena Tutorial: Liquid Argon Example Example 6 The Paso Code PASOLArG3Cell Builder LArCell Container LArCellLArPrintEvent new execute() new AddCell() accept(collector) current_event() execute(LArCellContainer*) iterators energy() digit loop Event Loop

4 Athena Tutorial: Liquid Argon Example Example 6 The Gaudi Equivalent Components Gaudi Algorithms: LArG3CellBuilder LArPrint Gaudi Container: LArCellContainer : public ObjectVector Contained Object: LArCell : public ContainedObject Use the Transient Event Store to access and store Event data & LArCellContainer

5 Athena Tutorial: Liquid Argon Example Example 6 Access through TDS Transient Data Store Digit Event LArG3CellBuilder LArCellContainer Cell LArPrint

6 Athena Tutorial: Liquid Argon Example Example 6 LArG3CellBuilder Header File: Declare as Gaudi Algorithm string m_cell_container_name // private Property Cxx file: Include necessary header files In initialize(): declareProperty(“LArCellContainer”,m_cell_container_name) Register the container class in TDS Get pointer to event (Not from EventManager) SmartDataPtr m_event(eventSvc(), “/Event”); Check the event pointer! Push_back LArCell into LArCellContainer Use the Message Service

7 Athena Tutorial: Liquid Argon Example Example 6 Accessing the digits Once you have the pointer to the event in TDS, access to digit information is exactly the same as in PASO. Hence NO changes to this part of the code is required. Setup a vector of ranges: Range lar_em_range(lar_em);// lar_em is an Identifier ranges.push_back(lar_em_range); Setup a Visitor object: CollectDetectorVisitor collector(ranges); m_event -> accept(collector); det_vector::const_iterator FDet = collector.detectors_begin(); det_vector::const_iterator LDet = collector.detectors_end(); Loop over your regions/digits: for(; FDet != LDet; ++FDet) { digit_vector::const_iterator FDigit = (*FDet)->digits_begin(); digit_vector::const_iterator LDigit = (*LDet)->digits_end(); for (; FDigit != LDigit; ++FDigit) { float energy = (*FDigit) -> energy(); } }

8 Athena Tutorial: Liquid Argon Example Example 6 LArCellContainer Header File: Inherit from : public ObjectVector Remove unnecessary lines AddCell is not required No need to maintain a private list Can remove methods to get size/iterators But you can add your private methods Cxx File: Remove almost everything. Leave empty constructor/destructor. There is nothing to do - but you can put in some intelligence here if you want.

9 Athena Tutorial: Liquid Argon Example Example 6 LArCell Header File: Inherit from : public ContainedObject Remember to add the magic lines: static const CLID CLID_LArCell = 214200; static const CLID& classID() {return CLID_LArCell;} virtual const CLID& clID() const {return CLID_LArCell; } Cxx File No changes!

10 Athena Tutorial: Liquid Argon Example Example 6 LArPrint Header File: Declare as a Gaudi Algorithm Replace void execute(LArCellContainer*) withStatusCode execute(); string m_cell_container_name; // private Cxx File Get Pointer to Event (and check it!) Get Pointer to LArCellContainer SmartDataPtr container(m_event,m_cell_container_name); Get the begin/end iterator of the container LArCellContainer::iterator first=container->begin() Print the cell information out (already done)

11 Athena Tutorial: Liquid Argon Example Example 6 Link & Run From the build area: gmake install From the run area: Check your jobOptions.txt There is a ZEBRA.P pointing to a data file E = 50 GeV, single photons, eta = 0.3 There is of course a atlas.datback To Run: example Watch the total Energy, Eta, & Phi print!

12 Athena Tutorial: Liquid Argon Example Example 6 For the more challenged Make LArG3Escale a sub-algorithm of LArG3CellBuilder. LArG3Escale must inherit from Algorithm. Introduce an initialize() method in LArG3CellBuilder and create a sub-algorithm. You may set sub-algorithm properties here. Execute the sub-algorithm. Use the Gaudi ntuple service in LArPrint and write out ntuples of the basic cell quantities.

13 Athena Tutorial: Liquid Argon Example Header files to add LArG3CellBuilder & LArPrint.h: Gaudi/Algorithm/Algorithm.h LArCell.h: Gaudi/Kernel/ContainedObject.h LArCellContainer.h: LHCbEvent/TopLevel/ObjectVector.h LArG3CellBuilder.cxx & LArPrint.cxx ZebraTDRCnv/ZebraTDREvent.h Gaudi/MessageSvc/MsgStream.h Gaudi/Kernel/AlgFactory.h Gaudi/Interfaces/IService.h Gaudi/DataSvc/SmartDataPtr.h Gaudi/Interfaces/IDataProviderSvc.h LHCbEvent/TopLevel/ObjectVector.h Gaudi/JobOptionsSvc/PropertyMgr.h


Download ppt "Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example Based on original by S. Rajagopalan BNL."

Similar presentations


Ads by Google