diff --git a/DDCore/include/DD4hep/Segmentations.h b/DDCore/include/DD4hep/Segmentations.h index 6b3df77fc5247d9e5071d58120fc20da64455d78..ad109e14e342aeae45143912e6acfcb24514741f 100644 --- a/DDCore/include/DD4hep/Segmentations.h +++ b/DDCore/include/DD4hep/Segmentations.h @@ -14,10 +14,10 @@ #define DD4HEP_SEGMENTATIONS_H // Framework include files -#include "DD4hep/Handle.h" -#include "DD4hep/Objects.h" -#include "DD4hep/BitFieldCoder.h" -#include "DDSegmentation/Segmentation.h" +#include <DD4hep/Handle.h> +#include <DD4hep/Objects.h> +#include <DD4hep/BitFieldCoder.h> +#include <DDSegmentation/Segmentation.h> /// Namespace for the AIDA detector description toolkit namespace dd4hep { @@ -79,9 +79,9 @@ namespace dd4hep { /// Set the underlying decoder void setDecoder(const BitFieldCoder* decoder) const; /// determine the local position based on the cell ID - Position position(const long64& cellID) const; + Position position(const CellID& cellID) const; /// determine the cell ID based on the local position - long64 cellID(const Position& localPosition, const Position& globalPosition, const long64& volumeID) const; + CellID cellID(const Position& localPosition, const Position& globalPosition, const VolumeID& volumeID) const; /// Determine the volume ID from the full cell ID by removing all local fields VolumeID volumeID(const CellID& cellID) const; /// Calculates the neighbours of the given cell ID and adds them to the list of neighbours diff --git a/DDCore/include/DDSegmentation/BitField64.h b/DDCore/include/DDSegmentation/BitField64.h index 1697404a6e43d6292cb3de463ef06b8b89c9300d..4b2895a549c8b6cf67e2f0deecbefd8357c36ff5 100644 --- a/DDCore/include/DDSegmentation/BitField64.h +++ b/DDCore/include/DDSegmentation/BitField64.h @@ -24,9 +24,6 @@ /// Namespace for the AIDA detector description toolkit namespace dd4hep { - typedef long long int long64 ; - typedef unsigned long long ulong64 ; - /// DDSegmentation namespace declaration namespace DDSegmentation { @@ -38,7 +35,7 @@ namespace dd4hep { */ class BitFieldValue{ - long64& _value ; + CellID& _value ; const BitFieldElement& _bv ; public : @@ -46,18 +43,18 @@ namespace dd4hep { BitFieldValue() = delete ; /// only c'tor with reference to bitfield and BitFieldElement - BitFieldValue( long64& bitfield, const BitFieldElement& bv ) : + BitFieldValue( CellID& bitfield, const BitFieldElement& bv ) : _value( bitfield ), _bv( bv) {} /** Returns the current field value */ - long64 value() const { return _bv.value( _value ) ; } + FieldID value() const { return _bv.value( _value ) ; } /// Calculate Field value given an external 64 bit bitmap value - long64 value(long64 id) const { return _bv.value( id ) ; } + FieldID value(CellID id) const { return _bv.value( id ) ; } //// Assignment operator for user convenience - BitFieldValue& operator=(long64 in) { + BitFieldValue& operator=(FieldID in) { _bv.set( _value, in ) ; return *this ; } @@ -65,7 +62,7 @@ namespace dd4hep { /** Conversion operator for long64 - allows to write:<br> * long64 index = myBitFieldValue ; */ - operator long64() const { return value() ; } + operator FieldID() const { return value() ; } /** The field's name */ const std::string& name() const { return _bv.name() ; } @@ -74,13 +71,13 @@ namespace dd4hep { unsigned offset() const { return _bv.offset() ; } /** The field's width */ - unsigned width() const { return _bv.width() ; } + unsigned width() const { return _bv.width() ; } /** True if field is interpreted as signed */ - bool isSigned() const { return _bv.isSigned() ; } + bool isSigned() const { return _bv.isSigned() ; } /** The field's mask */ - ulong64 mask() const { return _bv.mask() ; } + CellID mask() const { return _bv.mask() ; } /** Minimal value */ int minValue() const { return _bv.minValue(); } @@ -119,8 +116,8 @@ namespace dd4hep { virtual ~BitField64() { if( _owner) delete _coder ; - } ; - + }; + /** No default c'tor */ BitField64() = delete ; @@ -139,7 +136,6 @@ namespace dd4hep { * Example: "layer:7,system:-3,barrel:3,theta:32:11,phi:11" */ BitField64( const std::string& initString ){ - _coder = new BitFieldCoder( initString ) ; } @@ -150,11 +146,11 @@ namespace dd4hep { /** Returns the current 64bit value */ - long64 getValue() const { return _value ; } + CellID getValue() const { return _value ; } /** Set a new 64bit value - bits not used in description are set to 0. */ - void setValue(long64 value ) { _value = ( _coder->mask() & value ) ; } + void setValue(CellID value ) { _value = ( _coder->mask() & value ) ; } /** Set a new 64bit value given as high and low 32bit words. */ @@ -163,7 +159,7 @@ namespace dd4hep { } /** Operator for setting a new value and accessing the BitField directly */ - BitField64& operator()(long64 val) { setValue( val ) ; return *this ; } + BitField64& operator()(CellID val) { setValue( val ) ; return *this ; } /** Reset - same as setValue(0) - useful if the same encoder is used for many objects. */ @@ -196,7 +192,6 @@ namespace dd4hep { /** Access to field through name . */ BitFieldValue operator[](const std::string& name) { - return BitFieldValue( _value, _coder->operator[]( name ) ) ; } // /** Const Access to field through name . @@ -231,8 +226,8 @@ namespace dd4hep { protected: // -------------- data members:-------------- - bool _owner{true} ; - long64 _value{} ; + bool _owner{true} ; + CellID _value{} ; const BitFieldCoder* _coder{} ; }; diff --git a/DDCore/include/DDSegmentation/BitFieldCoder.h b/DDCore/include/DDSegmentation/BitFieldCoder.h index 8e6c6dc821e1bc89ffc4c7915f7608825efcaedb..c774b4d2cbdc1a0d0522e72b120da88160c5af9b 100644 --- a/DDCore/include/DDSegmentation/BitFieldCoder.h +++ b/DDCore/include/DDSegmentation/BitFieldCoder.h @@ -12,27 +12,26 @@ #ifndef DDSEGMENTATION_BITFIELDCODER_H #define DDSEGMENTATION_BITFIELDCODER_H 1 - +#include <map> #include <string> #include <vector> -#include <map> #include <sstream> - +#include <cstdint> namespace dd4hep { - typedef long long int long64 ; - typedef unsigned long long ulong64 ; - namespace DDSegmentation { + typedef int64_t FieldID; + typedef uint64_t CellID; + typedef uint64_t VolumeID; + class StringTokenizer ; /// Helper class for BitFieldCoder that corresponds to one field value. - class BitFieldElement{ + class BitFieldElement { public : - /// Default constructor BitFieldElement() = default ; /// Copy constructor @@ -53,12 +52,10 @@ namespace dd4hep { BitFieldElement& operator=(const BitFieldElement&) = default ; /// calculate this field's value given an external 64 bit bitmap - long64 value(long64 bitfield) const; - + FieldID value(CellID bitfield) const; // assign the given value to the bit field - void set(long64& bitfield, long64 value) const ; - + void set(CellID& bitfield, FieldID value) const ; /** The field's name */ const std::string& name() const { return _name ; } @@ -67,13 +64,13 @@ namespace dd4hep { unsigned offset() const { return _offset ; } /** The field's width */ - unsigned width() const { return _width ; } + unsigned width() const { return _width ; } /** True if field is interpreted as signed */ - bool isSigned() const { return _isSigned ; } + bool isSigned() const { return _isSigned ; } /** The field's mask */ - ulong64 mask() const { return _mask ; } + CellID mask() const { return _mask ; } /** Minimal value */ int minValue() const { return _minVal; } @@ -83,14 +80,13 @@ namespace dd4hep { protected: - ulong64 _mask {}; + CellID _mask {}; unsigned _offset {}; unsigned _width {}; int _minVal {}; int _maxVal {}; bool _isSigned {}; std::string _name; - }; @@ -116,11 +112,10 @@ namespace dd4hep { * @date 2017-09 */ class BitFieldCoder{ - public : - typedef std::map<std::string, unsigned int> IndexMap ; + public : /// Default constructor BitFieldCoder() = default ; /// Copy constructor @@ -148,57 +143,50 @@ namespace dd4hep { * Example: "layer:7,system:-3,barrel:3,theta:32:11,phi:11" */ BitFieldCoder( const std::string& initString ) : _joined(0){ - init( initString ) ; } /** return a new 64bit value given as high and low 32bit words. */ - static long64 toLong(unsigned low_Word, unsigned high_Word ) { + static CellID toLong(unsigned low_Word, unsigned high_Word ) { return ( ( low_Word & 0xffffffffULL ) | ( ( high_Word & 0xffffffffULL ) << 32 ) ) ; } /** The low word, bits 0-31 */ - static unsigned lowWord(long64 bitfield) { return unsigned( bitfield & 0xffffFFFFUL ) ; } + static unsigned lowWord(CellID bitfield) { return unsigned( bitfield & 0xffffFFFFUL ); } /** The high word, bits 32-63 */ - static unsigned highWord(long64 bitfield) { return unsigned( bitfield >> 32) ; } - + static unsigned highWord(CellID bitfield) { return unsigned( bitfield >> 32); } /** get value of sub-field specified by index */ - long64 get(long64 bitfield, size_t idx) const { + FieldID get(CellID bitfield, size_t idx) const { return _fields.at(idx).value( bitfield ) ; } /** Access to field through name . */ - long64 get(long64 bitfield, const std::string& name) const { - + FieldID get(CellID bitfield, const std::string& name) const { return _fields.at( index( name ) ).value( bitfield ) ; } /** set value of sub-field specified by index */ - void set(long64& bitfield, size_t idx, ulong64 value) const { + void set(CellID& bitfield, size_t idx, FieldID value) const { _fields.at(idx).set( bitfield , value ) ; } /** Access to field through name . */ - void set(long64& bitfield, const std::string& name, ulong64 value) const { - + void set(CellID& bitfield, const std::string& name, FieldID value) const { _fields.at( index( name ) ).set( bitfield, value ) ; } - - /** Highest bit used in fields [0-63] */ unsigned highestBit() const ; - /** Number of values */ size_t size() const { return _fields.size() ; } @@ -207,18 +195,15 @@ namespace dd4hep { */ size_t index( const std::string& name) const ; - /** Const Access to field through name . */ const BitFieldElement& operator[](const std::string& name) const { - return _fields[ index( name ) ] ; } /** Const Access to field through index . */ const BitFieldElement& operator[](unsigned idx) const { - return _fields[ idx ] ; } @@ -228,15 +213,14 @@ namespace dd4hep { /** Return a string with a comma separated list of the current sub field values */ - std::string valueString(ulong64 bitfield) const ; + std::string valueString(CellID bitfield) const ; const std::vector<BitFieldElement>& fields() const { return _fields; } - /** the mask of all the bits used in the description */ - ulong64 mask() const { return _joined ; } + CellID mask() const { return _joined ; } protected: @@ -249,16 +233,11 @@ namespace dd4hep { */ void init( const std::string& initString) ; - public: - protected: - // -------------- data members:-------------- - std::vector<BitFieldElement> _fields{} ; IndexMap _map{} ; - long64 _joined{} ; - + CellID _joined{} ; }; @@ -272,7 +251,6 @@ namespace dd4hep { * @date 2013-06 */ class StringTokenizer{ - std::vector< std::string >& _tokens ; char _del ; char _last ; @@ -288,9 +266,7 @@ namespace dd4hep { /** Operator for use with algorithms, e.g. for_each */ void operator()(const char& c) { - if( c != _del ) { - if( _last == _del ) { _tokens.emplace_back("") ; } @@ -298,13 +274,10 @@ namespace dd4hep { } _last = c ; } - }; } // end namespace - } // end namespace - #endif diff --git a/DDCore/include/DDSegmentation/Segmentation.h b/DDCore/include/DDSegmentation/Segmentation.h index 0c59d1fe1423e38d978a8819ad0a8d642fed976d..2a6c268495969d18f2914660d8af1df0dd4f4761 100644 --- a/DDCore/include/DDSegmentation/Segmentation.h +++ b/DDCore/include/DDSegmentation/Segmentation.h @@ -44,10 +44,6 @@ namespace dd4hep { typedef TypedSegmentationParameter<std::vector<std::string> >* StringVecParameter; typedef SegmentationParameter::UnitType UnitType; - /// Useful typedefs to differentiate cell IDs and volume IDs - typedef long long int CellID; - typedef long long int VolumeID; - /// Simple container for a physics vector struct Vector3D { /// Default constructor @@ -149,12 +145,12 @@ namespace dd4hep { const std::string& defaultVal); /// Helper method to convert a bin number to a 1D position - static double binToPosition(CellID bin, double cellSize, double offset = 0.); + static double binToPosition(FieldID bin, double cellSize, double offset = 0.); /// Helper method to convert a 1D position to a cell ID static int positionToBin(double position, double cellSize, double offset = 0.); /// Helper method to convert a bin number to a 1D position given a vector of binBoundaries - static double binToPosition(CellID bin, std::vector<double> const& cellBoundaries, double offset = 0.); + static double binToPosition(FieldID bin, std::vector<double> const& cellBoundaries, double offset = 0.); /// Helper method to convert a 1D position to a cell ID given a vector of binBoundaries static int positionToBin(double position, std::vector<double> const& cellBoundaries, double offset = 0.); diff --git a/DDCore/include/Parsers/Primitives.h b/DDCore/include/Parsers/Primitives.h index 4b598dd11061468801a3dd0140278c8c2b3b531a..2d4ed0afdba9a9f2dd319e61bc0d37918a640dbb 100644 --- a/DDCore/include/Parsers/Primitives.h +++ b/DDCore/include/Parsers/Primitives.h @@ -41,8 +41,9 @@ namespace dd4hep { class BitFieldCoder; class BitFieldElement; /// Useful typedefs to differentiate cell IDs and volume IDs - typedef long long int CellID; - typedef long long int VolumeID; + typedef uint64_t CellID; + typedef uint64_t VolumeID; + typedef int64_t FieldID; } @@ -54,6 +55,7 @@ namespace dd4hep { typedef DDSegmentation::BitFieldElement BitFieldElement; #else using DDSegmentation::CellID; + using DDSegmentation::FieldID; using DDSegmentation::VolumeID; using DDSegmentation::BitFieldCoder; using DDSegmentation::BitFieldElement; diff --git a/DDCore/src/Primitives.cpp b/DDCore/src/Primitives.cpp index 9b794f3f24e397d89b9711729b878f0649421199..0e892bf91a8610a670d80ae6b4750e0baaaf69c8 100644 --- a/DDCore/src/Primitives.cpp +++ b/DDCore/src/Primitives.cpp @@ -173,7 +173,7 @@ namespace { /// Convert volumeID to string format (016X) std::string dd4hep::volumeID(VolumeID vid) { char text[32]; - ::snprintf(text,sizeof(text),"%016llx",vid); + ::snprintf(text,sizeof(text),"%016lx", vid); return text; } diff --git a/DDCore/src/Segmentations.cpp b/DDCore/src/Segmentations.cpp index b21ea68ca982de57e5ccb523cc6599d477796360..bf4f6def6bc1b4ec28f4ee0969679912970dad24 100644 --- a/DDCore/src/Segmentations.cpp +++ b/DDCore/src/Segmentations.cpp @@ -68,12 +68,12 @@ DDSegmentation::Parameter Segmentation::parameter(const std::string& parameterN } /// determine the local position based on the cell ID -Position Segmentation::position(const long64& cell) const { +Position Segmentation::position(const CellID& cell) const { return Position(access()->segmentation->position(cell)); } /// determine the cell ID based on the local position -long64 Segmentation::cellID(const Position& localPosition, const Position& globalPosition, const long64& volID) const { +CellID Segmentation::cellID(const Position& localPosition, const Position& globalPosition, const CellID & volID) const { return access()->segmentation->cellID(localPosition, globalPosition, volID); } diff --git a/DDCore/src/segmentations/BitFieldCoder.cpp b/DDCore/src/segmentations/BitFieldCoder.cpp index d00800e650e0936056dc9105c079a9a2604e1457..1c3fbed771f2eb5e47c5e882ff7efe1f1dc88816 100644 --- a/DDCore/src/segmentations/BitFieldCoder.cpp +++ b/DDCore/src/segmentations/BitFieldCoder.cpp @@ -42,9 +42,9 @@ namespace dd4hep{ } } - long64 BitFieldElement::value(long64 id) const { + FieldID BitFieldElement::value(CellID id) const { if( _isSigned ) { - long64 val = ( id & _mask ) >> _offset ; + FieldID val = ( id & _mask ) >> _offset ; if( ( val & ( 1LL << ( _width - 1 ) ) ) != 0 ) { // negative value val -= ( 1LL << _width ); } @@ -54,7 +54,7 @@ namespace dd4hep{ } } - void BitFieldElement::set(long64& field, long64 in) const { + void BitFieldElement::set(CellID& field, FieldID in) const { // check range if( in < _minVal || in > _maxVal ) { @@ -96,7 +96,7 @@ namespace dd4hep{ } - std::string BitFieldCoder::valueString(ulong64 bitfield) const { + std::string BitFieldCoder::valueString(CellID bitfield) const { std::stringstream os ; diff --git a/DDCore/src/segmentations/Segmentation.cpp b/DDCore/src/segmentations/Segmentation.cpp index 83ccd74ebb2ee2b75baa4f334177dff29fc2ef32..d6906747041c752ab94c303b5580f8069b8e499c 100644 --- a/DDCore/src/segmentations/Segmentation.cpp +++ b/DDCore/src/segmentations/Segmentation.cpp @@ -132,7 +132,7 @@ namespace dd4hep { } /// Helper method to convert a bin number to a 1D position - double Segmentation::binToPosition(long64 bin, double cellSize, double offset) { + double Segmentation::binToPosition(FieldID bin, double cellSize, double offset) { return bin * cellSize + offset; } @@ -145,7 +145,7 @@ namespace dd4hep { } /// Helper method to convert a bin number to a 1D position given a vector of binBoundaries - double Segmentation::binToPosition(CellID bin, std::vector<double> const& cellBoundaries, double offset) { + double Segmentation::binToPosition(FieldID bin, std::vector<double> const& cellBoundaries, double offset) { return (cellBoundaries[bin+1] + cellBoundaries[bin])*0.5 + offset; } /// Helper method to convert a 1D position to a cell ID given a vector of binBoundaries diff --git a/DDDetectors/src/Beampipe_o1_v01_geo.cpp b/DDDetectors/src/Beampipe_o1_v01_geo.cpp index 2641bb7974ba13b895499cca557469f2f5b5e103..3c91b822a9b55335d2be9900b3b01eeb6aadb732 100644 --- a/DDDetectors/src/Beampipe_o1_v01_geo.cpp +++ b/DDDetectors/src/Beampipe_o1_v01_geo.cpp @@ -54,7 +54,7 @@ public: void setHalfLength( double half_length){ _half_length = half_length ; } - void setID( dd4hep::long64 id ) { _id = id ; + void setID( dd4hep::FieldID id ) { _id = id ; } // overwrite to include points inside the inner radius of the barrel bool insideBounds(const Vector3D& point, double epsilon) const { diff --git a/DDDetectors/src/CaloFaceBarrel_surfaces.cpp b/DDDetectors/src/CaloFaceBarrel_surfaces.cpp index 5d4ebc9fba37caa3c49775913853c87940fd0c95..61431fd5c1808e99496c9e4fda3afef0f0baa7a2 100644 --- a/DDDetectors/src/CaloFaceBarrel_surfaces.cpp +++ b/DDDetectors/src/CaloFaceBarrel_surfaces.cpp @@ -55,7 +55,7 @@ namespace{ _width = width ; } - void setID( dd4hep::long64 id_val ) { _id = id_val ; } + void setID( dd4hep::CellID id_val ) { _id = id_val ; } // overwrite to include points inside the inner radius of the barrel bool insideBounds(const dd4hep::rec::Vector3D& point, double epsilon) const { diff --git a/DDDetectors/src/CaloFaceEndcap_surfaces.cpp b/DDDetectors/src/CaloFaceEndcap_surfaces.cpp index e08eb56652317fd4966043b9db247e484e42cd53..b70ce5d12c4f3b56ea87d190cc8a68f27f2599aa 100644 --- a/DDDetectors/src/CaloFaceEndcap_surfaces.cpp +++ b/DDDetectors/src/CaloFaceEndcap_surfaces.cpp @@ -55,7 +55,7 @@ namespace{ _phi0 = phi0 ; _sym = symmetry ; } - void setID( dd4hep::long64 id_val ) { _id = id_val; } + void setID( dd4hep::CellID id_val ) { _id = id_val; } // overwrite to include points inside the inner radius of the endcap bool insideBounds(const dd4hep::rec::Vector3D& point, double epsilon) const { diff --git a/DDDigi/include/DDDigi/DigiSegmentSplitter.h b/DDDigi/include/DDDigi/DigiSegmentSplitter.h index a433e060351db480a2c5922a69c756ba861d4b93..25f32eb109cac1b60c46187f9af58473211cd735 100644 --- a/DDDigi/include/DDDigi/DigiSegmentSplitter.h +++ b/DDDigi/include/DDDigi/DigiSegmentSplitter.h @@ -60,12 +60,12 @@ namespace dd4hep { /// Full identifier (field + id) std::string identifier() const; /// Check a given cell id if it matches this selection - bool matches(uint64_t cell) const { - return this->split_id(cell) == this->predicate.id; - } + //bool matches(uint64_t cell) const { + // return this->split_id(cell) == this->predicate.id; + //} /// Check a given cell id if it matches this selection bool matches(CellID cell) const { - return this->split_id(cell) == this->predicate.id; + return this->split_id(cell) == this->predicate.id; } /// Check if a deposit should be processed diff --git a/DDG4/src/Geant4ReadoutVolumeFilter.cpp b/DDG4/src/Geant4ReadoutVolumeFilter.cpp index 856df933f7e024d679b3832e0e9ab2a748722e96..8e36c7d725f604ce5e6e28328cd873f5c5a42b2b 100644 --- a/DDG4/src/Geant4ReadoutVolumeFilter.cpp +++ b/DDG4/src/Geant4ReadoutVolumeFilter.cpp @@ -53,7 +53,7 @@ bool Geant4ReadoutVolumeFilter::operator()(const G4Step* step) const { Geant4StepHandler stepH(step); Geant4VolumeManager volMgr = Geant4Mapping::instance().volumeManager(); VolumeID id = volMgr.volumeID(stepH.preTouchable()); - long64 key = m_key->value(id); + FieldID key = m_key->value(id); if ( m_collection->key_min <= key && m_collection->key_max >= key ) return true; return false; @@ -64,7 +64,7 @@ bool Geant4ReadoutVolumeFilter::operator()(const Geant4FastSimSpot* spot) const Geant4FastSimHandler spotH(spot); Geant4VolumeManager volMgr = Geant4Mapping::instance().volumeManager(); VolumeID id = volMgr.volumeID(spotH.touchable()); - long64 key = m_key->value(id); + FieldID key = m_key->value(id); if ( m_collection->key_min <= key && m_collection->key_max >= key ) return true; return false; diff --git a/DDRec/include/DDRec/DetectorData.h b/DDRec/include/DDRec/DetectorData.h index dcf1162d4f89d0cab94008382ed73e480ca1d8d3..eb54b752a4e379d5211cd8a1d0a91b406281a0fd 100644 --- a/DDRec/include/DDRec/DetectorData.h +++ b/DDRec/include/DDRec/DetectorData.h @@ -486,13 +486,13 @@ namespace dd4hep { struct NeighbourSurfacesStruct { /// map of all neighbours in the same layer - std::map<dd4hep::long64 , std::vector<dd4hep::long64 > > sameLayer ; + std::map<dd4hep::CellID , std::vector<dd4hep::CellID > > sameLayer ; /// map of all neighbours in the previous layer - std::map<dd4hep::long64 , std::vector<dd4hep::long64 > > prevLayer ; + std::map<dd4hep::CellID , std::vector<dd4hep::CellID > > prevLayer ; /// map of all neighbours in the next layer - std::map<dd4hep::long64 , std::vector<dd4hep::long64 > > nextLayer ; + std::map<dd4hep::CellID , std::vector<dd4hep::CellID > > nextLayer ; } ; typedef StructExtension<NeighbourSurfacesStruct> NeighbourSurfacesData ; diff --git a/DDTest/src/test_bitfield64.cc b/DDTest/src/test_bitfield64.cc index 2159fdffc38b5fd81e4122aed8ca348f492c443e..ef98e427d90b626a05c70692ec91a02382eb21db 100644 --- a/DDTest/src/test_bitfield64.cc +++ b/DDTest/src/test_bitfield64.cc @@ -26,7 +26,7 @@ int main(int /* argc */, char** /* argv */ ){ BitField64 bf3( bf.fieldDescription() ) ; - test( bf.getValue() , long64(0x0) , " initialized with 0 " ); + test( bf.getValue() , CellID(0x0) , " initialized with 0 " ); // std::cout << " bf value : " << bf << std::endl ; @@ -34,10 +34,10 @@ int main(int /* argc */, char** /* argv */ ){ // std::cout << " bf value : " << bf << std::endl ; - test( bf.getValue() , long64( 0xbebafecacafebabeULL ) , + test( bf.getValue() , 0xbebafecacafebabeULL, " initialized with 0xbebafecacafebabeUL - compare as signed " ); - test( (ulong64) bf.getValue() , 0xbebafecacafebabeULL , + test( bf.getValue() , 0xbebafecacafebabeULL , " initialized with 0xbebafecacafebabeUL - compare as unsigned " ); diff --git a/DDTest/src/test_bitfieldcoder.cc b/DDTest/src/test_bitfieldcoder.cc index 98dd025cb3478cb5140d586c6f907f1ea840a5b7..e1233e751be5f07ecddf532372516d2c26060805 100644 --- a/DDTest/src/test_bitfieldcoder.cc +++ b/DDTest/src/test_bitfieldcoder.cc @@ -26,7 +26,7 @@ int main(int /* argc */, char** /* argv */ ){ const BitFieldCoder bf("system:5,side:-2,layer:9,module:8,sensor:8,x:32:-16,y:-16" ) ; // set some 'random' values to bf2 - long64 field = 0 ; + CellID field = 0 ; bf.set( field, "layer", 373 ); bf.set( field, "module", 254 ); @@ -37,7 +37,7 @@ int main(int /* argc */, char** /* argv */ ){ bf.set( field, "y", -16710 ); - test( field , long64(0xbebafecacafebabeUL) , " same value 0xbebafecacafebabeUL from individual initialization " ); + test( field , CellID(0xbebafecacafebabeUL) , " same value 0xbebafecacafebabeUL from individual initialization " ); // make a copy for testing the access diff --git a/UtilityApps/src/test_cellid_position_converter.cpp b/UtilityApps/src/test_cellid_position_converter.cpp index 7f8e90dd9df76da7f1082d8711a10ad42d722f46..76a223024b47bbecbc426b285ee02b888cb1df44 100644 --- a/UtilityApps/src/test_cellid_position_converter.cpp +++ b/UtilityApps/src/test_cellid_position_converter.cpp @@ -134,10 +134,10 @@ int main_wrapper(int argc, char** argv ){ SimCalorimeterHit* sHit = (SimCalorimeterHit*) col->getElementAt(i) ; - dd4hep::long64 id0 = sHit->getCellID0() ; - dd4hep::long64 id1 = sHit->getCellID1() ; + dd4hep::CellID id0 = sHit->getCellID0() ; + dd4hep::CellID id1 = sHit->getCellID1() ; - dd4hep::long64 id = idDecoder0.toLong( id0 , id1 ) ; + dd4hep::CellID id = idDecoder0.toLong( id0 , id1 ) ; Position point( sHit->getPosition()[0]* dd4hep::mm , sHit->getPosition()[1]* dd4hep::mm , sHit->getPosition()[2]* dd4hep::mm ) ; diff --git a/UtilityApps/src/test_surfaces.cpp b/UtilityApps/src/test_surfaces.cpp index d4e55e21b7ccf8b783c8e4a132d9aebd3ee3b1e7..1e7515a54bf84b02be4f667162d63536a1b6f2a3 100644 --- a/UtilityApps/src/test_surfaces.cpp +++ b/UtilityApps/src/test_surfaces.cpp @@ -120,7 +120,7 @@ int main_wrapper(int argc, char** argv ){ EVENT::SimTrackerHit* sHit = (EVENT::SimTrackerHit*) col->getElementAt(i) ; - dd4hep::long64 id = sHit->getCellID0() ; + dd4hep::FieldID id = sHit->getCellID0() ; idDecoder.setValue( id ) ; // std::cout << " simhit with cellid : " << idDecoder << std::endl ; diff --git a/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp b/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp index 8afc22bb4328e4caf1bb7ca9815564fe2abaf051..a8dbb5ed7aa3cdee10df4fe5fec4941a4b7e546f 100644 --- a/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp +++ b/examples/LHeD/src/Lhe_BeamPipe_Central_geo.cpp @@ -49,7 +49,7 @@ public: void setHalfLength( double half_length){ _half_length = half_length ; } - void setID( dd4hep::long64 id ) { _id = id ; + void setID( dd4hep::CellID id ) { _id = id ; } // overwrite to include points inside the inner radius of the barrel bool insideBounds(const rec::Vector3D& point, double epsilon) const { diff --git a/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp b/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp index 5d4ebc9fba37caa3c49775913853c87940fd0c95..61431fd5c1808e99496c9e4fda3afef0f0baa7a2 100644 --- a/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp +++ b/examples/LHeD/src/Lhe_CaloFaceBarrel_surfaces.cpp @@ -55,7 +55,7 @@ namespace{ _width = width ; } - void setID( dd4hep::long64 id_val ) { _id = id_val ; } + void setID( dd4hep::CellID id_val ) { _id = id_val ; } // overwrite to include points inside the inner radius of the barrel bool insideBounds(const dd4hep::rec::Vector3D& point, double epsilon) const { diff --git a/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp b/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp index e08eb56652317fd4966043b9db247e484e42cd53..b70ce5d12c4f3b56ea87d190cc8a68f27f2599aa 100644 --- a/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp +++ b/examples/LHeD/src/Lhe_CaloFaceEndcap_surfaces.cpp @@ -55,7 +55,7 @@ namespace{ _phi0 = phi0 ; _sym = symmetry ; } - void setID( dd4hep::long64 id_val ) { _id = id_val; } + void setID( dd4hep::CellID id_val ) { _id = id_val; } // overwrite to include points inside the inner radius of the endcap bool insideBounds(const dd4hep::rec::Vector3D& point, double epsilon) const {