CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Friends
HGCalParameters Class Reference

#include <HGCalParameters.h>

Classes

struct  hgtrap
 
struct  hgtrform
 

Public Types

typedef std::vector< std::unordered_map< int32_t, int32_t > > layer_map
 

Public Member Functions

void addTrForm (const CLHEP::Hep3Vector &h3v)
 
void fillModule (const hgtrap &mytr, bool reco)
 
void fillTrForm (const hgtrform &mytr)
 
hgtrap getModule (unsigned int k, bool reco) const
 
hgtrform getTrForm (unsigned int k) const
 
 HGCalParameters (const std::string &nam)
 
void scaleTrForm (double)
 
 ~HGCalParameters (void)
 

Public Attributes

std::vector< double > boundR_
 
std::vector< int > cellCoarse_
 
std::vector< bool > cellCoarseHalf_
 
std::vector< double > cellCoarseX_
 
std::vector< double > cellCoarseY_
 
std::vector< int > cellFactor_
 
std::vector< int > cellFine_
 
std::vector< bool > cellFineHalf_
 
std::vector< double > cellFineX_
 
std::vector< double > cellFineY_
 
std::vector< double > cellSize_
 
layer_map copiesInLayers_
 
std::vector< int > depth_
 
std::vector< int > depthIndex_
 
std::vector< int > depthLayerF_
 
std::vector< int > layer_
 
std::vector< int > layerGroup_
 
std::vector< int > layerGroupM_
 
std::vector< int > layerGroupO_
 
std::vector< int > layerIndex_
 
int levelT_
 
HGCalGeometryMode::GeometryMode mode_
 
std::vector< double > moduleAlphaR_
 
std::vector< double > moduleAlphaS_
 
std::vector< double > moduleBlR_
 
std::vector< double > moduleBlS_
 
std::vector< double > moduleCellR_
 
std::vector< double > moduleCellS_
 
std::vector< double > moduleDzR_
 
std::vector< double > moduleDzS_
 
std::vector< double > moduleHR_
 
std::vector< double > moduleHS_
 
std::vector< int > moduleLayR_
 
std::vector< int > moduleLayS_
 
std::vector< double > moduleTlR_
 
std::vector< double > moduleTlS_
 
std::string name_
 
int nCells_
 
int nSectors_
 
std::vector< double > rLimit_
 
std::vector< double > rMaxLayHex_
 
std::vector< double > rMinLayHex_
 
double slopeMin_
 
std::vector< uint32_t > trformIndex_
 
std::vector< double > trformRotXX_
 
std::vector< double > trformRotXY_
 
std::vector< double > trformRotXZ_
 
std::vector< double > trformRotYX_
 
std::vector< double > trformRotYY_
 
std::vector< double > trformRotYZ_
 
std::vector< double > trformRotZX_
 
std::vector< double > trformRotZY_
 
std::vector< double > trformRotZZ_
 
std::vector< double > trformTranX_
 
std::vector< double > trformTranY_
 
std::vector< double > trformTranZ_
 
std::vector< int > waferCopy_
 
std::vector< double > waferPosX_
 
std::vector< double > waferPosY_
 
double waferR_
 
std::vector< int > waferTypeL_
 
std::vector< int > waferTypeT_
 
std::vector< double > zLayerHex_
 

Static Public Attributes

static const int kMaskLayer = 0x7F
 
static const int kMaskSector = 0x3FF
 
static const int kMaskSubSec = 0x1
 
static const int kMaskZside = 0x1
 
static const int kShiftLayer = 12
 
static const int kShiftSector = 1
 
static const int kShiftSubSec = 0
 
static const int kShiftZside = 19
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 14 of file HGCalParameters.h.

Member Typedef Documentation

typedef std::vector<std::unordered_map<int32_t,int32_t> > HGCalParameters::layer_map

Definition at line 18 of file HGCalParameters.h.

Constructor & Destructor Documentation

HGCalParameters::HGCalParameters ( const std::string &  nam)

