Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClusHitsVerbosev1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ClusHitsVerbosev1.cc
1 #include "ClusHitsVerbosev1.h"
2 
3 #include <algorithm>
4 #include <iostream>
5 #include <phool/phool.h>
6 
7 using std::endl;
8 using std::cout;
9 
10 namespace
11 {
12  ClusHitsVerbose::Vector dummy_vec;
13  ClusHitsVerbose::PairVector dummy_pairvec;
14 }
15 
17 {
18  m_data.clear();
19  m_stage_phi .clear();
20  m_stage_z .clear();
21  m_stage_phiCut .clear();
22  m_stage_zCut .clear();
23 }
24 
26  return m_data.find(key) != m_data.end();
27 }
28 
30  if (!hasClusKey(key)) return dummy_vec;
31  else return m_data[key][which];
32 }
33 
35 { return vecBins(key, 0); }
36 
38 { return vecBins(key, 1); }
39 
41 { return vecBins(key, 2); }
42 
44 { return vecBins(key, 3); }
45 
47 {
48  if (!hasClusKey(key)) return dummy_pairvec;
49 
50  // unzip the vector<pair<int,int>> into two vectors: vector<int> vector<int>
51  std::vector<int> vecI{};
52  std::vector<int> vecE {};
53  for (auto& entry : m_data[key][which]) {
54  vecI.push_back(entry.first);
55  vecE.push_back(entry.second);
56  }
57  return {vecI, vecE};
58 }
59 
61 { return pvecIE(key, 0); }
62 
64 { return pvecIE(key, 1); }
65 
67 { return pvecIE(key, 2); }
68 
70 { return pvecIE(key, 3); }
71 
74  m_stage_phi .clear();
75  m_stage_z .clear();
76  m_stage_phiCut .clear();
77  m_stage_zCut .clear();
78 }