CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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< double > cellCoarseX_
 
std::vector< double > cellCoarseY_
 
std::vector< int > cellFactor_
 
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 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 > rMaxLayHex_
 
std::vector< double > rMinLayHex_
 
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 15 of file HGCalParameters.h.

Member Typedef Documentation

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

Definition at line 19 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 129 of file HGCalParameters.cc.

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

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

129  {
130 
131  unsigned int k = trformTranX_.size();
132  if (k > 0) {
133  trformTranX_[k-1] += h3v.x();
134  trformTranY_[k-1] += h3v.y();
135  trformTranZ_[k-1] += h3v.z();
136  }
137 }
std::vector< double > trformTranY_
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_.push_back(mytr.lay);
13  moduleBlR_.push_back(mytr.bl);
14  moduleTlR_.push_back(mytr.tl);
15  moduleHR_.push_back(mytr.h);
16  moduleDzR_.push_back(mytr.dz);
17  moduleAlphaR_.push_back(mytr.alpha);
18  moduleCellR_.push_back(mytr.cellSize);
19  } else {
20  moduleLayS_.push_back(mytr.lay);
21  moduleBlS_.push_back(mytr.bl);
22  moduleTlS_.push_back(mytr.tl);
23  moduleHS_.push_back(mytr.h);
24  moduleDzS_.push_back(mytr.dz);
25  moduleAlphaS_.push_back(mytr.alpha);
26  moduleCellS_.push_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_
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, relval_2017::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 // std::cout << "ZP " << zp << ":" << kMaskZside << ":" << kShiftZside << ((zp & kMaskZside) << kShiftZside) << " Lay " << mytr.lay << ":" << kMaskLayer << ":" << kShiftLayer << ":" << ((mytr.lay & kMaskLayer) << kShiftLayer) << " Sector " << mytr.sec << ":" << kMaskSector << ":" << kShiftSector << ":" << ((mytr.sec & kMaskSector) << kShiftSector) << " SubSec " << mytr.subsec << ":" << kMaskSubSec << ":" << kShiftSubSec << ":" << ((mytr.subsec & kMaskSubSec) << kShiftSubSec) << " Index " << std::hex << indx << std::dec << std::endl;
71 
72  trformIndex_.push_back(indx);
73  trformTranX_.push_back(mytr.h3v.x());
74  trformTranY_.push_back(mytr.h3v.y());
75  trformTranZ_.push_back(mytr.h3v.z());
76  trformRotXX_.push_back(mytr.hr.xx());
77  trformRotYX_.push_back(mytr.hr.yx());
78  trformRotZX_.push_back(mytr.hr.zx());
79  trformRotXY_.push_back(mytr.hr.xy());
80  trformRotYY_.push_back(mytr.hr.yy());
81  trformRotZY_.push_back(mytr.hr.zy());
82  trformRotXZ_.push_back(mytr.hr.xz());
83  trformRotYZ_.push_back(mytr.hr.yz());
84  trformRotZZ_.push_back(mytr.hr.zz());
85 #ifdef DebugLog
86  unsigned int k = trformIndex_.size() - 1;
87  std::cout << "HGCalParameters[" << k << "] Index " << std::hex
88  << trformIndex_[k] << std::dec << " (" << mytr.zp << ", "<< mytr.lay
89  << ", " << mytr.sec << ", " << mytr.subsec << ") Translation ("
90  << trformTranX_[k] << ", " << trformTranY_[k] << ", "
91  << trformTranZ_[k] << ") Rotation (" << trformRotXX_[k] << ", "
92  << trformRotYX_[k] << ", " << trformRotZX_[k] << ", "
93  << trformRotXY_[k] << ", " << trformRotYY_[k] << ", "
94  << trformRotZY_[k] << ", " << trformRotXZ_[k] << ", "
95  << trformRotYZ_[k] << ", " << trformRotZZ_[k] << std::endl;
96 #endif
97 }
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_
std::vector< double > trformTranX_
std::vector< double > trformRotXZ_
std::vector< double > trformRotYY_
static const int kShiftSector
std::vector< double > trformRotZZ_
static const int kShiftZside
tuple cout
Definition: gather_cfg.py:145
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, relval_2017::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_
std::vector< double > moduleCellS_
std::vector< double > moduleAlphaS_
std::vector< double > moduleBlS_
std::vector< int > moduleLayS_
std::vector< double > moduleTlR_
HGCalParameters::hgtrform HGCalParameters::getTrForm ( unsigned int  k) const

