Skip to content
Snippets Groups Projects
Commit 54c9fbc0 authored by Daniel Jeans's avatar Daniel Jeans Committed by Frank Gaede
Browse files

fixed to compile against latest DD4hep version (extra BitField64 constructor)

parent 451b8ad6
No related branches found
No related tags found
No related merge requests found
...@@ -38,9 +38,15 @@ namespace DD4hep { ...@@ -38,9 +38,15 @@ namespace DD4hep {
public: public:
/// Default constructor passing the encoding string /// Default constructor passing the encoding string
MegatileLayerGridXY(const std::string& cellEncoding = ""); MegatileLayerGridXY(const std::string& cellEncoding = "");
/// Default constructor used by derived classes passing an existing decoder
MegatileLayerGridXY(BitField64* decoder);
/// destructor /// destructor
virtual ~MegatileLayerGridXY(); virtual ~MegatileLayerGridXY();
void setup();
/// determine the position based on the cell ID /// determine the position based on the cell ID
virtual Vector3D position(const CellID& cellID) const; virtual Vector3D position(const CellID& cellID) const;
/// determine the cell ID based on the position /// determine the cell ID based on the position
......
...@@ -19,6 +19,20 @@ namespace DD4hep { ...@@ -19,6 +19,20 @@ namespace DD4hep {
/// default constructor using an encoding string /// default constructor using an encoding string
MegatileLayerGridXY::MegatileLayerGridXY(const std::string& cellEncoding) : MegatileLayerGridXY::MegatileLayerGridXY(const std::string& cellEncoding) :
CartesianGrid(cellEncoding) { CartesianGrid(cellEncoding) {
setup();
}
MegatileLayerGridXY::MegatileLayerGridXY(BitField64* decode) :
CartesianGrid(decode) {
setup();
}
/// destructor
MegatileLayerGridXY::~MegatileLayerGridXY() {
}
void MegatileLayerGridXY::setup() {
// define type and description // define type and description
_type = "MegatileLayerGridXY"; _type = "MegatileLayerGridXY";
_description = "Cartesian segmentation in the local XY-plane: megatiles, containing integer number of tiles/strips/cells"; _description = "Cartesian segmentation in the local XY-plane: megatiles, containing integer number of tiles/strips/cells";
...@@ -36,16 +50,11 @@ namespace DD4hep { ...@@ -36,16 +50,11 @@ namespace DD4hep {
SegmentationParameter::NoUnit, true); SegmentationParameter::NoUnit, true);
for (int i=0; i<MAX_LAYERS; i++) { for (int i=0; i<MAX_LAYERS; i++) {
_nCellsX[i]=0; _nCellsX[i]=0;
_nCellsY[i]=0; _nCellsY[i]=0;
} }
} }
/// destructor
MegatileLayerGridXY::~MegatileLayerGridXY() {
}
/// determine the position based on the cell ID /// determine the position based on the cell ID
Vector3D MegatileLayerGridXY::position(const CellID& cID) const { Vector3D MegatileLayerGridXY::position(const CellID& cID) const {
...@@ -65,9 +74,9 @@ namespace DD4hep { ...@@ -65,9 +74,9 @@ namespace DD4hep {
cellPosition.Y = cellIndexY * (_currentSegInfo.megaTileSizeY / _currentSegInfo.nCellsY ) + _currentSegInfo.megaTileOffsetY; cellPosition.Y = cellIndexY * (_currentSegInfo.megaTileSizeY / _currentSegInfo.nCellsY ) + _currentSegInfo.megaTileOffsetY;
if ( abs( cellPosition.X )>10000 || abs( cellPosition.Y )>10000 ) { if ( abs( cellPosition.X )>10000 || abs( cellPosition.Y )>10000 ) {
std::cout << "crazy cell position: " << cellPosition.X << " " << cellPosition.Y << std::endl; std::cout << "crazy cell position: " << cellPosition.X << " " << cellPosition.Y << std::endl;
std::cout << "layer, wafer, cellx,y indices: " << layerIndex << " " << waferIndex << " " << cellIndexX << " " << cellIndexY << std::endl; std::cout << "layer, wafer, cellx,y indices: " << layerIndex << " " << waferIndex << " " << cellIndexX << " " << cellIndexY << std::endl;
assert(0 && "crazy cell position?"); assert(0 && "crazy cell position?");
} }
return cellPosition; return cellPosition;
...@@ -111,10 +120,10 @@ namespace DD4hep { ...@@ -111,10 +120,10 @@ namespace DD4hep {
return cellDimensions(layerIndex, waferIndex); return cellDimensions(layerIndex, waferIndex);
} }
void MegatileLayerGridXY::setSpecialMegaTile( unsigned int layer, unsigned int tile, void MegatileLayerGridXY::setSpecialMegaTile( unsigned int layer, unsigned int tile,
double sizex, double sizey, double sizex, double sizey,
double offsetx, double offsety, double offsetx, double offsety,
unsigned int ncellsx, unsigned int ncellsy ) { unsigned int ncellsx, unsigned int ncellsy ) {
std::pair <int, int> tileid(layer, tile); std::pair <int, int> tileid(layer, tile);
segInfo sinf; segInfo sinf;
...@@ -134,15 +143,15 @@ namespace DD4hep { ...@@ -134,15 +143,15 @@ namespace DD4hep {
std::pair < unsigned int, unsigned int > tileid(layerIndex, waferIndex); std::pair < unsigned int, unsigned int > tileid(layerIndex, waferIndex);
if ( specialMegaTiles_layerWafer.find( tileid ) == specialMegaTiles_layerWafer.end() ) { // standard megatile if ( specialMegaTiles_layerWafer.find( tileid ) == specialMegaTiles_layerWafer.end() ) { // standard megatile
_currentSegInfo.megaTileSizeX = _megaTileSizeX; _currentSegInfo.megaTileSizeX = _megaTileSizeX;
_currentSegInfo.megaTileSizeY = _megaTileSizeY; _currentSegInfo.megaTileSizeY = _megaTileSizeY;
_currentSegInfo.megaTileOffsetX = _megaTileOffsetX; _currentSegInfo.megaTileOffsetX = _megaTileOffsetX;
_currentSegInfo.megaTileOffsetY = _megaTileOffsetY; _currentSegInfo.megaTileOffsetY = _megaTileOffsetY;
_currentSegInfo.nCellsX = _nCellsX[layerIndex]; _currentSegInfo.nCellsX = _nCellsX[layerIndex];
_currentSegInfo.nCellsY = _nCellsY[layerIndex]; _currentSegInfo.nCellsY = _nCellsY[layerIndex];
} else { // special megatile } else { // special megatile
_currentSegInfo = specialMegaTiles_layerWafer.find( tileid )->second; _currentSegInfo = specialMegaTiles_layerWafer.find( tileid )->second;
} }
} }
std::vector<double> MegatileLayerGridXY::cellDimensions(const unsigned int layerIndex, const unsigned int waferIndex) const { std::vector<double> MegatileLayerGridXY::cellDimensions(const unsigned int layerIndex, const unsigned int waferIndex) const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment