ATLAS Offline Software
Loading...
Searching...
No Matches
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
11PADpatterns::PADpatterns(int sector, int pad,unsigned long int debug) :
12 RPCtrigDataObject(0,"PAD patterns"),m_sector(sector),m_pad_id(pad),
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
39bool
41{
42 if(m_sector == patterns.sector())
43 {
44 if (m_pad_id == patterns.pad_id() ) return true;
45 }
46 return false;
47}
48
49bool
51{
52 return !(*this == patterns);
53}
54
55
56bool
58{
59 if(m_sector < patterns.sector())
60 {
61 if (m_pad_id < patterns.pad_id() ) return true;
62 }
63 return false;
64}
65
66void
71
72
75{
76 this->load_cma_patterns(patterns);
77 return *this;
78}
79
80Pad*
81PADpatterns::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
88 CMAdata::PatternsList::iterator cma = m_cma_patterns.begin();
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 = " +
117 std::to_string(m_sector) + ", " + std::to_string(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
148void
149PADpatterns::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
const std::string & name() const
Definition BaseObject.h:23
int Ixx_index() const
ubit16 getOutputThres(ubit16 bunch) const
ubit16 getOutputOverl(ubit16 bunch) const
const CMAdata::PatternsList & cma_patterns(void) const
Definition PADpatterns.h:52
Pad * give_pad(const RpcCablingCondData *readCdo, int NOBXS, int BCZERO)
void Print(std::ostream &, bool) const
void load_cma_patterns(CMApatterns *)
unsigned long int debug(void) const
Definition PADpatterns.h:50
PADpatterns operator=(const PADpatterns &)
bool operator!=(const PADpatterns &) const
bool operator<(const PADpatterns &) const
CMAdata::PatternsList m_cma_patterns
Definition PADpatterns.h:29
int sector(void) const
Definition PADpatterns.h:48
std::unique_ptr< Pad > m_pad
Definition PADpatterns.h:32
int pad_id(void) const
Definition PADpatterns.h:49
PADpatterns & operator<<(CMApatterns *)
unsigned long int m_debug
Definition PADpatterns.h:27
PADpatterns(int, int, unsigned long int)
bool operator==(const PADpatterns &) const
Definition Pad.h:10
int number(void) const
RPCtrigDataObject(int, const std::string &)
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
std::vector< std::string > patterns
Definition listroot.cxx:187