ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelBuilder.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_ITILERAWCHANNELBUILDER_H
6#define TILERECUTILS_ITILERAWCHANNELBUILDER_H
7
8/********************************************************************
9 *
10 * NAME: TileRawChanelBuilder
11 * PACKAGE: offline/TileCalorimeter/TileRecUtils
12 *
13 * AUTHOR : K. Gellerstedt
14 * CREATED: Nov 17 2003
15 *
16 * PURPOSE: Interface for builder algorithms
17 *
18 * Input: TileDigitsContainer
19 * Output: Container with TileRawChannels
20 * Parameters:
21 * TileRawChannelContainer - Name of output container
22 *
23 ********************************************************************/
24
25// Tile includes
37
38// Atlas includes
40
41//Gaudi includes
42#include "GaudiKernel/ToolHandle.h"
43#include "GaudiKernel/ServiceHandle.h"
45
46#include <utility>
47#include <vector>
48#include <memory>
49
50class TileDigits;
51class TileRawChannel;
52class TileID;
53class TileHWID;
54class TileInfo;
55class StoreGateSvc;
56
57typedef std::vector<std::pair<TileRawChannel*, const TileDigits*> > Overflows_t;
58
60 public:
61 TileRawChannelBuilder(const std::string& type, const std::string& name,
62 const IInterface* parent);
63
64 virtual ~TileRawChannelBuilder();
65
66 // Algorithm tool virtual methods
67 virtual StatusCode initialize();
68 //virtual StatusCode execute();
69 virtual StatusCode finalize();
70
75 virtual StatusCode createContainer(const EventContext& ctx);
76
82 virtual TileRawChannel* rawChannel(const TileDigits* digits, const EventContext& ctx);
83
87 virtual StatusCode commitContainer(const EventContext& ctx);
88
89 void initLog(const EventContext& ctx);
90 void endLog();
91
92 // process all digits from one collection and store results in internal container
93 StatusCode build (const TileDigitsCollection* collection, const EventContext& ctx);
94
98 static const InterfaceID& interfaceID();
99
100 static double correctAmp(double phase, bool of2 = true);
101
102 static double correctTime( double phase, bool of2 = true);
103
104 static int CorruptedData(int ros, int drawer, int channel, int gain,
105 const std::vector<float> & digits, float &dmin, float &dmax, float ADCmaxMinusEps, float ADCmaskValueMinusEps);
106
107 static const char* BadPatternName(float ped);
108
109 void resetDrawer();
110 void resetOverflows(void);
112 std::string getTileRawChannelContainerID(void);
113
114 protected:
115 // FIXME: Get rid of this abomination.
116 friend class TileHid2RESrcID;
117
118 // properties
119 // DQ status.
121 "TileDQstatus",
122 "TileDQstatus key"};
123
124 // DSP container. Only used of m_useDSP is set.
126 {this, "DSPContainer", "", "DSP Container key"};
127
128 // name of TDS container with output TileRawChannels
129 SG::WriteHandleKey<TileRawChannelContainer> m_rawChannelContainerKey{this,"TileRawChannelContainer","TileRawChannelFiltered",
130 "Output Tile raw channels container key"};
131
132 // RawChannelContainer
133 std::unique_ptr<TileMutableRawChannelContainer> m_rawChannelCnt;
134
135 // parameters for RawChannelContainer
138 unsigned int m_bsflags;
139 // parameter to determine which sample to start with the analysis
141 // Should energy be calibrated
143
144 // Should time be calibrated (delta added from laser run)
146
147
148 // Use DSP noise correction for incomplete containers
150
151 // thresholds for parabolic amplitude correction (used in optimal filter without iterations)
155
156 // runType used to override value of trigType in event
158
159 // Tile objects
162
163 ToolHandleArray<ITileRawChannelTool> m_noiseFilterTools{this,
164 "NoiseFilterTools", {}, "Tile noise filter tools"};
165
166 ToolHandle<TileCondToolEmscale> m_tileToolEmscale{this,
167 "TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"};
168
169 ToolHandle<TileCondToolTiming> m_tileToolTiming{this,
170 "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};
171
172 ToolHandle<TileCondIdTransforms> m_tileIdTransforms{this,
173 "TileCondIdTransforms", "TileCondIdTransforms",
174 "Tile tool to tranlate hardware identifier to the drawerIdx, channel, and adc"};
175
180 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};
181
183
184 Gaudi::Property<std::vector<int>> m_demoFragIDs{this,
185 "DemoFragIDs", {}, "List of Tile frag IDs with new electronics (demonstrator)"};
186
188 bool m_idophys; // Phys fitting
189 bool m_idolas; // Laser fitting
190 bool m_idoped; // Ped run, phys fitting
191 bool m_idocis; // CIS fitting
192 int m_cischan; // which channel is fired by CIS
193 double m_capdaq; // Capacitor
194
195 unsigned int m_evtCounter;
196 unsigned int m_chCounter;
197
200 double m_RChSumL;
201 double m_RChSumH;
202
205
206 static const int MAX_CHANNELS = 48;
207 static const int MAX_DMUS = 16;
209 int m_lastDrawer = -1;
210 bool m_badDrawer = false;
211
213
214 // TileInfo
215 std::string m_infoName;
223
224private:
225 // find all bad patterns in a drawer and fill internal static arrays
226 void fill_drawer_errors(const EventContext& ctx,
227 const TileDigitsCollection* collection);
228
229};
230
231#endif
Property holding a SG store/key/clid from which a WriteHandle is made.
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
Helper for holding non-const raw data prior to recording in SG.
std::vector< std::pair< TileRawChannel *, const TileDigits * > > Overflows_t
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
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.
The Athena Transient Store API.
TYPE
initialize
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
Helper class for TileCal offline identifiers.
Definition TileID.h:67
virtual StatusCode finalize()
ToolHandle< TileCondToolTiming > m_tileToolTiming
Overflows_t & getOverflowedChannels(void)
static const char * BadPatternName(float ped)
TileRawChannelUnit::UNIT m_rChUnit
StatusCode build(const TileDigitsCollection *collection, const EventContext &ctx)
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
float m_timeMinThresh
correct amplitude is time is above time min threshold
std::unique_ptr< TileMutableRawChannelContainer > m_rawChannelCnt
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
static double correctTime(double phase, bool of2=true)
Time correction factor.
virtual ~TileRawChannelBuilder()
Destructor.
float m_ADCmaskValueMinusEps
indicates channels which were masked in background dataset
SG::ReadHandleKey< TileRawChannelContainer > m_DSPContainerKey
float m_ampMinThresh
correct amplitude if it's above amplitude threshold (in ADC counts)
virtual StatusCode createContainer(const EventContext &ctx)
Create container in SG with name given by parameter (m_rawChannelContainerKey)
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
float m_timeMaxThresh
correct amplitude is time is below time max threshold
static int CorruptedData(int ros, int drawer, int channel, int gain, const std::vector< float > &digits, float &dmin, float &dmax, float ADCmaxMinusEps, float ADCmaskValueMinusEps)
ToolHandle< TileCondIdTransforms > m_tileIdTransforms
void fill_drawer_errors(const EventContext &ctx, const TileDigitsCollection *collection)
std::string getTileRawChannelContainerID(void)
virtual StatusCode commitContainer(const EventContext &ctx)
Commit RawChannelContiner in SG and make const.
static double correctAmp(double phase, bool of2=true)
Amplitude correction factor according to the time when using weights for tau=0 without iterations.
const TileCablingService * m_cabling
TileCabling instance.
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx)
Builder virtual method to be implemented by subclasses.
void initLog(const EventContext &ctx)
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
virtual StatusCode initialize()
Initializer.
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Gaudi::Property< std::vector< int > > m_demoFragIDs
TileRawChannelBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.