ATLAS Offline Software
Loading...
Searching...
No Matches
MM_ElectronicsResponseSimulation Class Reference

#include <MM_ElectronicsResponseSimulation.h>

Collaboration diagram for MM_ElectronicsResponseSimulation:

Classes

struct  ConfigModule
struct  DataCache

Public Member Functions

 MM_ElectronicsResponseSimulation (ConfigModule &&module)
 MM_ElectronicsResponseSimulation.cxx MC for micromegas athena integration.
 ~MM_ElectronicsResponseSimulation ()=default
MM_DigitToolOutput getPeakResponseFrom (const MM_ElectronicsToolInput &digiInput) const
MM_DigitToolOutput getThresholdResponseFrom (const MM_ElectronicsToolInput &digiInput) const
float getPeakTime () const
float getTimeWindowLowerOffset () const
float getTimeWindowUpperOffset () const
float getVmmDeadTime ()
float getVmmUpperGrazeWindow ()
float getStripdeadtime () const
float getARTdeadtime () const

Private Member Functions

void vmmPeakResponseFunction (DataCache &cache, const MM_ElectronicsToolInput &digiInput) const
void vmmThresholdResponseFunction (DataCache &cache, const MM_ElectronicsToolInput &digiInput) const

Private Attributes

const ConfigModule m_cfg {}
std::unique_ptr< VMM_Shaperm_vmmShaper {}

Detailed Description

Definition at line 31 of file MM_ElectronicsResponseSimulation.h.

Constructor & Destructor Documentation

◆ MM_ElectronicsResponseSimulation()

MM_ElectronicsResponseSimulation::MM_ElectronicsResponseSimulation ( ConfigModule && module)

MM_ElectronicsResponseSimulation.cxx MC for micromegas athena integration.

Definition at line 21 of file MM_ElectronicsResponseSimulation.cxx.

21 :
22 m_cfg{std::move(module)} {
23 // let the VMM peak search run in a wider window in order to simulate the dead time and to avoid a bug at the upper limit of the time
24 // window
26 std::make_unique<VMM_Shaper>(m_cfg.peakTime, m_cfg.timeWindowLowerOffset - m_cfg.vmmDeadtime, m_cfg.timeWindowUpperOffset + m_cfg.vmmUpperGrazeWindow);
27 m_vmmShaper->initialize();
28}

◆ ~MM_ElectronicsResponseSimulation()

MM_ElectronicsResponseSimulation::~MM_ElectronicsResponseSimulation ( )
default

Member Function Documentation

◆ getARTdeadtime()

float MM_ElectronicsResponseSimulation::getARTdeadtime ( ) const
inline

Definition at line 60 of file MM_ElectronicsResponseSimulation.h.

60{ return m_cfg.artDeadTime; };

◆ getPeakResponseFrom()

MM_DigitToolOutput MM_ElectronicsResponseSimulation::getPeakResponseFrom ( const MM_ElectronicsToolInput & digiInput) const

ToDo: include loop for calculating Trigger study vars

Definition at line 30 of file MM_ElectronicsResponseSimulation.cxx.

30 {
31 DataCache cache{};
32 vmmPeakResponseFunction(cache, digiInput);
33
35 // MM_DigitToolOutput(bool hitWasEff, std::vector <int> strpos, std::vector<float> time, std::vector<int> charge, std::vector<float>
36 // threshold, int strTrig, float strTimeTrig ):
37 MM_DigitToolOutput to_ret{true, std::move(cache.nStripElectronics),
38 std::move(cache.tStripElectronicsAbThr),
39 std::move(cache.qStripElectronics), 5, 0.3};
40
41 return to_ret;
42}
void vmmPeakResponseFunction(DataCache &cache, const MM_ElectronicsToolInput &digiInput) const

◆ getPeakTime()

float MM_ElectronicsResponseSimulation::getPeakTime ( ) const
inline

Definition at line 54 of file MM_ElectronicsResponseSimulation.h.

54{ return m_cfg.peakTime; };

◆ getStripdeadtime()

float MM_ElectronicsResponseSimulation::getStripdeadtime ( ) const
inline

Definition at line 59 of file MM_ElectronicsResponseSimulation.h.

59{ return m_cfg.stripDeadTime; };

◆ getThresholdResponseFrom()

MM_DigitToolOutput MM_ElectronicsResponseSimulation::getThresholdResponseFrom ( const MM_ElectronicsToolInput & digiInput) const

Definition at line 44 of file MM_ElectronicsResponseSimulation.cxx.

44 {
45 DataCache cache{};
46 vmmThresholdResponseFunction(cache, digiInput);
47 MM_DigitToolOutput to_ret{true, std::move(cache.nStripElectronics),
48 std::move(cache.tStripElectronicsAbThr),
49 std::move(cache.qStripElectronics), 5, 0.3};
50 return to_ret;
51}
void vmmThresholdResponseFunction(DataCache &cache, const MM_ElectronicsToolInput &digiInput) const

◆ getTimeWindowLowerOffset()

float MM_ElectronicsResponseSimulation::getTimeWindowLowerOffset ( ) const
inline

Definition at line 55 of file MM_ElectronicsResponseSimulation.h.

55{ return m_cfg.timeWindowLowerOffset; };

◆ getTimeWindowUpperOffset()

float MM_ElectronicsResponseSimulation::getTimeWindowUpperOffset ( ) const
inline

Definition at line 56 of file MM_ElectronicsResponseSimulation.h.

56{ return m_cfg.timeWindowUpperOffset; };

◆ getVmmDeadTime()

float MM_ElectronicsResponseSimulation::getVmmDeadTime ( )
inline

Definition at line 57 of file MM_ElectronicsResponseSimulation.h.

