test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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=0)
 Set parameters from ES. More...
 
void setUseT0 (bool useT0)
 Set t0i subtraction. More...
 
 ~DTConfigPedestals ()
 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 37 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) ,
35  my_tpgParams(0) , my_t0i(0) {
36 
37  //my_tpgParams = 0; // CB check that it could be done outside this
38  //my_t0i = 0;
39 
40 }
DTTPGParameters const * my_tpgParams
DTConfigPedestals::~DTConfigPedestals ( )

Destructor.

Definition at line 46 of file DTConfigPedestals.cc.

46 {}

Member Function Documentation

int DTConfigPedestals::debug ( ) const
inlineprivate

Debug flag.

Definition at line 66 of file DTConfigPedestals.h.

References my_debug.

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

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

Get wire by wire delay.

Definition at line 64 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(), and DTFineDelayCorr::runClientDiagnostic().

64  {
65 
66  int nc = 0;
67  float ph = 0.;
68 
69  //float coarse = my_tpgParams.totalTime(wire.chamberId(),DTTimeUnits::ns); // CB ask for this to be fixed
71  float pedestal = 25.*nc + ph;
72 
73  float t0mean = 0.;
74  float t0rms = 0.;
75 
76  if( useT0() ) {
77 
78  my_t0i->get(wire,t0mean,t0rms,DTTimeUnits::ns);
79  pedestal += t0mean;
80 
81  }
82 
83  if( debug() ){
84  std::cout << "DTConfigPedestals::getOffset :" << std::endl;
85  std::cout << "\t# of counts (BX): " << nc <<" fine corr (ns) : "<< ph << std::endl;
86  std::cout << "\tt0i subtraction : ";
87  if ( useT0() ) {
88  std::cout << "enabled. t0i for wire " << wire << " : " << t0mean << std::endl;
89  } else {
90  std::cout << "disabled" << std::endl;
91  }
92  }
93 
94  return pedestal;
95 
96 }
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:67
bool useT0() const
Use t0i.
tuple cout
Definition: gather_cfg.py:121
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 99 of file DTConfigPedestals.cc.

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

99  {
100 
101  std::cout << "******************************************************************************" << std::endl;
102  std::cout << "* DT ConfigPedestals *" << std::endl;
103  std::cout << "******************************************************************************" << std::endl;
104  std::cout << "* *" << std::endl;
105  std::cout << "Debug flag : " << debug() << std::endl;
106  std::cout << "Use t0i flag : " << useT0() << std::endl;
107 
108  for (int wh=-2 ; wh<=2; ++wh) {
109  for (int sec=1 ; sec<=14; ++sec) {
110  for (int st=1 ; st<=4; ++st) {
111 
112  if (sec>12 && st!=4) continue;
113 
114  int ncount = 0;
115  float fine = 0.;
116  DTChamberId chId = DTChamberId(wh,st,sec);
117  my_tpgParams->get(chId,ncount,fine,DTTimeUnits::ns);
118 
119  std::cout << chId << "\t# counts (BX) : " << ncount
120  << "\tfine adj : " << fine << std::endl;
121 
122  }
123  }
124  }
125 
126  std::cout << "******************************************************************************" << std::endl;
127 
128 }
int debug() const
Debug flag.
DTTPGParameters const * my_tpgParams
bool useT0() const
Use t0i.
tuple cout
Definition: gather_cfg.py:121
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 58 of file DTConfigPedestals.h.

References debug(), and my_debug.

Referenced by DTConfigDBProducer::readDBPedestalsConfig().

58 { my_debug = debug; }
int debug() const
Debug flag.
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().

54  {
55 
56  my_tpgParams = tpgParams;
57 
58  if (useT0())
59  my_t0i = t0Params;
60 
61 }
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 69 of file DTConfigPedestals.h.

References my_useT0.

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

69 { return my_useT0; }

Member Data Documentation

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().