ATLAS Offline Software
SCT_FrontEnd.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
27 #ifndef SCT_DIGITIZATION_SCT_FRONTEND_H
28 #define SCT_DIGITIZATION_SCT_FRONTEND_H
29 
30 // Inheritance
33 
34 // Athena
37 
38 // Gaudi
39 #include "GaudiKernel/ToolHandle.h"
40 
41 // STL
42 #include <atomic>
43 #include <mutex>
44 #include <vector>
45 
46 class IAmplifier;
47 class SCT_ID;
48 
49 namespace InDetDD {
50  class SCT_DetectorManager;
51 }
52 
53 namespace CLHEP {
54  class HepRandomEngine;
55 }
65  std::vector<float> m_GainFactor;
66  std::vector<double> m_Analogue[3];
67  std::vector<int> m_StripHitsOnWafer;
68 };
69 
70 class SCT_FrontEnd : public extends<AthAlgTool, IFrontEnd> {
71 
72  public:
73 
75  SCT_FrontEnd(const std::string& type, const std::string& name, const IInterface* parent);
77  virtual ~SCT_FrontEnd() = default;
78  //PJ not needed after merging?!
80  //static const InterfaceID& interfaceID();
81 
83  virtual StatusCode initialize() override;
85  virtual StatusCode finalize() override;
86 
92  virtual void process(SiChargedDiodeCollection& collection, CLHEP::HepRandomEngine* rndmEngine) const override;
93  StatusCode doSignalChargeForHits(SiChargedDiodeCollection& collectione, SCT_FrontEndData& data, const int& stripMax) const;
94  StatusCode doThresholdCheckForRealHits(SiChargedDiodeCollection& collectione, SCT_FrontEndData& data, const int& stripMax) const;
96  StatusCode doClustering(SiChargedDiodeCollection& collection, SCT_FrontEndData& data, const int& stripMax) const;
97  StatusCode prepareGainAndOffset(SiChargedDiodeCollection& collection, const Identifier& moduleId, CLHEP::HepRandomEngine* rndmEngine, SCT_FrontEndData& data, const int& stripMax) const;
98  StatusCode prepareGainAndOffset(SiChargedDiodeCollection& collection, int side, const Identifier& moduleId, CLHEP::HepRandomEngine* rndmEngine, SCT_FrontEndData& data, const int& stripMax) const;
99  StatusCode randomNoise(SiChargedDiodeCollection& collection, const Identifier& moduleId, CLHEP::HepRandomEngine* rndmEngine, SCT_FrontEndData& data, const int& stripMax) const;
100  StatusCode randomNoise(SiChargedDiodeCollection& collection, const Identifier& moduleId, int side, CLHEP::HepRandomEngine* rndmEngine, SCT_FrontEndData& data, const int& stripMax) const;
101  StatusCode addNoiseDiode(SiChargedDiodeCollection& collection, int strip, int tbin) const;
102  static float meanValue(std::vector<float>& calibDataVect) ;
103  StatusCode initVectors(int strips, SCT_FrontEndData& data) const;
104 
105  private:
106 
107  enum CompressionMode { Level_X1X=1, Edge_01X=2, AnyHit_1XX_X1X_XX1=3 }; // Used for m_data_compression_mode (DataCompressionMode)
108  enum ReadOutMode { Condensed=0, Expanded=1 }; // Used for m_data_readout_mode (DataReadOutMode)
109 
110  FloatProperty m_NoiseBarrel{this, "NoiseBarrel", 1500.0, "Noise factor, Barrel (in the case of no use of calibration data)"};
111  FloatProperty m_NoiseBarrel3{this, "NoiseBarrel3", 1541.0, "Noise factor, Barrel3 (in the case of no use of calibration data)"};
112  FloatProperty m_NoiseInners{this, "NoiseInners", 1090.0, "Noise factor, EC Inners (in the case of no use of calibration data)"};
113  FloatProperty m_NoiseMiddles{this, "NoiseMiddles", 1557.0, "Noise factor, EC Middles (in the case of no use of calibration data)"};
114  FloatProperty m_NoiseShortMiddles{this, "NoiseShortMiddles", 940.0, "Noise factor, EC Short Middles (in the case of no use of calibration data)"};
115  FloatProperty m_NoiseOuters{this, "NoiseOuters", 1618.0, "Noise factor, Ec Outers (in the case of no use of calibration data)"};
116  DoubleProperty m_NOBarrel{this, "NOBarrel", 1.5e-5, "Noise factor, Barrel (in the case of no use of calibration data)"};
117  DoubleProperty m_NOBarrel3{this, "NOBarrel3", 2.1e-5, "Noise factor, Barrel3 (in the case of no use of calibration data)"};
118  DoubleProperty m_NOInners{this, "NOInners", 5.0e-9, "Noise Occupancy, EC Inners (in the case of no use of calibration data)"};
119  DoubleProperty m_NOMiddles{this, "NOMiddles", 2.7e-5, "Noise Occupancy, EC Middles (in the case of no use of calibration data)"};
120  DoubleProperty m_NOShortMiddles{this, "NOShortMiddles", 2.0e-9, "Noise Occupancy, EC Short Middles (in the case of no use of calibration data)"};
121  DoubleProperty m_NOOuters{this, "NOOuters", 3.5e-5, "Noise Occupancy, Ec Outers (in the case of no use of calibration data)"};
122  BooleanProperty m_NoiseOn{this, "NoiseOn", true, "To know if noise is on or off when using calibration data"};
123  BooleanProperty m_analogueNoiseOn{this, "AnalogueNoiseOn", true, "To know if analogue noise is on or off"};
124  FloatProperty m_GainRMS{this, "GainRMS", 0.031, "Gain spread parameter within the strips for a given Chip gain"};
125  FloatProperty m_Ospread{this, "Ospread", 0.0001, "offset spread within the strips for a given Chip offset"};
126  FloatProperty m_OGcorr{this, "OffsetGainCorrelation", 0.00001, "Gain/offset correlation for the strips"};
127  FloatProperty m_Threshold{this, "Threshold", 1.0, "Threshold"};
128  FloatProperty m_timeOfThreshold{this, "TimeOfThreshold", 30.0, "Threshold time"};
129  ShortProperty m_data_compression_mode{this, "DataCompressionMode", Edge_01X, "Front End Data Compression Mode: 1 is level mode X1X (default), 2 is edge mode 01X, 3 is any hit mode (1XX|X1X|XX1)"};
130  ShortProperty m_data_readout_mode{this, "DataReadOutMode", Condensed, "Front End Data Read out mode Mode: 0 is condensed mode and 1 is expanded mode"};
131  BooleanProperty m_useCalibData{this, "UseCalibData", true, "Flag to set the use of calibration data for noise, Gain,offset etc."};
132 
133  ToolHandle<IAmplifier> m_sct_amplifier{this, "SCT_Amp", "SCT_Amp", "Handle the Amplifier tool"};
134  ToolHandle<ISCT_ReadCalibChipDataTool> m_ReadCalibChipDataTool{this, "SCT_ReadCalibChipDataTool", "SCT_ReadCalibChipDataTool", "Tool to retrieve chip calibration information"};
135 
137  const SCT_ID* m_sct_id{nullptr};
138 
139  //Allow a different DetMgr to be used
140  StringProperty m_detMgrName{this, "DetectorManager", "SCT", "Name of DetectorManager to retrieve"};
141 
142 
143 };
144 
145 #endif //SCT_FRONTEND_H
SCT_FrontEnd::m_timeOfThreshold
FloatProperty m_timeOfThreshold
Definition: SCT_FrontEnd.h:128
SCT_FrontEndData
simulation of the SCT front-end electronics working as a SiPreDigitsProcessor models response of ABCD...
Definition: SCT_FrontEnd.h:64
ISCT_ReadCalibChipDataTool.h
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SCT_FrontEnd::m_data_readout_mode
ShortProperty m_data_readout_mode
Definition: SCT_FrontEnd.h:130
SCT_FrontEndData::m_StripHitsOnWafer
std::vector< int > m_StripHitsOnWafer
Info about which strips are above threshold.
Definition: SCT_FrontEnd.h:67
SCT_FrontEnd::m_NoiseOn
BooleanProperty m_NoiseOn
Definition: SCT_FrontEnd.h:122
SCT_FrontEnd::m_data_compression_mode
ShortProperty m_data_compression_mode
Definition: SCT_FrontEnd.h:129
SCT_FrontEnd::randomNoise
StatusCode randomNoise(SiChargedDiodeCollection &collection, const Identifier &moduleId, CLHEP::HepRandomEngine *rndmEngine, SCT_FrontEndData &data, const int &stripMax) const
Definition: SCT_FrontEnd.cxx:356
SiliconTech::strip
@ strip
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
SCT_FrontEnd::m_ReadCalibChipDataTool
ToolHandle< ISCT_ReadCalibChipDataTool > m_ReadCalibChipDataTool
Handle to the Calibration ConditionsTool.
Definition: SCT_FrontEnd.h:134
SCT_FrontEnd::CompressionMode
CompressionMode
Definition: SCT_FrontEnd.h:107
SCT_FrontEnd::meanValue
static float meanValue(std::vector< float > &calibDataVect)
Definition: SCT_FrontEnd.cxx:997
SCT_FrontEnd::process
virtual void process(SiChargedDiodeCollection &collection, CLHEP::HepRandomEngine *rndmEngine) const override
process the collection of pre digits: needed to go through all single-strip pre-digits to calculate t...
Definition: SCT_FrontEnd.cxx:578
SCT_FrontEndData::m_GainFactor
std::vector< float > m_GainFactor
generate gain per channel (added to the gain per chip from calib data)
Definition: SCT_FrontEnd.h:65
SCT_FrontEnd::Level_X1X
@ Level_X1X
Definition: SCT_FrontEnd.h:107
SCT_FrontEnd::m_sct_id
const SCT_ID * m_sct_id
Handle to SCT ID helper.
Definition: SCT_FrontEnd.h:137
SCT_FrontEnd::m_NoiseInners
FloatProperty m_NoiseInners
Definition: SCT_FrontEnd.h:112
SCT_FrontEnd::m_OGcorr
FloatProperty m_OGcorr
Definition: SCT_FrontEnd.h:126
SCT_FrontEnd::prepareGainAndOffset
StatusCode prepareGainAndOffset(SiChargedDiodeCollection &collection, const Identifier &moduleId, CLHEP::HepRandomEngine *rndmEngine, SCT_FrontEndData &data, const int &stripMax) const
Definition: SCT_FrontEnd.cxx:132
SCT_FrontEnd::m_NOMiddles
DoubleProperty m_NOMiddles
Definition: SCT_FrontEnd.h:119
SCT_FrontEnd::Edge_01X
@ Edge_01X
Definition: SCT_FrontEnd.h:107
SCT_FrontEnd::initVectors
StatusCode initVectors(int strips, SCT_FrontEndData &data) const
Definition: SCT_FrontEnd.cxx:111
TRT::Hit::side
@ side
Definition: HitInfo.h:83
SCT_FrontEnd::SCT_FrontEnd
SCT_FrontEnd(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: SCT_FrontEnd.cxx:29
SCT_FrontEnd::m_Threshold
FloatProperty m_Threshold
Definition: SCT_FrontEnd.h:127
IAmplifier
Definition: IAmplifier.h:20
SCT_FrontEnd::~SCT_FrontEnd
virtual ~SCT_FrontEnd()=default
Destructor.
SiChargedDiodeCollection
Definition: SiChargedDiodeCollection.h:109
SCT_FrontEnd::m_NOBarrel3
DoubleProperty m_NOBarrel3
Definition: SCT_FrontEnd.h:117
SCT_FrontEnd::m_sct_amplifier
ToolHandle< IAmplifier > m_sct_amplifier
Handle the Amplifier tool.
Definition: SCT_FrontEnd.h:133
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
SCT_FrontEnd::m_GainRMS
FloatProperty m_GainRMS
Definition: SCT_FrontEnd.h:124
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SCT_FrontEnd::addNoiseDiode
StatusCode addNoiseDiode(SiChargedDiodeCollection &collection, int strip, int tbin) const
Definition: SCT_FrontEnd.cxx:983
SCT_FrontEnd::Condensed
@ Condensed
Definition: SCT_FrontEnd.h:108
SCT_FrontEnd::m_NoiseShortMiddles
FloatProperty m_NoiseShortMiddles
Definition: SCT_FrontEnd.h:114
SCT_FrontEnd
Definition: SCT_FrontEnd.h:70
SCT_FrontEnd::m_useCalibData
BooleanProperty m_useCalibData
Definition: SCT_FrontEnd.h:131
SCT_FrontEnd::m_Ospread
FloatProperty m_Ospread
Definition: SCT_FrontEnd.h:125
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SCT_FrontEnd::doThresholdCheckForCrosstalkHits
StatusCode doThresholdCheckForCrosstalkHits(SiChargedDiodeCollection &collection, SCT_FrontEndData &data, const int &stripMax) const
Definition: SCT_FrontEnd.cxx:813
SCT_FrontEnd::m_NoiseBarrel
FloatProperty m_NoiseBarrel
Definition: SCT_FrontEnd.h:110
SCT_FrontEnd::initialize
virtual StatusCode initialize() override
AlgTool InterfaceID.
Definition: SCT_FrontEnd.cxx:36
SCT_FrontEnd::m_detMgrName
StringProperty m_detMgrName
Definition: SCT_FrontEnd.h:140
SCT_FrontEnd::m_analogueNoiseOn
BooleanProperty m_analogueNoiseOn
Definition: SCT_FrontEnd.h:123
SCT_FrontEnd::m_NoiseMiddles
FloatProperty m_NoiseMiddles
Definition: SCT_FrontEnd.h:113
SCT_FrontEnd::m_NOBarrel
DoubleProperty m_NOBarrel
Definition: SCT_FrontEnd.h:116
SCT_FrontEnd::finalize
virtual StatusCode finalize() override
AlgTool finalize.
Definition: SCT_FrontEnd.cxx:101
SCT_FrontEnd::m_NOOuters
DoubleProperty m_NOOuters
Definition: SCT_FrontEnd.h:121
SCT_FrontEnd::m_NOInners
DoubleProperty m_NOInners
Definition: SCT_FrontEnd.h:118
SCT_FrontEnd::doThresholdCheckForRealHits
StatusCode doThresholdCheckForRealHits(SiChargedDiodeCollection &collectione, SCT_FrontEndData &data, const int &stripMax) const
Definition: SCT_FrontEnd.cxx:735
SCT_ID
Definition: SCT_ID.h:68
IFrontEnd.h
SCT_FrontEnd::ReadOutMode
ReadOutMode
Definition: SCT_FrontEnd.h:108
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
SCT_FrontEnd::m_SCTdetMgr
const InDetDD::SCT_DetectorManager * m_SCTdetMgr
Handle to SCT detector manager.
Definition: SCT_FrontEnd.h:136
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_FrontEnd::m_NOShortMiddles
DoubleProperty m_NOShortMiddles
Definition: SCT_FrontEnd.h:120
SCT_FrontEnd::m_NoiseBarrel3
FloatProperty m_NoiseBarrel3
Definition: SCT_FrontEnd.h:111
SCT_FrontEndData::m_Analogue
std::vector< double > m_Analogue[3]
To hold the noise and amplifier response.
Definition: SCT_FrontEnd.h:66
SCT_FrontEnd::doSignalChargeForHits
StatusCode doSignalChargeForHits(SiChargedDiodeCollection &collectione, SCT_FrontEndData &data, const int &stripMax) const
Definition: SCT_FrontEnd.cxx:660
SCT_FrontEnd::m_NoiseOuters
FloatProperty m_NoiseOuters
Definition: SCT_FrontEnd.h:115
SCT_FrontEnd::AnyHit_1XX_X1X_XX1
@ AnyHit_1XX_X1X_XX1
Definition: SCT_FrontEnd.h:107
SCT_FrontEnd::Expanded
@ Expanded
Definition: SCT_FrontEnd.h:108
SCT_FrontEnd::doClustering
StatusCode doClustering(SiChargedDiodeCollection &collection, SCT_FrontEndData &data, const int &stripMax) const
Definition: SCT_FrontEnd.cxx:889
SiChargedDiodeCollection.h