athena tutorial: liquid argon example athena the atlas control framework tutorial: liquid argon...

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

Upload: laura-neal

Post on 19-Jan-2018

221 views

Category:

Documents


1 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

ATHENAThe ATLAS Control Framework Tutorial: Liquid Argon Example

Based on original byS. Rajagopalan

BNL

Page 2: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

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)

Page 3: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6The Paso Code

PASO LArG3CellBuilder

LArCellContainer

LArCell LArPrintEvent

newnew

execute()new

newAddCell()

accept(collector)current_event()

execute(LArCellContainer*)iterators

energy()

digi

tlo

op

Eve n

t Loo

p

Page 4: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6The Gaudi Equivalent Components

• Gaudi Algorithms:LArG3CellBuilderLArPrint

• Gaudi Container:LArCellContainer : public ObjectVector<LArCell>

• Contained Object:LArCell : public ContainedObject

• Use the Transient Event Store to access and store Event data & LArCellContainer

Page 5: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6Access through TDS

Tran

sien

t Dat

a St

oreDigit

Digit

DigitEvent

LArG3CellBuilder

LArCellContainer

Cell

CellCell

Cell

LArPrint

Page 6: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6LArG3CellBuilder

• Header File:Declare as Gaudi Algorithmstring m_cell_container_name // private Property

• Cxx file:Include necessary header filesIn initialize(): declareProperty(“LArCellContainer”,m_cell_container_name)Register the container class in TDSGet pointer to event (Not from EventManager)

SmartDataPtr<ZebraTDREvent> m_event(eventSvc(), “/Event”);

Check the event pointer!Push_back LArCell into LArCellContainerUse the Message Service

Page 7: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6Accessing 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<CaloRegion> 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(); } }

Page 8: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6LArCellContainer

• Header File:Inherit from : public ObjectVector<LArCell>Remove unnecessary lines AddCell is not requiredNo need to maintain a private listCan 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.

Page 9: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6LArCell

• Header File:Inherit from : public ContainedObjectRemember 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 FileNo changes!

Page 10: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6LArPrint

• Header File:Declare as a Gaudi AlgorithmReplace void execute(LArCellContainer*)with StatusCode execute(); string m_cell_container_name; // private

• Cxx FileGet Pointer to Event (and check it!)Get Pointer to LArCellContainer

SmartDataPtr<LArCellContainer>container(m_event,m_cell_container_name);

Get the begin/end iterator of the containerLArCellContainer::iterator first=container->begin()Print the cell information out (already done)

Page 11: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6Link & Run

• From the build area:gmake install

• From the run area:Check your jobOptions.txtThere is a ZEBRA.P pointing to a data fileE = 50 GeV, single photons, eta = 0.3

There is of course a atlas.datback

To Run:example

Watch the total Energy, Eta, & Phi print!

Page 12: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

Athena Tutorial: Liquid Argon Example

Example 6For 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.

Page 13: Athena Tutorial: Liquid Argon Example ATHENA The ATLAS Control Framework Tutorial: Liquid Argon Example…

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.cxxZebraTDRCnv/ZebraTDREvent.hGaudi/MessageSvc/MsgStream.hGaudi/Kernel/AlgFactory.hGaudi/Interfaces/IService.hGaudi/DataSvc/SmartDataPtr.hGaudi/Interfaces/IDataProviderSvc.hLHCbEvent/TopLevel/ObjectVector.hGaudi/JobOptionsSvc/PropertyMgr.h