#include #include #include using namespace RAT; using namespace RAT::DU; #include using namespace std; ClassImp( RAT::DU::PanelInfo ) void PanelInfo::BeginOfRun() { DBLinkPtr pmtDB = DB::Get()->GetLink( "PANELINFO" ); fPanels = pmtDB->GetIArray("panel_number"); vector types = pmtDB->GetIArray("panel_type"); vector pmtx = pmtDB->GetDArray("x"); vector pmty = pmtDB->GetDArray("y"); vector pmtz = pmtDB->GetDArray("z"); vector dirx = pmtDB->GetDArray("u"); vector diry = pmtDB->GetDArray("v"); vector dirz = pmtDB->GetDArray("w"); Log::Assert( types.size() == fPanels.size() && types.size() == pmtx.size(), "PanelInfo::BeginOfRun: Miss-sized Panel database arrays." ); fTypes.resize(types.size()); fPositions.resize(types.size()); fDirections.resize(types.size()); for( size_t id = 0; id < types.size(); id++ ) { fTypes[id] = static_cast( types[id] ); fPositions[id] = TVector3( pmtx[id], pmty[id], pmtz[id] ); fDirections[id] = TVector3( dirx[id], diry[id], dirz[id] ).Unit(); } debug << "PanelInfo::BeginOfRun: Loaded " << fTypes.size() << " Panels.\n"; }