CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTConfigPedestals Class Reference

#include <DTConfigPedestals.h>

Inheritance diagram for DTConfigPedestals:
DTConfig

Public Member Functions

 DTConfigPedestals ()
 Default Constructor. More...
 
float getOffset (const DTWireId &wire) const
 Get wire by wire delay. More...
 
void print () const
 Print the setup. More...
 
void setDebug (bool debug)
 Set debug flag. More...
 
void setES (DTTPGParameters const *tpgParams, DTT0 const *t0Params=nullptr)
 Set parameters from ES. More...
 
void setUseT0 (bool useT0)
 Set t0i subtraction. More...
 
 ~DTConfigPedestals () override
 Destructor. More...
 

Private Member Functions

int debug () const
 Debug flag. More...
 
bool useT0 () const
 Use t0i. More...
 
- Private Member Functions inherited from DTConfig
 DTConfig ()
 Constructor. More...
 
virtual ~DTConfig ()
 Destructor. More...
 

Private Attributes

bool my_debug
 
DTT0 const * my_t0i
 
DTTPGParameters const * my_tpgParams
 
bool my_useT0
 

Additional Inherited Members

- Static Private Attributes inherited from DTConfig
static const int NBTITC = 4
 
static const int NSTEPF = 9
 
static const int NSTEPL = 24
 Constants: first and last step to start trigger finding. More...
 
static const int NTCTSS = 4
 Constant: number of TRACOs in input to a TSS. More...
 

Detailed Description

Definition at line 36 of file DTConfigPedestals.h.

Constructor & Destructor Documentation

DTConfigPedestals::DTConfigPedestals ( )

Default Constructor.

Definition at line 34 of file DTConfigPedestals.cc.

34  : my_debug(false), my_useT0(false), my_tpgParams(nullptr), my_t0i(nullptr) {
35  //my_tpgParams = 0; // CB check that it could be done outside this
36  //my_t0i = 0;
37 }
DTTPGParameters const * my_tpgParams
DTConfigPedestals::~DTConfigPedestals ( )
override

Destructor.

Definition at line 43 of file DTConfigPedestals.cc.

43 {}

Member Function Documentation

int DTConfigPedestals::debug ( ) const
inlineprivate

Debug flag.

Definition at line 61 of file DTConfigPedestals.h.

References my_debug.

Referenced by getOffset(), print(), and setDebug().

61 { return my_debug; }
float DTConfigPedestals::getOffset ( const DTWireId wire) const

Get wire by wire delay.

Definition at line 56 of file DTConfigPedestals.cc.

References DTSuperLayerId::chamberId(), gather_cfg::cout, debug(), DTT0::get(), DTTPGParameters::get(), my_t0i, my_tpgParams, DTTimeUnits::ns, EcalCondDBWriter_cfi::pedestal, and useT0().

Referenced by DTBtiCard::loadBTI().

56  {
57  int nc = 0;
58  float ph = 0.;
59 
60  //float coarse = my_tpgParams.totalTime(wire.chamberId(),DTTimeUnits::ns); // CB ask for this to be fixed
61  my_tpgParams->get(wire.chamberId(), nc, ph, DTTimeUnits::ns);
62  float pedestal = 25. * nc + ph;
63 
64  float t0mean = 0.;
65  float t0rms = 0.;
66 
67  if (useT0()) {
68  my_t0i->get(wire, t0mean, t0rms, DTTimeUnits::ns);
69  pedestal += t0mean;
70  }
71 
72  if (debug()) {
73  std::cout << "DTConfigPedestals::getOffset :" << std::endl;
74  std::cout << "\t# of counts (BX): " << nc << " fine corr (ns) : " << ph << std::endl;
75  std::cout << "\tt0i subtraction : ";
76  if (useT0()) {
77  std::cout << "enabled. t0i for wire " << wire << " : " << t0mean << std::endl;
78  } else {
79  std::cout << "disabled" << std::endl;
80  }
81  }
82 
83  return pedestal;
84 }
int debug() const
Debug flag.
DTChamberId chamberId() const
Return the corresponding ChamberId.
DTTPGParameters const * my_tpgParams
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:48
bool useT0() const
Use t0i.
int get(int wheelId, int stationId, int sectorId, int &nc, float &ph, DTTimeUnits::type unit) const
get content
void DTConfigPedestals::print ( void  ) const

