lcdd/src
diff -u -r1.13 -r1.14
--- IdFactory.cc 9 May 2005 04:40:54 -0000 1.13
+++ IdFactory.cc 23 Jun 2005 23:43:05 -0000 1.14
@@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/src/IdFactory.cc,v 1.13 2005/05/09 04:40:54 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/IdFactory.cc,v 1.14 2005/06/23 23:43:05 jeremy Exp $
// set for verbose output from this class
-//#define ID_DEBUG 1
+#define ID_DEBUG 1
// G4
#include "G4Step.hh"
@@ -100,7 +100,7 @@
std::cout << "field_label: " << id_field->getLabel() << std::endl;
std::cout << "field_start: " << field_start << std::endl;
std::cout << "field_val: " << dec << field_val << std::endl;
- std::cout << "field_bit_len: " << dec << field_bit_len << std::endl;
+ std::cout << "field_bit_len: " << dec << field_bit_len << std::endl;
#endif
// TJ's suggestion for making a bit mask with len = field_bit_len.
@@ -108,7 +108,7 @@
#ifdef ID_DEBUG
std::cout << "field_mask: " << hex << field_mask << std::endl;
-#endif
+#endif
// apply bit mask and shift to proper left pos
Bits field_val_shifted_masked = ( field_val & field_mask ) << field_start;
@@ -136,7 +136,7 @@
std::cout << std::endl << std::endl;
#endif
- // set the two 32-bit ids in the packed id to return
+ // set the two 32-bit ids in the packed id to return
id64.setId0( id64_val[0] );
id64.setId1( id64_val[1] );
@@ -148,32 +148,32 @@
assert( aStep );
assert( sd );
- IdSpec* idspec = sd->getIdSpec();
+ IdSpec* idspec = sd->getIdSpec();
IdVec ids;
G4Segmentation* seg = 0;
if ( sd->getType() == G4SensitiveDetector::eCalorimeter ) {
seg = (dynamic_cast<const G4CalorimeterSD*> ( sd ) )->getSegmentation();
}
-
+
if ( idspec ) {
for ( IdSpec::IdFields::const_iterator iter = idspec->IdFieldsBegin();
iter != idspec->IdFieldsEnd();
iter++ ) {
-
+
IdField* f = *iter;
-
+
int bin_val = 0;
bool fnd_it = false;
-#ifdef ID_DEBUG
+#ifdef ID_DEBUG
std::cout << "handling field: " << f->getLabel() << std::endl;
#endif
-
+
// look in seg, if exists
if ( seg ) {
int bin_idx = IdFactory::findFieldIdxInSegmentation( seg, f->getLabel() );
-
+
if ( bin_idx != -1 ) {
bin_val = seg->getBin( bin_idx );
fnd_it = true;
@@ -184,19 +184,19 @@
}
#endif
}
-
+
// find in PV ids
if ( !fnd_it ) {
std::vector<G4VPhysicalVolume*> pv_list = IdFactory::getPhysVolList( aStep );
- bin_val = findIdInPhysVols( pv_list, f->getLabel() );
+ bin_val = findIdInPhysVols( pv_list, f->getLabel() );
}
- ids.push_back( bin_val );
+ ids.push_back( bin_val );
#ifdef ID_DEBUG
std::cout << "set bin val: " << bin_val << std::endl << std::endl;
#endif
- }
+ }
}
return ids;
@@ -267,7 +267,7 @@
#ifdef ID_DEBUG
else {
std::cout << "no match on this PV" << std::endl;
- }
+ }
#endif
}
}
@@ -283,7 +283,7 @@
return id;
}
-std::vector<G4VPhysicalVolume*> IdFactory::getPhysVolList( G4Step* aStep )
+std::vector<G4VPhysicalVolume*> IdFactory::getPhysVolList( G4Step* aStep )
{
std::vector<G4VPhysicalVolume*> physVols;
@@ -316,7 +316,7 @@
// list of PV to iterate
std::vector<G4VPhysicalVolume*> physVols = getPhysVolList( aStep );
-
+
// ptr to ID mgr
IdManager* id_mgr = IdManager::instance();
@@ -343,6 +343,6 @@
}
return ids;
- }
-*/
+ }
+*/