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