-
Notifications
You must be signed in to change notification settings - Fork 0
/
trackObject.h
106 lines (91 loc) · 3.16 KB
/
trackObject.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*************************************
* Author: M. Babai (M.Babai@rug.nl) *
* Version: *
* License: *
*************************************/
#pragma once
#ifndef TRACK_OBJECT_H
#define TRACK_OBJECT_H
//#include <cstdlib>
#include <set>
#include <vector>
#include "auxfunctions.h"
struct TrackObject {
public:
// Constructors
TrackObject();
/* explicit TrackObject(std::set<int> const &sttComp, std::vector<int>
const &MVD_Comp);*/
// Destructor
virtual ~TrackObject();
std::set<int>* m_sttComponent;
std::vector<int> m_MVD_Component;
//_________ Protected functions and members _______
//protected:
//_________ Private functions and members _______
private:
TrackObject(TrackObject const &ot);
TrackObject& operator=(TrackObject const &ot);
bool operator==(TrackObject const &ot) const;
bool operator<(TrackObject const &ot) const;
bool operator>(TrackObject const &ot) const;
};// End interface Trackobjects
///// _____ Interface MC-Track object def. ________
struct MCTrackObject {
public:
// Constructors
MCTrackObject()
: m_pointSTTCoordList(std::vector < point3D >()),
m_pointMVDCoordList(std::vector < point3D >()),
m_STT_Component(std::vector<int>()),
m_MVD_Component(std::vector<int>()),
m_STT_Momentum(std::vector < point3D >()),
m_STT_Isochrone(std::vector < float >()),
m_matched(false)
{};
//Dtor
virtual ~MCTrackObject(){};
// member functions and operators
inline bool operator< (MCTrackObject const &ot) const;
inline bool operator> (MCTrackObject const &ot) const;
inline friend bool lessThanLength(MCTrackObject const *lt, MCTrackObject const *rt);
inline friend bool greaterThanLength(MCTrackObject const *lt, MCTrackObject const *rt);
/* Dumy Remove me later */
void print() const {};
/* End of dummy functions ... */
// member parameters.
std::vector < point3D > m_pointSTTCoordList;
std::vector < point3D > m_pointMVDCoordList;
std::vector < point3D > m_STT_Momentum;
std::vector<int> m_STT_Component;
std::vector<int> m_MVD_Component;
std::vector<float> m_STT_Isochrone;
bool m_matched;// If have been matched before
int m_trackID;
//_________ Protected functions and members _______
//protected:
//_________ Private functions and members _______
private:
MCTrackObject(MCTrackObject const &ot);
MCTrackObject& operator=(MCTrackObject const &ot);
bool operator==(MCTrackObject const &ot) const;
};// End Interface MC-Track
//=================================================================
//____________ Implementations ________
bool MCTrackObject::operator> (MCTrackObject const &ot) const
{
return ( (this->m_STT_Component).size() > (ot.m_STT_Component).size() );
}
bool MCTrackObject::operator< (MCTrackObject const &ot) const
{
return ( (this->m_STT_Component).size() < (ot.m_STT_Component).size() );
}
bool lessThanLength(MCTrackObject const *lt, MCTrackObject const *rt)
{
return ( (lt->m_STT_Component).size() < (rt->m_STT_Component).size() );
}
bool greaterThanLength(MCTrackObject const *lt, MCTrackObject const *rt)
{
return ( (lt->m_STT_Component).size() > (rt->m_STT_Component).size() );
}
#endif