57{ return m_cfg.vmmDeadtime; }

◆ getVmmUpperGrazeWindow()

float MM_ElectronicsResponseSimulation::getVmmUpperGrazeWindow ( )
inline

Definition at line 58 of file MM_ElectronicsResponseSimulation.h.

58{ return m_cfg.vmmUpperGrazeWindow; }

◆ vmmPeakResponseFunction()

void MM_ElectronicsResponseSimulation::vmmPeakResponseFunction ( DataCache & cache,
const MM_ElectronicsToolInput & digiInput ) const
private

Definition at line 53 of file MM_ElectronicsResponseSimulation.cxx.

53 {
54
55
56 const std::vector<int>& numberofStrip = digiInput.NumberOfStripsPos();
57 const std::vector<std::vector<float>>& qStrip = digiInput.chipCharge();
58 const std::vector<std::vector<float>>& tStrip = digiInput.chipTime();
59 const std::vector<float>& stripsElectronicsThreshold = digiInput.stripThreshold();
60
61 for (unsigned int ii = 0; ii < numberofStrip.size(); ii++) {
62 // find min and max times for each strip:
63 bool thisStripFired{false};
64 double leftStripFired = false;
65 double rightStripFired = false;
66
67 // find the maximum charge:
68 if (m_cfg.useNeighborLogic) { // only check neighbor strips if VMM neighbor logic is enabled
69 if (ii > 0) {
70 leftStripFired =
71 m_vmmShaper->hasChargeAboveThreshold(qStrip.at(ii - 1), tStrip.at(ii - 1), stripsElectronicsThreshold.at(ii - 1));
72 }
73
74 if (ii + 1 < numberofStrip.size()) {
75 rightStripFired =
76 m_vmmShaper->hasChargeAboveThreshold(qStrip.at(ii + 1), tStrip.at(ii + 1), stripsElectronicsThreshold.at(ii + 1));
77 }
78 }
79
80 thisStripFired = m_vmmShaper->hasChargeAboveThreshold(qStrip.at(ii), tStrip.at(ii), stripsElectronicsThreshold.at(ii));
81
82 // check if neighbor strip was above threshold
83 bool neighborFired = leftStripFired || rightStripFired;
84
85 // Look at strip if it or its neighbor was above threshold and if neighbor logic of the VMM is enabled:
86 if (thisStripFired || (m_cfg.useNeighborLogic && neighborFired)) {
87 double charge{FLT_MAX}, time{FLT_MAX};
88
89 // if strip is below threshold but read through NL reduce threshold to low value of 1e to still find the peak
90 float tmpScaledThreshold = (thisStripFired ? stripsElectronicsThreshold.at(ii) : 1);
91
92 bool foundPeak = m_vmmShaper->vmmPeakResponse(qStrip.at(ii), tStrip.at(ii), tmpScaledThreshold, charge, time);
93 if (!foundPeak) continue; // if no peak was found within the enlarged time window the strip is skipped and no digit is created.
94 if (time < m_cfg.timeWindowLowerOffset || time > m_cfg.timeWindowUpperOffset)
95 continue; // only accept strips in the correct time window
96
97 cache.nStripElectronics.push_back(numberofStrip.at(ii));
98 cache.tStripElectronicsAbThr.push_back(time);
99 cache.qStripElectronics.push_back(charge);
100 }
101 }
102}
double charge(const T &p)
Definition AtlasPID.h:997
const std::vector< std::vector< float > > & chipTime() const
const std::vector< int > & NumberOfStripsPos() const
const std::vector< std::vector< float > > & chipCharge() const
const std::vector< float > & stripThreshold() const
time(flags, cells_name, *args, **kw)

◆ vmmThresholdResponseFunction()

void MM_ElectronicsResponseSimulation::vmmThresholdResponseFunction ( DataCache & cache,
const MM_ElectronicsToolInput & digiInput ) const
private

Definition at line 104 of file MM_ElectronicsResponseSimulation.cxx.

104 {
105
106 const std::vector<int>& numberofStrip = digiInput.NumberOfStripsPos();
107 const std::vector<std::vector<float>>& qStrip = digiInput.chipCharge();
108 const std::vector<std::vector<float>>& tStrip = digiInput.chipTime();
109 const std::vector<float>& electronicsThreshold = digiInput.stripThreshold();
110
111 for (unsigned int ii = 0; ii < numberofStrip.size(); ii++) {
112 double localThresholdt{FLT_MAX}, localThresholdq{FLT_MAX};
113
114 bool crossedThreshold =
115 m_vmmShaper->vmmThresholdResponse(qStrip.at(ii), tStrip.at(ii), electronicsThreshold.at(ii), localThresholdq, localThresholdt);
116 if (!crossedThreshold)
117 continue; // if no threshold crossing was found within the time window the strip is skipped and no digits are created.
118 if (localThresholdt < m_cfg.timeWindowLowerOffset || localThresholdt > m_cfg.timeWindowUpperOffset)
119 continue; // only accept strips in the correct time window
120
121 cache.nStripElectronics.push_back(numberofStrip.at(ii));
122 cache.tStripElectronicsAbThr.push_back(localThresholdt);
123 cache.qStripElectronics.push_back(localThresholdq);
124 }
125}

Member Data Documentation

◆ m_cfg

const ConfigModule MM_ElectronicsResponseSimulation::m_cfg {}
private

Definition at line 65 of file MM_ElectronicsResponseSimulation.h.

65{};

◆ m_vmmShaper

std::unique_ptr<VMM_Shaper> MM_ElectronicsResponseSimulation::m_vmmShaper {}
private

Definition at line 74 of file MM_ElectronicsResponseSimulation.h.

74{};

The documentation for this class was generated from the following files: