ATLAS Offline Software
Loading...
Searching...
No Matches
HIEventShapeMapTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
8
10
11}
12
14
15 HIEventShapeIndex index_1, index_2;
20
21 return StatusCode::SUCCESS;
22}
23
25{
26 std::string myKey;
27 if(key == HI::BinningScheme::COMPACT) myKey="COMPACT";
28 else if (key == HI::BinningScheme::TOWER ) myKey="TOWER";
29 else myKey = "UNKNOWN SHAPE";
30
31 auto itr=m_map.find(key);
32 if(itr==m_map.end()) {
33 ATH_MSG_ERROR("HIEventShapeMapTool failed to find map w/ format " << myKey);
34 return nullptr;
35 }
36 return &(itr->second);
37}
38
40{
41 ATH_MSG_DEBUG("In getIndexFromShape, Shape size " << shape->size() << " And TOWER is: " << (HI::TowerBins::numLayers()*HI::TowerBins::numEtaBins()));
42 if(shape->size() == HI::BinningScheme::TOWER){
43 //TOWER
44 auto itr = m_map.find( HI::BinningScheme::TOWER );
45 return &(itr->second);
46 }
47 else if(shape->size() == HI::BinningScheme::COMPACT){
48 //COMPACT
49 auto itr = m_map.find( HI::BinningScheme::COMPACT );
50 return &(itr->second);
51 }
52 else {
53 ATH_MSG_FATAL("Event Shape w/ unknown binning! Not TOWER or COMPACT. Not possible to get Index");
54 return nullptr;
55 }
56}
57
59{
60 return (m_map.find(key)!=m_map.end());
61}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
size_type size() const noexcept
Returns the number of elements in the collection.
unsigned int setBinning(const TH2 *h2, bool asMask)
virtual bool hasKey(HI::BinningScheme key) override
HIEventShapeMapTool(const std::string &n)
virtual const HIEventShapeIndex * getIndex(HI::BinningScheme key) const override
std::map< HI::BinningScheme,HIEventShapeIndex > m_map
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual const HIEventShapeIndex * getIndexFromShape(const xAOD::HIEventShapeContainer *shape) const override
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
constexpr unsigned int numLayers()
Definition HIEventDefs.h:23
constexpr unsigned int numEtaBins()
Definition HIEventDefs.h:19
BinningScheme
Definition HIEventDefs.h:16
@ COMPACT
Definition HIEventDefs.h:16
@ TOWER
Definition HIEventDefs.h:16
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.