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

Definition at line 31 of file LoadEPDB.h.

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

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) break;
72  for(int j = 0; j< ncentbins; j++) {
73  const RPFlatParams::EP* thisBin = &(flatparmsDB_->m_table[Hbins+2*Obins +cbins+j+1]);
74  if(fabs(centbinning-1.)<0.01) {
75  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes1(j,thisBin->x[i],thisBin->y[i]);
76  }
77  if(fabs(centbinning-2.)<0.01) {
78  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes2(j,thisBin->x[i],thisBin->y[i]);
79  }
80  if(fabs(centbinning-5.)<0.01) {
81  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes5(j,thisBin->x[i],thisBin->y[i]);
82  }
83  if(fabs(centbinning-10.)<0.01) {
84  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes10(j,thisBin->x[i],thisBin->y[i]);
85  }
86  if(fabs(centbinning-20.)<0.01) {
87  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes20(j,thisBin->x[i],thisBin->y[i]);
88  }
89  if(fabs(centbinning-25.)<0.01) {
90  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes25(j,thisBin->x[i],thisBin->y[i]);
91  }
92  if(fabs(centbinning-30.)<0.01) {
93  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes30(j,thisBin->x[i],thisBin->y[i]);
94  }
95  if(fabs(centbinning-40.)<0.01) {
96  for(int i = 0; i<hi::NumEPNames; i++) flat[i]->setCentRes40(j,thisBin->x[i],thisBin->y[i]);
97  }
98  }
99 
100  cbins+=ncentbins+1;
101  }
102 
103  }
104 
105  }
int i
Definition: DBlmapReader.cc:9
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:111
void setYoffDB(unsigned int indx, double val)
void setPt2DB(unsigned int indx, double val)
int j
Definition: DBlmapReader.cc:9
int RPNameIndx[50]
Definition: RPFlatParams.h:16
void setPtDB(unsigned int indx, double val)
static const int NumEPNames
LoadEPDB::~LoadEPDB ( )
inline

Definition at line 108 of file LoadEPDB.h.

108 {}

Member Function Documentation

bool LoadEPDB::IsSuccess ( )
inline

Definition at line 107 of file LoadEPDB.h.

References genFlatPsi_.

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

107 {return genFlatPsi_;}
bool genFlatPsi_
Definition: LoadEPDB.h:111

Member Data Documentation

bool LoadEPDB::genFlatPsi_
private

Definition at line 111 of file LoadEPDB.h.

Referenced by IsSuccess(), and LoadEPDB().