ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
EDM_object Class Reference

#include <EDM_object.h>

Collaboration diagram for EDM_object:

Public Member Functions

void init_matching ()
 
bool update_match (int index, int ch_candidate)
 
bool identifierMatch (EDM_object &data0, EDM_object &data1, uint i, uint j)
 
void update_efficiency (int maximum_difference)
 
void printEfficiency (std::ofstream &file)
 
void setName (TString name)
 
void setName (TString name, TString detector)
 
void setDetector (TString detector)
 
void setMatchedwith (TString matchedwith)
 
TString getName ()
 
TString getDetector ()
 
TString getMatchedwith ()
 
size_t size ()
 
void checksize ()
 
void printInfo ()
 
void clearVars ()
 
bool empty ()
 
 EDM_object ()
 
 ~EDM_object ()
 

Public Attributes

std::vector< std::string > * m_stationName
 
std::vector< int > * m_stationEta
 
std::vector< int > * m_stationPhi
 
std::vector< int > * m_multiplet
 
std::vector< int > * m_gas_gap
 
std::vector< int > * m_channel_type
 
std::vector< int > * m_channel
 
std::vector< int > * m_matchedchannel
 

Private Attributes

TString m_name
 
TString m_matchedwith
 
TString m_detector
 
int m_mismatches
 
int m_total
 

Detailed Description

Definition at line 13 of file EDM_object.h.

Constructor & Destructor Documentation

◆ EDM_object()

EDM_object::EDM_object ( )

Definition at line 15 of file EDM_object.cxx.

15  {
16  m_stationName = nullptr;
17  m_stationEta = nullptr;
18  m_stationPhi = nullptr;
19  m_multiplet = nullptr;
20  m_gas_gap = nullptr;
21  m_channel_type = nullptr;
22  m_channel = nullptr;
23  m_matchedchannel = nullptr;
24  m_mismatches = 0;
25  m_total = 0;
26 }

◆ ~EDM_object()

EDM_object::~EDM_object ( )
inline

Definition at line 44 of file EDM_object.h.

44 { clearVars(); }

Member Function Documentation

◆ checksize()

void EDM_object::checksize ( )

Definition at line 41 of file EDM_object.cxx.

41  {
42  size_t channel_type_size;
43  size_t size = m_stationName->size();
44  //skip channel_type check if MM, as MM does not have this parameter.
45  channel_type_size = (m_channel_type) ? m_channel_type->size() : size;
46  if (! (m_stationEta->size() == size ||
47  m_stationPhi->size() == size ||
48  m_multiplet->size() == size ||
49  m_gas_gap->size() == size ||
50  channel_type_size == size ||
51  m_channel->size() == size) )
52  { printf("NSWMatchingAlg: Sizes of data object %s_%s do not match!\n", m_name.Data(), m_detector.Data()); }
53 }

◆ clearVars()

void EDM_object::clearVars ( )

Definition at line 28 of file EDM_object.cxx.

28  {
29  if (m_matchedchannel) {
30  delete m_matchedchannel;
31  m_matchedchannel = nullptr;
32  }
33 }

◆ empty()

bool EDM_object::empty ( )

Definition at line 101 of file EDM_object.cxx.

101  {
102  if (!m_stationName) { return true; }
103  if (m_stationName->empty()) { return true; }
104  return false;
105 }

◆ getDetector()

TString EDM_object::getDetector ( )
inline

Definition at line 33 of file EDM_object.h.

33 { return m_detector; }

◆ getMatchedwith()

TString EDM_object::getMatchedwith ( )
inline

Definition at line 34 of file EDM_object.h.

34 { return m_matchedwith; }

◆ getName()

TString EDM_object::getName ( )
inline

Definition at line 32 of file EDM_object.h.

32 { return m_name; }

◆ identifierMatch()

bool EDM_object::identifierMatch ( EDM_object data0,
EDM_object data1,
uint  i,
uint  j 
)

Definition at line 69 of file EDM_object.cxx.

69  {
70  bool match = true;
71  match &= data0.m_channel_type ? data0.m_channel_type->at(i) == data1.m_channel_type->at(j) : true;
72  match &= data0.m_stationName->at(i).compare(data1.m_stationName->at(j)) == 0;
73  match &= data0.m_stationEta->at(i) == data1.m_stationEta->at(j);
74  match &= data0.m_stationPhi->at(i) == data1.m_stationPhi->at(j);
75  match &= data0.m_multiplet->at(i) == data1.m_multiplet->at(j);
76  match &= data0.m_gas_gap->at(i) == data1.m_gas_gap->at(j);
77  return match;
78 }

◆ init_matching()

void EDM_object::init_matching ( )

Definition at line 95 of file EDM_object.cxx.

95  {
96  if (empty()) { return; }
97  m_matchedchannel = new std::vector<int>(this->size());
98  for ( uint i = 0; i < this->size(); ++i) { m_matchedchannel->at(i) = -10; }
99 }

◆ printEfficiency()

void EDM_object::printEfficiency ( std::ofstream &  file)

Definition at line 120 of file EDM_object.cxx.

120  {
121  file << "\nMatching " << m_name << " to " << m_matchedwith << " for " << m_detector << std::endl;
122  file << "Total: " << m_total << ", number of mismatches: " << m_mismatches << std::endl;
123  file << "Efficiency: " << (m_total - m_mismatches) / (double)m_total * 100. << "%" << std::endl;
124 }

◆ printInfo()

void EDM_object::printInfo ( )

Definition at line 55 of file EDM_object.cxx.

55  {
56  // sTGC
57  if (m_channel_type) {
58  printf("%-15s %-15s %-15s %-15s %-15s %-15s %-15s %-15s\n", "stationname", "stationEta", "stationPhi", "multiplet", "gas_gap", "channel_type", "channel", "matchedchannel");
59  for (uint i = 0; i < this->size(); ++i)
60  { printf("%-15s %-15d %-15d %-15d %-15d %-15d %-15d %-15d\n", m_stationName->at(i).data(), m_stationEta->at(i), m_stationPhi->at(i), m_multiplet->at(i), m_gas_gap->at(i), m_channel_type->at(i), m_channel->at(i), m_matchedchannel->at(i));}
61  // MM
62  } else {
63  printf("%-15s %-15s %-15s %-15s %-15s %-15s %-15s\n", "stationname", "stationEta", "stationPhi", "multiplet", "gas_gap", "channel", "matchedchannel");
64  for (uint i = 0; i < this->size(); ++i)
65  { printf("%-15s %-15d %-15d %-15d %-15d %-15d %-15d\n", m_stationName->at(i).data(), m_stationEta->at(i), m_stationPhi->at(i), m_multiplet->at(i), m_gas_gap->at(i), m_channel->at(i), m_matchedchannel->at(i));}
66  }
67 }

◆ setDetector()

void EDM_object::setDetector ( TString  detector)
inline

Definition at line 28 of file EDM_object.h.

28 { m_detector = detector; }

◆ setMatchedwith()

void EDM_object::setMatchedwith ( TString  matchedwith)
inline

Definition at line 29 of file EDM_object.h.

29 { m_matchedwith = matchedwith; }

◆ setName() [1/2]

void EDM_object::setName ( TString  name)
inline

Definition at line 26 of file EDM_object.h.

26 { m_name = name; }

◆ setName() [2/2]

void EDM_object::setName ( TString  name,
TString  detector 
)
inline

Definition at line 27 of file EDM_object.h.

◆ size()

size_t EDM_object::size ( )

Definition at line 35 of file EDM_object.cxx.

35  {
36  if (!m_stationName) { return 0; }
37  checksize();
38  return m_stationName->size();
39 }

◆ update_efficiency()

void EDM_object::update_efficiency ( int  maximum_difference)

Definition at line 107 of file EDM_object.cxx.

107  {
108  uint nMatches = 0;
109  size_t n_obj = size();
110  m_total += n_obj;
111  bool isMatched;
112  for (uint i = 0; i < n_obj; ++i) {
113  // default matched channel value is -10. If not set to any other value, it is always a mismatch
114  isMatched = m_matchedchannel->at(i) < 0 || abs( m_channel->at(i) - m_matchedchannel->at(i) ) <= maximum_difference;
115  nMatches += isMatched;
116  }
117  m_mismatches += (n_obj - nMatches);
118 }

◆ update_match()

bool EDM_object::update_match ( int  index,
int  ch_candidate 
)

Definition at line 80 of file EDM_object.cxx.

