CMS 3D CMS Logo

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

#include <LoadEPDB.h>

Public Member Functions

bool IsSuccess ()
 
 LoadEPDB (const edm::ESHandle< RPFlatParams > flatparmsDB_, HiEvtPlaneFlatten **flat)
 
 ~LoadEPDB ()
 

Private Attributes

bool genFlatPsi_
 

Detailed Description

Definition at line 28 of file LoadEPDB.h.

Constructor & Destructor Documentation

◆ LoadEPDB()

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

Definition at line 30 of file LoadEPDB.h.

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

References genFlatPsi_, HiEvtPlaneFlatten::getHBins(), HiEvtPlaneFlatten::getOBins(), mps_fire::i, if(), createfilelist::int, 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.

◆ ~LoadEPDB()

LoadEPDB::~LoadEPDB ( )
inline

Definition at line 113 of file LoadEPDB.h.

113 {}

Member Function Documentation

◆ IsSuccess()

bool LoadEPDB::IsSuccess ( )
inline

Definition at line 112 of file LoadEPDB.h.

112 { return genFlatPsi_; }

References genFlatPsi_.

Member Data Documentation

◆ genFlatPsi_

bool LoadEPDB::genFlatPsi_
private

Definition at line 116 of file LoadEPDB.h.

Referenced by IsSuccess(), and LoadEPDB().

mps_fire.i
i
Definition: mps_fire.py:428
RPFlatParams::EP::RPNameIndx
int RPNameIndx[50]
Definition: RPFlatParams.h:16
HiEvtPlaneFlatten::setYDB
void setYDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:277
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:58
HiEvtPlaneFlatten::setCentRes1
void setCentRes1(unsigned int bin, double res, double err)
Definition: HiEvtPlaneFlatten.h:299
HiEvtPlaneFlatten::setXoffDB
void setXoffDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:278
LoadEPDB::genFlatPsi_
bool genFlatPsi_
Definition: LoadEPDB.h:116
RPFlatParams::EP::x
float x[50]
Definition: RPFlatParams.h:10
RPFlatParams::EP
Definition: RPFlatParams.h:9
RPFlatParams::m_table
std::vector< EP > m_table
Definition: RPFlatParams.h:22
HiEvtPlaneFlatten::setYoffDB
void setYoffDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:279
HiEvtPlaneFlatten::setPt2DB
void setPt2DB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:281
createfilelist.int
int
Definition: createfilelist.py:10
HiEvtPlaneFlatten::setPtDB
void setPtDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:280
HiEvtPlaneFlatten::getOBins
int getOBins() const
Definition: HiEvtPlaneFlatten.h:241
HiEvtPlaneFlatten::getHBins
int getHBins() const
Definition: HiEvtPlaneFlatten.h:240
hi::NumEPNames
static const int NumEPNames
Definition: HiEvtPlaneList.h:28
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
RPFlatParams::EP::y
float y[50]
Definition: RPFlatParams.h:11
HiEvtPlaneFlatten::setXDB
void setXDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:276