Print the setup.

Definition at line 86 of file DTConfigPedestals.cc.

References gather_cfg::cout, debug(), DTTPGParameters::get(), my_tpgParams, DTTimeUnits::ns, fileinputsource_cfi::sec, and useT0().

Referenced by DTConfigTester::analyze(), and setDebug().

86  {
87  std::cout << "******************************************************************************" << std::endl;
88  std::cout << "* DT ConfigPedestals *" << std::endl;
89  std::cout << "******************************************************************************" << std::endl;
90  std::cout << "* *" << std::endl;
91  std::cout << "Debug flag : " << debug() << std::endl;
92  std::cout << "Use t0i flag : " << useT0() << std::endl;
93 
94  for (int wh = -2; wh <= 2; ++wh) {
95  for (int sec = 1; sec <= 14; ++sec) {
96  for (int st = 1; st <= 4; ++st) {
97  if (sec > 12 && st != 4)
98  continue;
99 
100  int ncount = 0;
101  float fine = 0.;
102  DTChamberId chId = DTChamberId(wh, st, sec);
103  my_tpgParams->get(chId, ncount, fine, DTTimeUnits::ns);
104 
105  std::cout << chId << "\t# counts (BX) : " << ncount << "\tfine adj : " << fine << std::endl;
106  }
107  }
108  }
109 
110  std::cout << "******************************************************************************" << std::endl;
111 }
int debug() const
Debug flag.
DTTPGParameters const * my_tpgParams
bool useT0() const
Use t0i.
int get(int wheelId, int stationId, int sectorId, int &nc, float &ph, DTTimeUnits::type unit) const
get content
void DTConfigPedestals::setDebug ( bool  debug)
inline

Set debug flag.

Definition at line 54 of file DTConfigPedestals.h.

References debug(), my_debug, and print().

Referenced by DTConfigDBProducer::readDBPedestalsConfig().

54 { my_debug = debug; }
int debug() const
Debug flag.
void DTConfigPedestals::setES ( DTTPGParameters const *  tpgParams,
DTT0 const *  t0Params = nullptr 
)

Set parameters from ES.

Definition at line 49 of file DTConfigPedestals.cc.

References my_t0i, my_tpgParams, and useT0().

Referenced by DTConfigTrivialProducer::buildTrivialPedestals(), DTConfigDBProducer::buildTrivialPedestals(), and DTConfigDBProducer::readDBPedestalsConfig().

49  {
50  my_tpgParams = tpgParams;
51 
52  if (useT0())
53  my_t0i = t0Params;
54 }
DTTPGParameters const * my_tpgParams
bool useT0() const
Use t0i.
void DTConfigPedestals::setUseT0 ( bool  useT0)
inline
bool DTConfigPedestals::useT0 ( ) const
inlineprivate

Use t0i.

Definition at line 64 of file DTConfigPedestals.h.

References my_useT0.

Referenced by getOffset(), print(), setES(), and setUseT0().

64 { return my_useT0; }

Member Data Documentation

bool DTConfigPedestals::my_debug
private

Definition at line 67 of file DTConfigPedestals.h.

Referenced by debug(), and setDebug().

DTT0 const* DTConfigPedestals::my_t0i
private

Definition at line 70 of file DTConfigPedestals.h.

Referenced by getOffset(), and setES().

DTTPGParameters const* DTConfigPedestals::my_tpgParams
private

Definition at line 69 of file DTConfigPedestals.h.

Referenced by getOffset(), print(), and setES().

bool DTConfigPedestals::my_useT0
private

Definition at line 68 of file DTConfigPedestals.h.

Referenced by setUseT0(), and useT0().