ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEMClusterCnv_p3.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9#include "AthLinks/ElementLink.h"
13
16
18 TrigEMCluster_p3* pers, MsgStream &log ) const
19{
20
21 log << MSG::DEBUG << "TrigEMClusterCnv_p3::tranToPers" << endmsg;
22
23 if ( (!trans) || (!pers) ) {
24 log << MSG::ERROR << "TrigEMClusterCnv_p3::trasnToPers with trans or pers == 0" << endmsg;
25 return;
26 }
27
28 pers->m_allFloats[0] = trans->energy();
29 pers->m_allFloats[1] = trans->et();
30 pers->m_allFloats[2] = trans->eta();
31 pers->m_allFloats[3] = trans->phi();
32 pers->m_allFloats[4] = trans->e237();
33 pers->m_allFloats[5] = trans->e277();
34 pers->m_allFloats[6] = trans->fracs1();
35 pers->m_allFloats[7] = trans->weta2();
36 pers->m_allFloats[8] = trans->ehad1();
37 pers->m_allFloats[9] = trans->Eta1();
38 pers->m_allFloats[10] = trans->emaxs1();
39 pers->m_allFloats[11] = trans->e2tsts1();
40 for(int i=0; i<MAXSIZE; i++){
41 pers->m_allFloats[12+i] = trans->energy((CaloSampling::CaloSample)i);
42 }
43
44 ELinkRingerRingsCnv.transToPers(&trans->ringsLink(), &pers->m_rings, log);
45 trigCaloClusterCnv.transToPers(trans, &pers->m_trigCaloCluster, log);
46// pers->m_trigCaloCluster = baseToPersistent( &m_trigCaloClusterCnv, trans, log );
47}
48
50 TrigEMCluster* trans, MsgStream &log ) const
51{
52
53 log << MSG::DEBUG << "TrigEMClusterCnv_p3::persToTrans" << endmsg;
54
55 if ( (!trans) || (!pers) ) {
56 log << MSG::ERROR << "TrigEMClusterCnv_p3::persToTrans with trans or pers == 0" << endmsg;
57 return;
58 }
59
60 // See that the order of the stored object is not the same as previously
61 trans->setEnergy (pers->m_allFloats[0]);
62 trans->setEt (pers->m_allFloats[1]);
63 trans->setEta (pers->m_allFloats[2]);
64 trans->setPhi (pers->m_allFloats[3]);
65 trans->set_e237 (pers->m_allFloats[4]);
66 trans->set_e277 (pers->m_allFloats[5]);
67 trans->set_fracs1 (pers->m_allFloats[6]);
68 trans->set_weta2 (pers->m_allFloats[7]);
69 trans->set_ehad1 (pers->m_allFloats[8]);
70 trans->set_Eta1 (pers->m_allFloats[9]);
71 trans->set_emaxs1 (pers->m_allFloats[10]);
72 trans->set_e2tsts1 (pers->m_allFloats[11]);
73 for(int i=0; i<MAXSIZE; i++){
74 trans->setEnergy ((CaloSampling::CaloSample)i, pers->m_allFloats[12+i]);
75 }
76
77/* trans->m_Energy = pers->m_Energy;
78 trans->m_Et = pers->m_Et;
79 for(int i=0; i<MAXSIZE; i++){
80 trans->m_EnergyS[i] = pers->m_EnergyS[i];
81 }
82 trans->m_Eta = pers->m_Eta;
83 trans->m_Phi = pers->m_Phi;
84 trans->m_e237 = pers->m_e237;
85 trans->m_e277 = pers->m_e277;
86 trans->m_fracs1 = pers->m_fracs1;
87 trans->m_weta2 = pers->m_weta2;
88 trans->m_ehad1 = pers->m_ehad1;
89 trans->m_Eta1 = pers->m_Eta1;
90 trans->m_emaxs1 = pers->m_emaxs1;
91 trans->m_e2tsts1 = pers->m_e2tsts1; */
92
94 ELinkRingerRingsCnv.persToTrans(&pers->m_rings, &ringsLink, log);
95 trans->setRings (ringsLink);
96 trigCaloClusterCnv.persToTrans(&pers->m_trigCaloCluster, trans, log);
97// fillTransFromPStore( &m_trigCaloClusterCnv, pers->m_trigCaloCluster, trans, log );
98
99}
#define endmsg
This file contains the class definition for the ElementLinkCnv_p3 class.
static const ElementLinkCnv_p3< ElementLink< RingerRingsContainer > > ELinkRingerRingsCnv
static const TrigCaloClusterCnv_p2 trigCaloClusterCnv
virtual void persToTrans(const TrigEMCluster_p3 *persObj, TrigEMCluster *transObj, MsgStream &log) const override
ElementLinkCnv_p3< ElementLink< RingerRingsContainer > > ELinkRingerRingsCnv
virtual void transToPers(const TrigEMCluster *transObj, TrigEMCluster_p3 *persObj, MsgStream &log) const override
ElementLinkInt_p3 m_rings
TrigCaloCluster_p2 m_trigCaloCluster
float m_allFloats[12+MAXSIZE]
Class with calibrated variables for egamma clustering.
float ehad1() const
get hadronic Energy (first hadronic layer)
void set_Eta1(float eta1)
set Eta sampling 1 (strip layer)
float emaxs1() const
get maximum energy in sampling 1 (strip layer)
void set_e237(float e237)
set Energy in a 3x7 cluster (no calibration) around hottest cell
void set_weta2(float weta2)
set cluster width (based on a 3x5 cluster - 2nd layer)
const ElementLink< RingerRingsContainer > & ringsLink() const
float e2tsts1() const
get second maximum energy in sampling 1 (strip layer)
void setEt(float et)
set Et (calibrated) - note that setting Energy this is not set by default
float weta2() const
get cluster width (based on a 3x5 cluster - 2nd layer)
void set_e2tsts1(float e2tsts1)
set second maximum energy in sampling 1 (strip layer)
void set_ehad1(float ehad1)
set hadronic Energy (first hadronic layer)
float e277() const
get Energy in a 7x7 cluster (no calibration) around hottest cell
void setRings(const RingerRingsContainer &ring_con, unsigned int ring_idx)
void set_emaxs1(float emaxs1)
set maximum energy in sampling 1 (strip layer)
void setEnergy(float energy)
set Energy (calibrated)
float fracs1() const
get Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
void set_e277(float e277)
set Energy in a 7x7 cluster (no calibration) around hottest cell
float Eta1() const
get Eta sampling 1 (strip layer)
void set_fracs1(float fracs1)
set Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
float e237() const
get Energy in a 3x7 cluster (no calibration) around hottest cell