#include <DTConfigPedestals.h>
Public Member Functions | |
DTConfigPedestals () | |
Default Constructor. | |
float | getOffset (const DTWireId &wire) |
Get wire by wire delay. | |
void | print () const |
Print the setup. | |
void | setDebug (bool debug) |
Set debug flag. | |
void | setES (DTTPGParameters const *tpgParams, DTT0 const *t0Params=0) |
Set parameters from ES. | |
void | setUseT0 (bool useT0) |
Set t0i subtraction. | |
~DTConfigPedestals () | |
Destructor. | |
Private Member Functions | |
int | debug () const |
Debug flag. | |
bool | useT0 () const |
Use t0i. | |
Private Attributes | |
bool | my_debug |
DTT0 const * | my_t0i |
DTTPGParameters const * | my_tpgParams |
bool | my_useT0 |
Definition at line 37 of file DTConfigPedestals.h.
DTConfigPedestals::DTConfigPedestals | ( | ) |
Default Constructor.
Definition at line 34 of file DTConfigPedestals.cc.
: my_debug(false) , my_useT0(false) , my_tpgParams(0) , my_t0i(0) { //my_tpgParams = 0; // CB check that it could be done outside this //my_t0i = 0; }
DTConfigPedestals::~DTConfigPedestals | ( | ) |
int DTConfigPedestals::debug | ( | ) | const [inline, private] |
Debug flag.
Definition at line 66 of file DTConfigPedestals.h.
References my_debug.
Referenced by getOffset(), print(), and setDebug().
{ return my_debug; }
float DTConfigPedestals::getOffset | ( | const DTWireId & | wire | ) |
Get wire by wire delay.
Definition at line 64 of file DTConfigPedestals.cc.
References DTSuperLayerId::chamberId(), gather_cfg::cout, debug(), DTTPGParameters::get(), DTT0::get(), my_t0i, my_tpgParams, DTTimeUnits::ns, and useT0().
Referenced by DTBtiCard::loadBTI(), and DTFineDelayCorr::runClientDiagnostic().
{ int nc = 0; float ph = 0.; //float coarse = my_tpgParams.totalTime(wire.chamberId(),DTTimeUnits::ns); // CB ask for this to be fixed my_tpgParams->get(wire.chamberId(),nc,ph,DTTimeUnits::ns); float pedestal = 25.*nc + ph; float t0mean = 0.; float t0rms = 0.; if( useT0() ) { my_t0i->get(wire,t0mean,t0rms,DTTimeUnits::ns); pedestal += t0mean; } if( debug() ){ std::cout << "DTConfigPedestals::getOffset :" << std::endl; std::cout << "\t# of counts (BX): " << nc <<" fine corr (ns) : "<< ph << std::endl; std::cout << "\tt0i subtraction : "; if ( useT0() ) { std::cout << "enabled. t0i for wire " << wire << " : " << t0mean << std::endl; } else { std::cout << "disabled" << std::endl; } } return pedestal; }
void DTConfigPedestals::print | ( | void | ) | const |
Print the setup.
Definition at line 99 of file DTConfigPedestals.cc.
References gather_cfg::cout, debug(), DTChamberId, DTTPGParameters::get(), my_tpgParams, DTTimeUnits::ns, and useT0().
{ std::cout << "******************************************************************************" << std::endl; std::cout << "* DT ConfigPedestals *" << std::endl; std::cout << "******************************************************************************" << std::endl; std::cout << "* *" << std::endl; std::cout << "Debug flag : " << debug() << std::endl; std::cout << "Use t0i flag : " << useT0() << std::endl; for (int wh=-2 ; wh<=2; ++wh) { for (int sec=1 ; sec<=14; ++sec) { for (int st=1 ; st<=4; ++st) { if (sec>12 && st!=4) continue; int ncount = 0; float fine = 0.; DTChamberId chId = DTChamberId(wh,st,sec); my_tpgParams->get(chId,ncount,fine,DTTimeUnits::ns); std::cout << chId << "\t# counts (BX) : " << ncount << "\tfine adj : " << fine << std::endl; } } } std::cout << "******************************************************************************" << std::endl; }
void DTConfigPedestals::setDebug | ( | bool | debug | ) | [inline] |
Set debug flag.
Definition at line 58 of file DTConfigPedestals.h.
References debug(), and my_debug.
Referenced by DTConfigDBProducer::readDBPedestalsConfig().
void DTConfigPedestals::setES | ( | DTTPGParameters const * | tpgParams, |
DTT0 const * | t0Params = 0 |
||
) |
Set parameters from ES.
Definition at line 53 of file DTConfigPedestals.cc.
References my_t0i, my_tpgParams, and useT0().
Referenced by DTConfigTrivialProducer::buildTrivialPedestals(), DTConfigDBProducer::buildTrivialPedestals(), and DTConfigDBProducer::readDBPedestalsConfig().
{ my_tpgParams = tpgParams; if (useT0()) my_t0i = t0Params; }
void DTConfigPedestals::setUseT0 | ( | bool | useT0 | ) | [inline] |
Set t0i subtraction.
Definition at line 55 of file DTConfigPedestals.h.
References my_useT0, and useT0().
Referenced by DTConfigTrivialProducer::buildTrivialPedestals(), DTConfigDBProducer::buildTrivialPedestals(), and DTConfigDBProducer::readDBPedestalsConfig().
bool DTConfigPedestals::useT0 | ( | ) | const [inline, private] |
Use t0i.
Definition at line 69 of file DTConfigPedestals.h.
References my_useT0.
Referenced by getOffset(), print(), setES(), and setUseT0().
{ return my_useT0; }
bool DTConfigPedestals::my_debug [private] |
Definition at line 73 of file DTConfigPedestals.h.
Referenced by debug(), and setDebug().
DTT0 const* DTConfigPedestals::my_t0i [private] |
Definition at line 76 of file DTConfigPedestals.h.
Referenced by getOffset(), and setES().
DTTPGParameters const* DTConfigPedestals::my_tpgParams [private] |
Definition at line 75 of file DTConfigPedestals.h.
Referenced by getOffset(), print(), and setES().
bool DTConfigPedestals::my_useT0 [private] |
Definition at line 74 of file DTConfigPedestals.h.
Referenced by setUseT0(), and useT0().