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 30 of file LoadEPDB.h.

Constructor & Destructor Documentation

◆ LoadEPDB()

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

Definition at line 32 of file LoadEPDB.h.

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

References genFlatPsi_, HiEvtPlaneFlatten::getHBins(), HiEvtPlaneFlatten::getOBins(), mps_fire::i, createfilelist::int, dqmiolumiharvest::j, RPFlatParams::m_table, hi::NumEPNames, RPFlatParams::EP::RPNameIndx, 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 115 of file LoadEPDB.h.

115 {}

Member Function Documentation

◆ IsSuccess()

bool LoadEPDB::IsSuccess ( )
inline

Definition at line 114 of file LoadEPDB.h.

114 { return genFlatPsi_; }

References genFlatPsi_.

Member Data Documentation

◆ genFlatPsi_

bool LoadEPDB::genFlatPsi_
private

Definition at line 118 of file LoadEPDB.h.

Referenced by IsSuccess(), and LoadEPDB().

mps_fire.i
i
Definition: mps_fire.py:355
RPFlatParams::EP::RPNameIndx
int RPNameIndx[50]
Definition: RPFlatParams.h:16
HiEvtPlaneFlatten::setYDB
void setYDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:238
HiEvtPlaneFlatten::setXoffDB
void setXoffDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:239
LoadEPDB::genFlatPsi_
bool genFlatPsi_
Definition: LoadEPDB.h:118
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:240
HiEvtPlaneFlatten::setPt2DB
void setPt2DB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:242
createfilelist.int
int
Definition: createfilelist.py:10
HiEvtPlaneFlatten::setPtDB
void setPtDB(unsigned int indx, double val)
Definition: HiEvtPlaneFlatten.h:241
HiEvtPlaneFlatten::getOBins
int getOBins() const
Definition: HiEvtPlaneFlatten.h:202
HiEvtPlaneFlatten::getHBins
int getHBins() const
Definition: HiEvtPlaneFlatten.h:201
hi::NumEPNames
static const int NumEPNames
Definition: HiEvtPlaneList.h:126
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:237