ATLAS Offline Software
Loading...
Searching...
No Matches
TrigRoiDescriptorCnv_p3.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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( std::move(roi) );
140 }
141 }
142
143}
144
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define endmsg
Athena::TPCnvVers::Current TrigRoiDescriptor
Describes the API of the Region of Ineterest geometry.
virtual double eta() const =0
virtual double phiPlus() const =0
extreme phi values
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
virtual double phiMinus() const =0
virtual double phi() const =0
Methods to retrieve data members.
virtual double zedMinus() const =0
virtual double zed() const =0
virtual double etaMinus() const =0
virtual double etaPlus() const =0
virtual double etaMinus() const override final
gets eta at zMinus
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
bool manageConstituents() const
always manage constituents ???
virtual double etaPlus() const override final
gets eta at zedPlus
virtual double zed() const override final
virtual bool isFullscan() const override final
is this a full scan RoI?
virtual double phi() const override final
Methods to retrieve data members.
virtual double phiMinus() const override final
gets phiMinus
virtual double zedPlus() const override final
z at the most forward end of the RoI
virtual double zedMinus() const override final
z at the most backward end of the RoI
virtual const IRoiDescriptor * at(int i) const override final
find an RoiDescriptor constituent
bool m_fullscan
flag this as a full detector RoI
virtual unsigned size() const override final
number of constituents
virtual double eta() const override final
virtual double phiPlus() const override final
gets phiPlus
virtual void transToPers(const TrigRoiDescriptor *transObj, TrigRoiDescriptor_p3 *persObj, MsgStream &log)
virtual void persToTrans(const TrigRoiDescriptor_p3 *persObj, TrigRoiDescriptor *transObj, MsgStream &log)
std::vector< std::vector< float > > rois
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
virtual unsigned int roiWord() const override final
virtual unsigned int roiId() const override final
these quantities probably don't need to be used any more