// // // File: SiL0.cpp // Purpose: Add Layer0 to SMT // Created: 01-FEB-2005 Shaohua Fu // // // Include files #include #include "SiL0.hpp" #include // Global definitions using namespace std; using namespace dgs; bool operator<(const SiL0& lhs, const SiL0&rhs) { return lhs.get_position()[2] < rhs.get_position()[2]; } // Constructors/Destructors SiL0::SiL0(int nb, std::vector barrels_zpos, const SiBarrel* proto_barrel) // // Purpose: Instantiate layer0 detector with nb barrels. // The ideal positions are given in barrel_zpos. // The barrel defined as proto_barrel define the barrels. // If the pointer is null, the defaults are used. // { const SiBarrel* use_barrel; if( proto_barrel ) use_barrel=proto_barrel; else use_barrel = new SiBarrel; // Create and position the barrels. for( int i=0 ; i barrels_zpos, const std::vector& barrels): _barrels(barrels) { // Now position the barrels. for( int i=0 ; i<_barrels.size() ; i++ ) { CartesianCoordinate zpos(0.0,0.0,barrels_zpos[i]); position_child_at(zpos,_barrels[i]); } } // Accessors const list SiL0::get_children() // // Purpose: Return the addresses of the barrels in the // layer0 section of the tracker // { list kids; for( int i=0 ; i<_barrels.size() ; i++ ) kids.push_back( &_barrels[i] ); return kids; } std::ostream& operator <<(std::ostream& os, const SiL0& me) // // Purpose: Dump a layer0 tracker // { os << "SiL0 at " << me.get_position() << " has " << me.get_barrel_count() << " barrels " << endl; for( int i=0 ; i