ATLAS Offline Software
Loading...
Searching...
No Matches
TowerFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6 * File: TowerFillerTool.cxx
7 * Author: stephen
8 *
9 * Created on August 26, 2011, 1:36 PM
10 */
11
12#include "TowerFillerTool.h"
14
15namespace D3PD{
16
18 const std::string& name,
19 const IInterface* parent): BlockFillerTool<CaloTower>(type,name,parent)
20{
21 m_SaveConstituents = false;
22 declareProperty("SaveNCellConstituents",m_SaveConstituents=true);
23 TowerFillerTool::book().ignore();
24}
25
26
29 CHECK(addVariable("tower_nCaloCells",m_nCaloCells));
30 CHECK(addVariable("tower_CellWeights",m_cellWeights));
31 CHECK(addVariable("tower_statusWord",m_statWord));
32 }
33 else {
34 CHECK(addVariable("tower_pT",m_pT));
35 CHECK(addVariable("tower_eta",m_eta));
36 CHECK(addVariable("tower_phi",m_phi));
37 CHECK(addVariable("tower_E",m_E));
38 }
39 return StatusCode::SUCCESS;
40}
41
42
43
44StatusCode TowerFillerTool::fill(const CaloTower& p){
46 *m_nCaloCells=p.getNumberOfCells();
47 *m_statWord=p.getRecoStatus().getStatusWord();
49 for(;it!=p.cell_end();++it){
50 double weight=p.getCellWeight(it);
51 m_cellWeights->push_back(weight);
52 }
53 }
54 else{
55 *m_pT=p.pt();
56 *m_eta=p.eta();
57 *m_phi=p.phi();
58 *m_E=p.energy();
59 }
60
61 return StatusCode::SUCCESS;
62}
63
64}
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Data class for calorimeter cell towers.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
virtual StatusCode book()
Declare tuple variables.
unsigned int * m_nCaloCells
unsigned int * m_statWord
virtual StatusCode fill(const CaloTower &p)
Fill one block — type-safe version.
TowerFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
std::vector< float > * m_cellWeights
NavigableIterator< CONT, RPAR, COLL > object_iter
Definition Navigable.h:159
Block filler tool for noisy FEB information.