10 ATH_MSG_DEBUG(
"Initializing JfexSimMonitorAlgorithm algorithm with name: "<<
name());
67 return StatusCode::SUCCESS;
76 if(larBadChan.isValid()) {
77 timeSince = ctx.eventID().time_stamp() - larBadChan.getRange().start().time_stamp();
78 timeUntil = larBadChan.getRange().stop().time_stamp() - ctx.eventID().time_stamp();
94 return StatusCode::SUCCESS;
100 const EventContext& ctx,
bool simReadyFlag)
const {
102 if(!tobs1Cont.isValid()) {
106 if(!tobs2Cont.isValid()) {
110 bool mismatches =
false;
122 auto mask = (
label==
"jTE") ? 0x7FFFFFFE : 0xFFFFFFFE;
124 unsigned zeroTobs1 = 0;
125 unsigned zeroTobs2 = 0;
126 for(
const auto tob1 : *tobs1Cont) {
128 auto word1 = tob1->tobWord();
129 auto jfex1 = tob1->jFexNumber();
130 auto fpga1 = tob1->fpgaNumber();
132 for (
const auto tob2 : *tobs2Cont) {
133 if(
word1==0 || ((
word1&
mask) == (tob2->tobWord()&
mask) && jfex1 == tob2->jFexNumber() && fpga1 == tob2->fpgaNumber())) {
146 for (
const auto tob2: *tobs2Cont) {
147 if (tob2->tobWord() == 0) {
152 if(tobs2Cont.isValid() && (tobs1Cont->size() - zeroTobs1) < (tobs2Cont->size() - zeroTobs2) ) {
163 auto itr = m_firstEvents.find(
lbn);
164 if(itr==m_firstEvents.end()) {
166 itr = m_firstEvents.find(
lbn);
168 lbnString = itr->second;
170 std::vector<float> detas{};std::vector<float> setas{};
171 std::vector<float> dphis{};std::vector<float> sphis{};
172 std::vector<unsigned int> dword0s{};std::vector<unsigned int> sword0s{};
182 std::cout <<
"LBN: " << std::string(lbnString) <<
" EventNumber: " << ULong64_t(evtNumber) <<
" signature: " <<
label << std::endl;
183 std::cout <<
" data : " << std::hex;
184 for (
const auto w: dword0s) std::cout <<
w <<
" ";
185 std::cout << std::endl <<
" sim : ";
186 for (
const auto w: sword0s) std::cout <<
w <<
" ";
187 std::cout << std::endl << std::dec;
190 fill(
"mismatches",tobMismatched,
lbn,lbnString,evtNumber,dtobEtas,dtobPhis,dtobWord0s,stobEtas,stobPhis,stobWord0s,Signature,eventType,IsDataTowers,IsEmulatedTowers,simReady,eventType);
191 fill(
"mismatches_count",
lbn,Signature,simReady,eventType);
194 fill(
"mismatches",
lbn,Signature,tobMismatched,simReady,eventType);
202 etas.clear();phis.clear();word0s.clear();
205 etas.reserve(tobs->size());
206 phis.reserve(tobs->size());
207 word0s.reserve(tobs->size());
208 std::vector<SortableTob> sortedTobs;
209 sortedTobs.reserve(tobs->size());
211 sortedTobs.emplace_back(
SortableTob{tob->tobWord(),0.,0.});
213 std::sort(sortedTobs.begin(),sortedTobs.end(),[](
const SortableTob& lhs,
const SortableTob& rhs) { return lhs.word0<rhs.word0; });
214 for(
const auto& tob : sortedTobs) {
215 etas.push_back(tob.eta);
216 phis.push_back(tob.phi);
217 word0s.push_back(tob.word0);
222 etas.clear();phis.clear();word0s.clear();
225 etas.reserve(tobs->size());
226 phis.reserve(tobs->size());
227 word0s.reserve(tobs->size());
228 std::vector<SortableTob> sortedTobs;
229 sortedTobs.reserve(tobs->size());
230 for(
const auto tob : *tobs) {
231 sortedTobs.emplace_back(SortableTob{tob->tobWord(),0.,0.});
233 std::sort(sortedTobs.begin(),sortedTobs.end(),[](
const SortableTob& lhs,
const SortableTob& rhs) { return lhs.word0<rhs.word0; });
234 for(
const auto& tob : sortedTobs) {
235 etas.push_back(tob.eta);
236 phis.push_back(tob.phi);
237 word0s.push_back(tob.word0);