1 #include "otsdaq-core/MonicelliInterface/MonicelliGeometryConverter.h"
2 #include "otsdaq-core/MonicelliInterface/MonicelliFileReader.h"
3 #include "otsdaq-core/MonicelliInterface/Visual3DGeometry.h"
5 #include "otsdaq-core/MonicelliInterface/Geometry.h"
6 #include "otsdaq-core/MonicelliInterface/Detector.h"
12 MonicelliGeometryConverter::MonicelliGeometryConverter(
void)
16 MonicelliGeometryConverter::~MonicelliGeometryConverter(
void)
20 void MonicelliGeometryConverter::loadGeometry(std::string fileName)
22 theVisual3DGeometry_.reset();
23 if(!theReader_.openGeoFile(fileName))
26 theMonicelliGeometry_ = theReader_.getGeometryPointer() ;
29 theReader_.closeGeoFile();
35 return theVisual3DGeometry_;
39 void MonicelliGeometryConverter::convertGeometry(
void)
41 for(monicelli::Geometry::iterator it=theMonicelliGeometry_->begin(); it!=theMonicelliGeometry_->end(); it++)
48 it->second->fromLocalToGlobal(&tmpPoint.x,&tmpPoint.y,&tmpPoint.z);
49 tmpShape.corners.push_back(tmpPoint*10);
50 tmpPoint.x = it->second->getDetectorLengthX();
53 it->second->fromLocalToGlobal(&tmpPoint.x,&tmpPoint.y,&tmpPoint.z);
54 tmpShape.corners.push_back(tmpPoint*10);
55 tmpPoint.x = it->second->getDetectorLengthX();
56 tmpPoint.y = it->second->getDetectorLengthY();
58 it->second->fromLocalToGlobal(&tmpPoint.x,&tmpPoint.y,&tmpPoint.z);
59 tmpShape.corners.push_back(tmpPoint*10);
61 tmpPoint.y = it->second->getDetectorLengthY();
63 it->second->fromLocalToGlobal(&tmpPoint.x,&tmpPoint.y,&tmpPoint.z);
64 tmpShape.corners.push_back(tmpPoint*10);
65 tmpShape.numberOfRows = it->second->getNumberOfRows();
66 tmpShape.numberOfColumns = it->second->getNumberOfCols();
67 theVisual3DGeometry_.addShape(tmpShape);