Definition at line 4 of file HGCalParameters.cc.

4 : name_(nam) { }
std::string name_
HGCalParameters::~HGCalParameters ( void  )

Definition at line 6 of file HGCalParameters.cc.

6 { }

Member Function Documentation

void HGCalParameters::addTrForm ( const CLHEP::Hep3Vector &  h3v)

Definition at line 138 of file HGCalParameters.cc.

References gen::k, trformTranX_, trformTranY_, and trformTranZ_.

Referenced by HGCalGeomParameters::loadGeometryHexagon(), and HGCalGeomParameters::loadGeometrySquare().

138  {
139 
140  unsigned int k = trformTranX_.size();
141  if (k > 0) {
142  trformTranX_[k-1] += h3v.x();
143  trformTranY_[k-1] += h3v.y();
144  trformTranZ_[k-1] += h3v.z();
145  }
146 }
std::vector< double > trformTranY_
int k[5][pyjets_maxn]
std::vector< double > trformTranX_
std::vector< double > trformTranZ_
void HGCalParameters::fillModule ( const hgtrap mytr,
bool  reco 
)

Definition at line 8 of file HGCalParameters.cc.

References HGCalParameters::hgtrap::alpha, HGCalParameters::hgtrap::bl, HGCalParameters::hgtrap::cellSize, HGCalParameters::hgtrap::dz, HGCalParameters::hgtrap::h, HGCalParameters::hgtrap::lay, moduleAlphaR_, moduleAlphaS_, moduleBlR_, moduleBlS_, moduleCellR_, moduleCellS_, moduleDzR_, moduleDzS_, moduleHR_, moduleHS_, moduleLayR_, moduleLayS_, moduleTlR_, moduleTlS_, and HGCalParameters::hgtrap::tl.

Referenced by HGCalGeomParameters::loadGeometryHexagon(), and HGCalGeomParameters::loadGeometrySquare().

9  {
10 
11  if (reco) {
12  moduleLayR_.emplace_back(mytr.lay);
13  moduleBlR_.emplace_back(mytr.bl);
14  moduleTlR_.emplace_back(mytr.tl);
15  moduleHR_.emplace_back(mytr.h);
16  moduleDzR_.emplace_back(mytr.dz);
17  moduleAlphaR_.emplace_back(mytr.alpha);
18  moduleCellR_.emplace_back(mytr.cellSize);
19  } else {
20  moduleLayS_.emplace_back(mytr.lay);
21  moduleBlS_.emplace_back(mytr.bl);
22  moduleTlS_.emplace_back(mytr.tl);
23  moduleHS_.emplace_back(mytr.h);
24  moduleDzS_.emplace_back(mytr.dz);
25  moduleAlphaS_.emplace_back(mytr.alpha);
26  moduleCellS_.emplace_back(mytr.cellSize);
27  }
28 }
std::vector< double > moduleDzR_
std::vector< double > moduleCellR_
std::vector< double > moduleHR_
std::vector< int > moduleLayR_
std::vector< double > moduleHS_
std::vector< double > moduleDzS_
std::vector< double > moduleAlphaR_
std::vector< double > moduleBlR_
std::vector< double > moduleTlS_
std::vector< double > moduleCellS_
std::vector< double > moduleAlphaS_
fixed size matrix
std::vector< double > moduleBlS_
std::vector< int > moduleLayS_
std::vector< double > moduleTlR_
void HGCalParameters::fillTrForm ( const hgtrform mytr)

Definition at line 63 of file HGCalParameters.cc.

References gather_cfg::cout, TauDecayModes::dec, HGCalParameters::hgtrform::h3v, HGCalParameters::hgtrform::hr, gen::k, kMaskLayer, kMaskSector, kMaskSubSec, kMaskZside, kShiftLayer, kShiftSector, kShiftSubSec, kShiftZside, HGCalParameters::hgtrform::lay, HGCalParameters::hgtrform::sec, HGCalParameters::hgtrform::subsec, trformIndex_, trformRotXX_, trformRotXY_, trformRotXZ_, trformRotYX_, trformRotYY_, trformRotYZ_, trformRotZX_, trformRotZY_, trformRotZZ_, trformTranX_, trformTranY_, trformTranZ_, and HGCalParameters::hgtrform::zp.

