16#include "GaudiKernel/ServiceHandle.h"
45 DataObjID id1 (
"testDetDescr");
47 auto mgr_cc=std::make_unique<CondCont<CaloDetDescrManager> >(rcu, id1);
49 CHECK_WITH_CONTEXT(condStore->record(std::move(mgr_cc),
"CaloDetDescrManager"),
"CaloTester");
51 return StatusCode::SUCCESS;
67 int subcalo = helper.sub_calo (
id);
69 int section = helper.section (
id);
70 int side = helper.side (
id);
71 reg_id = helper.region_id (subcalo,
section, side, 0);
74 int sampling = helper.sampling (
id);
75 int posneg = helper.pos_neg (
id);
76 int region = helper.region (
id);
77 reg_id = helper.region_id (subcalo, posneg, sampling, region);
82 auto ddp = std::make_unique<CaloDetDescriptor> (reg_id,
87 float eta0 = helper.eta0 (reg_id);
88 float eta1 = eta0 + (helper.eta_max (reg_id) - helper.eta_min (reg_id)) * helper.etaGranularity (reg_id);
90 if (ddp->calo_sign() >= 0) {
91 ddp->setLArRegMin (eta0);
92 ddp->setLArRegMax (eta1);
93 ddp->setCaloEtaMin (eta0);
94 ddp->setCaloEtaMax (eta1);
97 ddp->setLArRegMin (-eta1);
98 ddp->setLArRegMax (-eta0);
99 ddp->setCaloEtaMin (-eta1);
100 ddp->setCaloEtaMax (-eta0);
103 ddp->setLArEtaMin (eta0);
104 ddp->setLArPhiMin (0);
108 m_mgr->add (std::move (ddp));
133 auto ddep = std::make_unique<DummyDetDescrElement> (hashid -
134 descr->caloCellMin(),
140 int ieta_min =
m_helpers.caloID().eta_min (descr->identify());
141 int iphi_min =
m_helpers.caloID().phi_min (descr->identify());
145 float phi = descr->calo_phi_min() + (iphi - iphi_min) * descr->dphi();
147 if (descr->calo_sign() > 0) {
148 eta = descr->calo_eta_min() + (ieta - ieta_min) * descr->deta();
151 eta = descr->calo_eta_max() - (ieta - ieta_min) * descr->deta();
154 ddep->set_cylindric (
eta,
phi,
r);
155 ddep->set_cylindric_size (descr->deta(), descr->dphi(), 0);
159 if (
m_helpers.caloID().is_tile (hashid)) {
175 size_t hashmax =
m_helpers.caloID().calo_cell_hash_max();
177 for (
size_t i = 0; i < hashmax; i++)
191 std::vector<CaloCell*> cells;
192 cells.reserve (
m_cells.size());
193 for (
const std::unique_ptr<CaloCell>& cell :
m_cells) {
194 cells.push_back (cell.get());
209 std::vector<const CaloCell*> cells;
210 cells.reserve (
m_cells.size());
211 for (
const std::unique_ptr<CaloCell>& cell :
m_cells) {
212 cells.push_back (cell.get());
229 for (std::unique_ptr<CaloCell>& cell :
m_cells) {
230 ccc->push_back (cell.get());
232 ccc->initializeLookUpTable();
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Calo Subsystem specific Detector Elements + Dummy element for testing.
Helpers for creating calorimeter objects for unit tests.
Hold mappings of ranges to condition objects.
Helpers for checking error return status codes and reporting errors.
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
A no-op implementation of IRCUSvc, for use in unit tests.
Helper base class for offline cell identifiers.
This class groups all DetDescr information related to a CaloCell.
Identifier identify() const override final
cell identifier
This class provides the client interface for accessing the detector description information common to...
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
void make_cells()
Create all calo cells and save in internal list.
CaloHelpersTest m_helpers
The ID helpers.
std::unique_ptr< CaloCell > make_cell(int hashid)
Create a calorimeter cell.
std::vector< std::unique_ptr< CaloCell > > m_cells
The cells made by make_cells().
std::unique_ptr< CaloDetDescrManager > m_mgr_up
Owning pointer to the manager object.
std::unique_ptr< CaloCellContainer > make_ccc()
Return a CaloCellContainer for all cells.
std::vector< std::unique_ptr< CaloDetDescrElement > > m_tileddes
All Tile detdescr elements.
CaloDetDescrManager * m_mgr
The manager object.
std::vector< CaloCell * > get_cells()
Return a vector of all cells.
std::vector< const CaloCell * > get_const_cells()
Return a vector of all cells as const pointers.
StatusCode record_mgr()
Record the CaloDetDescrManager in the detector store.
const CaloDetDescriptor * find_dd(int hashid)
Return a region descriptor corresponding to a given cell.
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts