ATLAS Offline Software
Loading...
Searching...
No Matches
CscCalibTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "CscCalibTool.h"
6
7#include <sstream>
8#include <cmath>
9
11( const std::string& t, const std::string& n, const IInterface* p )
12 : base_class(t,n,p)
13{
14 declareProperty( "Slope", m_slope = 0.19 );
15 declareProperty( "Noise", m_noise = 3.5 );
16 declareProperty( "Pedestal", m_pedestal = 2048.0 );
17 declareProperty( "ReadFromDatabase", m_readFromDatabase = true);
18 declareProperty( "integrationNumber", m_integrationNumber = 12.0);
19 declareProperty( "integrationNumber2", m_integrationNumber2 = 11.66);
20 declareProperty( "samplingTime", m_samplingTime = 50. ); //ns
21 declareProperty( "signalWidth", m_signalWidth = 14.40922); // 50/3.47ns
22 declareProperty( "SlopeFromDatabase", m_slopeFromDatabase=false);
23 declareProperty( "timeOffset", m_timeOffset = 46.825 );
24
25 declareProperty( "IsOnline" , m_onlineHLT = true); // This will be fed from jO
26
27 // new latency starting from 2010...
28 declareProperty( "Latency", m_latency = 100 ); // ns.....
29 declareProperty( "NSamples", m_nSamples = 4); // number of samples
30
31 declareProperty( "Use2Samples", m_use2Samples = false); // force 2 sample
32}
33
34// ROOT USER Function
35Double_t bipfunc(const Double_t *x, const Double_t *par){
36 if (x[0] < par[1]) return 0.;
37 Double_t integrationNumber = par[2]; //12
38 Double_t integrationNumber2 = par[3]; //11.66
39 // Double_t samplingTime = par[4]; //50 ns
40 Double_t signalWidth = par[4]; //50 ns
41 Double_t sum = integrationNumber+integrationNumber2;
42 Double_t z0 = 0.5*( (sum+2)
43 -std::sqrt(std::pow(sum+2,2)
44 -4*integrationNumber*(integrationNumber2+1))
45 );
46
47 Double_t norm = (1.0 - z0 / (1 + integrationNumber2))
48 * std::pow(z0, 1.0 * integrationNumber)
49 * std::exp(-z0);
50
51 Double_t z = (x[0]-par[1])/signalWidth;//*3.47/samplingTime;
52 Double_t amplitude =
53 par[0]*(1-z/(1+integrationNumber2))
54 *std::pow(z,integrationNumber)*std::exp(-1.0*z)/norm;
55 return amplitude;
56}
57// To add two bipolar function and get a distribution, this function is defined
58Double_t dualbipfunc(const Double_t *x, const Double_t *par){
59 return ( bipfunc(x,par) + bipfunc(x,&par[5]) );
60}
61
63
64 ATH_MSG_DEBUG ( "Initializing Initializing CscCalibTool");
65
66 ATH_MSG_DEBUG ( "Default slope (if DB is not available) =" << m_slope );
67 ATH_MSG_DEBUG ( "Default noise (if DB is not available) =" << m_noise );
68 ATH_MSG_DEBUG ( "Default pedestal (if DB is not available) =" << m_pedestal );
69 ATH_MSG_DEBUG ( "Calib Constants are from DB ? =" << m_readFromDatabase );
70 ATH_MSG_DEBUG ( "Slope Constants are from DB ? =" << m_slopeFromDatabase );
71 ATH_MSG_DEBUG ( "Bipolar function integrationNumber(N_1) =" << m_integrationNumber);
72 ATH_MSG_DEBUG ( "Bipolar function integrationNumber(N_2) =" << m_integrationNumber2);
73 ATH_MSG_DEBUG ( "SamplingTime =" << m_samplingTime);
74 ATH_MSG_DEBUG ( "Signalwidth =" << m_signalWidth);
75 ATH_MSG_DEBUG ( "timeOffset (digitization) =" << m_timeOffset);
76 ATH_MSG_DEBUG ( "Is OnlineAccess (HLT) ?? =" << m_onlineHLT);
77 ATH_MSG_DEBUG ( "Force the use of the 2 sample charge? =" << m_use2Samples);
78
79 if (m_onlineHLT) {
80 ATH_MSG_DEBUG( "T0BaseFolder and T0PhaseFolder are not loaded!!! HLT COOLDB does not have it!!");
81 }
82
83 ATH_CHECK(m_readKey.initialize());
84
87
88 return StatusCode::SUCCESS;
89}
90
91float CscCalibTool::getPSlope(uint32_t stripHashId) const {
92
93
94 float slope = m_slope;
97 const CscCondDbData* readCdo{*readHandle};
98 if(!readCdo->readChannelPSlope(stripHashId, slope).isSuccess()){
99 ATH_MSG_WARNING ( " failed to access CSC conditions database - slope - "
100 << "strip hash id = " << stripHashId );
101 }
102 }
103 ATH_MSG_DEBUG ( "The slope is " << slope << " for strip hash = " << stripHashId );
104
105 return slope;
106
107}
108
109
111int CscCalibTool::numberOfElectronsToADCCount(uint32_t stripHashId, const int numberOfElecEquiv) const
112{
113
114 //ATH_MSG_VERBOSE ( "Using CscCalibTool::numberOfElectronsToADCCount" );
115
116 double conversionFactor = 1.602e-4; // 1 ee in femtoCoulomb
117 double femtoCoulombs = conversionFactor*numberOfElecEquiv;
118
119 float slope = getPSlope(stripHashId);
120
121 int adcValue = int ( func(femtoCoulombs,slope) );
122 return adcValue;
123}
124
125int CscCalibTool::femtoCoulombToADCCount(uint32_t stripHashId, const double femtoCoulombs) const
126{
127
128 //ATH_MSG_VERBOSE ( "Using CscCalibTool::femtoCoulombToADCCount" );
129
130 float slope = getPSlope(stripHashId);
131
132 int adcValue = int ( func(femtoCoulombs,slope) );
133 return adcValue;
134}
135
137double CscCalibTool::adcCountToNumberOfElectrons(const float adcValue, const float slope) const
138{
139 double conversionFactor = 1.602e-4; // 1 ee in femtoCoulomb
140 double femtoCoulombs = this->adcCountToFemtoCoulomb(adcValue, slope);
141 return (femtoCoulombs/conversionFactor);
142}
143
145double CscCalibTool::stripNoise ( uint32_t stripHashId, const bool convert ) const
146{
147 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
148
149 float noise = m_noise;
150 if ( m_readFromDatabase ) {
152 const CscCondDbData* readCdo{*readHandle};
153 if(!readCdo->readChannelNoise(stripHashId, noise).isSuccess()){
154 ATH_MSG_DEBUG ( " failed to access CSC conditions database - noise - "
155 << "strip hash id = " << stripHashId );
156 noise = m_noise;
157 }
158 }
159
160 ATH_MSG_VERBOSE ( "The noise is " << noise << " for strip hash = " << stripHashId );
161
162 if ( convert ) {
163 float slope = getPSlope(stripHashId);
164 return this->adcCountToNumberOfElectrons( noise, slope );
165 } else {
166 return noise;
167 }
168}
169
170
172double CscCalibTool::stripRMS ( uint32_t stripHashId, const bool convert ) const
173{
174 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
175
176 float rms = m_noise;
177 if ( m_readFromDatabase ) {
179 const CscCondDbData* readCdo{*readHandle};
180 if(!readCdo->readChannelRMS(stripHashId, rms).isSuccess()){
181 ATH_MSG_DEBUG ( " failed to access CSC conditions database - rms - "
182 << "strip hash id = " << stripHashId );
183 rms = m_noise;
184 }
185 }
186
187 ATH_MSG_VERBOSE ( "The RMS is " << rms << " for strip hash = " << stripHashId );
188
189 if ( convert ) {
190 float slope = getPSlope(stripHashId);
191 return this->adcCountToNumberOfElectrons( rms, slope );
192 } else {
193 return rms;
194 }
195
196}
197
199// NOTE: f001 is raw ADC count...+1
200double CscCalibTool::stripF001 ( uint32_t stripHashId, const bool convert ) const
201{
202 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
203
204 float f001 = m_noise+m_pedestal;
205 if ( m_readFromDatabase ) {
207 const CscCondDbData* readCdo{*readHandle};
208 if(!readCdo->readChannelF001(stripHashId, f001).isSuccess()){
209 ATH_MSG_DEBUG ( " failed to access CSC conditions database - f001 - "
210 << "strip hash id = " << stripHashId );
211 f001 = 3.251*m_noise+m_pedestal;
212 }
213 }
214
215 ATH_MSG_VERBOSE ( "The F001 is " << f001 << " for strip hash = " << stripHashId );
216
217 if ( convert ) {
218 float slope = getPSlope(stripHashId);
219 return this->adcCountToNumberOfElectrons( f001, slope );
220 } else {
221 return f001;
222 }
223}
224
226double CscCalibTool::stripPedestal ( uint32_t stripHashId, const bool convert ) const
227{
228 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
229
230 float pedestal = m_pedestal;
231 if ( m_readFromDatabase ) {
233 const CscCondDbData* readCdo{*readHandle};
234 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
235 ATH_MSG_DEBUG ( " failed to access CSC conditions database - pedestal - "
236 << "strip hash id = " << stripHashId );
237 pedestal = m_pedestal;
238 }
239 }
240 ATH_MSG_VERBOSE ( "The pedestal is " << pedestal << " for strip hash = " << stripHashId );
241
242 if ( convert ) {
243 float slope = getPSlope(stripHashId);
244 return this->adcCountToNumberOfElectrons( pedestal, slope );
245 } else {
246 return pedestal;
247 }
248}
249
253bool CscCalibTool::isGood ( uint32_t stripHashId ) const
254{
255
256 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
257
258 unsigned int status = stripStatusBit(stripHashId);
259 bool is_good = !( (status & 0x1) || ((status >> 1) & 0x1) ); // test for hot/dead channel
260 return is_good;
261}
262
263
264int CscCalibTool::stripStatusBit ( uint32_t stripHashId ) const {
265
266 int status = 0;
267 if ( m_readFromDatabase ) {
269 const CscCondDbData* readCdo{*readHandle};
270 if(!readCdo->readChannelStatus(stripHashId, status).isSuccess())
271 ATH_MSG_WARNING ( " failed to access CSC conditions database - status - "
272 << "strip hash id = " << stripHashId );
273 else
274 ATH_MSG_VERBOSE("The status word is " << std::hex << status <<
275 " for strip hash = " << std::dec << stripHashId);
276 }
277 return status;
278}
279
280
281
282bool CscCalibTool::stripT0phase ( uint32_t stripHashId ) const {
283
284 bool t0phase = 0;
285
286 if (! m_onlineHLT ) {
287 if ( m_readFromDatabase ) {
289 const CscCondDbData* readCdo{*readHandle};
290 if(!readCdo->readChannelT0Phase(stripHashId, t0phase).isSuccess()){
291 if (m_messageCnt_t0phase < 3) {
292 ATH_MSG_WARNING ( " failed to access CSC conditions database - t0phase - "
293 << "strip hash id = " << stripHashId );
294 ATH_MSG_WARNING ( " This WARNING Message can be temporarily until COOL DB is filled");
296 }
297 } else {
298 ATH_MSG_VERBOSE ( "The t0phase is " << t0phase << " for stripHashId " << stripHashId );
299 }
300 }
301 }
302 return t0phase;
303}
304
305
306double CscCalibTool::stripT0base ( uint32_t stripHashId ) const {
307
308 float t0base = 0.0;
309 if (! m_onlineHLT ) {
310 if ( m_readFromDatabase ) {
312 const CscCondDbData* readCdo{*readHandle};
313 if(!readCdo->readChannelT0Base(stripHashId, t0base).isSuccess()){
314
315 if (m_messageCnt_t0base < 3) {
316 ATH_MSG_WARNING ( " failed to access CSC conditions database - t0base - "
317 << "strip hash id = " << stripHashId );
318 ATH_MSG_WARNING ( " This WARNING Message can be temporarily until COOL DB is filled");
320 }
321 } else {
322 ATH_MSG_VERBOSE ( "The t0base is " << t0base << " for stripHashId " << stripHashId );
323 }
324 }
325 }
326 return t0base;
327}
328
329
330
331double CscCalibTool::adcCountToFemtoCoulomb(const float adc, const float slope) const
332{
333
334 double charge = adc * slope;
335 ATH_MSG_VERBOSE ( "Using CscCalibTool::adcCountToFemtoCoulomb - adc = "
336 << adc << " charge(fC) = " << charge );
337 return charge;
338}
339
340double CscCalibTool::func(const double x, const float slope) const
341{
342 int val = 0;
343 if ( slope != 0 ) val = int ( (x / slope) + 0.5);
344 // else
345 // ATH_MSG_WARNING ( "CscCalibTool::femtoCoulombToADC - slope = 0" );
346 // if ( val < 0 ) {
347 // ATH_MSG_WARNING ( "CscCalibTool::femtoCoulombToADC - ADC cannot be < 0 - " << val );
348 //val = 0;
349 // }
350
351 return (1.0*val);
352}
353
354double CscCalibTool::func_prime(const double x, const float slope) const
355{
356 double val = slope;
357 if ( slope == 0.0 )
358 ATH_MSG_WARNING ( "CscCalibTool - slope = 0 for x = " << x );
359 return val;
360}
361
362//
363bool CscCalibTool::findCharge(const float samplingTime, const unsigned int samplingPhase,
364 const std::vector<float>& samples, double & charge, double & time) const {
365
366 time = 0.0;
367 charge = 0.0;
368
369 int numberOfSamplings = samples.size();
370 // no samples given
371 if (numberOfSamplings==0) return false;
372
373 // MS: The case of only 2 samples:
374 if ((numberOfSamplings==2) || m_use2Samples) { // no parabola possible
375 int i = numberOfSamplings/2-1;
376 charge = 0.5*(samples[i]+samples[i+1]); // 1+2 for 4 samples, 0+1 for 2
377
378 double asym = 0.;
379 if (std::abs(samples[i]+samples[i+1])>0.0001) asym = (samples[i+1]-samples[i])/(samples[i]+samples[i+1]);
380 /********************* No charge correction now.
381 // charge correction:
382 double chargecor = 77.85 + 1.415*asym - 44.97*asym*asym; // in percent
383 charge = charge / chargecor * 100.0;
384 *******************/
385
386 // time = i+0.5; // midpoint beween the 2 samples: no interpolation
387 // time *= samplingTime;
388 time = 76 + 47.85*asym + 6.629*asym*asym; // in ns, for 50ns sampling
389 if ( samplingPhase == 1 ) time -= 25;
390 return true;
391 }
392
394 float max = -4096000;
395 int maxIndex = -1;
396
397 if ( numberOfSamplings >10) { // for x5 data
398 maxIndex = 2;
399 max = samples[maxIndex];
400 }
401
402 for (int i=0; i<numberOfSamplings; i++) {
403 if ( numberOfSamplings >10 && (i<2 || i>6) ) continue; // for x5 data
404 if (samples[i] > max) {
405 max = samples[i];
406 maxIndex = i;
407 }
408 }
409
411 // if (max == -4096000) return false; //not possible
412
413
415
416 double a{}, b{}, c{};
417
418 int midIndex = maxIndex;
419 if (maxIndex == 0) { // peaks on the first sample
420 a = samples[maxIndex];
421 b = samples[maxIndex+1];
422 c = samples[maxIndex+2];
423 midIndex +=1;
424 } else if (maxIndex == numberOfSamplings-1) { // last sample but it won't happen if third and 4th samples are same...
425 a = samples[maxIndex-2];
426 b = samples[maxIndex-1];
427 c = samples[maxIndex];
428 midIndex -=1;
429 } else if (maxIndex > 0){ // normal case
430 a = samples[maxIndex-1];
431 b = samples[maxIndex];
432 c = samples[maxIndex+1];
433 }
434
435 //#D!!!!! Need to carefully check the case of 250 * 23898.136 * 28535.650 * 33587.949 * 33587.949 *
436
437 double aa = 0.5*(c+a-2*b); // p2 (coeff for x^2)
438 double bb = 0.5*(c-a);
439
440
443 if ( aa >= 0 ) {
444 time = midIndex;
445 time *= samplingTime;
446 if ( samplingPhase == 1 ) time -= 25; // works for both 20MHz and 40MHz
447 // time =0.0;
448 charge = max;
449
450 if (maxIndex ==0 || maxIndex ==1)
451 time -= 1000;
452 else if (maxIndex ==2 || maxIndex ==3)
453 time += 1000;
454
455 ATH_MSG_VERBOSE("WP aa is positive");
456 return false;
457 }
458
459 double timeOffset = -0.5*bb/aa;
460
461 ATH_MSG_VERBOSE("WP " << timeOffset);
463 if ( ( maxIndex == 0 && timeOffset < -2.0 )
464 || ( maxIndex == 3 && timeOffset > 2.0) ) {
465 time = midIndex;
466 time *= samplingTime;
467 if ( samplingPhase == 1 ) time -= 25; // works for both 20MHz and 40MHz
468 // time =0.0;
469 charge = max;
470
471 if (maxIndex ==0 || maxIndex ==1)
472 time -= 1000;
473 else if (maxIndex ==2 || maxIndex ==3)
474 time += 1000;
475
476 ATH_MSG_VERBOSE("time is out of range");
477
478 return true;
479 }
480
482 charge = aa*timeOffset*timeOffset + bb*timeOffset + b;
483 time = timeOffset;
484
494 time += midIndex;
495 time *= samplingTime;
496 if ( samplingPhase == 1 ) time -= 25;
497
498 return true;
499}
500
501double CscCalibTool::adcCountToFemtoCoulomb(uint32_t stripHashId, const float adcValue) const
502{
503 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
504
506
508 float pedestal = m_pedestal;
509 float slope = getPSlope(stripHashId);
510
511 if ( m_readFromDatabase ) {
513 const CscCondDbData* readCdo{*readHandle};
514 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
515 ATH_MSG_DEBUG ( " failed to access CSC conditions database - pedestal - "
516 << "strip hash id = " << stripHashId );
517 pedestal = m_pedestal;
518 }
519 }
520 ATH_MSG_VERBOSE ( "Pedestal is " << pedestal << " For strip hash id " << stripHashId );
521
522 // allowed negative adc values for bipolar fit
523 float adc = adcValue-pedestal;
524 return this->adcCountToFemtoCoulomb( adc, slope );
525
526}
527
528double CscCalibTool::adcCountToNumberOfElectrons(uint32_t stripHashId, const float adcValue) const
529{
530 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
531
533
535 float pedestal = m_pedestal;
536 float slope = getPSlope(stripHashId);
537 if ( m_readFromDatabase ) {
539 const CscCondDbData* readCdo{*readHandle};
540 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
541 ATH_MSG_DEBUG ( "failed to access CSC Conditions database - pedestal - "
542 << "strip hash id = " << stripHashId );
543 pedestal = m_pedestal;
544 }
545 }
546 ATH_MSG_VERBOSE ( "Pedestal is " << pedestal << " For strip hash id " << stripHashId );
547
548 // allowed negative adc values for bipolar fit
549 float adc = adcValue-pedestal;
550 return this->adcCountToNumberOfElectrons( adc, slope );
551}
552
553bool CscCalibTool::adcToCharge(const std::vector<uint16_t>& samples, uint32_t stripHashId,
554 std::vector<float>& charges) const {
555 ATH_MSG_VERBOSE ( "The strip hash id is " << stripHashId );
556
557 charges.clear();
558
560 float pedestal = m_pedestal;
561 float slope = getPSlope(stripHashId);
562 if ( m_readFromDatabase ) {
564 const CscCondDbData* readCdo{*readHandle};
565 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
566 ATH_MSG_DEBUG ( "failed to access CSC Conditions database - pedestal - "
567 << "strip hash id = " << stripHashId );
568 pedestal = m_pedestal;
569 }
570 }
571 ATH_MSG_VERBOSE ( "Pedestal is " << pedestal << " For strip hash id " << stripHashId );
572
573 unsigned max = samples.size();
574 if ( max == 0 ) return false;
575 for (unsigned int i=0; i<max; i++) {
576 // if ( samples[i] > pedestal ) {
577 float adc = samples[i]-pedestal;
578 float charge = static_cast<float> ( this->adcCountToNumberOfElectrons( adc, slope ) );
579 charges.push_back( charge );
580 // } else charges.push_back( 0.0 );
581 }
582 return true;
583}
584
586// define bipolar functional shape
587// Parameters are from Kostas presentation at the following link (09/2007)
588// http://indico.cern.ch/getFile.py/access?contribId=1&resId=1&materialId=slides&confId=18787
589
590double CscCalibTool::getZ0() const{
592 double z0 = 0.5*( (sum+2)
593 -std::sqrt(std::pow(sum+2,2)
595 );
596 return z0;
597}
598
599double CscCalibTool::signal( const double z ) const{
600 double amplitude = (1.0 - z / (1 + m_integrationNumber2))
601 * std::pow(z, 1.0 * m_integrationNumber)
602 * std::exp(-z);
603 return amplitude;
604}
605
606double CscCalibTool::signal_amplitude(const double driftTime, const double samplingTime) const{
607 double z0 = getZ0();
608 double norm = signal(z0);
609 if (samplingTime <= driftTime) return 0.;
610 Double_t z = (samplingTime-driftTime)/m_signalWidth;
611 return signal(z)/norm;
612}
613
614
615// new schema starting from 09/2010...
616std::vector<float> CscCalibTool::getSamplesFromBipolarFunc(const double driftTime0, const double stripCharge0) const {
617
618 std::vector<float> result;
619 if ( stripCharge0==0.0 ) {
620 result.push_back(0.0);
621 result.push_back(0.0);
622 result.push_back(0.0);
623 result.push_back(0.0);
624 return result;
625 }
626
627 std::unique_ptr<TF1> bipolarFunc = std::make_unique<TF1>("bipolarFunc", bipfunc, -500, 500, 5, 1, TF1::EAddToList::kNo);
628 bipolarFunc->SetParameters(stripCharge0, driftTime0,
630
631
632 for (unsigned int i=0; i<m_nSamples; ++i) {
633
634 float sampleCharge = bipolarFunc->Eval(m_latency + i*m_samplingTime);
635 result.push_back( sampleCharge );
636
637 }
638 return result;
639}
640
641
642std::pair<double,double> CscCalibTool::addBipfunc(const double driftTime0,
643 const double stripCharge0,
644 const double driftTime1,
645 const double stripCharge1) const {
646
647 std::pair<double,double> result;
648 // To get a nomalization constant...
649 result.first =driftTime0;
650 result.second = stripCharge0;
651
652 if ( (stripCharge0==0.0 && stripCharge1==0.0)||
653 (stripCharge0>0.0 && stripCharge1==0.0))
654 return result;
655
656 if (stripCharge0==0.0 && stripCharge1>0.0) {
657 result.first =driftTime1;
658 result.second = stripCharge1;
659 return result;
660 }
661
662 std::unique_ptr<TF1> addedfunc = std::make_unique<TF1>("addedfunc", dualbipfunc, 0, 500, 10, 1, TF1::EAddToList::kNo);
663 addedfunc->SetParameters(stripCharge0, driftTime0,
665 stripCharge1, driftTime1,
667 result.second =addedfunc->GetMaximum(); // ==>stripCharges of added bipolars
668 float tmax =addedfunc->GetX(result.second);
669 result.first = tmax - getZ0()*m_signalWidth;
670
671 if (stripCharge0>0.0 && stripCharge1>0.0) return result;
672
673 float bipmin = addedfunc->GetMinimum(); // ==>stripCharges of added bipolars
674 float tmin = addedfunc->GetX(bipmin);
675 if (tmin<tmax) {
676 result.first = tmin-getZ0()*m_signalWidth;
677 result.second = bipmin;
678 }
679
680 // To check out conversion is correct...
681 ATH_MSG_VERBOSE ( "(" << driftTime0 << ":" << int(stripCharge0) << ")"
682 << "+(" << driftTime1 << ":" << int(stripCharge1) << ")"
683 << " ==> " << result.first << ":" << int(result.second)
684 << " e- which was " << int(stripCharge0+stripCharge1) );
685
686
687
688 return result;
689}
690
692double CscCalibTool::getLatency() const {return m_latency;}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
double charge(const T &p)
Definition AtlasPID.h:997
Double_t bipfunc(const Double_t *x, const Double_t *par)
Double_t dualbipfunc(const Double_t *x, const Double_t *par)
static Double_t a
#define x
#define z
#define max(a, b)
Definition cfImp.cxx:41
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
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
StatusCode readChannelPed(IdentifierHash, float &) const
StatusCode readChannelT0Base(IdentifierHash, float &) const
StatusCode readChannelT0Phase(IdentifierHash, bool &) const
StatusCode readChannelRMS(IdentifierHash, float &) const
StatusCode readChannelStatus(IdentifierHash, int &) const
StatusCode readChannelPSlope(IdentifierHash, float &) const
StatusCode readChannelNoise(IdentifierHash, float &) const
StatusCode readChannelF001(IdentifierHash, float &) const