ATLAS Offline Software
Loading...
Searching...
No Matches
TileDigitsMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5//****************************************************************************
6// Filename : TileDigitsMaker.h
7// Author : UC-ATLAS TileCal group
8// Created : Feb 2006 from TileHitToDigits algorithm
9//
10// DESCRIPTION
11//
12// Creates TileDigits from TileHit
13//
14// Properties (JobOption Parameters):
15//
16// TileHitContainer string Name of container with TileHit to read
17// TileDigitsContainer string Name of container with TileDigits to write
18// TileInfoName string Name of object in TDS with all parameters
19//
20// BUGS:
21//
22// History:
23//
24//
25//****************************************************************************
26
27#ifndef TILESIMALGS_TILEDIGITSMAKER_H
28#define TILESIMALGS_TILEDIGITSMAKER_H
29
30// Tile includes
40
41// Pile up
43
44// Atlas includes
49
50// Gaudi includes
51#include "GaudiKernel/ToolHandle.h"
52#include "GaudiKernel/ServiceHandle.h"
53
54#include "CLHEP/Random/RandomEngine.h"
55#include "AthenaKernel/Units.h"
56
57class IAthRNGSvc;
58class PileUpMergeSvc;
59class TileID;
60class TileTBID;
61class TileHWID;
62class TileInfo;
63class HWIdentifier;
65class TileDQstatus;
66
67#include <string>
68#include <vector>
69#include <memory>
70
80 public:
81 // Constructor
82 using AthReentrantAlgorithm::AthReentrantAlgorithm;
83
84 //Destructor
85 virtual ~TileDigitsMaker() = default;
86
87 //Gaudi Hooks
88 virtual StatusCode initialize() override;
89 virtual StatusCode execute(const EventContext &ctx) const override;
90 virtual StatusCode finalize() override;
91
92 private:
93 StatusCode overlayBackgroundDigits(const TileDigitsCollection* bkgDigitCollection,
94 const TileHitCollection* hitCollection,
95 std::vector<std::vector<double>>& drawerBufferLo,
96 std::vector<std::vector<double>>& drawerBufferHi,
97 std::vector<int>& igain, int ros, int drawer, int drawerIdx,
98 std::vector<int>& over_gain, const TileEMScale* emScale,
99 const TileSampleNoise* sampleNoise, const TileDQstatus* dqStatus,
100 const TileBadChannels* badChannels) const;
101
102 StatusCode fillDigitCollection(const TileHitCollection* hitCollection,
103 std::vector<std::vector<double>>& drawerBufferLo,
104 std::vector<std::vector<double>>& drawerBufferHi,
105 std::vector<int>& igain, std::vector<int>& overgain, std::vector<double>& ech_int,
106 std::vector<bool> &signal_in_channel, const TileEMScale* emScale,
107 const TileSamplingFraction* samplingFraction, const TilePulse* pulse) const;
108
110 "TileHitContainer", "TileHitCnt", "input Tile hit container key"};
111
113 "TileHitContainer_DigiHSTruth","TileHitCnt_DigiHSTruth", "input Tile hit container key"};
114
115 Gaudi::Property<bool> m_onlyUseContainerName{this,
116 "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
117
120
122 "TileDigitsContainer", "TileDigitsCnt", "Output Tile digits container key"};
123
125 "TileDigitsContainer_DigiHSTruth", "TileDigitsCnt_DigiHSTruth", "Output DigiHSTruth Tile digits container key"};
126
128 "TileFilteredContainer", "TileDigitsFlt", "Output filtered Tile digits container key"};
129
130 Gaudi::Property<double> m_filterThreshold{this,
131 "FilterThreshold", 100.0 * Athena::Units::MeV, "Threshold on filtered digits (default - 100 MeV)"};
132
133 Gaudi::Property<double> m_filterThresholdMBTS{this,
134 "FilterThresholdMBTS", 0.0 * Athena::Units::MeV, "Threshold on filtered digits of MBTS (default - 0 MeV)"};
135
136 Gaudi::Property<std::string> m_infoName{this,
137 "TileInfoName", "TileInfo", "TileInfo object name"};
138
139 Gaudi::Property<bool> m_integerDigits{this,
140 "IntegerDigits", true, "Round digits to integer"};
141
142 Gaudi::Property<bool> m_calibRun{this,
143 "CalibrationRun", false, "If true -> both high and low gain saved"};
144
145 Gaudi::Property<bool> m_rndmEvtOverlay{this,
146 "RndmEvtOverlay", false, "Pileup and/or noise added by overlaying random events (default=false)"};
147
148 Gaudi::Property<bool> m_useCoolPulseShapes{this,
149 "UseCoolPulseShapes", true, "Pulse shapes from database (default=true)"};
150
151 Gaudi::Property<bool> m_maskBadChannels{this,
152 "MaskBadChannels", false, "Remove channels tagged bad (default=false)"};
153
154 Gaudi::Property<bool> m_doDigiTruth{this,
155 "DoHSTruthReconstruction", false, ""};
156
157 Gaudi::Property<int> m_allChannels{this,
158 "AllChannels", -1, "Create all channels, use 0 or 1 or 2 (default=-1 - unset)"};
159
160 ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "PileUpMergeSvc", "PileUpMergeSvc"};
161
162 const TileID* m_tileID{nullptr};
163 const TileTBID* m_tileTBID{nullptr};
164 const TileHWID* m_tileHWID{nullptr};
165 const TileInfo* m_tileInfo{nullptr};
167
168 std::vector<std::unique_ptr<HWIdentifier[]> > m_all_ids;
169
170 int m_nSamples{0};
171 int m_iTrig{0};
172 int m_i_ADCmax{0};
173 float m_f_ADCmax{0.0F};
174 float m_f_ADCmaxHG{0.0F};
175 float m_ADCmaxMinusEps{0.0F};
176 float m_ADCmaxPlusEps{0.0F};
177 float m_f_ADCmaskValue{0.0F};
178 bool m_tileNoise{false};
179 bool m_tileCoherNoise{false};
180 bool m_tileThresh{false};
181 double m_tileThreshHi{0.0};
182 double m_tileThreshLo{0.0};
183
184 std::vector<double> m_digitShapeHi;
185 int m_nShapeHi{0};
188 double m_timeStepHi{0.};
189
190 std::vector<double> m_digitShapeLo;
191 int m_nShapeLo{0};
194 double m_timeStepLo{0.};
195
200 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};
201
202 ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
204 Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "Tile_DigitsMaker", ""};
205
210 "TileSampleNoise", "TileSampleNoise", "Input Tile sample noise"};
211
216 "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"};
217
222 "TilePulseShape", "TilePulseShape", "Input Tile pulse shape"};
223
228 "TileSamplingFraction", "TileSamplingFraction", "Input Tile sampling fraction"};
229
234 "TileBadChannels", "TileBadChannels", "Input Tile bad channel status"};
235
237 "TileDQstatus", "", "Input TileDQstatus key" };
238
239};
240
241#endif // TILESIMALGS_TILEDIGITSMAKER_H
the preferred mechanism to access information from the different event stores in a pileup job.
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.
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
Wrapper to avoid constant divisions when using units.
An algorithm that can be simultaneously executed in multiple threads.
manage multiple RandomEngines in thread-safe way.
Definition IAthRNGSvc.h:28
the preferred mechanism to access information from the different event stores in a pileup job.
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.
Condition object to keep Tile channel and ADC status.
Class that holds Data Quality fragment information and provides functions to extract the data quality...
This algorithm performs digitization in TileCal, obtaining TileDigits from TileHits.
int m_nSamples
Number of time slices for each channel.
int m_binTime0Lo
Index of time=0 bin for low gain pulse shape.
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainerKey
float m_ADCmaxMinusEps
ADC saturation value - 0.01 or something small.
Gaudi::Property< int > m_allChannels
SG::ReadHandleKey< TileHitContainer > m_hitContainer_DigiHSTruthKey
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
int m_nShapeLo
Number of bins in low gain pulse shape.
Gaudi::Property< bool > m_onlyUseContainerName
int m_i_ADCmax
ADC saturation value.
SG::ReadHandleKey< TileHitContainer > m_hitContainerKey
float m_f_ADCmax
ADC saturation value.
int m_nBinsPerXHi
Number of bins per bunch crossing in high gain pulse shape.
float m_ADCmaxPlusEps
ADC saturation value + 0.01 or something small.
bool m_tileNoise
If true => generate noise in TileDigits.
SG::ReadCondHandleKey< TilePulse > m_pulseShapeKey
Name of TilePulseShape in condition store.
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
Gaudi::Property< bool > m_rndmEvtOverlay
virtual StatusCode execute(const EventContext &ctx) const override
execute method
const TileHWID * m_tileHWID
int m_nBinsPerXLo
Number of bins per bunch crossing in low gain pulse shape.
SG::WriteHandleKey< TileDigitsContainer > m_filteredDigitsContainerKey
double m_timeStepHi
Time step in high gain pulse shape: 25.0 / nBinsPerXHi.
Gaudi::Property< bool > m_calibRun
StatusCode fillDigitCollection(const TileHitCollection *hitCollection, std::vector< std::vector< double > > &drawerBufferLo, std::vector< std::vector< double > > &drawerBufferHi, std::vector< int > &igain, std::vector< int > &overgain, std::vector< double > &ech_int, std::vector< bool > &signal_in_channel, const TileEMScale *emScale, const TileSamplingFraction *samplingFraction, const TilePulse *pulse) const
const TileInfo * m_tileInfo
bool m_tileThresh
If true => apply threshold to Digits.
std::vector< double > m_digitShapeHi
High gain pulse shape.
Gaudi::Property< bool > m_useCoolPulseShapes
std::vector< double > m_digitShapeLo
Low gain pulse shape.
bool m_tileCoherNoise
If true => generate coherent noise in TileDigits.
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Gaudi::Property< std::string > m_infoName
const TileCablingService * m_cabling
TileCabling instance.
double m_timeStepLo
Time step in low gain pulse shape: 25.0 / nBinsPerXLo.
int m_iTrig
Index of the triggering time slice.
int m_nShapeHi
Number of bins in high gain pulse shape.
Gaudi::Property< bool > m_integerDigits
double m_tileThreshHi
Actual threshold value for high gain.
std::string m_inputDigitContainerName
Gaudi::Property< double > m_filterThresholdMBTS
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Name of TileSampleNoise in condition store.
Gaudi::Property< bool > m_doDigiTruth
virtual ~TileDigitsMaker()=default
float m_f_ADCmaskValue
indicates channels which were masked in background dataset
int m_binTime0Hi
Index of time=0 bin for high gain pulse shape.
SG::ReadCondHandleKey< TileSamplingFraction > m_samplingFractionKey
Name of TileSamplingFraction in condition store.
Gaudi::Property< double > m_filterThreshold
Gaudi::Property< bool > m_maskBadChannels
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service to use.
SG::ReadHandleKey< TileDigitsContainer > m_inputDigitContainerKey
float m_f_ADCmaxHG
ADC saturation value - 0.5.
double m_tileThreshLo
Actual threshold value for low gain.
virtual StatusCode finalize() override
finalize method
StatusCode overlayBackgroundDigits(const TileDigitsCollection *bkgDigitCollection, const TileHitCollection *hitCollection, std::vector< std::vector< double > > &drawerBufferLo, std::vector< std::vector< double > > &drawerBufferHi, std::vector< int > &igain, int ros, int drawer, int drawerIdx, std::vector< int > &over_gain, const TileEMScale *emScale, const TileSampleNoise *sampleNoise, const TileDQstatus *dqStatus, const TileBadChannels *badChannels) const
std::vector< std::unique_ptr< HWIdentifier[]> > m_all_ids
SG::WriteHandleKey< TileDigitsContainer > m_digitsContainer_DigiHSTruthKey
virtual StatusCode initialize() override
initialize method
const TileTBID * m_tileTBID
const TileID * m_tileID
Condition object to keep calibration factors of TileCal channels.
Definition TileEMScale.h:87
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 pulse shape.
Definition TilePulse.h:15
Condition object to keep and provide Tile sample noise.
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.