Referenced by HGCalGeomParameters::loadGeometryHexagon(), and HGCalGeomParameters::loadGeometrySquare().

63  {
64 
65  int zp = (mytr.zp == 1) ? 1 : 0;
66  uint32_t indx = ((zp & kMaskZside) << kShiftZside);
67  indx |= ((mytr.lay & kMaskLayer) << kShiftLayer);
68  indx |= ((mytr.sec & kMaskSector) << kShiftSector);
69  indx |= ((mytr.subsec & kMaskSubSec) << kShiftSubSec);
70 #ifdef EDM_ML_DEBUG
71  std::cout << "ZP " << zp << ":" << kMaskZside << ":" << kShiftZside
72  << ((zp & kMaskZside) << kShiftZside) << " Lay " << mytr.lay
73  << ":" << kMaskLayer << ":" << kShiftLayer << ":"
74  << ((mytr.lay & kMaskLayer) << kShiftLayer) << " Sector "
75  << mytr.sec << ":" << kMaskSector << ":" << kShiftSector << ":"
76  << ((mytr.sec & kMaskSector) << kShiftSector) << " SubSec "
77  << mytr.subsec << ":" << kMaskSubSec << ":" << kShiftSubSec << ":"
78  << ((mytr.subsec & kMaskSubSec) << kShiftSubSec) << " Index "
79  << std::hex << indx << std::dec << std::endl;
80 #endif
81  trformIndex_.emplace_back(indx);
82  trformTranX_.emplace_back(mytr.h3v.x());
83  trformTranY_.emplace_back(mytr.h3v.y());
84  trformTranZ_.emplace_back(mytr.h3v.z());
85  trformRotXX_.emplace_back(mytr.hr.xx());
86  trformRotYX_.emplace_back(mytr.hr.yx());
87  trformRotZX_.emplace_back(mytr.hr.zx());
88  trformRotXY_.emplace_back(mytr.hr.xy());
89  trformRotYY_.emplace_back(mytr.hr.yy());
90  trformRotZY_.emplace_back(mytr.hr.zy());
91  trformRotXZ_.emplace_back(mytr.hr.xz());
92  trformRotYZ_.emplace_back(mytr.hr.yz());
93  trformRotZZ_.emplace_back(mytr.hr.zz());
94 #ifdef EDM_ML_DEBUG
95  unsigned int k = trformIndex_.size() - 1;
96  std::cout << "HGCalParameters[" << k << "] Index " << std::hex
97  << trformIndex_[k] << std::dec << " (" << mytr.zp << ", "<< mytr.lay
98  << ", " << mytr.sec << ", " << mytr.subsec << ") Translation ("
99  << trformTranX_[k] << ", " << trformTranY_[k] << ", "
100  << trformTranZ_[k] << ") Rotation (" << trformRotXX_[k] << ", "
101  << trformRotYX_[k] << ", " << trformRotZX_[k] << ", "
102  << trformRotXY_[k] << ", " << trformRotYY_[k] << ", "
103  << trformRotZY_[k] << ", " << trformRotXZ_[k] << ", "
104  << trformRotYZ_[k] << ", " << trformRotZZ_[k] << std::endl;
105 #endif
106 }
static const int kMaskSubSec
std::vector< double > trformTranY_
static const int kMaskLayer
std::vector< double > trformRotZY_
std::vector< uint32_t > trformIndex_
std::vector< double > trformRotXX_
std::vector< double > trformRotZX_
std::vector< double > trformRotYZ_
static const int kMaskSector
std::vector< double > trformRotXY_
std::vector< double > trformRotYX_
int k[5][pyjets_maxn]
std::vector< double > trformTranX_
std::vector< double > trformRotXZ_
std::vector< double > trformRotYY_
static const int kShiftSector
std::vector< double > trformRotZZ_
static const int kShiftZside
std::vector< double > trformTranZ_
static const int kMaskZside
static const int kShiftSubSec
static const int kShiftLayer
HGCalParameters::hgtrap HGCalParameters::getModule ( unsigned int  k,
bool  reco 
) const

