ATLAS Offline Software
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
RPC_CondCabling::CMApivotdata Class Reference

#include <CMApivotdata.h>

Inheritance diagram for RPC_CondCabling::CMApivotdata:
Collaboration diagram for RPC_CondCabling::CMApivotdata:

Public Member Functions

 CMApivotdata (DBline &, int, const std::string &)
 
virtual ~CMApivotdata ()=default
 
std::unique_ptr< EtaCMAgive_eta_cma ()
 
std::unique_ptr< EvenPhiCMAgive_evenphi_cma ()
 
std::unique_ptr< OddPhiCMAgive_oddphi_cma ()
 
virtual void Print (std::ostream &, bool) const override
 

Private Types

typedef std::list< EtaCMAETAlist
 
typedef std::list< EvenPhiCMAEvenPHIlist
 
typedef std::list< OddPhiCMAOddPHIlist
 

Private Member Functions

void reset_data (void)
 
bool get_data (DBline &, CMAparameters::parseParams &parser)
 
bool confirm_data (ViewType, CMAparameters::parseParams &parser)
 
ObjectType tag () const
 
const std::string & name () const
 

Private Attributes

bool m_fail {true}
 
std::string m_layout
 
ViewType m_view {ViewType::NoView}
 
std::string m_covtag {}
 
ETAlist m_etaCMA
 
EvenPHIlist m_evenphiCMA
 
OddPHIlist m_oddphiCMA
 
ObjectType m_tag
 
std::string m_name
 

Detailed Description

Definition at line 20 of file CMApivotdata.h.

Member Typedef Documentation

◆ ETAlist

typedef std::list<EtaCMA> RPC_CondCabling::CMApivotdata::ETAlist
private

Definition at line 22 of file CMApivotdata.h.

◆ EvenPHIlist

Definition at line 23 of file CMApivotdata.h.

◆ OddPHIlist

Definition at line 24 of file CMApivotdata.h.

Constructor & Destructor Documentation

◆ CMApivotdata()

CMApivotdata::CMApivotdata ( DBline data,
int  type,
const std::string &  layout 
)

Definition at line 11 of file CMApivotdata.cxx.

12  : BaseObject(Logic, "CMA Data"),
13  m_layout (layout)
14 {
15  (++data)("{");
16  do {
18  parser.sectorType = type;
19  parser.station = 0;
20  if (get_data(data, parser)) {
21  if (m_view == ViewType::Eta) {
22  m_etaCMA.emplace_back(parser);
23  } else if (m_view == ViewType::Phi) {
24  if (parser.coverage == EvenSectors) {
25  m_evenphiCMA.emplace_back(parser);
26  } else if (parser.coverage == OddSectors) {
27  m_oddphiCMA.emplace_back(parser);
28  }
29  }
30  }
31  ++data;
32  } while (!data("}"));
33 }

◆ ~CMApivotdata()

virtual RPC_CondCabling::CMApivotdata::~CMApivotdata ( )
virtualdefault

Member Function Documentation

◆ confirm_data()

bool CMApivotdata::confirm_data ( ViewType  side,
CMAparameters::parseParams parser 
)
private

Definition at line 40 of file CMApivotdata.cxx.

40  {
41  int start = parser.pivotStartChan * 100 + parser.pivotStartStation;
42  int stop = parser.pivotStopChan * 100 + parser.pivotStopStation;
43  std::string view = (side == Phi) ? "phi" : "eta";
44 
45  std::ostringstream disp;
46 
47  if (!CMAidentity::coverage(m_covtag, parser.coverage)) {
48  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMApivotdata")
49  << "CMA cabling error into configuration for Sector Type " << parser.sectorType << ", " << m_covtag << " " << view
50  << " CMA number " << parser.number << std::endl
51  << " coverage tag ==> " << m_covtag << " <== is not recognized!";
52  return false;
53  }
54 
55  if ((side == ViewType::Eta) & start) {
56  if (start >= stop) {
57  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMApivotdata")
58  << "CMA cabling error into configuration for Sector Type " << parser.sectorType << ", " << view << " CMA number "
59  << parser.number << std::endl
60  << " start position (" << parser.pivotStartChan << ":" << parser.pivotStartStation << ") is greater than stop position ("
61  << parser.pivotStopChan << ":" << parser.pivotStopStation << ")";
62  return false;
63  }
64  }
65  if (side == ViewType::Phi && start) {
66  if (start >= stop && parser.coverage == EvenSectors) {
67  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMApivotdata")
68  << "CMA cabling error into configuration for Sector Type " << parser.sectorType << ", " << m_covtag << " " << view
69  << " CMA number " << parser.number << std::endl
70  << " start position (" << parser.pivotStartChan << ":" << parser.pivotStartStation << ") is greater than stop position ("
71  << parser.pivotStopChan << ":" << parser.pivotStopStation << ")";
72  return false;
73  }
74  if (start <= stop && parser.coverage == OddSectors) {
75  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMApivotdata")
76  << "CMA cabling error into configuration for Sector Type " << parser.sectorType << ", " << m_covtag << " " << view
77  << " CMA number " << parser.number << std::endl
78  << " start position (" << parser.pivotStartChan << ":" << parser.pivotStartStation << ") is lower than stop position ("
79  << parser.pivotStopChan << ":" << parser.pivotStopStation << ")";
80  return false;
81  }
82  if (parser.pivotStartChan != parser.pivotStopChan) {
83  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMApivotdata")
84  << "CMA cabling error into configuration for Sector Type " << parser.sectorType << ", " << m_covtag << " " << view
85  << " CMA number " << parser.number << std::endl
86  << " phi CMA Pivot connected to more than 1 wired or";
87  return false;
88  }
89  }
90  return true;
91 }

