44 m_cablingService(nullptr),
49 declareProperty(
"MuonReceiverEneThreshCellD6Low" ,
m_threshold_d6_lo = 500. ,
"(RUN2) Setting the lowest trigger threshold for cell D6 in MeV (Def=500 MeV)");
50 declareProperty(
"MuonReceiverEneThreshCellD6andD5Low" ,
m_threshold_d5d6_lo = 500. ,
"(RUN2) Setting the lowest trigger threshold for cell D5+D6 in MeV (Def=500 MeV)");
51 declareProperty(
"MuonReceiverEneThreshCellD6High" ,
m_threshold_d6_hi = 600. ,
"(RUN2) Setting the highest trigger threshold for cell D6 in MeV (Def=600 MeV)");
52 declareProperty(
"MuonReceiverEneThreshCellD6andD5High" ,
m_threshold_d5d6_hi = 600. ,
"(RUN2) Setting the highest trigger threshold for cell D5+D6 in MeV (Def=600 MeV)");
53 declareProperty(
"MuonReceiverEneThreshCellD5" ,
m_threshold_d5 = 500. ,
"(RUN3) Setting the single threshold for cell D5 during Run 3 in MeV (Def=500 MeV)");
54 declareProperty(
"MuonReceiverEneThreshCellD6" ,
m_threshold_d6 = 500. ,
"(RUN3) Setting the single threshold for cell D6 during Run 3 in MeV (Def=500 MeV)");
55 declareProperty(
"MuonReceiverEneThreshCellD5andD6" ,
m_threshold_d5d6 = 500. ,
"(RUN3) Setting the single threshold for cell D5+D6 during Run 3 in MeV (Def=500 MeV)");
56 declareProperty(
"SelectionCutForMatchedFilterQf" ,
m_selCutQf = 0. ,
"n cut for the quality factor of the matched filters");
81 ATH_MSG_INFO(
"Stopping ... TileMuonReceiverDecision should not be used for RUN1 simulations");
82 return StatusCode::SUCCESS;
92 ATH_MSG_INFO(
"TileMuonReceiverDecision initialization completed" );
93 return StatusCode::SUCCESS;
98 std::vector<float> thresholds;
101 ATH_MSG_VERBOSE(
"ATT: RUN1 settings TileMuonReceiverDecision will end now" );
102 return StatusCode::SUCCESS;
105 ATH_MSG_VERBOSE(
"ATT: RUN2 settings TileMuonReceiverDecsionTool will run now" );
114 ATH_MSG_VERBOSE(
"ATT: RUN3 settings TileMuonReceiverDecsionTool will run now" );
132 std::vector<bool> tile2SL(4,
false);
133 std::vector<float> ene(2,0.0);
134 std::vector<float>
time(2,0.0);
139 ATH_CHECK( decisionContainer.
record(std::make_unique<TileMuonReceiverContainer>()) );
142 std::unique_ptr<TileMuonReceiverObj> tileMuRcvObj = std::make_unique<TileMuonReceiverObj>(0,thresholds);
143 decisionContainer->
push_back(tileMuRcvObj.release());
151 int EBchan[
nEBchan]={17,16,37,38,3,2};
153 int LBchan[
nLBchan]={0,13,14,25,24,41,44,39,40};
155 int EBIdCell[
nEBchan]={0,0,1,1,2,2};
156 int LBIdCell[
nLBchan]={0,1,1,2,2,3,3,4,4};
158 float energy_HLX[
maxCell]={0.,0.,0.,0.,0.};
159 float time_HLX[
maxCell]={0.,0.,0.,0.,0.};
161 int suppression_counter = 20;
162 bool suppress_printout =
false;
166 if (rawChannelCollection->empty())
continue;
168 float energy_d5 = 0.0;
169 float energy_d6 = 0.0;
170 float energy_d5d6 = 0.0;
172 float time_d5d6 = 0.0;
178 int frag_id = rawChannelCollection->identify();
180 int ros = frag_id>>8;
185 int drawer = (frag_id&0xFF);
186 memset(energy_HLX,0,
sizeof(energy_HLX));
187 memset(time_HLX,0,
sizeof(time_HLX));
198 if ( TMDBchan >= upperLim ) {
199 if ( !suppress_printout ) {
200 if ( suppression_counter-- ) {
204 ATH_MSG_WARNING(
"Too many HWID WARNINGS - suppressing further output - switch to debug mode to view them all" );
205 suppress_printout =
true;
214 int TILEchan = (eb_ros) ? EBchan[TMDBchan] : LBchan[TMDBchan];
221 float energy = rawChannel->amplitude()*ADC2MeV_factor;
222 float time = rawChannel->time();
225 ATH_MSG_DEBUG(
" E[ADC]: "<<rawChannel->amplitude()<<
" E[MeV]: "<<
energy<<
" t[ns]: "<<
time<<
" QF: "<<rawChannel->quality() );
233 if ( TMDBchan==2 || TMDBchan==3 ) {
238 if ( TMDBchan==0 || TMDBchan==1 ) {
244 energy_HLX[EBIdCell[TMDBchan]] +=
energy;
245 time_HLX[EBIdCell[TMDBchan]] +=
time;
249 energy_HLX[LBIdCell[TMDBchan]] +=
energy;
250 time_HLX[LBIdCell[TMDBchan]] +=
time;
256 ATH_MSG_VERBOSE(
"(X.0.0) Summary of the extended results for HL-LHC: " );
258 ATH_MSG_VERBOSE(
"(X.1.0) Energy D-5 "<<energy_HLX[0]<<
" D-6 "<<energy_HLX[1]<<
" D-4 "<<energy_HLX[2] );
259 ATH_MSG_VERBOSE(
"(X.2.0) Time D-5 "<<time_HLX[0]/2.<<
" D-6 "<<time_HLX[1]/2.<<
" D-4 "<<time_HLX[2]/2. );
261 ATH_MSG_VERBOSE(
"(X.1.0) Energy D-0 "<<energy_HLX[0]<<
" D-1 "<<energy_HLX[1]<<
" D-2 "<<energy_HLX[2]<<
" D-3 "<<energy_HLX[3]<<
" BC-8 "<<energy_HLX[4] );
262 ATH_MSG_VERBOSE(
"(X.2.0) Time D-0 "<<time_HLX[0]<<
" D-1 "<<time_HLX[1]/2.<<
" D-2 "<<time_HLX[2]/2.<<
" D-3 "<<time_HLX[3]/2.<<
" BC-8 "<<time_HLX[4]/2. );
273 if (jch6>1) time_d6 /= jch6;
303 if (
m_runPeriod == 2 ) tile2SL = { pass_d5d6_hi, (!pass_d5d6_hi && pass_d5d6_lo), pass_d6_hi, !pass_d6_hi && pass_d6_lo};
304 if (
m_runPeriod == 3 ) tile2SL = { 0, pass_d5d6, pass_d6, pass_d5};
313 ATH_MSG_VERBOSE(
"(E.2.0) Summary: e(d5+d6)= " << energy_d5d6 <<
" e(d6)= " << energy_d6 );
315 ATH_MSG_VERBOSE(
"(E.4.0) Check which thresholds were passed: d56 high " << pass_d5d6_hi <<
" d56 low " << pass_d5d6_lo <<
" d6 high " << pass_d6_hi <<
" d6 low " << pass_d6_lo );
316 ATH_MSG_VERBOSE(
"(E.5.0) Output to SL: " << tile2SL[0] << tile2SL[1] << tile2SL[2] << tile2SL[3] );
319 ATH_MSG_VERBOSE(
"(E.2.0) Summary: e(d5+d6)= " << energy_d5d6 <<
" e(d6)= " << energy_d6 <<
" e(d5)= " << energy_d5 );
321 ATH_MSG_VERBOSE(
"(E.4.0) Check which thresholds were passed: d56 " << pass_d5d6 <<
" d6 " << pass_d6 <<
" d5 " << pass_d5 );
322 ATH_MSG_VERBOSE(
"(E.5.0) Output to SL: " << tile2SL[0] << tile2SL[1] << tile2SL[2] << tile2SL[3] );
325 if (tile2SL[0] || tile2SL[1] || tile2SL[2] || tile2SL[3]) {
326 ene[0] = energy_d5d6; ene[1] = energy_d6;
327 time[0] = time_d5d6 ;
time[1] = time_d6;
328 std::unique_ptr<TileMuonReceiverObj> tileMuRcvObj = std::make_unique<TileMuonReceiverObj>(frag_id,ene,
time,tile2SL);
329 decisionContainer->
push_back(tileMuRcvObj.release());
336 ATH_MSG_DEBUG(
"== Print TileD decision container output to SL" );
337 decisionContainer->
print();
340 ATH_MSG_DEBUG(
"TileMuonReceiverDecision execution completed" );
341 return StatusCode::SUCCESS;