ATLAS Offline Software
Loading...
Searching...
No Matches
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
26
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
46class IAmplifier;
47class SCT_ID;
48
49namespace InDetDD {
51}
52
53namespace CLHEP {
54 class HepRandomEngine;
55}
63
65 std::vector<float> m_GainFactor;
66 std::vector<double> m_Analogue[3];
67 std::vector<int> m_StripHitsOnWafer;
68};
69
70class 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;
95 StatusCode doThresholdCheckForCrosstalkHits(SiChargedDiodeCollection& collection, 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
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
FloatProperty m_GainRMS
FloatProperty m_NoiseShortMiddles
StatusCode randomNoise(SiChargedDiodeCollection &collection, const Identifier &moduleId, CLHEP::HepRandomEngine *rndmEngine, SCT_FrontEndData &data, const int &stripMax) const
BooleanProperty m_analogueNoiseOn
BooleanProperty m_NoiseOn
DoubleProperty m_NOShortMiddles
DoubleProperty m_NOMiddles
DoubleProperty m_NOInners
FloatProperty m_NoiseOuters
ToolHandle< ISCT_ReadCalibChipDataTool > m_ReadCalibChipDataTool
Handle to the Calibration ConditionsTool.
FloatProperty m_Ospread
FloatProperty m_NoiseBarrel3
ToolHandle< IAmplifier > m_sct_amplifier
Handle the Amplifier tool.
FloatProperty m_timeOfThreshold
StatusCode doThresholdCheckForCrosstalkHits(SiChargedDiodeCollection &collection, SCT_FrontEndData &data, const int &stripMax) const
ShortProperty m_data_readout_mode
StatusCode initVectors(int strips, SCT_FrontEndData &data) const
BooleanProperty m_useCalibData
virtual StatusCode finalize() override
AlgTool finalize.
FloatProperty m_OGcorr
DoubleProperty m_NOOuters
FloatProperty m_NoiseInners
DoubleProperty m_NOBarrel3
FloatProperty m_Threshold
virtual ~SCT_FrontEnd()=default
Destructor.
StatusCode doThresholdCheckForRealHits(SiChargedDiodeCollection &collectione, SCT_FrontEndData &data, const int &stripMax) const
DoubleProperty m_NOBarrel
virtual StatusCode initialize() override
AlgTool InterfaceID.
static float meanValue(std::vector< float > &calibDataVect)
SCT_FrontEnd(const std::string &type, const std::string &name, const IInterface *parent)
constructor
StatusCode doSignalChargeForHits(SiChargedDiodeCollection &collectione, SCT_FrontEndData &data, const int &stripMax) const
const InDetDD::SCT_DetectorManager * m_SCTdetMgr
Handle to SCT detector manager.
const SCT_ID * m_sct_id
Handle to SCT ID helper.
StatusCode addNoiseDiode(SiChargedDiodeCollection &collection, int strip, int tbin) const
StatusCode doClustering(SiChargedDiodeCollection &collection, SCT_FrontEndData &data, const int &stripMax) const
FloatProperty m_NoiseBarrel
StatusCode prepareGainAndOffset(SiChargedDiodeCollection &collection, const Identifier &moduleId, CLHEP::HepRandomEngine *rndmEngine, SCT_FrontEndData &data, const int &stripMax) const
StringProperty m_detMgrName
ShortProperty m_data_compression_mode
FloatProperty m_NoiseMiddles
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
const std::string process
Message Stream Member.
simulation of the SCT front-end electronics working as a SiPreDigitsProcessor models response of ABCD...
std::vector< int > m_StripHitsOnWafer
Info about which strips are above threshold.
std::vector< double > m_Analogue[3]
To hold the noise and amplifier response.
std::vector< float > m_GainFactor
generate gain per channel (added to the gain per chip from calib data)