lcio/src/cpp/include/UTIL
diff -u -r1.4 -r1.5
--- CellIDEncoder.h 9 Feb 2007 11:37:01 -0000 1.4
+++ CellIDEncoder.h 9 Feb 2007 18:30:45 -0000 1.5
@@ -48,6 +48,21 @@
template<> int CellIDEncoder_cellID1Bit<EVENT::TrackerRawData>() ;
+ /** Helper function that sets cellid1 and cellid2
+ */
+ template <class T>
+ void CellIDEncoder_setCellID(T* hit, int low, int high) {
+
+ hit->setCellID0( low ) ;
+ hit->setCellID1( high ) ;
+ }
+
+ /** Specialization for SimTrackerHits that have only one cellID */
+ template<>
+ void CellIDEncoder_setCellID<IMPL::SimTrackerHitImpl>( IMPL::SimTrackerHitImpl* hit,
+ int low, int high);
+
+
/** Convenient class for encoding cellIDs for various hit objects.
* It sets the proper collection parameter LCIO::CellIDEncoding and
* sets the proper flag bit for storing a second cellid if necessary.
@@ -63,7 +78,7 @@
* } <br>
*
* @see BitField64
- * @version $Id: CellIDEncoder.h,v 1.4 2007/02/09 11:37:01 gaede Exp $
+ * @version $Id: CellIDEncoder.h,v 1.5 2007/02/09 18:30:45 gaede Exp $
*/
template <class T>
class CellIDEncoder : public BitField64 {
@@ -83,12 +98,9 @@
setCellIDFlag() ;
}
- void setCellID( T* hit) {
-
- hit->setCellID0( lowWord() ) ;
-
- hit->setCellID1( highWord() ) ;
+ inline void setCellID( T* hit) {
+ CellIDEncoder_setCellID( hit , lowWord() , highWord() ) ;
}
/** Helper method that sets/unsets the proper bit for storing a second cellid word
@@ -126,12 +138,6 @@
- /** Specialization for SimTrackerHits that have only one cellID */
- template<> void CellIDEncoder<IMPL::SimTrackerHitImpl>::setCellID( IMPL::SimTrackerHitImpl* hit) {
- hit->setCellID( lowWord() ) ;
- }
-
-
} // namespace
#endif
lcio/src/cpp/src/UTIL
diff -u -r1.1 -r1.2
--- CellIDEncoder.cc 9 Feb 2007 11:37:01 -0000 1.1
+++ CellIDEncoder.cc 9 Feb 2007 18:30:45 -0000 1.2
@@ -25,4 +25,13 @@
/** specialization that returns the proper bit for the second cellid */
template<> int CellIDEncoder_cellID1Bit<EVENT::TrackerRawData>() { return LCIO::TRAWBIT_ID1 ; }
+ /** Specialization for SimTrackerHits that have only one cellID */
+ // template<> void CellIDEncoder<IMPL::SimTrackerHitImpl>::setCellID( IMPL::SimTrackerHitImpl* hit) {
+ template<>
+ void CellIDEncoder_setCellID<IMPL::SimTrackerHitImpl>( IMPL::SimTrackerHitImpl* hit,
+ int low, int high){
+ hit->setCellID( low ) ;
+ }
+
+
}