ATLAS Offline Software
Loading...
Searching...
No Matches
LArHitCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "Identifier/Identifier.h"
7
10
11
12void
13LArHitCnv_p1::persToTrans(const LArHit_p1* persObj, LArHit* transObj, MsgStream &log)
14{
15 log << MSG::DEBUG << "LArHitCnv_p1::persToTrans called " << endmsg;
16
17 *transObj = LArHit (Identifier(persObj->m_channelID),
18 (double) persObj->m_energy,
19 persObj->m_energy != 0 ? (double) persObj->m_time/persObj->m_energy : 0);
20}
21
22
23void
24LArHitCnv_p1::transToPers(const LArHit* transObj, LArHit_p1* persObj, MsgStream &log)
25{
26 log << MSG::DEBUG << "LArHitCnv_p1::transToPers called " << endmsg;
27 persObj->m_channelID = transObj->cellID().get_identifier32().get_compact();
28 persObj->m_energy = (float) transObj->energy();
29 persObj->m_time = (float) transObj->time();
30}
31
32
#define endmsg
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
virtual void persToTrans(const LArHit_p1 *persObj, LArHit *transObj, MsgStream &log)
virtual void transToPers(const LArHit *transObj, LArHit_p1 *persObj, MsgStream &log)
Persistent LArHit class, version p1.
Definition LArHit_p1.h:13
float m_time
Definition LArHit_p1.h:31
unsigned int m_channelID
identifier of the cell in which this hit occured.
Definition LArHit_p1.h:25
float m_energy
energy (in MeV) deposited in this hit
Definition LArHit_p1.h:28
Class to store hit energy and time in LAr cell from G4 simulation.
Definition LArHit.h:25
double energy() const
Definition LArHit.h:113
Identifier cellID() const
Definition LArHit.h:108
double time() const
Definition LArHit.h:118