15 m_thresholdNumber{{0,1,2,3,4,5,6,7}, {8,9,10,11,12,13,14,15}},
16 m_thresholdNumber12{{0,1,2,3,4,5,6,7}, {8,1000,9,1000,10,1000,11,1000}}
49 for (std::shared_ptr<TrigConf::L1Threshold> thr : l1menu->thresholds(
"MBTS")) {
50 if(thr->name() !=
"MBTS_A" && thr->name() !=
"MBTS_C") {
53 std::string connName = l1menu->connectorNameFromThreshold(thr->name());
54 unsigned int startbit = l1menu->connector(connName).triggerLine(thr->name()).startbit();
56 std::vector<float> hwThrValues(12, 0.0);
57 if(thr->name() ==
"MBTS_A") {
75 for (std::shared_ptr<TrigConf::L1Threshold> thr : l1menu->thresholds(
"MBTSSI")) {
77 std::string thrname = thr->name();
79 size_t module = std::stoi(thrname.substr(6));
81 std::string connName = l1menu->connectorNameFromThreshold(thr->name());
82 unsigned int startbit = l1menu->connector(connName).triggerLine(thr->name()).startbit();
83 ATH_MSG_INFO(
"Read " << thrname <<
" with voltage " << hwValue <<
"mV at bit " << startbit <<
" on " << connName);
85 bool isCSide = thrname.find(
"MBTS_C")==0;
88 ATH_MSG_WARNING(
"Module number " << module <<
" on side C out of range");
93 }
else if(thrname.starts_with(
"MBTS_A") && thrname.size()>6) {
97 ATH_MSG_WARNING(
"Module number " << module <<
" on side A out of range");
109 ATH_MSG_INFO(
"MBTS_A Lvl 1 single input thresholds not set. Triggers will be disabled.");
111 for(
size_t i=0;i<16;i++) {
116 ATH_MSG_INFO(
"MBTS_C Lvl 1 single input thresholds not set. Triggers will be disabled.");
118 for(
size_t i=0;i<16;i++) {
125 msg(MSG::INFO) <<
"=================== Settings ==================" <<
endmsg;
130 msg(MSG::INFO) <<
"C side thresholds for single inputs = {";
131 for(
size_t i=0;i<12;i++) {
133 if(i<11)
msg(MSG::INFO) <<
",";
136 msg(MSG::INFO) <<
"A side thresholds for single inputs = {";
137 for(
size_t i=0;i<12;i++) {
139 if(i<11)
msg(MSG::INFO) <<
",";
143 msg(MSG::DEBUG) <<
"thresholdNumber12: ";
144 for(
size_t j=0;j<2;j++) {
145 for(
size_t i=0;i<8;i++) {
147 if(i<7)
msg(MSG::DEBUG) <<
",";
153 msg(MSG::INFO) <<
"C side thresholds for single inputs = {";
154 for(
size_t i=0;i<16;i++) {
156 if(i<15)
msg(MSG::INFO) <<
",";
159 msg(MSG::INFO) <<
"A side thresholds for single inputs = {";
160 for(
size_t i=0;i<16;i++) {
162 if(i<15)
msg(MSG::INFO) <<
",";
167 msg(MSG::DEBUG) <<
"thresholdNumber: " <<
endmsg;
168 for(
size_t j=0;j<2;j++) {
169 for(
size_t i=0;i<8;i++) {
171 if(i<7)
msg(MSG::DEBUG) <<
",";
175 msg(MSG::INFO) <<
"===============================================" <<
endmsg;
177 return StatusCode::SUCCESS;
186 if(
sc.isFailure() || !tileTTL1MBTSContainer ) {
188 return StatusCode::SUCCESS;
194 if(tileTTL1MBTSContainer->
size() > 32) {
196 ATH_MSG_WARNING(
"BAD DATA!!! tileTTL1MBTSContainer->size() = " << tileTTL1MBTSContainer->
size());
197 ATH_MSG_WARNING(
"There should be no more than 24 TileTTL1MBTS elements in one event.");
198 ATH_MSG_WARNING(
"This event will be skipped. Any further bad data will be skipped.");
201 return StatusCode::SUCCESS;
204 unsigned int triggersEBA = 0;
205 unsigned int triggersEBC = 0;
206 unsigned int single_triggers_A = 0;
207 unsigned int single_triggers_C = 0;
210 for(
const TileTTL1 * ttl1_mbts : *tileTTL1MBTSContainer) {
216 return StatusCode::FAILURE;
222 return StatusCode::FAILURE;
226 if(channel < 0 || channel > 1) {
227 ATH_MSG_ERROR(
"Channel value " << channel <<
" is out of range!");
228 return StatusCode::FAILURE;
232 if(detSide != -1 && detSide != 1) {
233 ATH_MSG_ERROR(
"Side value " << detSide <<
" is out of range!");
234 return StatusCode::FAILURE;
238 const std::vector<double> & samples = ttl1_mbts->samples();
239 unsigned int numSamples = samples.size();
242 return StatusCode::FAILURE;
257 ATH_MSG_ERROR(
"Threshold index \"" << thresholdIndex <<
"\" for single triggers is out of range.");
258 return StatusCode::FAILURE;
261 if(thresholdIndex12 == 1000){
262 ATH_MSG_DEBUG(
"this is a needless counter for run2, the sample will be skipped!");
267 float ThrValue_a = 0;
268 float ThrValue_c = 0;
286 else if (detSide == 1)
297 if (triggersEBA>7) triggersEBA=7;
298 if (triggersEBC>7) triggersEBC=7;
300 ATH_MSG_DEBUG(
"Multis: "<< triggersEBA <<
" and "<< triggersEBC );
302 unsigned int cableWordA = single_triggers_A + (triggersEBA<<
m_cablestart_a);
303 unsigned int cableWordC = single_triggers_C + (triggersEBC<<
m_cablestart_c);
306 auto mbtsACTP = std::make_unique<MbtsCTP>(cableWordA);
307 auto mbtsCCTP = std::make_unique<MbtsCTP>(cableWordC);
310 ATH_MSG_DEBUG(
" (in CTPSimulation) mbtsA cable word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << mbtsACTP->cableWord0() );
311 ATH_MSG_DEBUG(
" (in CTPSimulation) Mult of mbtsA is: "<<
static_cast<int>( (mbtsACTP->cableWord0() >>
m_cablestart_a) &
static_cast<unsigned int>( std::pow( 2, 3 ) - 1 ) ) );
313 ATH_MSG_DEBUG(
" (in CTPSimulation) mbtsC cable word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << mbtsCCTP->cableWord0() );
314 ATH_MSG_DEBUG(
" (in CTPSimulation) Mult of mbtsC is: "<<
static_cast<int>( (mbtsCCTP->cableWord0() >>
m_cablestart_c) &
static_cast<unsigned int>( std::pow( 2, 3 ) - 1 ) ) );
319 return StatusCode::SUCCESS;