ATLAS Offline Software
Loading...
Searching...
No Matches
LArCellContFakeCreator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
6#define ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
7
19
27
28//<<<<<< INCLUDES >>>>>>
29
30#include "GaudiKernel/MsgStream.h"
32#include "LArRecEvent/LArCell.h"
33
34//<<<<<< CLASS DECLARATIONS >>>>>>
35
37{
38public:
39
42
45 const CaloDetDescrManager* caloMgr,
46 MsgStream& log) const;
47
48
49};
50
51
52//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
53//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
54
58
59
60inline CaloCellContainer*
62 const CaloDetDescrManager* caloMgr,
63 MsgStream& log) const
64{
65
66
67 // Create container
68 CaloCellContainer* caloCont = new CaloCellContainer();
69
70
71 log << MSG::DEBUG << "Created CaloCellContainer" << endmsg;
72
73 // add 10 cells to container
74 for (int eta = 1; eta < 5; ++eta) {
75 for (int phi = 3; phi < 5; ++phi) {
76
77 Identifier id = calocellId->cell_id (0, 1, 1, 0, eta, phi);
78 IdentifierHash idHash = calocellId->calo_cell_hash (id);
79 const CaloDetDescrElement* elem = caloMgr->get_element (idHash);
80
81 //log << MSG::DEBUG << "Found elem" << elem << endmsg;
82
83 double energy = 5.0*eta;
84 double time = 0.0;
85 uint16_t quality = 0;
86 uint16_t prov = 0;
87 // time and quality/prov use the same bits - only write one out
88 if (4 == phi) {
89 time = 10.0*phi;
90 quality = 2*eta;
91 prov = 2*phi | 0x2000;
92 }
94
95 LArCell* cell = new LArCell(elem, energy, time, quality, prov, gain);
96 caloCont->push_back(cell);
97
98 //log << MSG::DEBUG << "Created CaloCellContainer" << endmsg;
99
100 }
101 }
102
103 return (caloCont);
104}
105
106#endif // SRC_LARCELLCONTFAKECREATOR_H
107
108
109
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define endmsg
Container class for CaloCell.
void push_back(CaloCell *)
reimplementation of const push_back
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
This class groups all DetDescr information related to a CaloCell.
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class provides the client interface for accessing the detector description information common to...
This is a "hash" representation of an Identifier.
LArCellContFakeCreator()
Default constructor.
CaloCellContainer * createCaloCellContainer(const CaloCell_ID *calocellId, const CaloDetDescrManager *caloMgr, MsgStream &log) const
Create a CaloCellContainer with LAr cells.
Data object for LAr calorimeter readout cell.
Definition LArCell.h:53
@ LARHIGHGAIN
Definition CaloGain.h:18