CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CaloDetInfo.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_Calo_CaloDetInfo_H
2 #define SimG4CMS_Calo_CaloDetInfo_H
3 #include <iostream>
4 #include <string>
5 #include <vector>
6 #include "G4ThreeVector.hh"
7 #include "G4VSolid.hh"
8 
9 class CaloDetInfo {
10 public:
11  CaloDetInfo(uint32_t id,
12  uint32_t depth,
13  double rho,
14  const std::string& name,
15  G4ThreeVector pos,
16  const G4VSolid* sol,
17  bool flag = false);
18  CaloDetInfo();
19  CaloDetInfo(const CaloDetInfo&);
20  ~CaloDetInfo() = default;
21 
22  uint32_t id() const { return id_; }
23  uint32_t depth() const { return depth_; }
24  double rho() const { return rho_; }
25  std::string name() const { return name_; }
26  G4ThreeVector pos() const { return pos_; }
27  const G4VSolid* solid() const { return solid_; }
28  bool flag() const { return flag_; }
29 
30  bool operator<(const CaloDetInfo& info) const;
31 
32 private:
33  uint32_t id_;
34  uint32_t depth_;
35  double rho_;
37  G4ThreeVector pos_;
38  const G4VSolid* solid_;
39  bool flag_;
40 };
41 
43 public:
44  bool operator()(const CaloDetInfo* a, const CaloDetInfo* b) {
45  if (a->id() == b->id()) {
46  if (a->depth() == b->depth()) {
47  return (a->rho() < b->rho());
48  } else {
49  return (a->depth() < b->depth());
50  }
51  } else {
52  return (a->id() < b->id());
53  }
54  }
55  bool operator()(const CaloDetInfo a, const CaloDetInfo b) {
56  if (a.id() == b.id()) {
57  if (a.depth() == b.depth()) {
58  return (a.rho() < b.rho());
59  } else {
60  return (a.depth() < b.depth());
61  }
62  } else {
63  return (a.id() < b.id());
64  }
65  }
66 };
67 
68 std::ostream& operator<<(std::ostream&, const CaloDetInfo&);
69 #endif
static const TGPicture * info(bool iBackgroundIsBlack)
bool operator<(const CaloDetInfo &info) const
Definition: CaloDetInfo.cc:22
uint32_t id_
Definition: CaloDetInfo.h:33
~CaloDetInfo()=default
G4ThreeVector pos_
Definition: CaloDetInfo.h:37
bool operator()(const CaloDetInfo a, const CaloDetInfo b)
Definition: CaloDetInfo.h:55
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
std::string name() const
Definition: CaloDetInfo.h:25
uint32_t depth() const
Definition: CaloDetInfo.h:23
uint32_t depth_
Definition: CaloDetInfo.h:34
G4ThreeVector pos() const
Definition: CaloDetInfo.h:26
constexpr float sol
Definition: Config.h:48
uint32_t id() const
Definition: CaloDetInfo.h:22
const G4VSolid * solid() const
Definition: CaloDetInfo.h:27
double rho_
Definition: CaloDetInfo.h:35
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
bool operator()(const CaloDetInfo *a, const CaloDetInfo *b)
Definition: CaloDetInfo.h:44
bool flag() const
Definition: CaloDetInfo.h:28
std::string name_
Definition: CaloDetInfo.h:36
const G4VSolid * solid_
Definition: CaloDetInfo.h:38
double rho() const
Definition: CaloDetInfo.h:24