ATLAS Offline Software
TrigRoiDescriptorCnv_p2.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_p2::persToTrans called " << endmsg;
17 
18  double phi = persObj->geom[PHI] ;
19  double eta = persObj->geom[ETA] ;
20  double zed = persObj->geom[ZED] ;
21  double phiPlus = persObj->geom[PHI] + persObj->geom[WPHI];
22  double phiMinus = persObj->geom[PHI] - persObj->geom[WPHI];
23  double etaPlus = persObj->geom[ETA] + persObj->geom[WETA];
24  double etaMinus = persObj->geom[ETA] - persObj->geom[WETA];
25  double zedPlus = persObj->geom[ZED] + persObj->geom[WZED];
26  double zedMinus = persObj->geom[ZED] - persObj->geom[WZED];
27 
28  *transObj = TrigRoiDescriptor (persObj->ids[ROIWORD],
29  0,
30  persObj->ids[ROIID],
31  eta, etaMinus, etaPlus,
32  phi, phiMinus, phiPlus,
33  zed, zedMinus, zedPlus );
34 
35  transObj->version (2);
36 }
37 
38 
40  TrigRoiDescriptor_p2* persObj,
41  MsgStream &log)
42 {
43  log << MSG::DEBUG << "TrigRoiDescriptorCnv_p2::transToPers called " << endmsg;
44  // log << MSG::FATAL << "TrigRoiDescriptorCnv_p1::transToPers called - do not use this converter, use more recent converter" << endmsg;
45 
46  persObj->geom[PHI] = transObj->phi() ;
47  persObj->geom[ETA] = transObj->eta() ;
48  persObj->geom[ZED] = transObj->zed() ;
49 
50  if ( transObj->phiPlus() > transObj->phiMinus() )
51  persObj->geom[WPHI] = 0.5*(transObj->phiPlus() - transObj->phiMinus());
52  else
53  persObj->geom[WPHI] = 0.5*(transObj->phiPlus() - transObj->phiMinus()) + M_PI;
54 
55  persObj->geom[WETA] = 0.5*std::fabs( transObj->etaPlus() - transObj->etaMinus() );
56  persObj->geom[WZED] = 0.5*std::fabs( transObj->zedPlus() - transObj->zedMinus() );
57  persObj->geom[ETAPLUS] = transObj->etaPlus() ;
58  persObj->geom[ETAMINUS] = transObj->etaMinus() ;
59 
60  persObj->ids[ROIID] = transObj->roiId() ;
61  persObj->ids[ROIWORD] = transObj->roiWord() ;
62 }
63 
TrigRoiDescriptorCnv_p2::PHI
@ PHI
Definition: TrigRoiDescriptorCnv_p2.h:39
TrigRoiDescriptorCnv_p2::ETAMINUS
@ ETAMINUS
Definition: TrigRoiDescriptorCnv_p2.h:39
TrigRoiDescriptor_p2::geom
float geom[8]
Definition: TrigRoiDescriptor_p2.h:30
TrigRoiDescriptorCnv_p2::WPHI
@ WPHI
Definition: TrigRoiDescriptorCnv_p2.h:39
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
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigRoiDescriptor::roiWord
virtual unsigned int roiWord() const override final
Definition: TrigRoiDescriptor.h:135
TrigRoiDescriptorCnv_p2::persToTrans
virtual void persToTrans(const TrigRoiDescriptor_p2 *persObj, TrigRoiDescriptor *transObj, MsgStream &log)
Definition: TrigRoiDescriptorCnv_p2.cxx:12
TrigRoiDescriptorCnv_p2::ETAPLUS
@ ETAPLUS
Definition: TrigRoiDescriptorCnv_p2.h:39
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
TrigRoiDescriptorCnv_p2.h
TrigRoiDescriptorCnv_p2::transToPers
virtual void transToPers(const TrigRoiDescriptor *transObj, TrigRoiDescriptor_p2 *persObj, MsgStream &log)
Definition: TrigRoiDescriptorCnv_p2.cxx:39
TrigRoiDescriptorCnv_p2::ZED
@ ZED
Definition: TrigRoiDescriptorCnv_p2.h:39
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigRoiDescriptorCnv_p2::ETA
@ ETA
Definition: TrigRoiDescriptorCnv_p2.h:39
TrigRoiDescriptor_p2.h
RoiDescriptor::zed
virtual double zed() const override final
Definition: RoiDescriptor.h:102
TrigRoiDescriptorCnv_p2::ROIWORD
@ ROIWORD
Definition: TrigRoiDescriptorCnv_p2.h:40
TrigRoiDescriptor::roiId
virtual unsigned int roiId() const override final
these quantities probably don't need to be used any more
Definition: TrigRoiDescriptor.h:133
RoiDescriptor::etaPlus
virtual double etaPlus() const override final
gets eta at zedPlus
Definition: RoiDescriptor.h:115
TrigRoiDescriptorCnv_p2::WZED
@ WZED
Definition: TrigRoiDescriptorCnv_p2.h:39
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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
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
RoiDescriptor::phiMinus
virtual double phiMinus() const override final
gets phiMinus
Definition: RoiDescriptor.h:119
TrigRoiDescriptor_p2::ids
unsigned int ids[2]
Definition: TrigRoiDescriptor_p2.h:41
TrigRoiDescriptorCnv_p2::ROIID
@ ROIID
Definition: TrigRoiDescriptorCnv_p2.h:40
TrigRoiDescriptorCnv_p2::WETA
@ WETA
Definition: TrigRoiDescriptorCnv_p2.h:39
TrigRoiDescriptor_p2
Definition: TrigRoiDescriptor_p2.h:17
RoiDescriptor::zedPlus
virtual double zedPlus() const override final
z at the most forward end of the RoI
Definition: RoiDescriptor.h:112