1 #ifndef CRITERIA_KEEPER_H
2 #define CRITERIA_KEEPER_H
4 #include "Criteria/Criteria.h"
13 _name = mChild->getName();
14 _type = mChild->getType();
23 virtual bool areCompatible(KiTrack::Segment *parent, KiTrack::Segment *child) {
24 bool result = mChild->areCompatible(parent, child);
29 float value = mChild->getMapOfValues()[mChild->getName()];
30 bool same_track =
false;
36 if ((parent->getHits().size() == 1) && (child->getHits().size() == 1)) {
37 KiTrack::IHit *a = parent->getHits()[0];
38 KiTrack::IHit *b = child->getHits()[0];
40 auto fwdA =
static_cast<FwdHit *
>(a);
41 auto fwdB =
static_cast<FwdHit *
>(b);
45 same_track = (fwdA->_tid == fwdB->_tid && fwdA->_tid != 0);
47 track_id = fwdA->_tid;
51 if ( _name ==
"Crit2_RZRatio" ){
53 std::map < std::string , float > my_map_name_value = mChild->getMapOfValues();
54 my_map_name_value[
"Crit2_RZRatio_x1"] = a->getX();
55 my_map_name_value[
"Crit2_RZRatio_y1"] = a->getY();
56 my_map_name_value[
"Crit2_RZRatio_z1"] = a->getZ();
57 my_map_name_value[
"Crit2_RZRatio_x2"] = b->getX();
58 my_map_name_value[
"Crit2_RZRatio_y2"] = b->getY();
59 my_map_name_value[
"Crit2_RZRatio_z2"] = b->getZ();
61 my_map_name_value[
"Crit2_RZRatio_h1"] = fwdA->_id;
62 my_map_name_value[
"Crit2_RZRatio_h2"] = fwdB->_id;
64 allValues.push_back( my_map_name_value );
66 std::map < std::string , float > my_map_name_value = mChild->getMapOfValues();
67 allValues.push_back( my_map_name_value);
72 if ((parent->getHits().size() == 2) && (child->getHits().size() == 2)) {
73 KiTrack::IHit *a = child->getHits()[0];
74 KiTrack::IHit *b = child->getHits()[1];
75 KiTrack::IHit *c = parent->getHits()[1];
79 auto fwdA =
static_cast<FwdHit *
>(a);
80 auto fwdB =
static_cast<FwdHit *
>(b);
81 auto fwdC =
static_cast<FwdHit *
>(c);
83 std::map < std::string , float > my_map_name_value = mChild->getMapOfValues();
85 my_map_name_value[
"Crit2_RZRatio_h1"] = fwdA->_id;
86 my_map_name_value[
"Crit2_RZRatio_h2"] = fwdB->_id;
87 my_map_name_value[
"Crit2_RZRatio_h3"] = fwdC->_id;
89 allValues.push_back( my_map_name_value );
91 same_track = (fwdA->_tid == fwdB->_tid && fwdB->_tid == fwdC->_tid && fwdA->_tid != 0);
93 track_id = fwdA->_tid;
98 values.push_back(value);
99 track_ids.push_back(track_id);
104 std::vector<float> getValues( ) {
107 std::vector<std::map < std::string , float >> getAllValues() {
110 std::vector<int> getTrackIds() {
121 ICriterion *mChild =
nullptr;
123 std::vector<float> values;
124 std::vector<std::map < std::string , float >> allValues;
125 std::vector<int> track_ids;