ATLAS Offline Software
TrigRoiDescriptorCnv_p3.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <iostream>
9 
10 
12  TrigRoiDescriptor* transObj,
13  MsgStream &log)
14 {
15  log << MSG::DEBUG << "TrigRoiDescriptorCnv_p3::persToTrans called " << endmsg;
16 
17  double phi = persObj->geom[PHI] ;
18  double eta = persObj->geom[ETA] ;
19  double zed = persObj->geom[ZED] ;
20 
21  double phiPlus = persObj->geom[PHIPLUS] ;
22  double phiMinus = persObj->geom[PHIMINUS] ;
23  double etaPlus = persObj->geom[ETAPLUS] ;
24  double etaMinus = persObj->geom[ETAMINUS] ;
25  double zedPlus = persObj->geom[ZEDPLUS] ;
26  double zedMinus = persObj->geom[ZEDMINUS] ;
27 
31 
36 
40 
41  if ( std::isnan(phiPlus) ) {
42  log << MSG::WARNING << "TrigRoiDescriptorCnv_p3::persToTrans: remapping nan for phiPlus " << endmsg;
43  phiPlus = phi;
44  }
45 
46  if ( std::isnan(phiMinus) ) {
47  log << MSG::WARNING << "TrigRoiDescriptorCnv_p3::persToTrans: remapping nan for phiMinus " << endmsg;
48  phiMinus = phi;
49  }
50 
51  if ( std::isnan(etaPlus) ) {
52  log << MSG::WARNING << "TrigRoiDescriptorCnv_p3::persToTrans: remapping nan for etaPlus " << endmsg;
53  etaPlus = eta;
54  }
55 
56  if ( std::isnan(etaMinus) ) {
57  log << MSG::WARNING << "TrigRoiDescriptorCnv_p3::persToTrans: remapping nan for etaMinus " << endmsg;
58  etaMinus = eta;
59  }
60 
61  if ( std::isnan(zedPlus) ) {
62  log << MSG::WARNING << "TrigRoiDescriptorCnv_p3::persToTrans: remapping nan for zedPlus " << endmsg;
63  zedPlus = zed;
64  }
65 
66  if ( std::isnan(zedMinus) ) {
67  log << MSG::WARNING << "TrigRoiDescriptorCnv_p3::persToTrans: remapping nan for zedMinus " << endmsg;
68  zedMinus = zed;
69  }
70 
71  *transObj = TrigRoiDescriptor (persObj->ids[ROIWORD],
72  0,
73  persObj->ids[ROIID],
74  eta, etaMinus, etaPlus,
75  phi, phiMinus, phiPlus,
76  zed, zedMinus, zedPlus );
77 
78  transObj->m_fullscan = persObj->fullscan ;
79 
80  if ( persObj->rois.size()>0 ) {
81 
82  transObj->manageConstituents (true);
83 
84  for (const std::vector<float>& roi : persObj->rois) {
85  transObj->push_back( new TrigRoiDescriptor( roi[ETA], roi[ETAMINUS], roi[ETAPLUS],
86  roi[PHI], roi[PHIMINUS], roi[PHIPLUS],
87  roi[ZED], roi[ZEDMINUS], roi[ZEDPLUS] ) );
88  }
89  }
90 
91 }
92 
93 
95  TrigRoiDescriptor_p3* persObj,
96  MsgStream &log)
97 {
98  log << MSG::DEBUG << "TrigRoiDescriptorCnv_p3::transToPers called " << endmsg;
99 
100  persObj->geom[PHI] = transObj->phi() ;
101  persObj->geom[ETA] = transObj->eta() ;
102  persObj->geom[ZED] = transObj->zed() ;
103  persObj->geom[PHIPLUS] = transObj->phiPlus() ;
104  persObj->geom[PHIMINUS] = transObj->phiMinus() ;
105  persObj->geom[ETAPLUS] = transObj->etaPlus() ;
106  persObj->geom[ETAMINUS] = transObj->etaMinus() ;
107  persObj->geom[ZEDPLUS] = transObj->zedPlus() ;
108  persObj->geom[ZEDMINUS] = transObj->zedMinus() ;
109 
110  persObj->ids[ROIID] = transObj->roiId() ;
111  persObj->ids[ROIWORD] = transObj->roiWord() ;
112 
113  persObj->fullscan = transObj->isFullscan() ;
114 
115 
116  if ( transObj->size()>0 ) {
117 
118  persObj->rois.reserve(transObj->size());
119 
120  for ( unsigned i=0 ; i<transObj->size() ; i++ ) {
121 
122  std::vector<float> roi(9);
123 
124  const IRoiDescriptor* iroi = transObj->at(i);
125 
126  roi[PHI] = iroi->phi();
127  roi[ETA] = iroi->eta();
128  roi[ZED] = iroi->zed();
129 
130  roi[PHIMINUS] = iroi->phiMinus();
131  roi[PHIPLUS] = iroi->phiPlus();
132 
133  roi[ETAMINUS] = iroi->etaMinus();
134  roi[ETAPLUS] = iroi->etaPlus();
135 
136  roi[ZEDMINUS] = iroi->zedMinus();
137  roi[ZEDPLUS] = iroi->zedPlus();
138 
139  persObj->rois.push_back( roi );
140  }
141  }
142 
143 }
144 
IRoiDescriptor::phi
virtual double phi() const =0
Methods to retrieve data members.
TrigRoiDescriptorCnv_p3::ZED
@ ZED
Definition: TrigRoiDescriptorCnv_p3.h:40
TrigRoiDescriptorCnv_p3::ETAPLUS
@ ETAPLUS
Definition: TrigRoiDescriptorCnv_p3.h:42
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_p3::PHIMINUS
@ PHIMINUS
Definition: TrigRoiDescriptorCnv_p3.h:41
TrigRoiDescriptorCnv_p3::ZEDMINUS
@ ZEDMINUS
Definition: TrigRoiDescriptorCnv_p3.h:43
IRoiDescriptor::etaMinus
virtual double etaMinus() const =0
TrigRoiDescriptorCnv_p3.h
TrigRoiDescriptor::roiWord
virtual unsigned int roiWord() const override final
Definition: TrigRoiDescriptor.h:135
RoiDescriptor::size
virtual unsigned size() const override final
number of constituents
Definition: RoiDescriptor.h:145
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
IRoiDescriptor::etaPlus
virtual double etaPlus() const =0
TrigRoiDescriptor_p3::fullscan
bool fullscan
Definition: TrigRoiDescriptor_p3.h:34
TrigRoiDescriptorCnv_p3::ROIWORD
@ ROIWORD
Definition: TrigRoiDescriptorCnv_p3.h:45
TrigRoiDescriptorCnv_p3::ETAMINUS
@ ETAMINUS
Definition: TrigRoiDescriptorCnv_p3.h:42
TrigRoiDescriptor_p3::geom
float geom[9]
Definition: TrigRoiDescriptor_p3.h:30
IRoiDescriptor::eta
virtual double eta() const =0
TrigRoiDescriptorCnv_p3::persToTrans
virtual void persToTrans(const TrigRoiDescriptor_p3 *persObj, TrigRoiDescriptor *transObj, MsgStream &log)
Definition: TrigRoiDescriptorCnv_p3.cxx:11
RoiDescriptor::push_back
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
Definition: RoiDescriptor.h:157
RoiDescriptor::at
virtual const IRoiDescriptor * at(int i) const override final
find an RoiDescriptor constituent
Definition: RoiDescriptor.h:148
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigRoiDescriptorCnv_p3::transToPers
virtual void transToPers(const TrigRoiDescriptor *transObj, TrigRoiDescriptor_p3 *persObj, MsgStream &log)
Definition: TrigRoiDescriptorCnv_p3.cxx:94
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
TrigRoiDescriptor_p3
Definition: TrigRoiDescriptor_p3.h:17
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
IRoiDescriptor::phiPlus
virtual double phiPlus() const =0
extreme phi values
RoiDescriptor::zed
virtual double zed() const override final
Definition: RoiDescriptor.h:102
TrigRoiDescriptorCnv_p3::PHI
@ PHI
Definition: TrigRoiDescriptorCnv_p3.h:40
TrigRoiDescriptor_p3::rois
std::vector< std::vector< float > > rois
Definition: TrigRoiDescriptor_p3.h:36
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_p3.h
RoiDescriptor::etaPlus
virtual double etaPlus() const override final
gets eta at zedPlus
Definition: RoiDescriptor.h:115
IRoiDescriptor::zedPlus
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
TrigRoiDescriptorCnv_p3::ZEDPLUS
@ ZEDPLUS
Definition: TrigRoiDescriptorCnv_p3.h:43
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::isFullscan
virtual bool isFullscan() const override final
is this a full scan RoI?
Definition: RoiDescriptor.h:132
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
IRoiDescriptor::zed
virtual double zed() const =0
RoiDescriptor::m_fullscan
bool m_fullscan
flag this as a full detector RoI
Definition: RoiDescriptor.h:232
IRoiDescriptor::zedMinus
virtual double zedMinus() const =0
TrigRoiDescriptor_p3::ids
unsigned ids[2]
Definition: TrigRoiDescriptor_p3.h:32
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
TrigRoiDescriptor.h
TrigRoiDescriptorCnv_p3::ROIID
@ ROIID
Definition: TrigRoiDescriptorCnv_p3.h:45
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141
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
TrigRoiDescriptorCnv_p3::PHIPLUS
@ PHIPLUS
Definition: TrigRoiDescriptorCnv_p3.h:41
TrigRoiDescriptorCnv_p3::ETA
@ ETA
Definition: TrigRoiDescriptorCnv_p3.h:40
RoiDescriptor::zedPlus
virtual double zedPlus() const override final
z at the most forward end of the RoI
Definition: RoiDescriptor.h:112