CMS 3D CMS Logo

HcalTimeSlew.cc
Go to the documentation of this file.
2 #include <cmath>
3 #include <iostream>
4 
5 void HcalTimeSlew::addM2ParameterSet(double tzero, double slope, double tmax){
6  parametersM2_.emplace_back(tzero,slope,tmax);
7 }
8 
9 void HcalTimeSlew::addM3ParameterSet(double cap, double tspar0, double tspar1, double tspar2, double tspar0_siPM, double tspar1_siPM, double tspar2_siPM){
10  parametersM3_.emplace_back(cap, tspar0, tspar1, tspar2, tspar0_siPM, tspar1_siPM, tspar2_siPM);
11 }
12 
13 // Used by M2/Simulation
14 double HcalTimeSlew::delay(double fC, BiasSetting bias) const {
15  double rawDelay = parametersM2_[bias].tzero + parametersM2_[bias].slope*log(fC);
16  return (rawDelay < 0)?(0):((rawDelay > parametersM2_[bias].tmax)?(parametersM2_[bias].tmax):(rawDelay));
17 }
18 
19 // Used by M3
20 double HcalTimeSlew::delay(double fC, ParaSource source, BiasSetting bias, bool isHPD) const {
21  double rawDelay = 0.0;
22  if(source == TestStand){
23  return HcalTimeSlew::delay(fC, bias);
24  }
25  else if(isHPD){
26  rawDelay = std::fmin( parametersM3_[source].cap,
27  parametersM3_[source].tspar0+parametersM3_[source].tspar1*log(fC+parametersM3_[source].tspar2 ));
28  }
29  else{
30  rawDelay = parametersM3_[source].cap+parametersM3_[source].tspar0_siPM;
31  }
32  return rawDelay;
33 }
static const double slope[3]
void addM3ParameterSet(double cap, double tspar0, double tspar1, double tspar2, double tspar0_siPM, double tspar1_siPM, double tspar2_siPM)
Definition: HcalTimeSlew.cc:9
double delay(double fC, BiasSetting bias=Medium) const
Returns the amount (ns) by which a pulse of the given number of fC will be delayed by the timeslew ef...
Definition: HcalTimeSlew.cc:14
void addM2ParameterSet(double tzero, double slope, double tmax)
Definition: HcalTimeSlew.cc:5
static const double tmax[3]
std::vector< HcalTimeSlewM3Parameters > parametersM3_
Definition: HcalTimeSlew.h:61
static const double tzero[3]
std::vector< HcalTimeSlewM2Parameters > parametersM2_
Definition: HcalTimeSlew.h:60
static std::string const source
Definition: EdmProvDump.cc:43