Definition at line 30 of file HGCalParameters.cc.

References HGCalParameters::hgtrap::alpha, HGCalParameters::hgtrap::bl, HGCalParameters::hgtrap::cellSize, HGCalParameters::hgtrap::dz, HGCalParameters::hgtrap::h, gen::k, HGCalParameters::hgtrap::lay, moduleAlphaR_, moduleAlphaS_, moduleBlR_, moduleBlS_, moduleCellR_, moduleCellS_, moduleDzR_, moduleDzS_, moduleHR_, moduleHS_, moduleLayR_, moduleLayS_, moduleTlR_, moduleTlS_, and HGCalParameters::hgtrap::tl.

Referenced by HGCalDDDConstants::getModule(), HGCalDDDConstants::getModules(), HGCalGeomParameters::loadGeometryHexagon(), and HGCalGeomParameters::loadGeometrySquare().

31  {
33  if (reco) {
34  if (k < moduleLayR_.size()) {
35  mytr.lay = moduleLayR_[k];
36  mytr.bl = moduleBlR_[k];
37  mytr.tl = moduleTlR_[k];
38  mytr.h = moduleHR_[k];
39  mytr.dz = moduleDzR_[k];
40  mytr.alpha = moduleAlphaR_[k];
41  mytr.cellSize = moduleCellR_[k];
42  } else {
43  mytr.lay = -1;
44  mytr.bl = mytr.tl = mytr.h = mytr.dz = mytr.alpha = mytr.cellSize = 0;
45  }
46  } else {
47  if (k < moduleLayS_.size()) {
48  mytr.lay = moduleLayS_[k];
49  mytr.bl = moduleBlS_[k];
50  mytr.tl = moduleTlS_[k];
51  mytr.h = moduleHS_[k];
52  mytr.dz = moduleDzS_[k];
53  mytr.alpha = moduleAlphaS_[k];
54  mytr.cellSize = moduleCellS_[k];
55  } else {
56  mytr.lay = -1;
57  mytr.bl = mytr.tl = mytr.h = mytr.dz = mytr.alpha = mytr.cellSize = 0;
58  }
59  }
60  return mytr;
61 }
std::vector< double > moduleDzR_
std::vector< double > moduleCellR_
std::vector< double > moduleHR_
std::vector< int > moduleLayR_
std::vector< double > moduleHS_
std::vector< double > moduleDzS_
std::vector< double > moduleAlphaR_
std::vector< double > moduleBlR_
std::vector< double > moduleTlS_
int k[5][pyjets_maxn]
std::vector< double > moduleCellS_
std::vector< double > moduleAlphaS_
fixed size matrix
std::vector< double > moduleBlS_
std::vector< int > moduleLayS_
std::vector< double > moduleTlR_
HGCalParameters::hgtrform HGCalParameters::getTrForm ( unsigned int  k) const

Definition at line 108 of file HGCalParameters.cc.

References gather_cfg::cout, TauDecayModes::dec, HGCalParameters::hgtrform::h3v, HGCalParameters::hgtrform::hr, gen::k, kMaskLayer, kMaskSector, kMaskSubSec, kMaskZside, kShiftLayer, kShiftSector, kShiftSubSec, kShiftZside, HGCalParameters::hgtrform::lay, idealTransformation::rotation, HGCalParameters::hgtrform::sec, HGCalParameters::hgtrform::subsec, trformIndex_, trformRotXX_, trformRotXY_, trformRotXZ_, trformRotYX_, trformRotYY_, trformRotYZ_, trformRotZX_, trformRotZY_, trformRotZZ_, trformTranX_, trformTranY_, trformTranZ_, and HGCalParameters::hgtrform::zp.

