|
ATLAS Offline Software
|
Go to the documentation of this file.
12 (
const std::string&
t,
const std::string&
n,
const IInterface*
p )
15 declareProperty(
"Slope",
m_slope = 0.19 );
16 declareProperty(
"Noise",
m_noise = 3.5 );
17 declareProperty(
"Pedestal",
m_pedestal = 2048.0 );
29 declareProperty(
"Latency",
m_latency = 100 );
37 if (
x[0] <
par[1])
return 0.;
38 Double_t integrationNumber =
par[2];
39 Double_t integrationNumber2 =
par[3];
41 Double_t signalWidth =
par[4];
42 Double_t
sum = integrationNumber+integrationNumber2;
43 Double_t
z0 = 0.5*( (
sum+2)
45 -4*integrationNumber*(integrationNumber2+1))
48 Double_t
norm = (1.0 -
z0 / (1 + integrationNumber2))
52 Double_t
z = (
x[0]-
par[1])/signalWidth;
54 par[0]*(1-
z/(1+integrationNumber2))
81 ATH_MSG_DEBUG(
"T0BaseFolder and T0PhaseFolder are not loaded!!! HLT COOLDB does not have it!!");
89 return StatusCode::SUCCESS;
99 if(!readCdo->readChannelPSlope(stripHashId, slope).isSuccess()){
100 ATH_MSG_WARNING (
" failed to access CSC conditions database - slope - "
101 <<
"strip hash id = " << stripHashId );
104 ATH_MSG_DEBUG (
"The slope is " << slope <<
" for strip hash = " << stripHashId );
117 double conversionFactor = 1.602e-4;
118 double femtoCoulombs = conversionFactor*numberOfElecEquiv;
122 int adcValue =
int (
func(femtoCoulombs,slope) );
133 int adcValue =
int (
func(femtoCoulombs,slope) );
140 double conversionFactor = 1.602e-4;
142 return (femtoCoulombs/conversionFactor);
154 if(!readCdo->readChannelNoise(stripHashId,
noise).isSuccess()){
155 ATH_MSG_DEBUG (
" failed to access CSC conditions database - noise - "
156 <<
"strip hash id = " << stripHashId );
181 if(!readCdo->readChannelRMS(stripHashId,
rms).isSuccess()){
182 ATH_MSG_DEBUG (
" failed to access CSC conditions database - rms - "
183 <<
"strip hash id = " << stripHashId );
209 if(!readCdo->readChannelF001(stripHashId, f001).isSuccess()){
210 ATH_MSG_DEBUG (
" failed to access CSC conditions database - f001 - "
211 <<
"strip hash id = " << stripHashId );
216 ATH_MSG_VERBOSE (
"The F001 is " << f001 <<
" for strip hash = " << stripHashId );
235 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
236 ATH_MSG_DEBUG (
" failed to access CSC conditions database - pedestal - "
237 <<
"strip hash id = " << stripHashId );
241 ATH_MSG_VERBOSE (
"The pedestal is " << pedestal <<
" for strip hash = " << stripHashId );
260 bool is_good = !( (
status & 0x1) || ((
status >> 1) & 0x1) );
271 if(!readCdo->readChannelStatus(stripHashId,
status).isSuccess())
272 ATH_MSG_WARNING (
" failed to access CSC conditions database - status - "
273 <<
"strip hash id = " << stripHashId );
276 " for strip hash = " << std::dec << stripHashId);
291 if(!readCdo->readChannelT0Phase(stripHashId, t0phase).isSuccess()){
293 ATH_MSG_WARNING (
" failed to access CSC conditions database - t0phase - "
294 <<
"strip hash id = " << stripHashId );
295 ATH_MSG_WARNING (
" This WARNING Message can be temporarily until COOL DB is filled");
299 ATH_MSG_VERBOSE (
"The t0phase is " << t0phase <<
" for stripHashId " << stripHashId );
314 if(!readCdo->readChannelT0Base(stripHashId, t0base).isSuccess()){
317 ATH_MSG_WARNING (
" failed to access CSC conditions database - t0base - "
318 <<
"strip hash id = " << stripHashId );
319 ATH_MSG_WARNING (
" This WARNING Message can be temporarily until COOL DB is filled");
323 ATH_MSG_VERBOSE (
"The t0base is " << t0base <<
" for stripHashId " << stripHashId );
336 ATH_MSG_VERBOSE (
"Using CscCalibTool::adcCountToFemtoCoulomb - adc = "
344 if ( slope != 0 )
val =
int ( (
x / slope) + 0.5);
365 const std::vector<float>& samples,
double &
charge,
double &
time)
const {
370 int numberOfSamplings = samples.size();
372 if (numberOfSamplings==0)
return false;
376 int i = numberOfSamplings/2-1;
377 charge = 0.5*(samples[
i]+samples[
i+1]);
380 if (std::abs(samples[
i]+samples[
i+1])>0.0001) asym = (samples[
i+1]-samples[
i])/(samples[
i]+samples[
i+1]);
389 time = 76 + 47.85*asym + 6.629*asym*asym;
390 if ( samplingPhase == 1 )
time -= 25;
395 float max = -4096000;
398 if ( numberOfSamplings >10) {
400 max = samples[maxIndex];
403 for (
int i=0;
i<numberOfSamplings;
i++) {
404 if ( numberOfSamplings >10 && (i<2 || i>6) )
continue;
405 if (samples[
i] >
max) {
419 int midIndex = maxIndex;
421 a = samples[maxIndex];
422 b = samples[maxIndex+1];
423 c = samples[maxIndex+2];
425 }
else if (maxIndex == numberOfSamplings-1) {
426 a = samples[maxIndex-2];
427 b = samples[maxIndex-1];
428 c = samples[maxIndex];
431 a = samples[maxIndex-1];
432 b = samples[maxIndex];
433 c = samples[maxIndex+1];
438 double aa = 0.5*(
c+
a-2*
b);
439 double bb = 0.5*(
c-
a);
446 time *= samplingTime;
447 if ( samplingPhase == 1 )
time -= 25;
451 if (maxIndex ==0 || maxIndex ==1)
453 else if (maxIndex ==2 || maxIndex ==3)
460 double timeOffset = -0.5*bb/
aa;
464 if ( ( maxIndex == 0 && timeOffset < -2.0 )
465 || ( maxIndex == 3 && timeOffset > 2.0) ) {
467 time *= samplingTime;
468 if ( samplingPhase == 1 )
time -= 25;
472 if (maxIndex ==0 || maxIndex ==1)
474 else if (maxIndex ==2 || maxIndex ==3)
483 charge =
aa*timeOffset*timeOffset + bb*timeOffset +
b;
496 time *= samplingTime;
497 if ( samplingPhase == 1 )
time -= 25;
515 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
516 ATH_MSG_DEBUG (
" failed to access CSC conditions database - pedestal - "
517 <<
"strip hash id = " << stripHashId );
521 ATH_MSG_VERBOSE (
"Pedestal is " << pedestal <<
" For strip hash id " << stripHashId );
524 float adc = adcValue-pedestal;
541 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
542 ATH_MSG_DEBUG (
"failed to access CSC Conditions database - pedestal - "
543 <<
"strip hash id = " << stripHashId );
547 ATH_MSG_VERBOSE (
"Pedestal is " << pedestal <<
" For strip hash id " << stripHashId );
550 float adc = adcValue-pedestal;
555 std::vector<float>& charges)
const {
566 if(!readCdo->readChannelPed(stripHashId, pedestal).isSuccess()){
567 ATH_MSG_DEBUG (
"failed to access CSC Conditions database - pedestal - "
568 <<
"strip hash id = " << stripHashId );
572 ATH_MSG_VERBOSE (
"Pedestal is " << pedestal <<
" For strip hash id " << stripHashId );
574 unsigned max = samples.size();
575 if (
max == 0 )
return false;
576 for (
unsigned int i=0;
i<
max;
i++) {
578 float adc = samples[
i]-pedestal;
580 charges.push_back(
charge );
593 double z0 = 0.5*( (
sum+2)
610 if (samplingTime <=
driftTime)
return 0.;
619 std::vector<float>
result;
620 if ( stripCharge0==0.0 ) {
628 std::unique_ptr<TF1> bipolarFunc = std::make_unique<TF1>(
"bipolarFunc",
bipfunc, -500, 500, 5, 1, TF1::EAddToList::kNo);
629 bipolarFunc->SetParameters(stripCharge0, driftTime0,
636 result.push_back( sampleCharge );
644 const double stripCharge0,
645 const double driftTime1,
646 const double stripCharge1)
const {
648 std::pair<double,double>
result;
651 result.second = stripCharge0;
653 if ( (stripCharge0==0.0 && stripCharge1==0.0)||
654 (stripCharge0>0.0 && stripCharge1==0.0))
657 if (stripCharge0==0.0 && stripCharge1>0.0) {
659 result.second = stripCharge1;
663 std::unique_ptr<TF1> addedfunc = std::make_unique<TF1>(
"addedfunc",
dualbipfunc, 0, 500, 10, 1, TF1::EAddToList::kNo);
664 addedfunc->SetParameters(stripCharge0, driftTime0,
666 stripCharge1, driftTime1,
668 result.second =addedfunc->GetMaximum();
669 float tmax =addedfunc->GetX(
result.second);
672 if (stripCharge0>0.0 && stripCharge1>0.0)
return result;
674 float bipmin = addedfunc->GetMinimum();
675 float tmin = addedfunc->GetX(bipmin);
683 <<
"+(" << driftTime1 <<
":" <<
int(stripCharge1) <<
")"
685 <<
" e- which was " <<
int(stripCharge0+stripCharge1) );
#define ATH_MSG_VERBOSE(x)
::StatusCode StatusCode
StatusCode definition for legacy code.
double charge(const T &p)
StatusCode initialize(bool used=true)
std::unique_ptr< MVAUtils::BDT > convert(TMVA::MethodBDT *bdt, bool isRegression=true, bool useYesNoLeaf=false)
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
constexpr int pow(int base, int exp) noexcept