ATLAS Offline Software
JetSamplingCnv_p2.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // JetSamplingCnv_p2.cxx
8 // Implementation file for class JetSamplingCnv_p2
9 // Created by Belen.Salvachua@cern.ch based on JetSamplingCnv_p1.cxx from
10 // S.Binet<binet@cern.ch>
11 // Date : Dec 2008
13 
14 
15 // STL includes
16 
17 // JetEvent includes
18 #include "JetEvent/JetSampling.h"
19 
20 // JetEventTPCnv includes
22 
23 // little MACRO helpers
24 #define TPCNV_PERSTOTRANS(p,t,x) t->x = p->x
25 //#define TPCNV_TRANSTOPERS(t,p,x) p->x = t->x
26 #define TPDFCNV_TRANSTOPERS(t,p,x) p->x = static_cast< float >( t->x ) // use cast to convert from double to float, the opposite is not needed
27 
28 
29 // statics
31 
32 // Convert Persistent (JetSampling_p2) to Transient (latest version, JetSampling)
34  JetSampling* trans,
35  MsgStream& msg ) const
36 {
37 // msg << MSG::DEBUG << "Loading JetSampling from persistent state..."
38 // << endmsg;
39 
40  m_hlvCnv.persToTrans( &pers->m_pr, &trans->m_pr, msg ); // reco jet at EM scale
41  m_hlvCnv.persToTrans( &pers->m_pt, &trans->m_pt, msg ); // PIC jet
42  m_hlvCnv.persToTrans( &pers->m_pn, &trans->m_pn, msg ); // NTJ jet
43  m_hlvCnv.persToTrans( &pers->m_pd, &trans->m_pd, msg ); // data driven kinematics
44  m_hlvCnv.persToTrans( &pers->m_h1, &trans->m_h1, msg ); // calibrated jet H1
45  m_hlvCnv.persToTrans( &pers->m_pisa, &trans->m_pisa, msg ); // calibrated jet pisa
46  m_hlvCnv.persToTrans( &pers->m_samp, &trans->m_samp, msg ); // calibrated jet sampling
47 
48  // Distance to 1st and 2nd NTJ jet
49  TPCNV_PERSTOTRANS( pers, trans, m_dr1 );
50  TPCNV_PERSTOTRANS( pers, trans, m_dr2 );
51 
52  // Jet sampling layer info
53  TPCNV_PERSTOTRANS( pers, trans, m_ejsPreSamplerB );
54  TPCNV_PERSTOTRANS( pers, trans, m_ejsPreSamplerE );
55  TPCNV_PERSTOTRANS( pers, trans, m_ejsEMB1 );
56  TPCNV_PERSTOTRANS( pers, trans, m_ejsEME1 );
57  TPCNV_PERSTOTRANS( pers, trans, m_ejsEMB2 );
58  TPCNV_PERSTOTRANS( pers, trans, m_ejsEME2 );
59  TPCNV_PERSTOTRANS( pers, trans, m_ejsEMB3 );
60  TPCNV_PERSTOTRANS( pers, trans, m_ejsEME3 );
61  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileBar0 );
62  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileExt0 );
63  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileBar1 );
64  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileExt1 );
65  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileBar2 );
66  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileExt2 );
67  TPCNV_PERSTOTRANS( pers, trans, m_ejsHEC0 );
68  TPCNV_PERSTOTRANS( pers, trans, m_ejsHEC1 );
69  TPCNV_PERSTOTRANS( pers, trans, m_ejsHEC2 );
70  TPCNV_PERSTOTRANS( pers, trans, m_ejsHEC3 );
71  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileGap1 );
72  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileGap2 );
73  TPCNV_PERSTOTRANS( pers, trans, m_ejsTileGap3 );
74  TPCNV_PERSTOTRANS( pers, trans, m_ejsFCAL0 );
75  TPCNV_PERSTOTRANS( pers, trans, m_ejsFCAL1 );
76  TPCNV_PERSTOTRANS( pers, trans, m_ejsFCAL2 );
77 
78  TPCNV_PERSTOTRANS( pers, trans, m_tot );
79  TPCNV_PERSTOTRANS( pers, trans, m_ctot );
80  TPCNV_PERSTOTRANS( pers, trans, m_ehad );
81  TPCNV_PERSTOTRANS( pers, trans, m_eem );
82 
83  // JetSums no longer exist as members in JetSampling_p2
84 
85  TPCNV_PERSTOTRANS( pers, trans, m_eCryo );
86  TPCNV_PERSTOTRANS( pers, trans, m_eGap );
87  TPCNV_PERSTOTRANS( pers, trans, m_eScint );
88  TPCNV_PERSTOTRANS( pers, trans, m_eNull );
89 
90  // JetECS
91  for ( std::size_t i = 0; i != std::tuple_size_v<JetSampling_p2::ECS_t>; ++i ) {
92  TPCNV_PERSTOTRANS( pers, trans, m_ePreSamBCell[i] );
93  TPCNV_PERSTOTRANS( pers, trans, m_ePreSamECell[i] );
94  TPCNV_PERSTOTRANS( pers, trans, m_eEMB1Cell[i] );
95  TPCNV_PERSTOTRANS( pers, trans, m_eEMB2Cell1[i] );
96  TPCNV_PERSTOTRANS( pers, trans, m_eEMB2Cell2[i] );
97  TPCNV_PERSTOTRANS( pers, trans, m_eEMB3Cell1[i] );
98  TPCNV_PERSTOTRANS( pers, trans, m_eEMB3Cell2[i] );
99  TPCNV_PERSTOTRANS( pers, trans, m_eEME1Cell[i] );
100  TPCNV_PERSTOTRANS( pers, trans, m_eEME2Cell1[i] );
101  TPCNV_PERSTOTRANS( pers, trans, m_eEME2Cell2[i] );
102  TPCNV_PERSTOTRANS( pers, trans, m_eEME3Cell1[i] );
103  TPCNV_PERSTOTRANS( pers, trans, m_eEME3Cell2[i] );
104  TPCNV_PERSTOTRANS( pers, trans, m_eTileBar0Cell[i] );
105  TPCNV_PERSTOTRANS( pers, trans, m_eTileBar1Cell[i] );
106  TPCNV_PERSTOTRANS( pers, trans, m_eTileBar2Cell[i] );
107  TPCNV_PERSTOTRANS( pers, trans, m_eTileExt0Cell[i] );
108  TPCNV_PERSTOTRANS( pers, trans, m_eTileExt1Cell[i] );
109  TPCNV_PERSTOTRANS( pers, trans, m_eTileExt2Cell[i] );
110  TPCNV_PERSTOTRANS( pers, trans, m_eHec0Cell1[i] );
111  TPCNV_PERSTOTRANS( pers, trans, m_eHec1Cell1[i] );
112  TPCNV_PERSTOTRANS( pers, trans, m_eHec2Cell1[i] );
113  TPCNV_PERSTOTRANS( pers, trans, m_eHec3Cell1[i] );
114  TPCNV_PERSTOTRANS( pers, trans, m_eHec0Cell2[i] );
115  TPCNV_PERSTOTRANS( pers, trans, m_eHec1Cell2[i] );
116  TPCNV_PERSTOTRANS( pers, trans, m_eHec2Cell2[i] );
117  TPCNV_PERSTOTRANS( pers, trans, m_eHec3Cell2[i] );
118  TPCNV_PERSTOTRANS( pers, trans, m_eFCal0Cell[i] );
119  TPCNV_PERSTOTRANS( pers, trans, m_eFCal1Cell[i] );
120  TPCNV_PERSTOTRANS( pers, trans, m_eFCal2Cell[i] );
121  }
122 
123  // Energy in cone radii, from cells and from tracks
124  for ( std::size_t i = 0; i != std::tuple_size_v<JetSampling_p2::ERad_t>; ++i ) {
125  TPCNV_PERSTOTRANS( pers, trans, m_erad_cells[i] );
126  TPCNV_PERSTOTRANS( pers, trans, m_erad_tracks[i] );
127  }
128 
129 // msg << MSG::DEBUG << "Loaded JetSampling from persistent state [OK]"
130 // << endmsg;
131  }
132 
134  JetSampling_p2* pers,
135  MsgStream& msg ) const
136 {
137 // msg << MSG::DEBUG << "Creating persistent state of JetSampling..."
138 // << endmsg;
139 
140  m_hlvCnv.transToPers( &trans->m_pr, &pers->m_pr, msg ); // reconstructed jet at EM scale
141  m_hlvCnv.transToPers( &trans->m_pt, &pers->m_pt, msg ); // PIC jet
142  m_hlvCnv.transToPers( &trans->m_pn, &pers->m_pn, msg ); // NTJ jet
143  m_hlvCnv.transToPers( &trans->m_pd, &pers->m_pd, msg ); // data driven jet kinematics
144  m_hlvCnv.transToPers( &trans->m_h1, &pers->m_h1, msg ); // calibrated jet H1
145  m_hlvCnv.transToPers( &trans->m_pisa, &pers->m_pisa, msg ); // calibrated jet PISA
146  m_hlvCnv.transToPers( &trans->m_samp, &pers->m_samp, msg ); // calibrated jet sampling
147 
148  // Distnace to 1st and 2nd NTJ jet
149  TPDFCNV_TRANSTOPERS( trans, pers, m_dr1 );
150  TPDFCNV_TRANSTOPERS( trans, pers, m_dr2 );
151 
152  // Jet sampling layer info
153  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsPreSamplerB );
154  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsPreSamplerE );
155  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsEMB1 );
156  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsEME1 );
157  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsEMB2 );
158  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsEME2 );
159  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsEMB3 );
160  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsEME3 );
161  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileBar0 );
162  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileExt0 );
163  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileBar1 );
164  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileExt1 );
165  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileBar2 );
166  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileExt2 );
167  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsHEC0 );
168  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsHEC1 );
169  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsHEC2 );
170  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsHEC3 );
171  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileGap1 );
172  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileGap2 );
173  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsTileGap3 );
174  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsFCAL0 );
175  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsFCAL1 );
176  TPDFCNV_TRANSTOPERS( trans, pers, m_ejsFCAL2 );
177 
178  TPDFCNV_TRANSTOPERS( trans, pers, m_tot );
179  TPDFCNV_TRANSTOPERS( trans, pers, m_ctot );
180  TPDFCNV_TRANSTOPERS( trans, pers, m_ehad );
181  TPDFCNV_TRANSTOPERS( trans, pers, m_eem );
182 
183  // JetSums no longer exist as members
184 
185  TPDFCNV_TRANSTOPERS( trans, pers, m_eCryo );
186  TPDFCNV_TRANSTOPERS( trans, pers, m_eGap );
187  TPDFCNV_TRANSTOPERS( trans, pers, m_eScint );
188  TPDFCNV_TRANSTOPERS( trans, pers, m_eNull );
189 
190  // JetECS
191  for ( std::size_t i = 0; i != std::tuple_size_v<JetSampling_p2::ECS_t>; ++i ) {
192  TPDFCNV_TRANSTOPERS( trans, pers, m_ePreSamBCell[i] );
193  TPDFCNV_TRANSTOPERS( trans, pers, m_ePreSamECell[i] );
194  TPDFCNV_TRANSTOPERS( trans, pers, m_eEMB1Cell[i] );
195  TPDFCNV_TRANSTOPERS( trans, pers, m_eEMB2Cell1[i] );
196  TPDFCNV_TRANSTOPERS( trans, pers, m_eEMB2Cell2[i] );
197  TPDFCNV_TRANSTOPERS( trans, pers, m_eEMB3Cell1[i] );
198  TPDFCNV_TRANSTOPERS( trans, pers, m_eEMB3Cell2[i] );
199  TPDFCNV_TRANSTOPERS( trans, pers, m_eEME1Cell[i] );
200  TPDFCNV_TRANSTOPERS( trans, pers, m_eEME2Cell1[i] );
201  TPDFCNV_TRANSTOPERS( trans, pers, m_eEME2Cell2[i] );
202  TPDFCNV_TRANSTOPERS( trans, pers, m_eEME3Cell1[i] );
203  TPDFCNV_TRANSTOPERS( trans, pers, m_eEME3Cell2[i] );
204  TPDFCNV_TRANSTOPERS( trans, pers, m_eTileBar0Cell[i] );
205  TPDFCNV_TRANSTOPERS( trans, pers, m_eTileBar1Cell[i] );
206  TPDFCNV_TRANSTOPERS( trans, pers, m_eTileBar2Cell[i] );
207  TPDFCNV_TRANSTOPERS( trans, pers, m_eTileExt0Cell[i] );
208  TPDFCNV_TRANSTOPERS( trans, pers, m_eTileExt1Cell[i] );
209  TPDFCNV_TRANSTOPERS( trans, pers, m_eTileExt2Cell[i] );
210  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec0Cell1[i] );
211  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec1Cell1[i] );
212  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec2Cell1[i] );
213  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec3Cell1[i] );
214  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec0Cell2[i] );
215  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec1Cell2[i] );
216  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec2Cell2[i] );
217  TPDFCNV_TRANSTOPERS( trans, pers, m_eHec3Cell2[i] );
218  TPDFCNV_TRANSTOPERS( trans, pers, m_eFCal0Cell[i] );
219  TPDFCNV_TRANSTOPERS( trans, pers, m_eFCal1Cell[i] );
220  TPDFCNV_TRANSTOPERS( trans, pers, m_eFCal2Cell[i] );
221  }
222 
223  // Energy in cone radii, from cells and from tracks
224  for ( std::size_t i = 0; i != std::tuple_size_v<JetSampling_p2::ERad_t>; ++i ) {
225  TPDFCNV_TRANSTOPERS( trans, pers, m_erad_cells[i] );
226  TPDFCNV_TRANSTOPERS( trans, pers, m_erad_tracks[i] );
227  }
228 
229 // msg << MSG::DEBUG << "Created persistent state of JetSampling [OK]"
230 // << endmsg;
231  }
JetSampling_p2::m_samp
HepLorentzVector_p1 m_samp
Calibbrated jet kinematics (samplings)
Definition: JetSampling_p2.h:81
JetSampling_p2::m_pd
HepLorentzVector_p1 m_pd
Data driven jet kinematics, could be any 4-mom vector used as reference for calibration.
Definition: JetSampling_p2.h:72
JetSampling::m_pd
CLHEP::HepLorentzVector m_pd
Data driven jet kinematics, reference jet kinematics It could be a CLHEP::HepLorentzVector with the k...
Definition: JetSampling.h:271
JetSamplingCnv_p2::transToPers
virtual void transToPers(const JetSampling *trans, JetSampling_p2 *pers, MsgStream &msg) const override
Method creating the persistent representation JetSampling_p2 from its transient representation JetSam...
Definition: JetSamplingCnv_p2.cxx:133
JetSampling::m_pn
CLHEP::HepLorentzVector m_pn
Nearest Truth Jet kinematics.
Definition: JetSampling.h:267
JetSamplingCnv_p2.h
JetSampling.h
JetSampling_p2::m_pt
HepLorentzVector_p1 m_pt
Particle-In-Cone Truth jet kinematics.
Definition: JetSampling_p2.h:65
JetSampling::m_pt
CLHEP::HepLorentzVector m_pt
Particle-In-Cone jet kinematics.
Definition: JetSampling.h:264
JetSampling::m_pr
CLHEP::HepLorentzVector m_pr
Reconstructed Jet at EM scale kinematics.
Definition: JetSampling.h:261
JetSamplingCnv_p2::m_hlvCnv
static const HepLorentzVectorCnv_p1 m_hlvCnv
Definition: JetSamplingCnv_p2.h:59
JetSampling_p2
Definition: JetSampling_p2.h:30
JetSampling::m_samp
CLHEP::HepLorentzVector m_samp
Kinematics of the PISA calibrated jet
Definition: JetSampling.h:276
JetSampling
Definition: JetSampling.h:44
lumiFormat.i
int i
Definition: lumiFormat.py:85
TPCNV_PERSTOTRANS
#define TPCNV_PERSTOTRANS(p, t, x)
Definition: JetSamplingCnv_p2.cxx:24
HepLorentzVectorCnv_p1::transToPers
virtual void transToPers(const CLHEP::HepLorentzVector *transObj, HepLorentzVector_p1 *persObj, MsgStream &log) const override
Method creating the persistent representation HepLorentzVector_p1 from its transient representation H...
Definition: HepLorentzVectorCnv_p1.cxx:35
TPDFCNV_TRANSTOPERS
#define TPDFCNV_TRANSTOPERS(t, p, x)
Definition: JetSamplingCnv_p2.cxx:26
JetSampling_p2::m_pn
HepLorentzVector_p1 m_pn
Nearest truth jet kinematics.
Definition: JetSampling_p2.h:68
JetSampling::m_h1
CLHEP::HepLorentzVector m_h1
Definition: JetSampling.h:274
HepLorentzVectorCnv_p1::persToTrans
virtual void persToTrans(const HepLorentzVector_p1 *persObj, CLHEP::HepLorentzVector *transObj, MsgStream &log) const override
Method creating the transient representation of HepLorentzVector from its persistent representation H...
Definition: HepLorentzVectorCnv_p1.cxx:26
JetSamplingCnv_p2::persToTrans
virtual void persToTrans(const JetSampling_p2 *pers, JetSampling *trans, MsgStream &msg) const override
Method creating the transient representation of JetSampling from its persistent representation JetSam...
Definition: JetSamplingCnv_p2.cxx:33
JetSampling::m_pisa
CLHEP::HepLorentzVector m_pisa
Kinematics of the H1 calibrated jet
Definition: JetSampling.h:275
JetSampling_p2::m_pisa
HepLorentzVector_p1 m_pisa
Calibrated jet kinematics (PISA)
Definition: JetSampling_p2.h:78
HepLorentzVectorCnv_p1
Definition: HepLorentzVectorCnv_p1.h:34
JetSampling_p2::m_h1
HepLorentzVector_p1 m_h1
Calibrated jet kinematics (H1)
Definition: JetSampling_p2.h:75
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
JetSampling_p2::m_pr
HepLorentzVector_p1 m_pr
Reconstructed jet at EM scale kinematics.
Definition: JetSampling_p2.h:62