CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
LoadEPDB Class Reference

#include <LoadEPDB.h>

Public Member Functions

bool IsSuccess ()
 
 LoadEPDB (const RPFlatParams &flatparmsDB_, HiEvtPlaneFlatten **flat)
 
 ~LoadEPDB ()
 

Private Attributes

bool genFlatPsi_
 

Detailed Description

Definition at line 21 of file LoadEPDB.h.

Constructor & Destructor Documentation

LoadEPDB::LoadEPDB ( const RPFlatParams flatparmsDB_,
HiEvtPlaneFlatten **  flat 
)
inlineexplicit

Definition at line 23 of file LoadEPDB.h.

References genFlatPsi_, HiEvtPlaneFlatten::getHBins(), HiEvtPlaneFlatten::getOBins(), mps_fire::i, if(), dqmiolumiharvest::j, RPFlatParams::m_table, hi::NumEPNames, RPFlatParams::EP::RPNameIndx, HiEvtPlaneFlatten::setCentRes1(), HiEvtPlaneFlatten::setPt2DB(), HiEvtPlaneFlatten::setPtDB(), HiEvtPlaneFlatten::setXDB(), HiEvtPlaneFlatten::setXoffDB(), HiEvtPlaneFlatten::setYDB(), HiEvtPlaneFlatten::setYoffDB(), RPFlatParams::EP::x, and RPFlatParams::EP::y.

23  {
24  int Hbins;
25  int Obins;
26  int flatTableSize = flatparmsDB_.m_table.size();
27  genFlatPsi_ = kTRUE;
28  if (flatTableSize < flat[0]->getHBins() + 2 * flat[0]->getOBins()) {
29  genFlatPsi_ = kFALSE;
30  } else {
31  Hbins = flat[0]->getHBins();
32  Obins = flat[0]->getOBins();
33 
34  for (int i = 0; i < flatTableSize; i++) {
35  const RPFlatParams::EP* thisBin = &(flatparmsDB_.m_table[i]);
36  for (int j = 0; j < hi::NumEPNames; j++) {
37  int indx = thisBin->RPNameIndx[j];
38  if (indx < 0 || indx >= hi::NumEPNames) {
39  genFlatPsi_ = kFALSE;
40  break;
41  }
42  if (indx >= 0) {
43  if (i < Hbins) {
44  flat[indx]->setXDB(i, thisBin->x[j]);
45  flat[indx]->setYDB(i, thisBin->y[j]);
46  } else if (i >= Hbins && i < Hbins + Obins) {
47  flat[indx]->setXoffDB(i - Hbins, thisBin->x[j]);
48  flat[indx]->setYoffDB(i - Hbins, thisBin->y[j]);
49  } else if (i >= Hbins + Obins && i < Hbins + 2 * Obins) {
50  flat[indx]->setPtDB(i - Hbins - Obins, thisBin->x[j]);
51  flat[indx]->setPt2DB(i - Hbins - Obins, thisBin->y[j]);
52  }
53  }
54  }
55  }
56  int cbins = 0;
57  while (flatTableSize > Hbins + 2 * Obins + cbins) {
58  const RPFlatParams::EP* thisBin = &(flatparmsDB_.m_table[Hbins + 2 * Obins + cbins]);
59  double centbinning = thisBin->x[0];
60  int ncentbins = (int)thisBin->y[0] + 0.01;
61  if (ncentbins == 0)
62  break;
63  for (int j = 0; j < ncentbins; j++) {
64  const RPFlatParams::EP* thisBin = &(flatparmsDB_.m_table[Hbins + 2 * Obins + cbins + j + 1]);
65  if (fabs(centbinning - 1.) < 0.01) {
66  for (int i = 0; i < hi::NumEPNames; i++) {
67  flat[i]->setCentRes1(j, thisBin->x[i], thisBin->y[i]);
68  }
69  }
70  if (fabs(centbinning - 2.) < 0.01) {
71  for (int i = 0; i < hi::NumEPNames; i++)
72  flat[i]->setCentRes2(j, thisBin->x[i], thisBin->y[i]);
73  }
74  if (fabs(centbinning - 5.) < 0.01) {
75  for (int i = 0; i < hi::NumEPNames; i++)
76  flat[i]->setCentRes5(j, thisBin->x[i], thisBin->y[i]);
77  }
78  if (fabs(centbinning - 10.) < 0.01) {
79  for (int i = 0; i < hi::NumEPNames; i++)
80  flat[i]->setCentRes10(j, thisBin->x[i], thisBin->y[i]);
81  }
82  if (fabs(centbinning - 20.) < 0.01) {
83  for (int i = 0; i < hi::NumEPNames; i++)
84  flat[i]->setCentRes20(j, thisBin->x[i], thisBin->y[i]);
85  }
86  if (fabs(centbinning - 25.) < 0.01) {
87  for (int i = 0; i < hi::NumEPNames; i++)
88  flat[i]->setCentRes25(j, thisBin->x[i], thisBin->y[i]);
89  }
90  if (fabs(centbinning - 30.) < 0.01) {
91  for (int i = 0; i < hi::NumEPNames; i++)
92  flat[i]->setCentRes30(j, thisBin->x[i], thisBin->y[i]);
93  }
94  if (fabs(centbinning - 40.) < 0.01) {
95  for (int i = 0; i < hi::NumEPNames; i++)
96  flat[i]->setCentRes40(j, thisBin->x[i], thisBin->y[i]);
97  }
98  }
99 
100  cbins += ncentbins + 1;
101  }
102  }
103  }
void setCentRes1(unsigned int bin, double res, double err)
void setXoffDB(unsigned int indx, double val)
void setXDB(unsigned int indx, double val)
void setYDB(unsigned int indx, double val)
bool genFlatPsi_
Definition: LoadEPDB.h:109
void setYoffDB(unsigned int indx, double val)
std::vector< EP > m_table
Definition: RPFlatParams.h:22
void setPt2DB(unsigned int indx, double val)
if(conf_.getParameter< bool >("UseStripCablingDB"))
int RPNameIndx[50]
Definition: RPFlatParams.h:16
void setPtDB(unsigned int indx, double val)
static const int NumEPNames
LoadEPDB::~LoadEPDB ( )
inline

Definition at line 106 of file LoadEPDB.h.

106 {}

Member Function Documentation

bool LoadEPDB::IsSuccess ( )
inline

Definition at line 105 of file LoadEPDB.h.

References genFlatPsi_.

105 { return genFlatPsi_; }
bool genFlatPsi_
Definition: LoadEPDB.h:109

Member Data Documentation

bool LoadEPDB::genFlatPsi_
private

Definition at line 109 of file LoadEPDB.h.

Referenced by IsSuccess(), and LoadEPDB().