10 ATH_MSG_DEBUG(
"Initializing GfexSimMonitorAlgorithm algorithm with name: "<< name());
89 return StatusCode::SUCCESS;
95 const EventContext& ctx,
bool simReadyFlag)
const {
112 std::set<const xAOD::gFexJetRoI*> mismatchedTOBs;
113 std::set<const xAOD::gFexJetRoI*> DataMismatchedTOBs;
115 for (
auto tob1 : *tobs1Cont) {
116 bool isMatched =
false;
118 auto word1 = tob1->word();
119 auto gfex1 = tob1->gFexType();
120 for (
auto tob2 : *tobs2Cont) {
121 if(gfex1 == tob2->gFexType()) {
122 if(word1 == tob2->word()) {
132 mismatchedTOBs.insert(tob1);
133 DataMismatchedTOBs.insert(tob1);
138 for (
auto tob2 : *tobs2Cont) {
139 bool isMatched =
false;
140 auto word = tob2->word();
auto gfex = tob2->gFexType();
141 for (
auto tob1 : *tobs1Cont) {
142 if(gfex == tob1->gFexType() && word == tob1->word()) {
148 mismatchedTOBs.insert(tob2);
155 if(!mismatchedTOBs.empty()) {
162 auto itr = m_firstEvents.find(lbn);
163 if(itr==m_firstEvents.end()) {
164 m_firstEvents[lbn] = std::to_string(lbn)+
":"+std::to_string(evtNumber);
165 itr = m_firstEvents.find(lbn);
167 lbnString = itr->second;
169 std::vector<SortableTob> sortedDataTobs;
170 std::vector<SortableTob> sortedSimTobs;
176 auto dtobEtas =
Monitored::Collection(
"dataEtas", sortedDataTobs, [](
const auto& t) {
return t.eta; });
177 auto dtobPhis =
Monitored::Collection(
"dataPhis", sortedDataTobs, [](
const auto& t) {
return t.phi; });
179 auto dtobWord0s =
Monitored::Collection(
"dataWord0s", sortedDataTobs, [](
const auto& t) {
return t.word0; });
181 auto stobEtas =
Monitored::Collection(
"simEtas", sortedSimTobs, [](
const auto& t) {
return t.eta; });
182 auto stobPhis =
Monitored::Collection(
"simPhis", sortedSimTobs, [](
const auto& t) {
return t.phi; });
184 auto stobWord0s =
Monitored::Collection(
"simWord0s", sortedSimTobs, [](
const auto& t) {
return t.word0; });
198 fill(
"mismatches",FillJetTree,simReadyMismatch,tobMismatched,lbn,lbnString,l1id,evtNumber,dtobEtas,dtobPhis,dtobEts,dtobWord0s,stobEtas,stobPhis,stobEts,stobWord0s,Signature,simReady,eventType);
201 for(
auto tob : DataMismatchedTOBs) {
202 locIdx = std::to_string(tob->iEta()) +
":" + std::to_string(tob->iPhi());
208 fill(
"mismatches",lbn,Signature,tobMismatched,simReady,eventType);
211 return !mismatchedTOBs.empty();
219 const EventContext& ctx, uint32_t tobMask)
const {
233 bool mismatches = (tobs1Cont->size()!=tobs2Cont->size());
235 for(
const auto tob1 : *tobs1Cont) {
236 bool isMatched =
false;
237 uint32_t word1 = tob1->word()&tobMask;
238 auto gfex1 = tob1->globalType();
239 for (
auto tob2 : *tobs2Cont) {
240 if(gfex1 == tob2->globalType()) {
241 if(word1 == (tob2->word()&tobMask)) {
260 auto itr = m_firstEvents.find(lbn);
261 if(itr==m_firstEvents.end()) {
262 m_firstEvents[lbn] = std::to_string(lbn)+
":"+std::to_string(evtNumber);
263 itr = m_firstEvents.find(lbn);
265 lbnString = itr->second;
267 auto dtobMet1 =
Monitored::Collection(
"dataTOB1", *tobs1Cont,[](
const auto& tob) {
return tob->METquantityOne(); });
268 auto dtobMet2 =
Monitored::Collection(
"dataTOB2", *tobs1Cont,[](
const auto& tob) {
return tob->METquantityTwo(); });
269 auto dtobWord0s =
Monitored::Collection(
"dataWord0s", *tobs1Cont,[](
const auto& tob) {
return tob->word(); });
270 auto stobMet1 =
Monitored::Collection(
"simTOB1", *tobs2Cont,[](
const auto& tob) {
return tob->METquantityOne(); });
271 auto stobMet2 =
Monitored::Collection(
"simTOB2", *tobs2Cont,[](
const auto& tob) {
return tob->METquantityTwo(); });
272 auto stobWord0s =
Monitored::Collection(
"simWord0s", *tobs2Cont,[](
const auto& tob) {
return tob->word(); });
287 fill(
"mismatches",FillGlobalTree,simReadyMismatch,lbn,lbnString,evtNumber,l1id,dtobMet1,dtobMet2,dtobWord0s,stobMet1,stobMet2,stobWord0s,Signature,tobMismatched,eventType);
290 fill(
"mismatches",lbn,Signature,tobMismatched,eventType);
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
initialize
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_data_gFexBlock
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_simu_gFexBlock
void fillVectors(const SG::ReadHandleKey< T > &key, const EventContext &ctx, std::vector< SortableTob > &sortedTobs) const
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gMETComponentsNoiseCut
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gMSTComponentsJwoj
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_data_gFexJet
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gScalarERms
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gScalarEJwoj
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gMETComponentsJwoj
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gMSTComponentsJwoj
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_simu_gFexJet
virtual StatusCode initialize() override
initialize
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
bool compareGlobalRoI(const std::string &label, const SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > &tobs1Key, const SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > &tobs2Key, const EventContext &ctx, uint32_t tobMask=0xffffffff) const
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gMETComponentsNoiseCut
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gScalarEJwoj
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gScalarERms
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gScalarENoiseCut
std::mutex m_firstEventsMutex
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gMETComponentsRms
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gMETComponentsJwoj
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_data_gFexRho
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gScalarENoiseCut
bool compareJetRoI(const std::string &label, const SG::ReadHandleKey< xAOD::gFexJetRoIContainer > &tobs1Key, const SG::ReadHandleKey< xAOD::gFexJetRoIContainer > &tobs2Key, const EventContext &ctx, bool simReady=false) const
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gMHTComponentsJwoj
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_simu_gMETComponentsRms
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_data_gMHTComponentsJwoj
GfexSimMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_simu_gFexRho
Declare a monitored scalar variable.
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string label(const std::string &format, int i)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
void fill(H5::Group &out_file, size_t iterations)