Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:24:13

0001 #include "SimG4CMS/Calo/interface/CaloDetInfo.h"
0002 
0003 #include <iomanip>
0004 
0005 CaloDetInfo::CaloDetInfo(
0006     uint32_t id, uint32_t d, double r, const std::string& name, G4ThreeVector pos, const G4VSolid* solid, bool flag)
0007     : id_(id), depth_(d), rho_(r), name_(name), pos_(pos), solid_(solid), flag_(flag) {}
0008 
0009 CaloDetInfo::CaloDetInfo()
0010     : id_(0), depth_(0), rho_(0), name_(""), pos_(G4ThreeVector(0, 0, 0)), solid_(nullptr), flag_(false) {}
0011 
0012 CaloDetInfo::CaloDetInfo(const CaloDetInfo& right) {
0013   id_ = right.id_;
0014   depth_ = right.depth_;
0015   rho_ = right.rho_;
0016   name_ = right.name_;
0017   pos_ = right.pos_;
0018   solid_ = right.solid_;
0019   flag_ = right.flag_;
0020 }
0021 
0022 bool CaloDetInfo::operator<(const CaloDetInfo& info) const {
0023   if (id_ == info.id()) {
0024     if (depth_ == info.depth()) {
0025       return (rho_ > info.rho());
0026     } else {
0027       return (depth_ > info.depth());
0028     }
0029   } else {
0030     return (id_ > info.id());
0031   }
0032 }
0033 
0034 std::ostream& operator<<(std::ostream& os, const CaloDetInfo& info) {
0035   os << info.name() << " Id 0x" << std::hex << info.id() << std::dec << ":" << info.depth() << " R "
0036      << std::setprecision(4) << info.rho() << " Position " << info.pos();
0037   return os;
0038 }