ATLAS Offline Software
TileRawChannelBuilderOpt2Filter.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_TILERAWCHANNELBUILDEROPT2FILTER_H
6 #define TILERECUTILS_TILERAWCHANNELBUILDEROPT2FILTER_H
7 
9 //
10 // Based on the code of Ximo Poveda@cern.ch. June 2007
11 // Andrei.Artamonov@cern.ch, July 2008
12 //
13 // TileRawChannelBuilderOpt2Filter.h
14 //
15 // implementation of the Optimal Filtering based on Lagrange multipliers
16 // for energy/time reconstruction in TileCal
17 //
19 
20 // Tile includes
25 
26 #include <vector>
27 #include <string>
28 
48  public:
49 
50  TileRawChannelBuilderOpt2Filter(const std::string& type, const std::string& name,
51  const IInterface *parent);
53 
54  // virtual methods
55  virtual StatusCode initialize();
56  //virtual StatusCode execute();
57  virtual StatusCode finalize();
58 
59  // Inherited from TileRawChannelBuilder
60  virtual TileRawChannel* rawChannel(const TileDigits* digits, const EventContext& ctx);
61 
65  static const InterfaceID& interfaceID();
66 
67  private:
68 
69  ToolHandle<ITileCondToolOfc> m_tileCondToolOfc{this,
70  "TileCondToolOfc", "TileCondToolOfc", "Tile OFC tool"};
71 
72  ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample{this,
73  "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile noise sample tool"};
74 
76  double filter(int ros, int drawer, int channel, int &gain, double &pedestal, double &amplitude, double &time, const EventContext &ctx);
77  int findMaxDigitPosition();
78  float getPedestal(int ros, int drawer, int channel, int gain, const EventContext &ctx);
81  int iterate(int ros, int drawer, int channel, int gain, double &pedestal, double &amplitude, double &time, double &chi2, const EventContext &ctx);
83  double compute(int ros, int drawer, int channel, int gain, double &pedestal, double &amplitude, double &time, double& phase, const EventContext &ctx);
84 
85  void ofc2int(int nDigits, double* w_off, short* w_int, short& scale); // convert weights to dsp short int format
86 
89  bool m_confTB;
91  bool m_of2;
92  bool m_minus1Iter;
95 
96  bool m_bestPhase; // if true, use best phase from COOL DB in "fixed phase" mode (i.e., no iterations)
97  bool m_emulateDsp; // if true, emulate DSP reconstruction algorithm
98  int m_nSignal;
100  int m_nCenter;
101  int m_nConst;
102 
105  double m_maxTime;
106  double m_minTime;
107 
108 
109  std::vector<float> m_digits;
110 
113 };
114 
115 #endif
TileRawChannelBuilderOpt2Filter::m_minTime
double m_minTime
min allowed time = -25*(m_nSamples-1)/2
Definition: TileRawChannelBuilderOpt2Filter.h:106
ReadOfcFromCool.phase
phase
Definition: ReadOfcFromCool.py:127
TileRawChannelBuilderOpt2Filter::TileRawChannelBuilderOpt2Filter
TileRawChannelBuilderOpt2Filter(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: TileRawChannelBuilderOpt2Filter.cxx:52
TileRawChannelBuilderOpt2Filter::m_noiseThresholdLG
int m_noiseThresholdLG
Definition: TileRawChannelBuilderOpt2Filter.h:112
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileRawChannelBuilderOpt2Filter::m_correctTimeNI
bool m_correctTimeNI
If true, resulting time is corrected when using method without iteration.
Definition: TileRawChannelBuilderOpt2Filter.h:94
TileRawChannelBuilderOpt2Filter::compute
double compute(int ros, int drawer, int channel, int gain, double &pedestal, double &amplitude, double &time, double &phase, const EventContext &ctx)
Definition: TileRawChannelBuilderOpt2Filter.cxx:557
TileRawChannelBuilderOpt2Filter::m_nSignal
int m_nSignal
internal counters
Definition: TileRawChannelBuilderOpt2Filter.h:98
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TileRawChannelBuilderOpt2Filter::m_pedestalMode
int m_pedestalMode
pedestal mode to use
Definition: TileRawChannelBuilderOpt2Filter.h:88
ITileCondToolOfc.h
TileRawChannelBuilderOpt2Filter::initialize
virtual StatusCode initialize()
Initialize method.
Definition: TileRawChannelBuilderOpt2Filter.cxx:90
TileRawChannelBuilderOpt2Filter::m_tileCondToolOfc
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
Definition: TileRawChannelBuilderOpt2Filter.h:69
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
TileCondToolTiming.h
TileRawChannelBuilderOpt2Filter::m_minus1Iter
bool m_minus1Iter
bool variable for whether to apply -1 iteration (initial phase guess)
Definition: TileRawChannelBuilderOpt2Filter.h:92
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileRawChannelBuilderOpt2Filter::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: TileRawChannelBuilderOpt2Filter.cxx:45
TileRawChannelBuilderOpt2Filter::m_timeForConvergence
double m_timeForConvergence
minimum time difference to quit iteration procedure
Definition: TileRawChannelBuilderOpt2Filter.h:90
TileRawChannelBuilderOpt2Filter::m_tileToolNoiseSample
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
Applies OF algorithm.
Definition: TileRawChannelBuilderOpt2Filter.h:72
TileRawChannelBuilderOpt2Filter::ofc2int
void ofc2int(int nDigits, double *w_off, short *w_int, short &scale)
Definition: TileRawChannelBuilderOpt2Filter.cxx:717
TileRawChannelBuilderOpt2Filter::m_of2
bool m_of2
bool variable for OF method: true=> OF2; false=> OF1
Definition: TileRawChannelBuilderOpt2Filter.h:91
TileCondToolNoiseSample.h
TileRawChannelBuilderOpt2Filter::m_emulateDsp
bool m_emulateDsp
Definition: TileRawChannelBuilderOpt2Filter.h:97
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
TileRawChannel
Definition: TileRawChannel.h:35
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TileRawChannelBuilderOpt2Filter::filter
double filter(int ros, int drawer, int channel, int &gain, double &pedestal, double &amplitude, double &time, const EventContext &ctx)
Definition: TileRawChannelBuilderOpt2Filter.cxx:340
TileRawChannelBuilder
Definition: TileRawChannelBuilder.h:59
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileRawChannelBuilderOpt2Filter::iterate
int iterate(int ros, int drawer, int channel, int gain, double &pedestal, double &amplitude, double &time, double &chi2, const EventContext &ctx)
Computes A,time,ped using OF.
Definition: TileRawChannelBuilderOpt2Filter.cxx:505
TileRawChannelBuilderOpt2Filter::getPedestal
float getPedestal(int ros, int drawer, int channel, int gain, const EventContext &ctx)
Apply the number of iterations needed for reconstruction by calling the Filter method.
Definition: TileRawChannelBuilderOpt2Filter.cxx:300
TileRawChannelBuilderOpt2Filter::rawChannel
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx)
Builder virtual method to be implemented by subclasses.
Definition: TileRawChannelBuilderOpt2Filter.cxx:192
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TileDigits
Definition: TileDigits.h:30
TileRawChannelBuilderOpt2Filter::m_nCenter
int m_nCenter
internal counters
Definition: TileRawChannelBuilderOpt2Filter.h:100
TileRawChannelBuilderOpt2Filter::m_maxTime
double m_maxTime
max allowed time = 25*(m_nSamples-1)/2
Definition: TileRawChannelBuilderOpt2Filter.h:105
TileRawChannelBuilderOpt2Filter
Reconstructs Tile digitized pulses (ie, computes amplitude, time and pedestal) as a linear combinatio...
Definition: TileRawChannelBuilderOpt2Filter.h:47
TileRawChannelBuilder.h
TileRawChannelBuilderOpt2Filter::m_nConst
int m_nConst
internal counters
Definition: TileRawChannelBuilderOpt2Filter.h:101
TileRawChannelBuilderOpt2Filter::m_maxIterations
int m_maxIterations
maximum number of iteration to perform
Definition: TileRawChannelBuilderOpt2Filter.h:87
TileRawChannelBuilderOpt2Filter::m_confTB
bool m_confTB
use testbeam configuration
Definition: TileRawChannelBuilderOpt2Filter.h:89
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
TileRawChannelBuilderOpt2Filter::m_digits
std::vector< float > m_digits
Definition: TileRawChannelBuilderOpt2Filter.h:109
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileRawChannelBuilderOpt2Filter::m_correctAmplitude
bool m_correctAmplitude
If true, resulting amplitude is corrected when using weights for tau=0 without iteration.
Definition: TileRawChannelBuilderOpt2Filter.h:93
TileRawChannelBuilderOpt2Filter::m_t0SamplePosition
int m_t0SamplePosition
position of peak sample = (m_nSamples-1)/2
Definition: TileRawChannelBuilderOpt2Filter.h:104
TileRawChannelBuilderOpt2Filter::m_noiseThresholdHG
int m_noiseThresholdHG
Definition: TileRawChannelBuilderOpt2Filter.h:111
TileRawChannelBuilderOpt2Filter::~TileRawChannelBuilderOpt2Filter
~TileRawChannelBuilderOpt2Filter()
Destructor.
Definition: TileRawChannelBuilderOpt2Filter.cxx:86
TileRawChannelBuilderOpt2Filter::m_nSamples
int m_nSamples
number of samples in the data
Definition: TileRawChannelBuilderOpt2Filter.h:103
TileRawChannelBuilderOpt2Filter::m_bestPhase
bool m_bestPhase
Definition: TileRawChannelBuilderOpt2Filter.h:96
TileRawChannelBuilderOpt2Filter::findMaxDigitPosition
int findMaxDigitPosition()
Finds maximum digit position in the pulse.
Definition: TileRawChannelBuilderOpt2Filter.cxx:270
TileRawChannelBuilderOpt2Filter::m_nNegative
int m_nNegative
internal counters
Definition: TileRawChannelBuilderOpt2Filter.h:99
TileRawChannelBuilderOpt2Filter::finalize
virtual StatusCode finalize()
Finalize method.
Definition: TileRawChannelBuilderOpt2Filter.cxx:170