CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexTracker.h
Go to the documentation of this file.
1 #ifndef FWCore_Services_Vertex_Tracker_h
2 #define FWCore_Services_Vertex_Tracker_h
3 
4 #include <atomic>
5 #include <iosfwd>
6 #include <string>
7 
8 #include "Sym.h"
9 #include "ProfParseTypedefs.h"
10 
11 // ------------------- Vertex Tracker class ----------------
13 {
14  typedef void* address_type;
16  name_(),
17  library_(),
18  addr_(),
19  id_(),
21  total_seen_(),
22  in_path_(),
23  //size_(),
24  percent_leaf_(0.0),
25  percent_path_(0.0)
26  { }
27 
28  explicit VertexTracker(unsigned int id):
29  name_(),
30  library_(),
31  addr_(),
32  id_(id),
34  total_seen_(),
35  in_path_(),
36  //size_(),
37  percent_leaf_(0.0),
38  percent_path_(0.0)
39  { }
40 
42  name_(name),
43  library_(),
44  addr_(addr),
45  id_(),
47  total_seen_(),
48  in_path_(),
49  //size_(),
50  percent_leaf_(0.0),
51  percent_path_(0.0)
52  { }
53 
54  explicit VertexTracker(const Sym& sym) :
55  name_(sym.name_),
56  library_(sym.library_),
57  addr_(sym.addr_),
58  id_(),
60  total_seen_(),
61  in_path_(),
62  //size_(sym.size_),
63  percent_leaf_(0.0),
64  percent_path_(0.0)
65  { }
66 
67  bool
68  operator<(const VertexTracker& a) const
69  { return addr_<a.addr_; }
70 
71  bool
72  operator<(unsigned int id) const
73  { return id_<id; }
74 
75  void
76  incLeaf() const
77  { ++total_as_leaf_; }
78 
79  void
80  incTotal() const
81  { ++total_seen_; }
82 
83  void
84  incPath(int by) const
85  { in_path_+=by; }
86 
87  void
88  setID() const
89  { id_=next_id_++; }
90 
94  mutable unsigned int id_;
95  mutable unsigned int total_as_leaf_;
96  mutable unsigned int total_seen_;
97  mutable unsigned int in_path_;
98  mutable EdgeMap edges_;
99  //mutable int size_;
100  mutable float percent_leaf_;
101  mutable float percent_path_;
102 
103  static std::atomic<unsigned int> next_id_;
104 };
105 
106 std::ostream&
107 operator<< (std::ostream& os, VertexTracker const& vt);
108 
109 #endif
Definition: Sym.h:10
VertexTracker(address_type addr, const std::string &name)
Definition: VertexTracker.h:41
std::string library_
Definition: VertexTracker.h:92
std::string name_
Definition: VertexTracker.h:91
EdgeMap edges_
Definition: VertexTracker.h:98
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void incLeaf() const
Definition: VertexTracker.h:76
bool operator<(const VertexTracker &a) const
Definition: VertexTracker.h:68
address_type addr_
Definition: VertexTracker.h:93
VertexTracker(unsigned int id)
Definition: VertexTracker.h:28
unsigned int total_as_leaf_
Definition: VertexTracker.h:95
unsigned int in_path_
Definition: VertexTracker.h:97
static std::atomic< unsigned int > next_id_
VertexTracker(const Sym &sym)
Definition: VertexTracker.h:54
void incPath(int by) const
Definition: VertexTracker.h:84
void * address_type
Definition: VertexTracker.h:14
void setID() const
Definition: VertexTracker.h:88
unsigned int total_seen_
Definition: VertexTracker.h:96
double a
Definition: hdecay.h:121
std::map< unsigned int, int > EdgeMap
unsigned int id_
Definition: VertexTracker.h:94
void incTotal() const
Definition: VertexTracker.h:80