19 constexpr std::array<int, 6> wheelIds = { {1, 2, 0, 0, -1, -2} };
33 m_Wheels[
k].setProperties( wheelIds[(
id*2)+(
k-2)] );
42 m_ttuconf{std::make_unique<TTUBasicConfig>(ttulogic_type)},
46 m_Wheels[
k].setProperties( wheelIds[(
id*2)+(
k-2)], rbclogic_type );
50 const char * ttulogic_type,
int mxw ) :
55 m_ttuconf{std::make_unique<TTUBasicConfig>(ttulogic_type)},
60 m_Wheels[
k].setProperties( wheelIds[(
id*2)+(
k-2)], f_name, rbclogic_type );
67 m_ttuconf = std::make_unique<TTUBasicConfig>(ttuspecs);
72 std::vector<TTUBoardSpecs::TTUBoardConfig>::const_iterator itr;
73 itr =
m_ttuconf->m_ttuboardspecs->m_boardspecs.begin();
75 m_mode = (*itr).m_triggerMode;
88 if(
m_debug )
std::cout <<
"TTUEmulator> Problem initialising the Configuration \n";
120 std::vector<int> bxVec;
121 std::vector<int>::iterator bxItr;
122 std::map<int,RBCInput*> * linkboardin;
123 std::map<int,RBCInput*>::iterator inItr;
127 for( inItr = (*linkboardin).begin(); inItr != (*linkboardin).end(); ++inItr)
130 if ( (*inItr).first < 0 ) bx = (
int) ceil( (*inItr).first / 1000000.0 );
131 else bx = (
int) floor( (*inItr).first / 1000000.0 );
136 bxItr =
unique (bxVec.begin(), bxVec.end());
137 bxVec.resize(bxItr - bxVec.begin());
140 for ( bxItr = bxVec.begin(); bxItr != bxVec.end(); ++bxItr) {
155 trg =
m_ttuconf->ttulogic()->isTriggered();
160 <<
" bx: " << (*bxItr)
162 <<
" response: " << trg << std::endl;
171 triggerResponse.setTriggerBits( (*bxItr) ,
m_trigger );
181 if(
m_debug )
std::cout <<
"TTUEmulator::processTtu> done with this TTU: " <<
m_id << std::endl;
196 if(
m_debug )
std::cout <<
"TTUEmulator::processTtu( Pointing ) starts " <<
'\n';
201 std::vector<int> bxVec;
202 std::vector<int>::iterator bxItr;
203 std::map<int,RBCInput*> * linkboardin;
204 std::map<int,RBCInput*>::iterator inItr;
208 for( inItr = (*linkboardin).begin(); inItr != (*linkboardin).end(); ++inItr)
211 if ( (*inItr).first < 0 ) bx = (
int) ceil( (*inItr).first / 1000000.0 );
212 else bx = (
int) floor( (*inItr).first / 1000000.0 );
217 bxItr =
unique (bxVec.begin(), bxVec.end());
218 bxVec.resize(bxItr - bxVec.begin());
222 for ( bxItr = bxVec.begin(); bxItr != bxVec.end(); ++bxItr) {
237 trg =
m_ttuconf->ttulogic()->isTriggered();
242 <<
" bx: " << (*bxItr)
244 <<
" response: " << trg << std::endl;
252 triggerResponse.setTriggerBits( (*bxItr) , wedgeId,
m_trigger );
256 if(
m_debug )
std::cout <<
"TTUEmulator::processTtu (Pointing) > size of trigger map " 259 if(
m_debug )
std::cout <<
"TTUEmulator::processTtu (Pointing) > done with this TTU: " <<
m_id << std::endl;
263 if(
m_debug )
std::cout <<
"TTUEmulator::processTtu( Pointing ) end" <<
'\n';
std::bitset< 2 > m_trigger
std::vector< TriggerResponse > m_triggerBxVec
void clearTriggerResponse()
std::unique_ptr< TTUConfiguration > m_ttuconf
def unique(seq, keepstr=True)
std::array< TTUInput, 2 > m_ttuin
void processTtu(RPCInputSignal *)
std::array< RPCWheel, 2 > m_Wheels
std::map< int, std::bitset< 2 > > m_triggerBx
void setSpecifications(const TTUBoardSpecs *, const RBCBoardSpecs *)
TTUEmulator()
Standard constructor.