ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
 ~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
25  m_vmmShaper =
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 }

◆ 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 }

◆ 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 }

◆ 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.

◆ m_vmmShaper

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

Definition at line 74 of file MM_ElectronicsResponseSimulation.h.


The documentation for this class was generated from the following files:
MM_ElectronicsResponseSimulation::ConfigModule::vmmUpperGrazeWindow
float vmmUpperGrazeWindow
Definition: MM_ElectronicsResponseSimulation.h:42
MM_ElectronicsResponseSimulation::ConfigModule::vmmDeadtime
float vmmDeadtime
Definition: MM_ElectronicsResponseSimulation.h:41
MM_ElectronicsResponseSimulation::m_cfg
const ConfigModule m_cfg
Definition: MM_ElectronicsResponseSimulation.h:65
MM_ElectronicsToolInput::stripThreshold
const std::vector< float > & stripThreshold() const
Definition: MM_ElectronicsToolInput.h:34
MM_DigitToolOutput
Definition: MM_DigitToolOutput.h:25
MM_ElectronicsResponseSimulation::ConfigModule::stripDeadTime
float stripDeadTime
Definition: MM_ElectronicsResponseSimulation.h:39
python.PyAthena.module
module
Definition: PyAthena.py:131
MM_ElectronicsResponseSimulation::ConfigModule::timeWindowLowerOffset
float timeWindowLowerOffset
Definition: MM_ElectronicsResponseSimulation.h:37
MM_ElectronicsResponseSimulation::vmmPeakResponseFunction
void vmmPeakResponseFunction(DataCache &cache, const MM_ElectronicsToolInput &digiInput) const
Definition: MM_ElectronicsResponseSimulation.cxx:53
MM_ElectronicsResponseSimulation::m_vmmShaper
std::unique_ptr< VMM_Shaper > m_vmmShaper
Definition: MM_ElectronicsResponseSimulation.h:74
MM_ElectronicsToolInput::chipTime
const std::vector< std::vector< float > > & chipTime() const
Definition: MM_ElectronicsToolInput.h:33
MM_ElectronicsResponseSimulation::ConfigModule::useNeighborLogic
bool useNeighborLogic
Definition: MM_ElectronicsResponseSimulation.h:43
MM_ElectronicsResponseSimulation::vmmThresholdResponseFunction
void vmmThresholdResponseFunction(DataCache &cache, const MM_ElectronicsToolInput &digiInput) const
Definition: MM_ElectronicsResponseSimulation.cxx:104
charge
double charge(const T &p)
Definition: AtlasPID.h:538
MM_ElectronicsToolInput::NumberOfStripsPos
const std::vector< int > & NumberOfStripsPos() const
Definition: MM_ElectronicsToolInput.h:31
MM_ElectronicsResponseSimulation::ConfigModule::artDeadTime
float artDeadTime
Definition: MM_ElectronicsResponseSimulation.h:40
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
MM_ElectronicsResponseSimulation::ConfigModule::timeWindowUpperOffset
float timeWindowUpperOffset
Definition: MM_ElectronicsResponseSimulation.h:38
MM_ElectronicsResponseSimulation::ConfigModule::peakTime
float peakTime
power of responce function
Definition: MM_ElectronicsResponseSimulation.h:36
MM_ElectronicsToolInput::chipCharge
const std::vector< std::vector< float > > & chipCharge() const
Definition: MM_ElectronicsToolInput.h:32