◆ get_data()

bool CMApivotdata::get_data ( DBline data,
CMAparameters::parseParams parser 
)
private

Definition at line 93 of file CMApivotdata.cxx.

93  {
94  reset_data();
95 
96  if (data("eta matrix") >> parser.number >> ":" >> "eta" >> parser.etaIndex >> "phi" >> parser.phiIndex >> "PAD" >> parser.padIndex >>
97  "Idx" >> parser.IxxIndex >> parser.pivotStation >> parser.lowPtStation >> parser.highPtStation >> parser.pivotStartChan >> ":" >>
98  parser.pivotStartStation >> "-" >> parser.pivotStopChan >> ":" >> parser.pivotStopStation) {
99  m_view = parser.view = ViewType::Eta;
100  m_fail = false;
101  if (!confirm_data(ViewType::Eta, parser)) m_fail = true;
102  }
103 
104  if (data("phi matrix") >> m_covtag >> parser.number >> ":" >> "eta" >> parser.etaIndex >> "phi" >> parser.phiIndex >> "PAD" >>
105  parser.padIndex >> "Idx" >> parser.IxxIndex >> parser.pivotStation >> parser.lowPtStation >> parser.highPtStation >>
106  parser.pivotStartChan >> ":" >> parser.pivotStartStation >> "-" >> parser.pivotStopChan >> ":" >> parser.pivotStopStation) {
107  m_view = parser.view = ViewType::Phi;
108  m_fail = false;
109  if (!confirm_data(ViewType::Phi, parser)) m_fail = true;
110  }
111 
112  return !m_fail;
113 }

◆ give_eta_cma()

std::unique_ptr< EtaCMA > CMApivotdata::give_eta_cma ( )

Definition at line 115 of file CMApivotdata.cxx.

115  {
116  if (!m_etaCMA.empty()) {
117  std::unique_ptr<EtaCMA> CMA = std::make_unique<EtaCMA>(m_etaCMA.front());
118  m_etaCMA.pop_front();
119  return CMA;
120  }
121  return nullptr;
122 }

◆ give_evenphi_cma()

std::unique_ptr< EvenPhiCMA > CMApivotdata::give_evenphi_cma ( )

Definition at line 124 of file CMApivotdata.cxx.

124  {
125  if (!m_evenphiCMA.empty()) {
126  std::unique_ptr<EvenPhiCMA> CMA = std::make_unique<EvenPhiCMA>(m_evenphiCMA.front());
127  m_evenphiCMA.pop_front();
128  return CMA;
129  }
130  return nullptr;
131 }

◆ give_oddphi_cma()

std::unique_ptr< OddPhiCMA > CMApivotdata::give_oddphi_cma ( )

Definition at line 133 of file CMApivotdata.cxx.

133  {
134  if (!m_oddphiCMA.empty()) {
135  std::unique_ptr<OddPhiCMA> CMA = std::make_unique<OddPhiCMA>(m_oddphiCMA.front());
136  m_oddphiCMA.pop_front();
137  return CMA;
138  }
139  return nullptr;
140 }

◆ name()

const std::string& BaseObject::name ( ) const
inlineinherited

Definition at line 23 of file BaseObject.h.

23 { return m_name; }

◆ Print()

void CMApivotdata::Print ( std::ostream &  stream,
bool  detail 
) const
overridevirtual

Reimplemented from BaseObject.

Definition at line 142 of file CMApivotdata.cxx.