80  {
81  // make sure the machedchannel is set to the default value (-10)
82  if (!m_matchedchannel) { return false; }
83  // If any match found, overwarite default value
84  if ( m_matchedchannel->at(index) == -10 ) { m_matchedchannel->at(index) = ch_candidate; }
85  // Default channel value in digitization = -1
86  if ( ch_candidate == -1 ) { return false; }
87  // Check if the match is close enough
88  if (abs(ch_candidate - m_channel->at(index)) < abs(m_channel->at(index) - m_matchedchannel->at(index)) ) {
89  m_matchedchannel->at(index) = ch_candidate;
90  return true;
91  }
92  return false;
93 }

Member Data Documentation

◆ m_channel

std::vector<int>* EDM_object::m_channel

Definition at line 52 of file EDM_object.h.

◆ m_channel_type

std::vector<int>* EDM_object::m_channel_type

Definition at line 51 of file EDM_object.h.

◆ m_detector

TString EDM_object::m_detector
private

Definition at line 59 of file EDM_object.h.

◆ m_gas_gap

std::vector<int>* EDM_object::m_gas_gap

Definition at line 50 of file EDM_object.h.

◆ m_matchedchannel

std::vector<int>* EDM_object::m_matchedchannel

Definition at line 54 of file EDM_object.h.

◆ m_matchedwith

TString EDM_object::m_matchedwith
private

Definition at line 58 of file EDM_object.h.

◆ m_mismatches

int EDM_object::m_mismatches
private

Definition at line 60 of file EDM_object.h.

◆ m_multiplet

std::vector<int>* EDM_object::m_multiplet

Definition at line 49 of file EDM_object.h.

◆ m_name

TString EDM_object::m_name
private

Definition at line 57 of file EDM_object.h.

◆ m_stationEta

std::vector<int>* EDM_object::m_stationEta

Definition at line 47 of file EDM_object.h.

◆ m_stationName

std::vector<std::string>* EDM_object::m_stationName

Definition at line 46 of file EDM_object.h.

◆ m_stationPhi

std::vector<int>* EDM_object::m_stationPhi

Definition at line 48 of file EDM_object.h.

◆ m_total

int EDM_object::m_total
private

Definition at line 61 of file EDM_object.h.


The documentation for this class was generated from the following files:
EDM_object::m_stationName
std::vector< std::string > * m_stationName
Definition: EDM_object.h:46
EDM_object::checksize
void checksize()
Definition: EDM_object.cxx:41
EDM_object::m_matchedchannel
std::vector< int > * m_matchedchannel
Definition: EDM_object.h:54
index
Definition: index.py:1
EDM_object::m_detector
TString m_detector
Definition: EDM_object.h:59
EDM_object::size
size_t size()
Definition: EDM_object.cxx:35
EDM_object::m_matchedwith
TString m_matchedwith
Definition: EDM_object.h:58
EDM_object::m_stationPhi
std::vector< int > * m_stationPhi
Definition: EDM_object.h:48
InDetSecVtxTruthMatchUtils::isMatched
bool isMatched(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:48
EDM_object::m_channel
std::vector< int > * m_channel
Definition: EDM_object.h:52
EDM_object::empty
bool empty()
Definition: EDM_object.cxx:101
TRT::Hit::detector
@ detector
Definition: HitInfo.h:78
EDM_object::m_gas_gap
std::vector< int > * m_gas_gap
Definition: EDM_object.h:50
EDM_object::m_channel_type
std::vector< int > * m_channel_type
Definition: EDM_object.h:51
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
lumiFormat.i
int i
Definition: lumiFormat.py:92
file
TFile * file
Definition: tile_monitor.h:29
EDM_object::m_mismatches
int m_mismatches
Definition: EDM_object.h:60
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EDM_object::m_name
TString m_name
Definition: EDM_object.h:57
RTTAlgmain.data1
data1
Definition: RTTAlgmain.py:54
EDM_object::m_total
int m_total
Definition: EDM_object.h:61
EDM_object::m_multiplet
std::vector< int > * m_multiplet
Definition: EDM_object.h:49
EDM_object::clearVars
void clearVars()
Definition: EDM_object.cxx:28
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
EDM_object::m_stationEta
std::vector< int > * m_stationEta
Definition: EDM_object.h:47