Referenced by HGCalDDDConstants::getTrForm(), and HGCalDDDConstants::getTrForms().

108  {
109 
111  if (k < trformIndex_.size()) {
112  int zp = ((trformIndex_[k] >> kShiftZside) & kMaskZside);
113  mytr.zp = (zp == 1) ? 1 : -1;
114  mytr.lay = ((trformIndex_[k] >> kShiftLayer) & kMaskLayer);
115  mytr.sec = ((trformIndex_[k] >> kShiftSector) & kMaskSector);
116  mytr.subsec= ((trformIndex_[k] >> kShiftSubSec) & kMaskSubSec);
117  mytr.h3v = CLHEP::Hep3Vector(trformTranX_[k],trformTranY_[k],trformTranZ_[k]);
118  const CLHEP::HepRep3x3 rotation(trformRotXX_[k],trformRotXY_[k],trformRotXZ_[k],
121  mytr.hr = CLHEP::HepRotation(rotation);
122  } else {
123  mytr.zp = mytr.lay = mytr.sec = mytr.subsec = 0;
124  }
125 #ifdef EDM_ML_DEBUG
126  std::cout << "HGCalParameters[" << k << "] Index " << std::hex
127  << trformIndex_[k] << std::dec << " (" << mytr.zp << ", "<< mytr.lay
128  << ", " << mytr.sec << ", " << mytr.subsec << ") Translation ("
129  << mytr.h3v.x() << ", " << mytr.h3v.y() << ", " << mytr.h3v.z()
130  << ") Rotation (" << mytr.hr.xx() << ", " << mytr.hr.yx() << ", "
131  << mytr.hr.zx() << ", " << mytr.hr.xy() << ", " << mytr.hr.yy()
132  << ", " << mytr.hr.zy() << ", " << mytr.hr.xz() << ", "
133  << mytr.hr.yz() << ", " << mytr.hr.zz() << std::endl;
134 #endif
135  return mytr;
136 }
static const int kMaskSubSec
std::vector< double > trformTranY_
static const int kMaskLayer
std::vector< double > trformRotZY_
std::vector< uint32_t > trformIndex_
std::vector< double > trformRotXX_
std::vector< double > trformRotZX_
std::vector< double > trformRotYZ_
static const int kMaskSector
std::vector< double > trformRotXY_
std::vector< double > trformRotYX_
int k[5][pyjets_maxn]
std::vector< double > trformTranX_
std::vector< double > trformRotXZ_
std::vector< double > trformRotYY_
static const int kShiftSector
std::vector< double > trformRotZZ_
static const int kShiftZside
std::vector< double > trformTranZ_
static const int kMaskZside
CLHEP::HepRotation hr
static const int kShiftSubSec
static const int kShiftLayer
void HGCalParameters::scaleTrForm ( double  scale)

Definition at line 148 of file HGCalParameters.cc.

References gen::k, Scenarios_cff::scale, trformTranX_, trformTranY_, and trformTranZ_.

Referenced by HGCalGeomParameters::loadGeometryHexagon(), and HGCalGeomParameters::loadGeometrySquare().

148  {
149  unsigned int k = trformTranX_.size();
150  if (k > 0) {
151  trformTranX_[k-1] *= scale;
152  trformTranY_[k-1] *= scale;
153  trformTranZ_[k-1] *= scale;
154  }
155 }
std::vector< double > trformTranY_
int k[5][pyjets_maxn]
std::vector< double > trformTranX_
std::vector< double > trformTranZ_
template<class Archive >
void HGCalParameters::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 113 of file HGCalParameters.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 113 of file HGCalParameters.h.

Member Data Documentation

std::vector<double> HGCalParameters::boundR_
std::vector<int> HGCalParameters::cellCoarse_

Definition at line 106 of file HGCalParameters.h.

Referenced by HGCalGeomParameters::loadCellParsHexagon().

std::vector<bool> HGCalParameters::cellCoarseHalf_
std::vector<double> HGCalParameters::cellCoarseX_
std::vector<double> HGCalParameters::cellCoarseY_
std::vector<int> HGCalParameters::cellFactor_
std::vector<int> HGCalParameters::cellFine_

Definition at line 105 of file HGCalParameters.h.

Referenced by HGCalGeomParameters::loadCellParsHexagon().

std::vector<bool> HGCalParameters::cellFineHalf_
std::vector<double> HGCalParameters::cellFineX_
std::vector<double> HGCalParameters::cellFineY_
std::vector<double> HGCalParameters::cellSize_
layer_map HGCalParameters::copiesInLayers_
std::vector<int> HGCalParameters::depth_
std::vector<int> HGCalParameters::depthIndex_
std::vector<int> HGCalParameters::depthLayerF_
const int HGCalParameters::kMaskLayer = 0x7F
static

Definition at line 41 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kMaskSector = 0x3FF
static

Definition at line 42 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kMaskSubSec = 0x1
static

Definition at line 43 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kMaskZside = 0x1
static

Definition at line 40 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftLayer = 12
static

Definition at line 45 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftSector = 1
static

Definition at line 46 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftSubSec = 0
static

Definition at line 47 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftZside = 19
static

Definition at line 44 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

std::vector<int> HGCalParameters::layer_
std::vector<int> HGCalParameters::layerGroup_
std::vector<int> HGCalParameters::layerGroupM_
std::vector<int> HGCalParameters::layerGroupO_
std::vector<int> HGCalParameters::layerIndex_
int HGCalParameters::levelT_
HGCalGeometryMode::GeometryMode HGCalParameters::mode_
std::vector<double> HGCalParameters::moduleAlphaR_
std::vector<double> HGCalParameters::moduleAlphaS_
std::vector<double> HGCalParameters::moduleBlR_
std::vector<double> HGCalParameters::moduleBlS_
std::vector<double> HGCalParameters::moduleCellR_
std::vector<double> HGCalParameters::moduleCellS_
std::vector<double> HGCalParameters::moduleDzR_
std::vector<double> HGCalParameters::moduleDzS_
std::vector<double> HGCalParameters::moduleHR_
std::vector<double> HGCalParameters::moduleHS_
std::vector<int> HGCalParameters::moduleLayR_
std::vector<int> HGCalParameters::moduleLayS_
std::vector<double> HGCalParameters::moduleTlR_
std::vector<double> HGCalParameters::moduleTlS_
std::string HGCalParameters::name_

Definition at line 49 of file HGCalParameters.h.

Referenced by PHGCalParametersDBBuilder::swapParameters().

int HGCalParameters::nCells_
int HGCalParameters::nSectors_
std::vector<double> HGCalParameters::rLimit_
std::vector<double> HGCalParameters::rMaxLayHex_
std::vector<double> HGCalParameters::rMinLayHex_
double HGCalParameters::slopeMin_
std::vector<uint32_t> HGCalParameters::trformIndex_
std::vector<double> HGCalParameters::trformRotXX_
std::vector<double> HGCalParameters::trformRotXY_
std::vector<double> HGCalParameters::trformRotXZ_
std::vector<double> HGCalParameters::trformRotYX_
std::vector<double> HGCalParameters::trformRotYY_
std::vector<double> HGCalParameters::trformRotYZ_
std::vector<double> HGCalParameters::trformRotZX_
std::vector<double> HGCalParameters::trformRotZY_
std::vector<double> HGCalParameters::trformRotZZ_
std::vector<double> HGCalParameters::trformTranX_
std::vector<double> HGCalParameters::trformTranY_
std::vector<double> HGCalParameters::trformTranZ_
std::vector<int> HGCalParameters::waferCopy_
std::vector<double> HGCalParameters::waferPosX_
std::vector<double> HGCalParameters::waferPosY_
double HGCalParameters::waferR_
std::vector<int> HGCalParameters::waferTypeL_
std::vector<int> HGCalParameters::waferTypeT_
std::vector<double> HGCalParameters::zLayerHex_