ATLAS Offline Software
Loading...
Searching...
No Matches
TileCellBuilderFromHit.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TILERECUTILS_TILECELLBUILDERFROMHIT_H
6#define TILERECUTILS_TILECELLBUILDERFROMHIT_H
7
8/********************************************************************
9 *
10 * NAME: TileCellBuilderFromHit
11 * PACKAGE: offline/TileCalorimeter/TileRecUtils
12 *
13 * AUTHOR : A. Solodkov
14 * CREATED: 10-Oct-2015
15 *
16 * PURPOSE: Create Cells from Hits and store them in container
17 *
18 * Input: TileHit from TileHitContainer
19 * Output: Container or collection with TileCells
20 * Parameters:
21 * TileHitContainer - Name of input container
22 *
23 ********************************************************************/
24
25// Tile includes
36
37// Calo includes
41
42// Atlas includes
52
53// Gaudi includes
54#include "GaudiKernel/ToolHandle.h"
55#include "GaudiKernel/ServiceHandle.h"
56#include "CLHEP/Random/RandomEngine.h"
57
58// C++ STL includes
59#include <string>
60#include <vector>
61#include <memory>
62
63// forward declarations
64class TileID;
65class TileTBID;
66class TileHWID;
67class TileCell;
73
74
81 : public extends<AthAlgTool, ICaloCellMakerTool>
82{
83 public:
84 TileCellBuilderFromHit(const std::string& type, const std::string& name, const IInterface* parent);
85
86 virtual ~TileCellBuilderFromHit();
87
88 virtual StatusCode initialize() override;
89
90 virtual StatusCode finalize() override;
91
93 virtual StatusCode process (CaloCellContainer* theCellContainer,
94 const EventContext& ctx) const override;
95
96 //AlgTool InterfaceID
97 static const InterfaceID& interfaceID();
98 //static const InterfaceID& interfaceID() { return ICaloCellMakerTool; };
99
100 private:
103
104 // properties
106 "electronicNoise",
107 "CaloNoise object to read"};
109 "TileHitCnt",
110 "Input Tile hit container key"};
111
113 "EventInfo",
114 "EventInfo key"};
115
116
118 "MBTSContainer",
119 "Output Tile MBTS container key"};
120
122 "E4prContainer",
123 "Output Tile E4 prime container key"};
124
128 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};
129
130
131 std::string m_infoName;
132
137
138 float m_maxTime;
139 float m_minTime;
142
143 const TileID* m_tileID{nullptr};
144 const TileTBID* m_tileTBID{nullptr};
145 const TileHWID* m_tileHWID{nullptr};
147
149 { this, "RndmSvc", "AthRNGSvc", "Random Number Service used in TileCellBuildetFromHit" };
150
151 ToolHandle<ITileBadChanTool> m_tileBadChanTool{this,
152 "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};
153
158 "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"};
159
164 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};
165
166
169
171 //unsigned int m_bsflags; //!< other flags stored in TileRawChannelContainer
172
173 // These were accumulated, but never actually used.
174 // They also spoil reentrancy, so leave them commented-out for now.
175 // If this information is needed in the future, these can be changed
176 // to use atomics.
178 //int m_eventErrorCounter[4]; //!< number of events with no errors(0), warnings(1), error(2), total(3)
179
180 std::vector<CaloAffectedRegionInfo> m_affectedRegionInfo_global;
181 std::vector<CaloAffectedRegionInfo> m_affectedRegionInfo_current_run;
182
184 template<class ITERATOR, class COLLECTION>
185 void build(const CaloNoise* caloNoise,
186 TileDrawerEvtStatusArray& drawerEvtStatus,
187 const ITERATOR & begin,
188 const ITERATOR & end,
189 COLLECTION * coll,
190 TileCellContainer* MBTSCells,
191 TileCellContainer* E4prCells,
192 const TileSamplingFraction* samplingFraction) const;
193
194
198 bool maskBadChannel (TileDrawerEvtStatusArray& drawerEvtStatus,
199 TileCell* pCell) const;
200 bool maskBadChannels (TileDrawerEvtStatusArray& drawerEvtStatus,
201 TileCell* pCell, bool single_PMT_C10, bool Ecell) const;
202
203 void correctCell(TileCell* pCell, int correction, int pmt, int gain, float ener, float time,
204 unsigned char iqual, unsigned char qbit) const;
205
206 unsigned char iquality(float qual) const {
207 return std::min(255, abs((int) qual));
208 } // keep quality within 8 bits make it "unsigned char"
209
210 unsigned char qbits(TileDrawerEvtStatusArray& drawerEvtStatus,
211 int ros, int drawer, bool count_over, bool good_time, bool good_ener,
212 bool overflow, bool underflow, bool good_overflowfit) const;
213
214 bool m_RUN2;
217
218 static const int NSIDE = 2;
219 static const int NPHI = 8;
220 static const int NETA = 2;
221 static const int NCELLMBTS = NSIDE * NPHI * NETA;
222 inline int mbts_index(int side, int phi, int eta) const {
223 return (side * NPHI + phi) * NETA + eta;
224 }
225 static const int E4SIDE = -1;
226 static const int E4ETA = 2;
227 static const int E4NPHI = 4;
228 static const int NCELLE4PR = E4NPHI;
229 inline int e4pr_index(int phi) const {
230 return phi;
231 }
232
233};
234
235#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
object to store information about affected regions in calorimeter
defines and typedefs for IOVSvc
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
TileContainer< TileCell > TileCellContainer
Container class for CaloCell.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
const MbtsDetDescrManager * m_mbtsMgr
Pointer to MbtsDetDescrManager.
unsigned char iquality(float qual) const
int m_qualityCut
cut on channel quality (set energy to m_zeroEnergy for them)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
static const InterfaceID & interfaceID()
float m_zeroEnergy
energy to store in every PMT if both PMT are bad
bool maskBadChannel(TileDrawerEvtStatusArray &drawerEvtStatus, TileCell *pCell) const
method to check if channels are good or bad.
TileCellBuilderFromHit(const std::string &type, const std::string &name, const IInterface *parent)
Contructor.
virtual StatusCode initialize() override
Initializer.
TileDrawerEvtStatus TileDrawerEvtStatusArray[5][64]
status of every drawer
float m_maxTime
maximum time for the PMTs in the cels
const TileTBID * m_tileTBID
Pointer to TileTBID.
unsigned char qbits(TileDrawerEvtStatusArray &drawerEvtStatus, int ros, int drawer, bool count_over, bool good_time, bool good_ener, bool overflow, bool underflow, bool good_overflowfit) const
method to compute the cell quality bits
std::vector< CaloAffectedRegionInfo > m_affectedRegionInfo_current_run
method to process raw channels from a given vector and store them in collection
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
const TileDetDescrManager * m_tileMgr
Pointer to TileDetDescrManager.
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
void build(const CaloNoise *caloNoise, TileDrawerEvtStatusArray &drawerEvtStatus, const ITERATOR &begin, const ITERATOR &end, COLLECTION *coll, TileCellContainer *MBTSCells, TileCellContainer *E4prCells, const TileSamplingFraction *samplingFraction) const
const TileID * m_tileID
Pointer to TileID.
float m_minTime
minimum time for the PMTs in the cels
std::vector< CaloAffectedRegionInfo > m_affectedRegionInfo_global
TileDrawerRunStatus m_drawerRunStatus[5][64]; //!< overall status of drawer in whole run.
void correctCell(TileCell *pCell, int correction, int pmt, int gain, float ener, float time, unsigned char iqual, unsigned char qbit) const
Compute calibrated energy, time, etc.
virtual StatusCode finalize() override
const TileHWID * m_tileHWID
Pointer to TileHWID.
const TileCablingService * m_cabling
Pointer to TileCabling.
bool m_maskBadChannels
if true=> bad channels are masked
SG::WriteHandleKey< TileCellContainer > m_E4prContainerKey
virtual ~TileCellBuilderFromHit()
Destructor.
TileFragHash::TYPE m_RChType
Type of TileRawChannels (Fit, OF2, etc.)
float m_eneForTimeCutMBTS
similar cut for MBTS in pC
ToolHandle< ITileBadChanTool > m_tileBadChanTool
SG::ReadCondHandleKey< CaloNoise > m_caloNoiseKey
float m_noiseSigma
cell electronic noise if CaloNoise is switched off
bool maskBadChannels(TileDrawerEvtStatusArray &drawerEvtStatus, TileCell *pCell, bool single_PMT_C10, bool Ecell) const
int mbts_index(int side, int phi, int eta) const
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
ServiceHandle< IAthRNGSvc > m_rndmSvc
< Random number service to use
float m_eneForTimeCut
keep time for channels with energy above cut
SG::WriteHandleKey< TileCellContainer > m_MBTSContainerKey
This class keep detailed status info about one drawer in a given event.
TYPE
initialize
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
Helper class for TileCal offline identifiers.
Definition TileID.h:67
Condition object to keep and provide Tile Calorimeter sampling fraction and number of photoelectrons.
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
const std::string process