ATLAS Offline Software
CscRODReadOutV0.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CscRODReadOutV0.h"
6 
7 // constructor
9  m_cscHelper(nullptr),
10  m_sourceID(0),
11  m_moduleType(0),
12  m_rodId(0),
13  m_subDetectorId(0),
14  m_amp1(0),
15  m_amp2(0),
16  m_amp3(0),
17  m_amp4(0),
18  m_address(0) {
19  m_TIME_OFFSET = 46.825; // ns
20  m_SIGNAL_WIDTH = 16.08; // ns
21  m_SAMPLING_TIME = 50.0; // ns
22  m_Z0 = 9.394; // time bin at the maximum
23  // obtained by setting the derivative = 0
24  // this gives 2 solutions: Z0=9.394 and 16.606
25  // 9.394 is for positive amplitude
26 
28 
29  // conversion factor from ee charge to ADC count
30  // assuming for now 1 ADC count = 0.32 femtoCoulomb!
31 
32  /* From Valeri Tcherniatine --- April 11, 2004
33  conversion= ( e*G*k*m*d*1.6e-19)/2000
34  e=75 - average number ionization e in CSC
35  G=10^5 - gas gain
36  k=0.15 - factor taking to account electronic time integration (charge
37  deficit) and only one cathode readout
38  m=0.5 - part of induce charge contained in max. strip
39  d=7 - value of dynamic range expressed in average particle ionization
40  deposition in CSC. At this value (7) out of region inefficiency is <2%.
41  1.6e-19 - e charge
42  2000 - max. ADC counts for positive part of signal
43  Collect all numbers together conversion = 0.32 femtoCoulomb per ADC count
44  */
45 
46  m_CHARGE_TO_ADC_COUNT = (0.32e-15) / (1.602e-19);
47  m_norm = signal(m_Z0);
48 }
49 
50 // destructor
51 
52 
53 void CscRODReadOutV0::encodeFragments(const uint16_t* amplitude, const uint32_t& address, std::vector<uint32_t>& v) const {
54  uint16_t amp[2] = {0, 0};
55  uint32_t v32 = 0;
56 
57  for (int i = 0; i < 2; i++) amp[i] = (BODY_AMPLITUDE << 12) | *(amplitude + i);
58  set32bits(amp, v32);
59  v[0] = v32;
60  v32 = 0;
61  for (int i = 2; i < 4; i++) amp[i - 2] = (BODY_AMPLITUDE << 12) | *(amplitude + i);
62  set32bits(amp, v32);
63  v[1] = v32;
64 
65  v[2] = (BODY_ADDRESS << 28) | address;
66 }
67 
69  const int N_SAMPLE = 4;
70 
71  // the sampling times
72  double time[N_SAMPLE];
73  for (int i = 0; i < N_SAMPLE; i++) time[i] = (i + 1) * m_SAMPLING_TIME + m_TIME_OFFSET;
74 
75  // the corresponding amplitudes
76  uint16_t amp[N_SAMPLE];
77  amp[0] = m_amp1;
78  amp[1] = m_amp2;
79  amp[2] = m_amp3;
80  amp[3] = m_amp4;
81 
82  // to be replaced by a fitting procedure
83  double adcCount = 0.0;
84  int n = 0;
85  for (int i = 0; i < N_SAMPLE; i++) {
86  adcCount = adcCount + amp[i] / signal_amplitude(time[i]);
87  if (amp[i] > 0) n++;
88  }
89  adcCount = adcCount / n;
90 
91  return adcCount;
92 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CscRODReadOutV0::address
uint32_t address() const
Definition: CscRODReadOutV0.h:65
CscRODReadOutV0::m_SAMPLING_TIME
double m_SAMPLING_TIME
Definition: CscRODReadOutV0.h:82
CscRODReadOutV0::m_SIGNAL_WIDTH
double m_SIGNAL_WIDTH
Definition: CscRODReadOutV0.h:81
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CscRODReadOutV0.h
CscRODReadOutV0::m_norm
double m_norm
Definition: CscRODReadOutV0.h:78
CscRODReadOutV0::m_NUMBER_OF_INTEGRATION
int m_NUMBER_OF_INTEGRATION
Definition: CscRODReadOutV0.h:83
CscRODReadOutV0::m_amp2
uint16_t m_amp2
Definition: CscRODReadOutV0.h:74
CscRODReadOutV0::signal
double signal(double z) const
Definition: CscRODReadOutV0.h:172
CscRODReadOutV0::signal_amplitude
double signal_amplitude(double samplingTime) const
Definition: CscRODReadOutV0.h:165
CscRODReadOutV0::CscRODReadOutV0
CscRODReadOutV0()
Definition: CscRODReadOutV0.cxx:8
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
CscRODReadOutV0::m_amp3
uint16_t m_amp3
Definition: CscRODReadOutV0.h:75
CscRODReadOutV0::set32bits
void set32bits(const uint16_t *v16, uint32_t &v32) const
Definition: CscRODReadOutV0.h:115
CscRODReadOutV0::findCharge
double findCharge()
Definition: CscRODReadOutV0.cxx:68
CscRODReadOutV0::m_Z0
double m_Z0
Definition: CscRODReadOutV0.h:85
CscRODReadOutV0::m_amp4
uint16_t m_amp4
Definition: CscRODReadOutV0.h:76
CscRODReadOutV0::m_amp1
uint16_t m_amp1
Definition: CscRODReadOutV0.h:73
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
python.PyAthena.v
v
Definition: PyAthena.py:154
CscRODReadOutV0::BODY_AMPLITUDE
static const uint16_t BODY_AMPLITUDE
Definition: CscRODReadOutV0.h:95
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
CscRODReadOutV0::BODY_ADDRESS
static const uint32_t BODY_ADDRESS
Definition: CscRODReadOutV0.h:96
CscRODReadOutV0::m_CHARGE_TO_ADC_COUNT
double m_CHARGE_TO_ADC_COUNT
Definition: CscRODReadOutV0.h:84
CscRODReadOutV0::encodeFragments
void encodeFragments(const uint16_t *amplitude, const uint32_t &address, std::vector< uint32_t > &v) const
Definition: CscRODReadOutV0.cxx:53
CscRODReadOutV0::m_TIME_OFFSET
double m_TIME_OFFSET
Definition: CscRODReadOutV0.h:80