Definition at line 99 of file HGCalParameters.cc.

References gather_cfg::cout, TauDecayModes::dec, HGCalParameters::hgtrform::h3v, HGCalParameters::hgtrform::hr, relval_2017::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().

99  {
100 
102  if (k < trformIndex_.size()) {
103  int zp = ((trformIndex_[k] >> kShiftZside) & kMaskZside);
104  mytr.zp = (zp == 1) ? 1 : -1;
105  mytr.lay = ((trformIndex_[k] >> kShiftLayer) & kMaskLayer);
106  mytr.sec = ((trformIndex_[k] >> kShiftSector) & kMaskSector);
107  mytr.subsec= ((trformIndex_[k] >> kShiftSubSec) & kMaskSubSec);
108  mytr.h3v = CLHEP::Hep3Vector(trformTranX_[k],trformTranY_[k],trformTranZ_[k]);
109  const CLHEP::HepRep3x3 rotation(trformRotXX_[k],trformRotXY_[k],trformRotXZ_[k],
112  mytr.hr = CLHEP::HepRotation(rotation);
113  } else {
114  mytr.zp = mytr.lay = mytr.sec = mytr.subsec = 0;
115  }
116 #ifdef DebugLog
117  std::cout << "HGCalParameters[" << k << "] Index " << std::hex
118  << trformIndex_[k] << std::dec << " (" << mytr.zp << ", "<< mytr.lay
119  << ", " << mytr.sec << ", " << mytr.subsec << ") Translation ("
120  << mytr.h3v.x() << ", " << mytr.h3v.y() << ", " << mytr.h3v.z()
121  << ") Rotation (" << mytr.hr.xx() << ", " << mytr.hr.yx() << ", "
122  << mytr.hr.zx() << ", " << mytr.hr.xy() << ", " << mytr.hr.yy()
123  << ", " << mytr.hr.zy() << ", " << mytr.hr.xz() << ", "
124  << mytr.hr.yz() << ", " << mytr.hr.zz() << std::endl;
125 #endif
126  return mytr;
127 }
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_
std::vector< double > trformTranX_
std::vector< double > trformRotXZ_
std::vector< double > trformRotYY_
static const int kShiftSector
std::vector< double > trformRotZZ_
static const int kShiftZside
tuple cout
Definition: gather_cfg.py:145
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 139 of file HGCalParameters.cc.

References relval_2017::k, pileupReCalc_HLTpaths::scale, trformTranX_, trformTranY_, and trformTranZ_.

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

139  {
140  unsigned int k = trformTranX_.size();
141  if (k > 0) {
142  trformTranX_[k-1] *= scale;
143  trformTranY_[k-1] *= scale;
144  trformTranZ_[k-1] *= scale;
145  }
146 }
std::vector< double > trformTranY_
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 107 of file HGCalParameters.h.

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

Definition at line 107 of file HGCalParameters.h.

Member Data Documentation

std::vector<double> HGCalParameters::boundR_
std::vector<double> HGCalParameters::cellCoarseX_
std::vector<double> HGCalParameters::cellCoarseY_
std::vector<int> HGCalParameters::cellFactor_
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 42 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kMaskSector = 0x3FF
static

Definition at line 43 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kMaskSubSec = 0x1
static

Definition at line 44 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kMaskZside = 0x1
static

Definition at line 41 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftLayer = 12
static

Definition at line 46 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftSector = 1
static

Definition at line 47 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftSubSec = 0
static

Definition at line 48 of file HGCalParameters.h.

Referenced by fillTrForm(), and getTrForm().

const int HGCalParameters::kShiftZside = 19
static

Definition at line 45 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::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 50 of file HGCalParameters.h.

Referenced by PHGCalParametersDBBuilder::swapParameters().

int HGCalParameters::nCells_
int HGCalParameters::nSectors_
std::vector<double> HGCalParameters::rMaxLayHex_
std::vector<double> HGCalParameters::rMinLayHex_
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_