ATLAS Offline Software
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 
14 static const ElementLinkCnv_p3< ElementLink<RingerRingsContainer> > ELinkRingerRingsCnv;
15 static const TrigCaloClusterCnv_p2 trigCaloClusterCnv;
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 
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 }
ElementLinkCnv_p3
Definition: ElementLinkCnv_p3.h:27
ElementLinkCnv_p3.h
This file contains the class definition for the ElementLinkCnv_p3 class.
ElementLinkCnv_p3::persToTrans
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
TrigEMCluster::e2tsts1
float e2tsts1() const
get second maximum energy in sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:133
TrigEMCluster::set_emaxs1
void set_emaxs1(float emaxs1)
set maximum energy in sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:92
TrigEMCluster::Eta1
float Eta1() const
get Eta sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:129
TrigEMCluster::phi
float phi() const
get Phi (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:116
TrigEMCluster::setPhi
void setPhi(float phi)
set Phi (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:77
TrigEMCluster::setEt
void setEt(float et)
set Et (calibrated) - note that setting Energy this is not set by default
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:70
TrigEMCluster
Class with calibrated variables for egamma clustering.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:31
TrigEMCluster::set_e237
void set_e237(float e237)
set Energy in a 3x7 cluster (no calibration) around hottest cell
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:79
TrigEMClusterCnv_p3::persToTrans
virtual void persToTrans(const TrigEMCluster_p3 *persObj, TrigEMCluster *transObj, MsgStream &log) const override
Definition: TrigEMClusterCnv_p3.cxx:49
TrigEMCluster::e277
float e277() const
get Energy in a 7x7 cluster (no calibration) around hottest cell
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:120
TrigEMCluster::weta2
float weta2() const
get cluster width (based on a 3x5 cluster - 2nd layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:125
TrigEMCluster::fracs1
float fracs1() const
get Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:123
ElementLinkCnv_p3::transToPers
void transToPers(const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
TrigEMCluster::set_Eta1
void set_Eta1(float eta1)
set Eta sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:90
TrigCaloClusterCnv_p2.h
TrigEMCluster::set_weta2
void set_weta2(float weta2)
set cluster width (based on a 3x5 cluster - 2nd layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:86
RingerRingsContainer.h
TrigEMCluster_p3::m_allFloats
float m_allFloats[12+MAXSIZE]
Definition: TrigEMCluster_p3.h:67
TrigEMCluster::set_e2tsts1
void set_e2tsts1(float e2tsts1)
set second maximum energy in sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:94
TrigEMCluster::e237
float e237() const
get Energy in a 3x7 cluster (no calibration) around hottest cell
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:118
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
MAXSIZE
const int MAXSIZE
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigEMCluster_p3::m_trigCaloCluster
TrigCaloCluster_p2 m_trigCaloCluster
Definition: TrigEMCluster_p3.h:70
TrigEMCluster.h
TrigEMCluster::set_e277
void set_e277(float e277)
set Energy in a 7x7 cluster (no calibration) around hottest cell
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:81
TrigCaloClusterCnv_p2::transToPers
virtual void transToPers(const TrigCaloCluster *transObj, TrigCaloCluster_p2 *persObj, MsgStream &log) const override
Definition: TrigCaloClusterCnv_p2.cxx:27
TrigEMClusterCnv_p3::transToPers
virtual void transToPers(const TrigEMCluster *transObj, TrigEMCluster_p3 *persObj, MsgStream &log) const override
Definition: TrigEMClusterCnv_p3.cxx:17
TrigEMCluster_p3::m_rings
ElementLinkInt_p3 m_rings
Definition: TrigEMCluster_p3.h:73
TrigEMCluster::eta
float eta() const
get Eta (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:114
TrigEMClusterCnv_p3.h
TrigEMCluster::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:67
TrigEMCluster::ehad1
float ehad1() const
get hadronic Energy (first hadronic layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:127
TrigEMCluster::energy
float energy() const
get Energy (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:102
TrigCaloClusterCnv_p2
Definition: TrigCaloClusterCnv_p2.h:28
TrigEMCluster::set_fracs1
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...
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:84
TrigEMCluster_p3.h
TrigEMClusterCnv_p3::ELinkRingerRingsCnv
ElementLinkCnv_p3< ElementLink< RingerRingsContainer > > ELinkRingerRingsCnv
Definition: TrigEMClusterCnv_p3.h:48
TrigEMCluster::emaxs1
float emaxs1() const
get maximum energy in sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:131
TrigEMCluster::ringsLink
const ElementLink< RingerRingsContainer > & ringsLink() const
Definition: TrigEMCluster.cxx:147
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigEMCluster::setEta
void setEta(float eta)
set Eta (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:75
TrigEMCluster_p3
Definition: TrigEMCluster_p3.h:27
TrigCaloClusterCnv_p2::persToTrans
virtual void persToTrans(const TrigCaloCluster_p2 *persObj, TrigCaloCluster *transObj, MsgStream &log) const override
Definition: TrigCaloClusterCnv_p2.cxx:9
TrigEMCluster::set_ehad1
void set_ehad1(float ehad1)
set hadronic Energy (first hadronic layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:88
TrigEMCluster::setRings
void setRings(const RingerRingsContainer &ring_con, unsigned int ring_idx)
Definition: TrigEMCluster.cxx:124
TrigEMCluster::et
float et() const
get Et (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:106