Commit 1408a777 authored by Riccardo Longo's avatar Riccardo Longo
Browse files

Merge branch 'master' of ssh://gitlab.cern.ch:7999/rlongo/JCaPA

parents 7fb7c2d4 c424dae0
......@@ -25,6 +25,7 @@ class Detector{
virtual Channel* GetElement (int row, int column);
virtual Channel* GetElement (std::string _name);
virtual std::vector < Channel* > GetChannelsVector () { return m_Element; }
virtual double* GetPosition ( ) { return m_Position; }
virtual double* GetAngle ( ) { return m_Angle; }
......
......@@ -44,7 +44,24 @@ Channel* Detector::GetElement(int row, int column){
}
/** @brief Get the properties of a detector element
*
* Returns a pointer to the Channel stored in m_Elements with the
* requested channel name.
* If the requested element is not found, return a warning message and a NULL pointer.
*
*/
Channel* Detector::GetElement(std::string _name){
for(int i=0; i < (int)m_Element.size(); i++){
if(!name.compare(m_Element->name){
return m_Element[i];
}
}
std::cerr << " WARNING: Element (" << _name << ") not found! " << std::endl;
return nullptr;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment