CMS 3D CMS Logo

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
CaloDetInfo::~CaloDetInfo
~CaloDetInfo()=default
CaloDetInfoLess::operator()
bool operator()(const CaloDetInfo a, const CaloDetInfo b)
Definition: CaloDetInfo.h:55
CaloDetInfo::pos_
G4ThreeVector pos_
Definition: CaloDetInfo.h:37
pos
Definition: PixelAliasList.h:18
CaloDetInfoLess
Definition: CaloDetInfo.h:42
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
CaloDetInfo::flag_
bool flag_
Definition: CaloDetInfo.h:39
CaloDetInfo::name
std::string name() const
Definition: CaloDetInfo.h:25
CaloDetInfo::pos
G4ThreeVector pos() const
Definition: CaloDetInfo.h:26
CaloDetInfo::depth
uint32_t depth() const
Definition: CaloDetInfo.h:23
CaloDetInfo::solid
const G4VSolid * solid() const
Definition: CaloDetInfo.h:27
CaloDetInfo::CaloDetInfo
CaloDetInfo()
Definition: CaloDetInfo.cc:9
CaloDetInfo::rho
double rho() const
Definition: CaloDetInfo.h:24
b
double b
Definition: hdecay.h:118
CaloDetInfo::depth_
uint32_t depth_
Definition: CaloDetInfo.h:34
a
double a
Definition: hdecay.h:119
CaloDetInfoLess::operator()
bool operator()(const CaloDetInfo *a, const CaloDetInfo *b)
Definition: CaloDetInfo.h:44
CaloDetInfo
Definition: CaloDetInfo.h:9
CaloDetInfo::operator<
bool operator<(const CaloDetInfo &info) const
Definition: CaloDetInfo.cc:22
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CaloDetInfo::id
uint32_t id() const
Definition: CaloDetInfo.h:22
CaloDetInfo::rho_
double rho_
Definition: CaloDetInfo.h:35
CaloDetInfo::flag
bool flag() const
Definition: CaloDetInfo.h:28
CaloDetInfo::name_
std::string name_
Definition: CaloDetInfo.h:36
CaloDetInfo::solid_
const G4VSolid * solid_
Definition: CaloDetInfo.h:38
operator<<
std::ostream & operator<<(std::ostream &, const CaloDetInfo &)
Definition: CaloDetInfo.cc:34
CaloDetInfo::id_
uint32_t id_
Definition: CaloDetInfo.h:33