-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged Run2-hcx60 from repository bsunanda
Conflicts: CondFormats/GeometryObjects/src/classes.h CondFormats/GeometryObjects/src/classes_def.xml
- Loading branch information
Showing
71 changed files
with
3,029 additions
and
1,177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
CondFormats/GeometryObjects/interface/HGCalParameters.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#ifndef CondFormats_GeometryObjects_HGCalParameters_h | ||
#define CondFormats_GeometryObjects_HGCalParameters_h | ||
|
||
#include "CondFormats/Serialization/interface/Serializable.h" | ||
#include "DataFormats/GeometryVector/interface/GlobalPoint.h" | ||
#include<string> | ||
#include<vector> | ||
#include<iostream> | ||
#include<stdint.h> | ||
#include<CLHEP/Geometry/Transform3D.h> | ||
|
||
class HGCalParameters { | ||
|
||
public: | ||
|
||
struct hgtrap { | ||
int lay; | ||
float bl, tl, h, dz, alpha, cellSize; | ||
}; | ||
|
||
struct hgtrform { | ||
int zp, lay, sec, subsec; | ||
CLHEP::Hep3Vector h3v; | ||
CLHEP::HepRotation hr; | ||
}; | ||
|
||
HGCalParameters(const std::string& nam); | ||
~HGCalParameters( void ); | ||
void fillModule(const hgtrap& mytr, bool reco); | ||
hgtrap getModule(unsigned int k, bool reco) const; | ||
void fillTrForm(const hgtrform& mytr); | ||
hgtrform getTrForm(unsigned int k) const; | ||
void addTrForm(const CLHEP::Hep3Vector& h3v); | ||
void scaleTrForm(double); | ||
|
||
static const int kMaskZside = 0x1; | ||
static const int kMaskLayer = 0x7F; | ||
static const int kMaskSector = 0x3FF; | ||
static const int kMaskSubSec = 0x1; | ||
static const int kShiftZside = 19; | ||
static const int kShiftLayer = 12; | ||
static const int kShiftSector = 1; | ||
static const int kShiftSubSec = 0; | ||
|
||
std::string name_; | ||
int nCells_; | ||
int nSectors_; | ||
std::vector<double> cellSize_; | ||
std::vector<int> moduleLayS_; | ||
std::vector<double> moduleBlS_; | ||
std::vector<double> moduleTlS_; | ||
std::vector<double> moduleHS_; | ||
std::vector<double> moduleDzS_; | ||
std::vector<double> moduleAlphaS_; | ||
std::vector<double> moduleCellS_; | ||
std::vector<int> moduleLayR_; | ||
std::vector<double> moduleBlR_; | ||
std::vector<double> moduleTlR_; | ||
std::vector<double> moduleHR_; | ||
std::vector<double> moduleDzR_; | ||
std::vector<double> moduleAlphaR_; | ||
std::vector<double> moduleCellR_; | ||
std::vector<uint32_t> trformIndex_; | ||
std::vector<double> trformTranX_; | ||
std::vector<double> trformTranY_; | ||
std::vector<double> trformTranZ_; | ||
std::vector<double> trformRotXX_; | ||
std::vector<double> trformRotYX_; | ||
std::vector<double> trformRotZX_; | ||
std::vector<double> trformRotXY_; | ||
std::vector<double> trformRotYY_; | ||
std::vector<double> trformRotZY_; | ||
std::vector<double> trformRotXZ_; | ||
std::vector<double> trformRotYZ_; | ||
std::vector<double> trformRotZZ_; | ||
std::vector<int> layer_; | ||
std::vector<int> layerIndex_; | ||
std::vector<int> layerGroup_; | ||
std::vector<int> cellFactor_; | ||
std::vector<int> depth_; | ||
std::vector<int> depthIndex_; | ||
std::vector<int> depthLayerF_; | ||
std::vector<double> zLayerHex_; | ||
std::vector<double> rMinLayHex_; | ||
std::vector<double> rMaxLayHex_; | ||
std::vector<int> waferCopy_; | ||
std::vector<int> waferTypeL_; | ||
std::vector<int> waferTypeT_; | ||
std::vector<double> waferPosX_; | ||
std::vector<double> waferPosY_; | ||
std::vector<double> cellFineX_; | ||
std::vector<double> cellFineY_; | ||
std::vector<double> cellCoarseX_; | ||
std::vector<double> cellCoarseY_; | ||
std::vector<int> layerGroupM_; | ||
std::vector<int> layerGroupO_; | ||
std::vector<double> boundR_; | ||
double waferR_; | ||
int mode_; | ||
|
||
COND_SERIALIZABLE; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
#include "CondFormats/GeometryObjects/interface/HGCalParameters.h" | ||
//#define DebugLog | ||
|
||
HGCalParameters::HGCalParameters(const std::string& nam): name_(nam) { } | ||
|
||
HGCalParameters::~HGCalParameters() { } | ||
|
||
void HGCalParameters::fillModule(const HGCalParameters::hgtrap& mytr, | ||
bool reco) { | ||
|
||
if (reco) { | ||
moduleLayR_.push_back(mytr.lay); | ||
moduleBlR_.push_back(mytr.bl); | ||
moduleTlR_.push_back(mytr.tl); | ||
moduleHR_.push_back(mytr.h); | ||
moduleDzR_.push_back(mytr.dz); | ||
moduleAlphaR_.push_back(mytr.alpha); | ||
moduleCellR_.push_back(mytr.cellSize); | ||
} else { | ||
moduleLayS_.push_back(mytr.lay); | ||
moduleBlS_.push_back(mytr.bl); | ||
moduleTlS_.push_back(mytr.tl); | ||
moduleHS_.push_back(mytr.h); | ||
moduleDzS_.push_back(mytr.dz); | ||
moduleAlphaS_.push_back(mytr.alpha); | ||
moduleCellS_.push_back(mytr.cellSize); | ||
} | ||
} | ||
|
||
HGCalParameters::hgtrap HGCalParameters::getModule(unsigned int k, | ||
bool reco) const { | ||
HGCalParameters::hgtrap mytr; | ||
if (reco) { | ||
if (k < moduleLayR_.size()) { | ||
mytr.lay = moduleLayR_[k]; | ||
mytr.bl = moduleBlR_[k]; | ||
mytr.tl = moduleTlR_[k]; | ||
mytr.h = moduleHR_[k]; | ||
mytr.dz = moduleDzR_[k]; | ||
mytr.alpha = moduleAlphaR_[k]; | ||
mytr.cellSize = moduleCellR_[k]; | ||
} else { | ||
mytr.lay = -1; | ||
mytr.bl = mytr.tl = mytr.h = mytr.dz = mytr.alpha = mytr.cellSize = 0; | ||
} | ||
} else { | ||
if (k < moduleLayS_.size()) { | ||
mytr.lay = moduleLayS_[k]; | ||
mytr.bl = moduleBlS_[k]; | ||
mytr.tl = moduleTlS_[k]; | ||
mytr.h = moduleHS_[k]; | ||
mytr.dz = moduleDzS_[k]; | ||
mytr.alpha = moduleAlphaS_[k]; | ||
mytr.cellSize = moduleCellS_[k]; | ||
} else { | ||
mytr.lay = -1; | ||
mytr.bl = mytr.tl = mytr.h = mytr.dz = mytr.alpha = mytr.cellSize = 0; | ||
} | ||
} | ||
return mytr; | ||
} | ||
|
||
void HGCalParameters::fillTrForm(const HGCalParameters::hgtrform& mytr) { | ||
|
||
int zp = (mytr.zp == 1) ? 1 : 0; | ||
uint32_t indx = ((zp & kMaskZside) << kShiftZside); | ||
indx |= ((mytr.lay & kMaskLayer) << kShiftLayer); | ||
indx |= ((mytr.sec & kMaskSector) << kShiftSector); | ||
indx |= ((mytr.subsec & kMaskSubSec) << kShiftSubSec); | ||
// 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; | ||
|
||
trformIndex_.push_back(indx); | ||
trformTranX_.push_back(mytr.h3v.x()); | ||
trformTranY_.push_back(mytr.h3v.y()); | ||
trformTranZ_.push_back(mytr.h3v.z()); | ||
trformRotXX_.push_back(mytr.hr.xx()); | ||
trformRotYX_.push_back(mytr.hr.yx()); | ||
trformRotZX_.push_back(mytr.hr.zx()); | ||
trformRotXY_.push_back(mytr.hr.xy()); | ||
trformRotYY_.push_back(mytr.hr.yy()); | ||
trformRotZY_.push_back(mytr.hr.zy()); | ||
trformRotXZ_.push_back(mytr.hr.xz()); | ||
trformRotYZ_.push_back(mytr.hr.yz()); | ||
trformRotZZ_.push_back(mytr.hr.zz()); | ||
#ifdef DebugLog | ||
unsigned int k = trformIndex_.size() - 1; | ||
std::cout << "HGCalParameters[" << k << "] Index " << std::hex | ||
<< trformIndex_[k] << std::dec << " (" << mytr.zp << ", "<< mytr.lay | ||
<< ", " << mytr.sec << ", " << mytr.subsec << ") Translation (" | ||
<< trformTranX_[k] << ", " << trformTranY_[k] << ", " | ||
<< trformTranZ_[k] << ") Rotation (" << trformRotXX_[k] << ", " | ||
<< trformRotYX_[k] << ", " << trformRotZX_[k] << ", " | ||
<< trformRotXY_[k] << ", " << trformRotYY_[k] << ", " | ||
<< trformRotZY_[k] << ", " << trformRotXZ_[k] << ", " | ||
<< trformRotYZ_[k] << ", " << trformRotZZ_[k] << std::endl; | ||
#endif | ||
} | ||
|
||
HGCalParameters::hgtrform HGCalParameters::getTrForm(unsigned int k) const { | ||
|
||
HGCalParameters::hgtrform mytr; | ||
if (k < trformIndex_.size()) { | ||
int zp = ((trformIndex_[k] >> kShiftZside) & kMaskZside); | ||
mytr.zp = (zp == 1) ? 1 : -1; | ||
mytr.lay = ((trformIndex_[k] >> kShiftLayer) & kMaskLayer); | ||
mytr.sec = ((trformIndex_[k] >> kShiftSector) & kMaskSector); | ||
mytr.subsec= ((trformIndex_[k] >> kShiftSubSec) & kMaskSubSec); | ||
mytr.h3v = CLHEP::Hep3Vector(trformTranX_[k],trformTranY_[k],trformTranZ_[k]); | ||
const CLHEP::HepRep3x3 rotation(trformRotXX_[k],trformRotXY_[k],trformRotXZ_[k], | ||
trformRotYX_[k],trformRotYY_[k],trformRotYZ_[k], | ||
trformRotZX_[k],trformRotZY_[k],trformRotZZ_[k]); | ||
mytr.hr = CLHEP::HepRotation(rotation); | ||
} else { | ||
mytr.zp = mytr.lay = mytr.sec = mytr.subsec = 0; | ||
} | ||
#ifdef DebugLog | ||
std::cout << "HGCalParameters[" << k << "] Index " << std::hex | ||
<< trformIndex_[k] << std::dec << " (" << mytr.zp << ", "<< mytr.lay | ||
<< ", " << mytr.sec << ", " << mytr.subsec << ") Translation (" | ||
<< mytr.h3v.x() << ", " << mytr.h3v.y() << ", " << mytr.h3v.z() | ||
<< ") Rotation (" << mytr.hr.xx() << ", " << mytr.hr.yx() << ", " | ||
<< mytr.hr.zx() << ", " << mytr.hr.xy() << ", " << mytr.hr.yy() | ||
<< ", " << mytr.hr.zy() << ", " << mytr.hr.xz() << ", " | ||
<< mytr.hr.yz() << ", " << mytr.hr.zz() << std::endl; | ||
#endif | ||
return mytr; | ||
} | ||
|
||
void HGCalParameters::addTrForm(const CLHEP::Hep3Vector& h3v) { | ||
|
||
unsigned int k = trformTranX_.size(); | ||
if (k > 0) { | ||
trformTranX_[k-1] += h3v.x(); | ||
trformTranY_[k-1] += h3v.y(); | ||
trformTranZ_[k-1] += h3v.z(); | ||
} | ||
} | ||
|
||
void HGCalParameters::scaleTrForm(double scale) { | ||
unsigned int k = trformTranX_.size(); | ||
if (k > 0) { | ||
trformTranX_[k-1] *= scale; | ||
trformTranY_[k-1] *= scale; | ||
trformTranZ_[k-1] *= scale; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
CondFormats/GeometryObjects/src/T_EventSetup_HGCalParameters.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "CondFormats/GeometryObjects/interface/HGCalParameters.h" | ||
#include "FWCore/Utilities/interface/typelookup.h" | ||
|
||
TYPELOOKUP_DATA_REG(HGCalParameters); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.