ATLAS Offline Software
TrigRoiDescriptorCnv_p1.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 #include <iostream>
7 #include <cmath>
10 
11 
13  TrigRoiDescriptor* transObj,
14  MsgStream &log)
15 {
16  log << MSG::DEBUG << "TrigRoiDescriptorCnv_p1::persToTrans called " << endmsg;
17 
18  double phi = persObj->m_phi0 ;
19  double eta = persObj->m_eta0 ;
20  double zed = persObj->m_zed0 ;
21  double phiPlus = persObj->m_phi0 + persObj->m_phiHalfWidth;
22  double phiMinus = persObj->m_phi0 - persObj->m_phiHalfWidth;
23  double etaPlus = persObj->m_eta0 + persObj->m_etaHalfWidth;
24  double etaMinus = persObj->m_eta0 - persObj->m_etaHalfWidth;
25  double zedPlus = persObj->m_zed0 + persObj->m_zedHalfWidth;
26  double zedMinus = persObj->m_zed0 - persObj->m_zedHalfWidth;
27 
28  *transObj = TrigRoiDescriptor (persObj->m_roiWord,
29  persObj->m_l1Id,
30  persObj->m_roiId,
31  eta, etaMinus, etaPlus,
32  phi, phiMinus, phiPlus,
33  zed, zedMinus, zedPlus );
34  transObj->version (1);
35 }
36 
37 
39  TrigRoiDescriptor_p1* persObj,
40  MsgStream &log)
41 {
42  log << MSG::DEBUG << "TrigRoiDescriptorCnv_p1::transToPers called " << endmsg;
43  // log << MSG::FATAL << "TrigRoiDescriptorCnv_p1::transToPers called - do not use this converter, use more recent converter" << endmsg;
44 
45  persObj->m_phi0 = transObj->phi() ;
46  persObj->m_eta0 = transObj->eta() ;
47  persObj->m_zed0 = transObj->zed() ;
48 
49  if ( transObj->phiPlus() > transObj->phiMinus() )
50  persObj->m_phiHalfWidth = 0.5*( transObj->phiPlus()-transObj->phiMinus());
51  else
52  persObj->m_phiHalfWidth = 0.5*( transObj->phiPlus()-transObj->phiMinus()) + M_PI;
53 
54  persObj->m_etaHalfWidth = 0.5*std::fabs( transObj->etaPlus()-transObj->etaMinus()) ;
55  persObj->m_zedHalfWidth = 0.5*std::fabs( transObj->zedPlus()-transObj->zedMinus()) ;
56  persObj->m_etaPlus = transObj->etaPlus() ;
57  persObj->m_etaMinus = transObj->etaMinus() ;
58 
59  persObj->m_l1Id = transObj->l1Id() ;
60  persObj->m_roiId = transObj->roiId() ;
61  persObj->m_roiWord = transObj->roiWord() ;
62  //persObj->m_serialized = transObj->m_serialized ;
63 }
TrigRoiDescriptor_p1::m_etaPlus
float m_etaPlus
Definition: TrigRoiDescriptor_p1.h:49
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
RoiDescriptor::zedMinus
virtual double zedMinus() const override final
z at the most backward end of the RoI
Definition: RoiDescriptor.h:113
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TrigRoiDescriptorCnv_p1::persToTrans
virtual void persToTrans(const TrigRoiDescriptor_p1 *persObj, TrigRoiDescriptor *transObj, MsgStream &log)
Definition: TrigRoiDescriptorCnv_p1.cxx:12
TrigRoiDescriptor_p1::m_eta0
float m_eta0
Definition: TrigRoiDescriptor_p1.h:44
TrigRoiDescriptor_p1
Definition: TrigRoiDescriptor_p1.h:23
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigRoiDescriptor::roiWord
virtual unsigned int roiWord() const override final
Definition: TrigRoiDescriptor.h:135
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
TrigRoiDescriptorCnv_p1.h
TrigRoiDescriptor_p1::m_zedHalfWidth
float m_zedHalfWidth
Definition: TrigRoiDescriptor_p1.h:48
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigRoiDescriptor_p1::m_etaMinus
float m_etaMinus
Definition: TrigRoiDescriptor_p1.h:50
TrigRoiDescriptorCnv_p1::transToPers
virtual void transToPers(const TrigRoiDescriptor *transObj, TrigRoiDescriptor_p1 *persObj, MsgStream &log)
Definition: TrigRoiDescriptorCnv_p1.cxx:38
TrigRoiDescriptor::l1Id
virtual unsigned int l1Id() const override final
Definition: TrigRoiDescriptor.h:134
TrigRoiDescriptor_p1::m_phiHalfWidth
float m_phiHalfWidth
Definition: TrigRoiDescriptor_p1.h:46
RoiDescriptor::zed
virtual double zed() const override final
Definition: RoiDescriptor.h:102
TrigRoiDescriptor_p1.h
TrigRoiDescriptor::roiId
virtual unsigned int roiId() const override final
these quantities probably don't need to be used any more
Definition: TrigRoiDescriptor.h:133
TrigRoiDescriptor_p1::m_roiId
unsigned int m_roiId
Definition: TrigRoiDescriptor_p1.h:53
RoiDescriptor::etaPlus
virtual double etaPlus() const override final
gets eta at zedPlus
Definition: RoiDescriptor.h:115
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigRoiDescriptor_p1::m_zed0
float m_zed0
Definition: TrigRoiDescriptor_p1.h:45
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
TrigRoiDescriptor_p1::m_phi0
float m_phi0
Definition: TrigRoiDescriptor_p1.h:43
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
TrigRoiDescriptor.h
RoiDescriptor::version
virtual int version() const override final
versioning
Definition: RoiDescriptor.h:123
RoiDescriptor::phiPlus
virtual double phiPlus() const override final
gets phiPlus
Definition: RoiDescriptor.h:118
RoiDescriptor::etaMinus
virtual double etaMinus() const override final
gets eta at zMinus
Definition: RoiDescriptor.h:116
TrigRoiDescriptor_p1::m_l1Id
unsigned int m_l1Id
Definition: TrigRoiDescriptor_p1.h:52
RoiDescriptor::phiMinus
virtual double phiMinus() const override final
gets phiMinus
Definition: RoiDescriptor.h:119
TrigRoiDescriptor_p1::m_etaHalfWidth
float m_etaHalfWidth
Definition: TrigRoiDescriptor_p1.h:47
TrigRoiDescriptor_p1::m_roiWord
unsigned int m_roiWord
Definition: TrigRoiDescriptor_p1.h:54
RoiDescriptor::zedPlus
virtual double zedPlus() const override final
z at the most forward end of the RoI
Definition: RoiDescriptor.h:112