14 ATH_MSG_DEBUG(
"Initializing JfexInputMonitorAlgorithm algorithm with name: "<<
name());
49 return StatusCode::FAILURE;
56 if(larBadChan.isValid()) {
57 timeSince = ctx.eventID().time_stamp() - larBadChan.getRange().start().time_stamp();
58 timeUntil = larBadChan.getRange().stop().time_stamp() - ctx.eventID().time_stamp();
61 if((timeSince>=0&&timeSince<10))
EventType=
"JustAfterMask";
62 else if((timeUntil>=0&&timeUntil<10))
EventType=
"JustBeforeMask";
71 return StatusCode::SUCCESS;
75 if(!jFexEmulatedTowerContainer.isValid()) {
77 return StatusCode::FAILURE;
84 return StatusCode::SUCCESS;
90 return StatusCode::SUCCESS;
96 return StatusCode::SUCCESS;
102 return StatusCode::SUCCESS;
146 nJfexTowers=njfexTowers;
149 std::unordered_map< int, const xAOD::jFexTower* >dataTowers_map;
154 Towereta=dataTower->eta()+1
e-5;
155 Towerphi=dataTower->phi();
157 if(dataTower->isCore()){
158 const int TTID = dataTower->jFEXtowerID();
159 const int source = dataTower->Calosource();
163 auto it_TTower2SCells = dataTowers_map.find(
code );
164 if(it_TTower2SCells == dataTowers_map.end()){
165 dataTowers_map[
code ] = dataTower;
173 DataEt = jTowerEtMeV(*dataTower);
174 EmulatedEt = SCellEtMeV(*dataTower);
179 EmulatedEt = TileEtMeV(*dataTower);
194 if( (dataTower->et_count()).at(0) != emulated_jtowerEt(*dataTower)) {
196 std::string location =
"EM layer";
197 if(dataTower->Calosource()== 1 || dataTower->Calosource()== 3 || dataTower->Calosource() == 5 || dataTower->Calosource() == 6 ){
198 location=
"HAD layer";
203 ATH_MSG_WARNING(
"Tower:"<< TTID <<
" source:"<< +dataTower->Calosource() <<
" for eventNumber:"<<
GetEventInfo(ctx)->
eventNumber()<<
" and LB:"<<
GetEventInfo(ctx)->
lumiBlock() <<
". DataTower Et:"<< (dataTower->et_count()).at(0) <<
"/"<< DataEt<<
" MeV vs EmulatedTower Et:" << emulated_jtowerEt(*dataTower)<<
"/"<< EmulatedEt<<
" MeV");
205 frac_SCellSum = DataEt != 0 ? (EmulatedEt - DataEt)/DataEt : 0;
206 fill(
m_Grouphist+
"_decorated",Towereta,Towerphi,DataEt,EmulatedEt,frac_SCellSum);
211 if(std::string(
Decision).
find(
"TileMismatches")==std::string::npos)
Decision+=
"TileMismatches;";
215 genError(
"Input_Mismatch", location);
223 genError(
"Input_Invalids", location);
236 Towerglobaleta=dataTower->globalEta();
237 Towerglobalphi=dataTower->globalPhi();
240 Towermodule=dataTower->module();
243 Towerfpga=dataTower->fpga();
246 Towerchannel=dataTower->channel();
249 TowerdataID=dataTower->jFEXdataID();
252 TowersimulationID=dataTower->jFEXtowerID();
255 Towercalosource=dataTower->Calosource();
258 std::vector<uint16_t> Toweret_count=dataTower->et_count();
259 Toweretcount_barrel=Toweret_count.at(0);
260 Toweretcount_tile=Toweret_count.at(0);
261 Toweretcount_emec=Toweret_count.at(0);
262 Toweretcount_hec=Toweret_count.at(0);
263 Toweretcount_fcal1=Toweret_count.at(0);
264 Toweretcount_fcal2=Toweret_count.at(0);
265 Toweretcount_fcal3=Toweret_count.at(0);
267 if(dataTower->Calosource() != 1){
269 ToweretaInvalid=dataTower->eta();
270 TowerPhiInvalid=dataTower->phi();
275 ToweretaEmpty=dataTower->eta();
276 TowerPhiEmpty=dataTower->phi();
282 if(Towercalosource==0) {
285 if(Towercalosource==1) {
288 if(Towercalosource==2) {
291 if(Towercalosource==3) {
294 if(Towercalosource==4) {
297 if(Towercalosource==5) {
300 if(Towercalosource==6) {
304 std::vector<char> Tower_saturationflag=dataTower->isjTowerSat();
305 Towersaturationflag=Tower_saturationflag.at(0);
316 if(emulTower->isCore()){
318 auto it_TTower2SCells = dataTowers_map.find(
codedVal(emulTower->jFEXtowerID(), emulTower->Calosource() ) );
320 if(it_TTower2SCells == dataTowers_map.end() ){
322 ATH_MSG_WARNING(
"DataTower: "<<emulTower->jFEXtowerID()<<
" with Calosource: "<<emulTower->Calosource()<<
" does not exists. It should! Investigate ");
329 if(emulTower->et_count().at(0) != dataTower->
et_count().at(0) ){
331 Towereta=emulTower->
eta()+1
e-5;
332 Towerphi=emulTower->phi();
337 if(emulTower->et_count().at(0) != emulated_jtowerEt(*dataTower) ){
339 ToweretaDeco=emulTower->eta()+1
e-5;
340 TowerphiDeco=emulTower->phi();
354 return StatusCode::SUCCESS;