ATLAS Offline Software
PADpatterns.cxx
Go to the documentation of this file.
1 /* // -*- C++ -*- */
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
9 
10 
11 PADpatterns::PADpatterns(int sector, int pad,unsigned long int debug) :
12  RPCtrigDataObject(0,"PAD patterns"),m_sector(sector),m_pad_id(pad),
13  m_debug(debug)
14 {
15 }
16 
18  RPCtrigDataObject(PAD.number(),PAD.name())
19 {
20  m_sector = PAD.sector();
21  m_pad_id = PAD.pad_id();
22  m_debug = PAD.debug();
24 }
25 
28 {
29  static_cast<RPCtrigDataObject&>(*this) =
30  static_cast<const RPCtrigDataObject&>(PAD);
31  m_sector = PAD.sector();
32  m_pad_id = PAD.pad_id();
33  m_debug = PAD.debug();
34  m_cma_patterns.clear();
36  return *this;
37 }
38 
39 bool
41 {
42  if(m_sector == patterns.sector())
43  {
44  if (m_pad_id == patterns.pad_id() ) return true;
45  }
46  return false;
47 }
48 
49 bool
51 {
52  return !(*this == patterns);
53 }
54 
55 
56 bool
58 {
59  if(m_sector < patterns.sector())
60  {
61  if (m_pad_id < patterns.pad_id() ) return true;
62  }
63  return false;
64 }
65 
66 void
68 {
69  m_cma_patterns.push_back(patterns);
70 }
71 
72 
75 {
76  this->load_cma_patterns(patterns);
77  return *this;
78 }
79 
80 Pad*
81 PADpatterns::give_pad(const RpcCablingCondData* readCdo, int NOBXS, int BCZERO)
82 {
83  if (!m_pad)
84  {
85  int subsystem = (m_sector<32)? 0 : 1;
86  int logic_sector = m_sector%32;
87 
89 
90  // M.Corradi 26/2/2010 check if old cabling from cma data !
91  bool oldSimulation = false;
92  if (cma!=m_cma_patterns.end()) {
93  if ( (*cma)->cma_parameters().conf_type() != CMAparameters::Atlas){
94  oldSimulation = true;
95  }
96  }
97 
98  m_pad = std::make_unique<Pad>(0,0,m_debug,subsystem,logic_sector,m_pad_id,1,oldSimulation, NOBXS);
99 
100  //M.Corradi 8/1/2015 get Pad configuration Parameters
101  bool eta_and_phi, feet_on;
102  unsigned short int cma_mask, feet_th0, feet_th1, feet_th2 ;
103 
104  if (readCdo->give_Pad_Parameters((unsigned short int)m_sector,
105  (unsigned short int)m_pad_id,
106  feet_on,eta_and_phi,cma_mask,
107  feet_th0,feet_th1,feet_th2)){
108  m_pad->setFeetOn(feet_on);
109  m_pad->setFeetThresholds(0,feet_th0);
110  m_pad->setFeetThresholds(1,feet_th1);
111  m_pad->setFeetThresholds(2,feet_th2);
112  // m_pad->display(1);
113  // MASK AND eta_and_phi to be implemented
114 
115  }else {
116  std::runtime_error("Could not retrieve Pad Parameters m_sector, m_pad_id = " +
118  }
119 
120 
121  while(cma != m_cma_patterns.end())
122  {
123  Matrix* low_pt_matrix = (*cma)->give_low_pt_matrix(NOBXS, BCZERO);
124  Matrix* high_pt_matrix = (*cma)->give_high_pt_matrix(NOBXS, BCZERO);
125 
126  CMAidentity id = (*cma)->cma_parameters().id();
127  int matrix_view = (id.type() == Phi)? 1 : 0;
128  int matrix_id = id.Ixx_index();
129 
130  for (int bunch=0;bunch< NOBXS;++bunch)
131  {
132  m_pad->load(0,matrix_view,matrix_id,bunch,
133  low_pt_matrix->getOutputThres(bunch),
134  low_pt_matrix->getOutputOverl(bunch));
135 
136  m_pad->load(1,matrix_view,matrix_id,bunch,
137  high_pt_matrix->getOutputThres(bunch),
138  high_pt_matrix->getOutputOverl(bunch));
139  }
140  ++cma;
141  }
142 
143  m_pad->execute();
144  }
145  return m_pad.get();
146 }
147 
148 void
149 PADpatterns::Print(std::ostream& stream,bool detail) const
150 {
151  stream << name() << " (Id = " << m_pad_id << ") in sector logic "
152  << m_sector << std::endl;
153  stream << "It contains n. " << m_cma_patterns.size()
154  << " CMAs";
155 
156  if(detail)
157  {
158  stream << " :" << std::endl;
159  CMAdata::PatternsList::const_iterator cma = m_cma_patterns.begin();
160  while (cma != m_cma_patterns.end())
161  {
162  (*cma)->Print(stream,false);
163  ++cma;
164  }
165  }
166  else stream << "." << std::endl;
167 }
168 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Matrix
Definition: Trigger/TrigT1/TrigT1RPChardware/TrigT1RPChardware/Matrix.h:15
PADpatterns::operator!=
bool operator!=(const PADpatterns &) const
Definition: PADpatterns.cxx:50
Matrix::getOutputThres
ubit16 getOutputThres(ubit16 bunch) const
Definition: Trigger/TrigT1/TrigT1RPChardware/src/Matrix.cxx:1762
patterns
std::vector< std::string > patterns
Definition: listroot.cxx:187
PADpatterns::m_sector
int m_sector
Definition: PADpatterns.h:25
PADpatterns::pad_id
int pad_id(void) const
Definition: PADpatterns.h:49
detail
Definition: extract_histogram_tag.cxx:14
Phi
@ Phi
Definition: RPCdef.h:8
PADpatterns::m_cma_patterns
CMAdata::PatternsList m_cma_patterns
Definition: PADpatterns.h:29
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
RpcCablingCondData
Definition: RpcCablingCondData.h:21
PADpatterns
Definition: PADpatterns.h:20
PADpatterns::m_debug
unsigned long int m_debug
Definition: PADpatterns.h:27
PADpatterns::PADpatterns
PADpatterns(int, int, unsigned long int)
Definition: PADpatterns.cxx:11
PADpatterns::load_cma_patterns
void load_cma_patterns(CMApatterns *)
Definition: PADpatterns.cxx:67
RpcCablingCondData::give_Pad_Parameters
virtual bool give_Pad_Parameters(unsigned short int logic_sector, unsigned short int PADId, bool &feet, bool &eta_and_phi, unsigned short int &cma_mask, unsigned short int &feet_th0, unsigned short int &feet_th1, unsigned short int &feet_th2) const
Definition: RpcCablingCondData.cxx:405
BaseObject::name
std::string name() const
Definition: BaseObject.h:23
PADpatterns::m_pad
std::unique_ptr< Pad > m_pad
Definition: PADpatterns.h:32
Matrix::getOutputOverl
ubit16 getOutputOverl(ubit16 bunch) const
Definition: Trigger/TrigT1/TrigT1RPChardware/src/Matrix.cxx:1764
PADpatterns::operator==
bool operator==(const PADpatterns &) const
Definition: PADpatterns.cxx:40
PADpatterns::give_pad
Pad * give_pad(const RpcCablingCondData *readCdo, int NOBXS, int BCZERO)
Definition: PADpatterns.cxx:81
CMAidentity::Ixx_index
int Ixx_index() const
Definition: CMAidentity.cxx:123
python.selection.number
number
Definition: selection.py:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
RPCtrigDataObject
Definition: RPCtrigDataObject.h:15
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
PADpatterns::cma_patterns
const CMAdata::PatternsList cma_patterns(void) const
Definition: PADpatterns.h:52
PADpatterns::Print
void Print(std::ostream &, bool) const
Definition: PADpatterns.cxx:149
PADpatterns.h
PADpatterns::operator<
bool operator<(const PADpatterns &) const
Definition: PADpatterns.cxx:57
CMAidentity
Definition: CMAidentity.h:16
PADpatterns::sector
int sector(void) const
Definition: PADpatterns.h:48
Pad
Definition: Pad.h:10
CMApatterns
Definition: CMApatterns.h:21
CMAparameters::Atlas
@ Atlas
Definition: CMAparameters.h:23
L1TopoSimulationConfig.subsystem
subsystem
Definition: L1TopoSimulationConfig.py:242
PADpatterns::operator<<
PADpatterns & operator<<(CMApatterns *)
Definition: PADpatterns.cxx:74
PADpatterns::m_pad_id
int m_pad_id
Definition: PADpatterns.h:26
PADpatterns::debug
unsigned long int debug(void) const
Definition: PADpatterns.h:50
PADpatterns::operator=
PADpatterns operator=(const PADpatterns &)
Definition: PADpatterns.cxx:27