142  {
143  stream << "CMA pivot segmentation";
144 
145  stream << "It contains " << m_etaCMA.size();
146  stream << " eta CMAs:" << std::endl;
147  ETAlist::const_iterator ei;
148  for (ei = m_etaCMA.begin(); ei != m_etaCMA.end(); ++ei) stream << ShowRequest<EtaCMA>(*ei, detail);
149 
150  stream << "It contains " << m_evenphiCMA.size();
151  stream << "even phi CMAs:" << std::endl;
152  EvenPHIlist::const_iterator ev;
153  for (ev = m_evenphiCMA.begin(); ev != m_evenphiCMA.end(); ++ev) stream << ShowRequest<EvenPhiCMA>(*ev, detail);
154 
155  stream << "It contains " << m_oddphiCMA.size();
156  stream << "odd phi CMAs:" << std::endl;
157  OddPHIlist::const_iterator od;
158  for (od = m_oddphiCMA.begin(); od != m_oddphiCMA.end(); ++od) stream << ShowRequest<OddPhiCMA>(*od, detail);
159 }

◆ reset_data()

void CMApivotdata::reset_data ( void  )
private

Definition at line 34 of file CMApivotdata.cxx.

34  {
36  m_covtag.clear();
37  m_fail = true;
38 }

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22 { return m_tag; }

Member Data Documentation

◆ m_covtag

std::string RPC_CondCabling::CMApivotdata::m_covtag {}
private

Definition at line 31 of file CMApivotdata.h.

◆ m_etaCMA

ETAlist RPC_CondCabling::CMApivotdata::m_etaCMA
private

Definition at line 33 of file CMApivotdata.h.

◆ m_evenphiCMA

EvenPHIlist RPC_CondCabling::CMApivotdata::m_evenphiCMA
private

Definition at line 34 of file CMApivotdata.h.

◆ m_fail

bool RPC_CondCabling::CMApivotdata::m_fail {true}
private

Definition at line 26 of file CMApivotdata.h.

◆ m_layout

std::string RPC_CondCabling::CMApivotdata::m_layout
private

Definition at line 28 of file CMApivotdata.h.

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_oddphiCMA

OddPHIlist RPC_CondCabling::CMApivotdata::m_oddphiCMA
private

Definition at line 35 of file CMApivotdata.h.

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.

◆ m_view

ViewType RPC_CondCabling::CMApivotdata::m_view {ViewType::NoView}
private

Definition at line 30 of file CMApivotdata.h.


The documentation for this class was generated from the following files:
python.CaloScaleNoiseConfig.parser
parser
Definition: CaloScaleNoiseConfig.py:75
OddSectors
@ OddSectors
Definition: CMAidentity.h:14
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
BaseObject::m_name
std::string m_name
Definition: BaseObject.h:16
RPC_CondCabling::CMApivotdata::m_covtag
std::string m_covtag
Definition: CMApivotdata.h:31
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
detail
Definition: extract_histogram_tag.cxx:14
Phi
@ Phi
Definition: RPCdef.h:8
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
Logic
@ Logic
Definition: BaseObject.h:11
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
TRT::Hit::side
@ side
Definition: HitInfo.h:83
ev
int ev
Definition: globals.cxx:25
RPC_CondCabling::CMApivotdata::m_etaCMA
ETAlist m_etaCMA
Definition: CMApivotdata.h:33
EvenSectors
@ EvenSectors
Definition: CMAidentity.h:14
RPC_CondCabling::CMApivotdata::m_evenphiCMA
EvenPHIlist m_evenphiCMA
Definition: CMApivotdata.h:34
RPC_CondCabling::CMApivotdata::m_oddphiCMA
OddPHIlist m_oddphiCMA
Definition: CMApivotdata.h:35
RPC_CondCabling::CMApivotdata::confirm_data
bool confirm_data(ViewType, CMAparameters::parseParams &parser)
Definition: CMApivotdata.cxx:40
RPC_CondCabling::CMApivotdata::reset_data
void reset_data(void)
Definition: CMApivotdata.cxx:34
NoView
@ NoView
Definition: RPCdef.h:8
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
BaseObject::BaseObject
BaseObject(ObjectType, const std::string &)
Definition: BaseObject.cxx:7
RPC_CondCabling::CMApivotdata::m_layout
std::string m_layout
Definition: CMApivotdata.h:28
CMAparameters::parseParams
Definition: CMAparameters.h:51
BaseObject::m_tag
ObjectType m_tag
Definition: BaseObject.h:15
RPC_CondCabling::CMApivotdata::m_fail
bool m_fail
Definition: CMApivotdata.h:26
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CMAidentity::coverage
CMAcoverage coverage() const
Definition: CMAidentity.cxx:118
RPC_CondCabling::CMApivotdata::get_data
bool get_data(DBline &, CMAparameters::parseParams &parser)
Definition: CMApivotdata.cxx:93
Eta
@ Eta
Definition: RPCdef.h:8
RPC_CondCabling::CMApivotdata::m_view
ViewType m_view
Definition: CMApivotdata.h:30
drawFromPickle.view
view
Definition: drawFromPickle.py:294