blob: 0c62a1926350136c448e63b7a08e11d72ba2c5b1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/*
* CompositeElement.cc
*
* Created on: Mar 23, 2011
* Author: jakob
*/
#include "CompositeElement.h"
namespace vhc {
CompositeElement::CompositeElement(const Vector3D& entry, const Vector3D& exit, double sectionRadius, Element* next):
Element(entry, exit, sectionRadius, next),
elements(0) {};
CompositeElement::~CompositeElement() {};
bool CompositeElement::hasHit(const Particle& particle) const {
for (int i(0); i < elements.size(); ++i) {
if (elements[i]->hasHit(particle)) return true;
}
return false;
}
bool CompositeElement::isPast(const Particle& particle) const {
if (elements[elements.size() - 1]->isPast(particle)) return true;
else return false;
}
}
|