| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DetElemContainsRule< Q > Class Template Reference

#include <HistorianCustomRules.h>

Inheritance diagram for DetElemContainsRule< Q >:

[legend]
Collaboration diagram for DetElemContainsRule< Q >:
[legend]
List of all members.

Public Member Functions

 DetElemContainsRule (std::string n, const IDetectorElement *value)
virtual ~DetElemContainsRule ()
virtual bool select (const RuleParser::Queriable *thing)
virtual const std::string & name () const

Protected Attributes

std::string m_name
RulemA
RulemB

Private Attributes

const IDetectorElementmValue

Detailed Description

template<class Q>
class DetElemContainsRule< Q >

Definition at line 28 of file HistorianCustomRules.h.


Constructor & Destructor Documentation

template<class Q>
DetElemContainsRule< Q >::DetElemContainsRule ( std::string  n,
const IDetectorElement value 
) [inline]

Definition at line 31 of file HistorianCustomRules.h.

00032           : Rule(n) 
00033           , mValue(value) {};

template<class Q>
virtual DetElemContainsRule< Q >::~DetElemContainsRule (  )  [inline, virtual]

Definition at line 34 of file HistorianCustomRules.h.

00034 {};


Member Function Documentation

template<class Q>
bool DetElemContainsRule< Q >::select ( const RuleParser::Queriable thing  )  [virtual]

Implements RuleParser::Rule.

Definition at line 43 of file HistorianCustomRules.h.

00044  {
00045    const Q* q = dynamic_cast<const Q*>(thing);
00046    assert(q && "Was given the wrong kind of Queriable!");
00047    const IDetectorElement* curElement = q->getDetectorElement();
00048    if(!curElement) return false;
00049    if(!mValue) return false;
00050    // The problem with this method is that parentIDetectorElement() seems to crash.
00051    // bool done = false;
00052    // while(!done) {
00053    //   if(curElement == mValue) return true;
00054    //   if(curElement == 0) return false;
00055    //   curElement = curElement->parentIDetectorElement();
00056    // }
00058    const IGeometryInfo* curGeo = curElement->geometry();
00059    const IGeometryInfo* valGeo = mValue->geometry();
00060    ILVolume::ReplicaPath dummy;
00061    while(true){
00062      if(!curGeo) break;  // We got to the top of the tree and never hit the Value
00063      if(curGeo == valGeo) return true; // The value matches a parent of the current position.. it's contained
00064      IGeometryInfo* nextGeo = 0;
00065      curGeo->location(nextGeo, dummy); 
00066      curGeo = nextGeo;  // Ok, move up a level and check again.
00067    }
00068    return false;
00069 }


Member Data Documentation

template<class Q>
const IDetectorElement* DetElemContainsRule< Q >::mValue [private]

Definition at line 37 of file HistorianCustomRules.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:54:54 2011 for Historian by doxygen 1.4.7