/// Standard constructor
Geant4ReadoutVolumeFilter::Geant4ReadoutVolumeFilter(Geant4Context* ctxt, 
                                                     const std::string& nam, 
                                                     Readout ro, 
                                                     const std::string& coll)
  : Geant4Filter(ctxt, nam), m_readout(ro), m_collection(0), m_key(0)
{
  InstanceCount::increment(this);
  for(size_t i=0; i<ro->hits.size(); ++i)  {
    const Collection& c = ro->hits[i];
    if ( c.name == coll )   {
      m_collection = &c;
      m_key = ro.idSpec().field(c.key);
      return;
    }
  }
  except("+++ Custom collection name '%s' not defined in the Readout object: %s.",
         coll.c_str(), ro.name());      
}
示例#2
0
/// Access to the system index
long int IDDecoder::systemIndex(const CellID& cell) const {
	Readout r = this->readout(cell);
	return r.idSpec().field(this->systemIdentifier())->value(cell);
}
示例#3
0
/// Access to the barrel-endcap flag
IDDecoder::BarrelEndcapFlag IDDecoder::barrelEndcapFlag(const CellID& cell) const {
	Readout r = this->readout(cell);
	return BarrelEndcapFlag(r.idSpec().field(this->barrelIdentifier())->value(cell));
}