ATLAS Offline Software
Loading...
Searching...
No Matches
CscCalibTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CSCCALIBTOOLBASE_H
6#define CSCCALIBTOOLBASE_H
7
8/*******************************************************************************
9 Name : CscCalibToolBase.h
10 Package : offline/MuonSpectrometer/MuonCalib/MuonCalibTools
11 Author : Ketevi A. Assamagan
12 Created : March 2005
13
14 DESCRIPTION:
15 This class is the base class for run time CSC calibration tools.
16 These calibration tools need theCSC conditions data. The conditions data
17 are written and read with a different set of tools. The production of the
18 conditions data can be done via ATHENA or standalone
19*******************************************************************************/
20
25
26#include "TF1.h"
27
28#include <atomic>
29#include <inttypes.h>
30#include <memory>
31#include <mutex>
32#include <vector>
33
34class CscCondDbData;
35
36class CscCalibTool : public extends<AthAlgTool, ICscCalibTool> {
37
38public:
39 CscCalibTool(const std::string&, const std::string&, const IInterface*);
40 virtual ~CscCalibTool () = default;
41
42 virtual StatusCode initialize() override final;
43
48 virtual int femtoCoulombToADCCount (uint32_t stripHashId, const double femtoCoulombs) const override final;
49
52 virtual int numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const override final;
53
55 virtual double adcCountToFemtoCoulomb (const float adcCounts, const float slope) const override final;
56 virtual double adcCountToFemtoCoulomb (uint32_t stripHashId, const float adcCounts) const override final;
57
59 virtual double adcCountToNumberOfElectrons (const float adcValue, const float slope) const override final;
60 virtual double adcCountToNumberOfElectrons (uint32_t stripHashId, const float adcValue) const override final;
61
64 virtual bool adcToCharge(const std::vector<uint16_t>& samples, uint32_t stripHashId,
65 std::vector<float>& charges) const override final;
66
70 virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase,
71 const std::vector<float>& samples,double & charge, double & time) const override final;
72
73
76 virtual double stripNoise ( uint32_t stripHashId, const bool convert=true ) const override final;
77
80 virtual double stripRMS ( uint32_t stripHashId, const bool convert=true ) const override final;
81
84 virtual double stripF001 ( uint32_t stripHashId, const bool convert=true ) const override final;
85
88 virtual double stripPedestal ( uint32_t stripHashId, const bool convert=true ) const override final;
89
92 virtual bool isGood ( uint32_t stripHashId ) const override final;
93
95 virtual int stripStatusBit ( uint32_t stripHashId ) const override final;
96
98 virtual bool stripT0phase ( uint32_t stripHashId ) const override final;
99
101 virtual double stripT0base ( uint32_t stripHashId ) const override final;
102
105 virtual double func (const double x, const float slope) const override final;
106 virtual double func_prime (const double x, const float slope) const override final;
107
108 virtual double signal (const double z) const override final;
109 virtual double signal_amplitude (const double driftTime, const double samplingTime) const override final;
110 virtual double getZ0() const override final;
111
112 virtual double getSamplingTime() const override final;
113 virtual double getTimeOffset() const override final;
114 virtual double getSignalWidth() const override final;
115 virtual double getNumberOfIntegration() const override final;
116 virtual double getNumberOfIntegration2() const override final;
117
118 // virtual Double_t bipfunc (const Double_t *x, const Double_t *par);
119 // virtual Double_t dualbipfunc (const Double_t *x, const Double_t *par);
120
121 // To add bipolar functions and extract drftTime and stripCharge after addition,
122 // this function is defined. Return value is pair and the first one is driftTime.
123 virtual std::pair<double,double> addBipfunc(const double driftTime0, const double stripCharge0,
124 const double driftTime1, const double stripCharge1) const override final;
125
126 // 09/2010
127 virtual std::vector<float> getSamplesFromBipolarFunc(const double driftTime0, const double stripCharge0) const override final;
128 virtual double getLatency() const override final;
129
130
131 mutable std::atomic_int m_messageCnt_t0base{};
132 mutable std::atomic_int m_messageCnt_t0phase{};
133 //private:
134 // ../src/CscCalibTool.cxx: In member function 'virtual bool CscCalibTool::stripT0phase(uint32_t) const':
135 // ../src/CscCalibTool.cxx:351: error: increment of data-member 'CscCalibTool::m_messageCnt_t0phase' in read-only structure
136 // ../src/CscCalibTool.cxx: In member function 'virtual double CscCalibTool::stripT0base(uint32_t) const':
137 // ../src/CscCalibTool.cxx:371: error: increment of data-member 'CscCalibTool::m_messageCnt_t0base' in read-only structure
138 // due to const in format?
139
140private:
141 float getPSlope(uint32_t stripHashId) const;
142
143
144protected:
145
146 SG::ReadCondHandleKey<CscCondDbData> m_readKey{this, "ReadKey", "CscCondDbData", "Key of CscCondDbData"};
147
150
151 float m_slope;
152 float m_noise;
154
156 // define bipolar functional shape
157 // Parameters are from Kostas presentation at the following link (09/2007)
158 // http://indico.cern.ch/getFile.py/access?contribId=1&resId=1&materialId=slides&confId=18787
161
164 double m_timeOffset; // bipolar's start time (or drift time)
165
166 double m_latency; // new in 2010....latency may be controlled in CscCalibTool.
167
168 unsigned int m_nSamples;
169
171 bool m_use2Samples; // for the use of only 2 samples for strip charge
172
173};
174
175#endif
double charge(const T &p)
Definition AtlasPID.h:997
#define x
#define z
Define macros for attributes used to control the static checker.
virtual bool adcToCharge(const std::vector< uint16_t > &samples, uint32_t stripHashId, std::vector< float > &charges) const override final
Conversion of ADC value to charge - Here the charges is returned in numbers of equivalent electrons.
virtual StatusCode initialize() override final
virtual int femtoCoulombToADCCount(uint32_t stripHashId, const double femtoCoulombs) const override final
given a charge on the CSC strip, convert that to ADC counts this is needed in the digitization for ex...
virtual bool findCharge(const float samplingTime, const unsigned int samplingPhase, const std::vector< float > &samples, double &charge, double &time) const override final
Given sampling values for a CSC strip, find the corresponding charge by fitting the time samples.
unsigned int m_nSamples
virtual double stripPedestal(uint32_t stripHashId, const bool convert=true) const override final
return the pedestal on the readout strip in ADC counts or Number of Electrons
bool m_slopeFromDatabase
virtual double stripNoise(uint32_t stripHashId, const bool convert=true) const override final
return the noise(sigma) on the readout strip in ADC counts or Number of Electrons number of electrons...
double m_integrationNumber2
double m_integrationNumber
ROOT version of bipolar function.
virtual double signal_amplitude(const double driftTime, const double samplingTime) const override final
virtual double getTimeOffset() const override final
double m_signalWidth
virtual double getNumberOfIntegration() const override final
virtual double getLatency() const override final
virtual double getZ0() const override final
ROOT version of bipolar function.
bool m_readFromDatabase
SG::ReadCondHandleKey< CscCondDbData > m_readKey
virtual std::vector< float > getSamplesFromBipolarFunc(const double driftTime0, const double stripCharge0) const override final
std::atomic_int m_messageCnt_t0base
virtual bool stripT0phase(uint32_t stripHashId) const override final
return T0phase related to 5 ASM.
std::atomic_int m_messageCnt_t0phase
virtual double signal(const double z) const override final
virtual int stripStatusBit(uint32_t stripHashId) const override final
return status bit
virtual std::pair< double, double > addBipfunc(const double driftTime0, const double stripCharge0, const double driftTime1, const double stripCharge1) const override final
virtual int numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const override final
Here the charge on the CSC strip is given in number of equivalent electrons; conversion to ADC counts...
virtual bool isGood(uint32_t stripHashId) const override final
return the status of this strip, good channel, dead channel, noisy channel - it will return true for ...
virtual double stripT0base(uint32_t stripHashId) const override final
return T0base related to 5 ASM.
virtual double getNumberOfIntegration2() const override final
virtual double adcCountToNumberOfElectrons(const float adcValue, const float slope) const override final
given one CSC ADC sample value, convert that to charge in number of equivalent electrons
virtual ~CscCalibTool()=default
CscCalibTool(const std::string &, const std::string &, const IInterface *)
double m_samplingTime
virtual double getSamplingTime() const override final
virtual double func_prime(const double x, const float slope) const override final
virtual double stripRMS(uint32_t stripHashId, const bool convert=true) const override final
return the RMS on the readout strip in ADC counts or Number of Electrons number of electrons by defau...
virtual double getSignalWidth() const override final
virtual double adcCountToFemtoCoulomb(const float adcCounts, const float slope) const override final
given one CSC ADC sample value, convert that to charge in femtoCoulomb
virtual double stripF001(uint32_t stripHashId, const bool convert=true) const override final
return the F001 on the readout strip in ADC counts or Number of Electrons number of electrons by defa...
virtual double func(const double x, const float slope) const override final
these function used in the AOD <-> conversion; may not be needed once we integrate the calibration se...
double m_timeOffset
float getPSlope(uint32_t stripHashId) const
STL class.
STL namespace.