Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
DerivationFramework::CellsInConeThinning Class Reference

#include <CellsInConeThinning.h>

Inheritance diagram for DerivationFramework::CellsInConeThinning:
Collaboration diagram for DerivationFramework::CellsInConeThinning:

Public Member Functions

 CellsInConeThinning (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~CellsInConeThinning ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
StatusCode addBranches () const
 

Private Attributes

SG::ReadHandleKey< xAOD::EgammaContainerm_SGKey { this, "InputSGKey", "Electrons", "SG key for input container" }
 
SG::ReadHandleKey< CaloCellContainerm_InputCellsSGKey
 
SG::WriteHandleKey< xAOD::CaloClusterContainerm_OutputClusterSGKey
 
SG::WriteHandleKey< CaloClusterCellLinkContainerm_OutputCellLinkSGKey
 
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
 
std::string m_selectionString
 
double m_dr
 

Detailed Description

Definition at line 29 of file CellsInConeThinning.h.

Constructor & Destructor Documentation

◆ CellsInConeThinning()

DerivationFramework::CellsInConeThinning::CellsInConeThinning ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 11 of file CellsInConeThinning.cxx.

15  : base_class(type, name, parent)
16  , m_selectionString("")
17  , m_dr(0.5)
18 {
19  declareProperty("deltaR", m_dr = 0.5);
20 }

◆ ~CellsInConeThinning()

DerivationFramework::CellsInConeThinning::~CellsInConeThinning ( )
inline

Definition at line 36 of file CellsInConeThinning.h.

36 {}

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::CellsInConeThinning::addBranches ( ) const

Make new container

Input objects

Fill clusters without selection string

Finalize clusters

Return

Definition at line 46 of file CellsInConeThinning.cxx.

47 {
48 
52 
55  const xAOD::EgammaContainer* egammas = egHdl.cptr();
56  if (!egammas) {
57  ATH_MSG_ERROR("Couldn't retrieve egamma container with key: " << m_SGKey);
58  return StatusCode::FAILURE;
59  }
60 
61  unsigned int nEgammas(egammas->size());
62  if (nEgammas == 0) {
63  return StatusCode::SUCCESS;
64  }
65 
67  const CaloCellContainer* cells = cellHdl.cptr();
68  if (!cells) {
70  "Couldn't retrieve cell container with key: " << m_InputCellsSGKey);
71  return StatusCode::FAILURE;
72  }
73 
75  const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
76 
77  // We have a selection string
78  if (!m_selectionString.empty()) {
79  std::vector<int> entries = m_parser->evaluateAsVector();
80  unsigned int nEntries = entries.size();
81  // check the sizes are compatible
82  if (nEgammas != nEntries) {
83  ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string "
84  "used e-gamma objects");
85  return StatusCode::FAILURE;
86  }
87  // Loop over the egammas, pick the selected ones and fill the cluster
88  int index(0);
89  for (const xAOD::Egamma* eg : *egammas) {
90  if (static_cast<bool>(entries.at(index))) {
93  dummy, cells, caloDDMgr, eg, m_dr);
94  }
95  ++index;
96  }
97  }
99  else {
100  for (const xAOD::Egamma* eg : *egammas) {
103  dummy, cells, caloDDMgr, eg, m_dr);
104  }
105  }
109  ATH_CHECK(CaloClusterStoreHelper::finalizeClusters(cellLinks, dclHdl.ptr()));
111  return StatusCode::SUCCESS;
112 }

◆ finalize()

StatusCode DerivationFramework::CellsInConeThinning::finalize ( )

Definition at line 39 of file CellsInConeThinning.cxx.

40 {
41  ATH_CHECK(finalizeParser());
42  return StatusCode::SUCCESS;
43 }

◆ initialize()

StatusCode DerivationFramework::CellsInConeThinning::initialize ( )

Definition at line 23 of file CellsInConeThinning.cxx.

