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 ( const edm::ESHandle< RPFlatParams flatparmsDB_,
HiEvtPlaneFlatten **  flat 
)
inlineexplicit

Definition at line 33 of file LoadEPDB.h.

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

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

Definition at line 110 of file LoadEPDB.h.

110 {}

Member Function Documentation

bool LoadEPDB::IsSuccess ( )
inline

Definition at line 109 of file LoadEPDB.h.

References genFlatPsi_.

Referenced by HiEvtPlaneFlatProducer::produce(), and EvtPlaneProducer::produce().

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

Member Data Documentation

bool LoadEPDB::genFlatPsi_
private

Definition at line 113 of file LoadEPDB.h.

Referenced by IsSuccess(), and LoadEPDB().