00001
00002
00004
00005 #include "TdVetoData.h"
00006 #include "instrument/Scintillator.h"
00007
00008
00009 using namespace std;
00010 #include <iomanip>
00011
00012 TdVetoData::TdVetoData ()
00013 {
00014 }
00015
00016
00017 TdVetoData::~TdVetoData ()
00018 {
00019 clear();
00020 }
00021
00022 void TdVetoData::printOn (ostream& cout) const
00023 {
00024 cout << "\nTdVetoData:\n";
00025 for( const_iterator it = begin(); it != end(); ++it){
00026 const IVetoData::Tile& v = *it;
00027 cout << '\t' << v.type() << '\t' << setprecision(3)
00028 << v.position() << '\t' << v.energy() <<'\n';
00029 }
00030 }
00031
00032 void TdVetoData::load (const Scintillator& tile)
00033 {
00034 float energy = tile.energy();
00035 if( energy >0.0 ) {
00036
00037 CoordTransform T = tile.localToGlobal();
00038 Point p(0,0,0);
00039 p.transform(T);
00040 tileList.push_back(Tile(p, tile.type(), energy) );
00041 }
00042
00043 }
00044
00045
00046 void TdVetoData::clear ()
00047 {
00048 tileList.clear();
00049 }
00050
00051 int TdVetoData::count()const { return tileList.size();}