24 {
25 
26  ATH_CHECK(m_SGKey.initialize());
31 
32  if (!m_selectionString.empty()) {
33  ATH_CHECK(initializeParser(m_selectionString));
34  }
35  return StatusCode::SUCCESS;
36 }

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> DerivationFramework::CellsInConeThinning::m_caloMgrKey
private
Initial value:
{
this,
"CaloDetDescrManager",
"CaloDetDescrManager"
}

Definition at line 63 of file CellsInConeThinning.h.

◆ m_dr

double DerivationFramework::CellsInConeThinning::m_dr
private

Definition at line 70 of file CellsInConeThinning.h.

◆ m_InputCellsSGKey

SG::ReadHandleKey<CaloCellContainer> DerivationFramework::CellsInConeThinning::m_InputCellsSGKey
private
Initial value:
{
this,
"InputCellsSGKey",
"AllCalo",
"SG key for input cells container"
}

Definition at line 44 of file CellsInConeThinning.h.

◆ m_OutputCellLinkSGKey

SG::WriteHandleKey<CaloClusterCellLinkContainer> DerivationFramework::CellsInConeThinning::m_OutputCellLinkSGKey
private
Initial value:
{
this,
"OutputCellLinksSGKey",
"EgammaDummyCellLink",
"SG key for output cell links"
}

Definition at line 56 of file CellsInConeThinning.h.

◆ m_OutputClusterSGKey

SG::WriteHandleKey<xAOD::CaloClusterContainer> DerivationFramework::CellsInConeThinning::m_OutputClusterSGKey
private
Initial value:
{
this,
"OutputClusterSGKey",
"EgammaDummyClusters",
"SG key for output"
}

Definition at line 50 of file CellsInConeThinning.h.

◆ m_selectionString

std::string DerivationFramework::CellsInConeThinning::m_selectionString
private

Definition at line 69 of file CellsInConeThinning.h.

◆ m_SGKey

SG::ReadHandleKey<xAOD::EgammaContainer> DerivationFramework::CellsInConeThinning::m_SGKey { this, "InputSGKey", "Electrons", "SG key for input container" }
private

Definition at line 43 of file CellsInConeThinning.h.


The documentation for this class was generated from the following files:
CaloClusterStoreHelper::makeCluster
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
Definition: CaloClusterStoreHelper.cxx:13
DerivationFramework::CellsInConeThinning::m_dr
double m_dr
Definition: CellsInConeThinning.h:70
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:280
CaloClusterStoreHelper::finalizeClusters
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
Definition: CaloClusterStoreHelper.cxx:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CaloClusterStoreHelper::AddContainerWriteHandle
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
Definition: CaloClusterStoreHelper.cxx:53
ParticleTest.eg
eg
Definition: ParticleTest.py:29
DerivationFramework::CellsInConeThinning::m_selectionString
std::string m_selectionString
Definition: CellsInConeThinning.h:69
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
DerivationFramework::CellsInConeThinning::m_SGKey
SG::ReadHandleKey< xAOD::EgammaContainer > m_SGKey
Definition: CellsInConeThinning.h:43
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
DerivationFramework::CellsInCone::egammaSelect
void egammaSelect(xAOD::CaloCluster *inputCl, const CaloCellContainer *inputcells, const CaloDetDescrManager *caloMgr, const xAOD::Egamma *eg, const double dr)
Definition: CellsInCone.cxx:13
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:62
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DerivationFramework::CellsInConeThinning::m_InputCellsSGKey
SG::ReadHandleKey< CaloCellContainer > m_InputCellsSGKey
Definition: CellsInConeThinning.h:44
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::CellsInConeThinning::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: CellsInConeThinning.h:63
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
DeMoScan.index
string index
Definition: DeMoScan.py:364
DerivationFramework::CellsInConeThinning::m_OutputClusterSGKey
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_OutputClusterSGKey
Definition: CellsInConeThinning.h:50
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
DerivationFramework::CellsInConeThinning::m_OutputCellLinkSGKey
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_OutputCellLinkSGKey
Definition: CellsInConeThinning.h:56
entries
double entries
Definition: listroot.cxx:49
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:73
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.