ATLAS Offline Software
L1CPCMXTools.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef LVL1L1CPCMXTOOLS_H
7 #define LVL1L1CPCMXTOOLS_H
8 
9 #include <string>
10 #include <vector>
11 
12 #include "GaudiKernel/ServiceHandle.h"
18 #include "TrigConfData/L1Menu.h"
19 
20 namespace LVL1 {
21 class CPMTobRoI;
22 class EmTauROI;
23 
36 class L1CPCMXTools : virtual public IL1CPCMXTools, public AthAlgTool {
37 public:
38  L1CPCMXTools(const std::string &type, const std::string &name,
39  const IInterface *parent);
40 
42  virtual StatusCode initialize();
43 
45  virtual void formCMXCPTob(const xAOD::CPMTobRoIContainer *cpmRoiVec,
46  xAOD::CMXCPTobContainer *cmxTobVec) const;
48  virtual void
49  formCMXCPTob(const std::vector<const xAOD::CPMTobRoIContainer *> &cpmRoiColls,
50  xAOD::CMXCPTobContainer *cmxTobVec, uint8_t peak) const;
52  virtual void formCMXCPHits(const TrigConf::L1Menu* l1menu,
53  const xAOD::CMXCPTobContainer *cmxTobVec,
54  xAOD::CMXCPHitsContainer *cmxHitsVec) const;
56  virtual void formCMXCPHitsCrate(const TrigConf::L1Menu* l1menu,
57  const xAOD::CMXCPTobContainer *cmxTobVec,
58  xAOD::CMXCPHitsContainer *cmxHitsCrate) const;
60  virtual void formCMXCPHitsSystem(const xAOD::CMXCPHitsContainer *cmxHitsCrate,
61  xAOD::CMXCPHitsContainer *cmxHitsSys) const;
63  virtual void formCMXCPHitsTopo(const xAOD::CMXCPTobContainer *cmxTobVec,
64  xAOD::CMXCPHitsContainer *cmxHitsTopo) const;
65 
66 private:
67  typedef std::vector<uint32_t> HitsVector;
68  typedef std::vector<uint32_t> ErrorVector;
69 
71  std::pair<uint32_t, uint32_t> roiWord(const EmTauROI *roi) const;
72  int isolationEm(unsigned int clusterEnergy, unsigned int emIsol,
73  unsigned int hadIsol, unsigned int hadVeto) const;
74  int isolationTau(unsigned int clusterEnergy, unsigned int emIsol,
75  unsigned int hadIsol) const;
76  void unpackEmIsol(int energy, int isol, unsigned int &emIsol,
77  unsigned int &hadIsol, unsigned int &hadVeto) const;
78  void unpackTauIsol(int energy, int isol, unsigned int &emIsol,
79  unsigned int &hadIsol) const;
80  // void getHits(const xAOD::CMXCPTob* tob,
81  // HitsVector& hit0, HitsVector& hit1) const;
82  void getHits(const TrigConf::L1Menu* l1menu, const xAOD::CMXCPTob *tob, HitsVector &hits0,
83  HitsVector &hits1) const;
84 
85  void addOverflow(ErrorVector &hitErr, const ErrorVector &tobErr) const;
86 
88  void addCMXCPHits(HitsVector &vec1, const HitsVector &vec2) const;
90  unsigned int addHits(unsigned int hitMult, unsigned int hitVec, int multBits,
91  int vecBits) const;
93  void mergeCMXCPHits(xAOD::CMXCPHitsContainer *cmxHitsVec1,
94  xAOD::CMXCPHitsContainer *cmxHitsVec2) const;
96  void saveCMXCPHits(xAOD::CMXCPHitsContainer *cmxHitsVec,
97  const HitsVector &hits0, const HitsVector &hits1,
98  const ErrorVector &err0, const ErrorVector &err1,
99  uint8_t crate, uint8_t cmx, uint8_t source,
100  uint8_t peak) const;
101 
103  int m_crates;
111  bool m_debug;
112 };
113 
114 } // end of namespace
115 
116 #endif
D3PDMakerTestInstan::vec2
std::vector< D3PDTest::MyVec2 > vec2
Definition: D3PDMakerTestDict.h:14
xAOD::hadIsol
setThrPattern hadIsol
Definition: EmTauRoI_v2.cxx:68
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LVL1::EmTauROI
This class defines the em/tau hadron ROI which are generated by the LVL1 Calo Trigger.
Definition: EmTauROI.h:40
LVL1::L1CPCMXTools::L1CPCMXTools
L1CPCMXTools(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: L1CPCMXTools.cxx:30
LVL1::L1CPCMXTools::m_debug
bool m_debug
Debug printout flag.
Definition: L1CPCMXTools.h:111
IL1CPCMXTools.h
LVL1::L1CPCMXTools::unpackEmIsol
void unpackEmIsol(int energy, int isol, unsigned int &emIsol, unsigned int &hadIsol, unsigned int &hadVeto) const
Definition: L1CPCMXTools.cxx:106
LVL1::L1CPCMXTools::ErrorVector
std::vector< uint32_t > ErrorVector
Definition: L1CPCMXTools.h:68
xAOD::CMXCPTob_v1
Description of CMXCPTob_v1.
Definition: CMXCPTob_v1.h:27
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
LVL1::L1CPCMXTools::formCMXCPHits
virtual void formCMXCPHits(const TrigConf::L1Menu *l1menu, const xAOD::CMXCPTobContainer *cmxTobVec, xAOD::CMXCPHitsContainer *cmxHitsVec) const
form complete CMX-CP hits from CMX-CP TOBs
Definition: L1CPCMXTools.cxx:218
LVL1::L1CPCMXTools::formCMXCPHitsTopo
virtual void formCMXCPHitsTopo(const xAOD::CMXCPTobContainer *cmxTobVec, xAOD::CMXCPHitsContainer *cmxHitsTopo) const
form partial CMX-CP hits (topo) from CMX-CP TOBs
Definition: L1CPCMXTools.cxx:421
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
CMXCPTobContainer.h
LVL1::L1CPCMXTools::addCMXCPHits
void addCMXCPHits(HitsVector &vec1, const HitsVector &vec2) const
Add hits from second vector to first.
Definition: L1CPCMXTools.cxx:490
CMXCPHitsContainer.h
LVL1::L1CPCMXTools::m_crates
int m_crates
Number of CP crates.
Definition: L1CPCMXTools.h:103
LVL1::L1CPCMXTools::mergeCMXCPHits
void mergeCMXCPHits(xAOD::CMXCPHitsContainer *cmxHitsVec1, xAOD::CMXCPHitsContainer *cmxHitsVec2) const
Merge CMX-CP hits vectors.
Definition: L1CPCMXTools.cxx:548
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
LVL1::L1CPCMXTools::addHits
unsigned int addHits(unsigned int hitMult, unsigned int hitVec, int multBits, int vecBits) const
Increment CPM/CMX hit word.
Definition: L1CPCMXTools.cxx:507
LVL1::L1CPCMXTools::getHits
void getHits(const TrigConf::L1Menu *l1menu, const xAOD::CMXCPTob *tob, HitsVector &hits0, HitsVector &hits1) const
Definition: L1CPCMXTools.cxx:287
LVL1::L1CPCMXTools::initialize
virtual StatusCode initialize()
standard Athena-Algorithm method
Definition: L1CPCMXTools.cxx:41
LVL1::L1CPCMXTools::unpackTauIsol
void unpackTauIsol(int energy, int isol, unsigned int &emIsol, unsigned int &hadIsol) const
Definition: L1CPCMXTools.cxx:114
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1::L1CPCMXTools::addOverflow
void addOverflow(ErrorVector &hitErr, const ErrorVector &tobErr) const
Definition: L1CPCMXTools.cxx:359
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
LVL1::L1CPCMXTools::isolationEm
int isolationEm(unsigned int clusterEnergy, unsigned int emIsol, unsigned int hadIsol, unsigned int hadVeto) const
Definition: L1CPCMXTools.cxx:88
TrigConf::name
Definition: HLTChainList.h:35
LVL1::L1CPCMXTools::formCMXCPHitsCrate
virtual void formCMXCPHitsCrate(const TrigConf::L1Menu *l1menu, const xAOD::CMXCPTobContainer *cmxTobVec, xAOD::CMXCPHitsContainer *cmxHitsCrate) const
form partial CMX-CP hits (crate) from CMX-CP TOBs
Definition: L1CPCMXTools.cxx:239
LVL1::L1CPCMXTools::m_sysCrate
int m_sysCrate
System crate.
Definition: L1CPCMXTools.h:109
LVL1::L1CPCMXTools::formCMXCPTob
virtual void formCMXCPTob(const xAOD::CPMTobRoIContainer *cpmRoiVec, xAOD::CMXCPTobContainer *cmxTobVec) const
form CMX-CP TOBs from RoIs - single slice
Definition: L1CPCMXTools.cxx:122
LVL1::L1CPCMXTools::saveCMXCPHits
void saveCMXCPHits(xAOD::CMXCPHitsContainer *cmxHitsVec, const HitsVector &hits0, const HitsVector &hits1, const ErrorVector &err0, const ErrorVector &err1, uint8_t crate, uint8_t cmx, uint8_t source, uint8_t peak) const
Save non-zero CMX-CP hits.
Definition: L1CPCMXTools.cxx:562
LVL1::L1CPCMXTools::roiWord
std::pair< uint32_t, uint32_t > roiWord(const EmTauROI *roi) const
Temporary for testing until CPAlgorithm and EmTauROI are updated.
Definition: L1CPCMXTools.cxx:49
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::L1CPCMXTools::HitsVector
std::vector< uint32_t > HitsVector
Definition: L1CPCMXTools.h:67
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
LVL1::L1CPCMXTools::isolationTau
int isolationTau(unsigned int clusterEnergy, unsigned int emIsol, unsigned int hadIsol) const
Definition: L1CPCMXTools.cxx:97
copySelective.source
string source
Definition: copySelective.py:32
LVL1::L1CPCMXTools::formCMXCPHitsSystem
virtual void formCMXCPHitsSystem(const xAOD::CMXCPHitsContainer *cmxHitsCrate, xAOD::CMXCPHitsContainer *cmxHitsSys) const
form partial CMX-CP hits (system) from crate CMX-CP hits
Definition: L1CPCMXTools.cxx:377
AthAlgTool
Definition: AthAlgTool.h:26
L1Menu.h
LVL1::L1CPCMXTools::m_modules
int m_modules
Number of CPMs per crate.
Definition: L1CPCMXTools.h:105
LVL1::L1CPCMXTools
Definition: L1CPCMXTools.h:36
LVL1::L1CPCMXTools::m_maxTobs
int m_maxTobs
Maximum number of TOBs per CPM.
Definition: L1CPCMXTools.h:107
xAOD::CPMTobRoI
CPMTobRoI_v1 CPMTobRoI
Define the latest version of the CPMTobRoI class.
Definition: Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CPMTobRoI.h:17
LVL1::IL1CPCMXTools
Definition: IL1CPCMXTools.h:30