ATLAS Offline Software
eFEXTOBSimDataCompare.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // eFEXTOBSimDataCompare - description
7 // ------------------------------
8 // Small utility function to compare TOBs from data and simulation
9 // begin : 19 08 2022
10 // email : paul.daniel.thompson@CERN.CH
11 // ***************************************************************************/
12 
13 #include <set>
14 #include <iostream>
15 
16 namespace LVL1 {
17 
18 
19  template <typename T> void compareTOBs(T& dataTOBs, T& simTOBs, std::set<uint32_t> &simEqDataWord0s) {
20 
21  // loop over input TOBs and simulated TOBs and fill a std set for those where the first TOB word matches
22  //
23 
24  std::cout << "compareTOBs ndata " << dataTOBs->size() << std::endl;
25  std::cout << "compareTOBs nsim " << simTOBs->size() << std::endl;
26 
27  // Use a std::set of TOB word0s to match TOBs and simTOBs
28  std::set<uint32_t> tobWord0sData;
29 
30  // Fill set with word0 of TOBs
31  for (auto t : *dataTOBs) {
32  uint32_t word0Data = t->word0();
33  std::cout << "compareTOBs data " << word0Data << std::endl;
34  tobWord0sData.insert(word0Data);
35  }
36 
37  // Set simEqData if the TOB word0s match
38  for (auto t : *simTOBs) {
39  uint32_t word0Sim = t->word0();
40  std::cout << "compareTOBs sim " << word0Sim << std::endl;
41  if (tobWord0sData.find(word0Sim) != tobWord0sData.end()) simEqDataWord0s.insert(word0Sim);
42  }
43 
44  }
45 } // end of namespace bracket
46 
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::compareTOBs
void compareTOBs(T &dataTOBs, T &simTOBs, std::set< uint32_t > &simEqDataWord0s)
Definition: eFEXTOBSimDataCompare.h:19
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18