Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:56

0001 #include "DetectorDescription/Core/interface/DDDivision.h"
0002 
0003 #include <ostream>
0004 
0005 #include "DetectorDescription/Core/src/Division.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 
0008 using DDI::Division;
0009 
0010 std::ostream& operator<<(std::ostream& os, const DDDivision& div) {
0011   DDBase<DDName, Division*>::def_type defined(div.isDefined());
0012   if (defined.first) {
0013     os << *(defined.first) << " ";
0014     if (defined.second) {
0015       div.rep().stream(os);
0016     } else {
0017       os << "* division not defined * ";
0018     }
0019   } else {
0020     os << "* division not declared * ";
0021   }
0022   return os;
0023 }
0024 
0025 DDDivision::DDDivision() : DDBase<DDName, std::unique_ptr<DDI::Division> >() {}
0026 
0027 DDDivision::DDDivision(const DDName& name) : DDBase<DDName, std::unique_ptr<DDI::Division> >() { create(name); }
0028 
0029 DDDivision::DDDivision(const DDName& name,
0030                        const DDLogicalPart& parent,
0031                        const DDAxes axis,
0032                        const int nReplicas,
0033                        const double width,
0034                        const double offset)
0035     : DDBase<DDName, std::unique_ptr<DDI::Division> >() {
0036   create(name, std::make_unique<Division>(parent, axis, nReplicas, width, offset));
0037 }
0038 
0039 DDDivision::DDDivision(
0040     const DDName& name, const DDLogicalPart& parent, const DDAxes axis, const int nReplicas, const double offset) {
0041   create(name, std::make_unique<Division>(parent, axis, nReplicas, offset));
0042 }
0043 
0044 DDDivision::DDDivision(
0045     const DDName& name, const DDLogicalPart& parent, const DDAxes axis, const double width, const double offset) {
0046   create(name, std::make_unique<Division>(parent, axis, width, offset));
0047 }
0048 
0049 DDAxes DDDivision::axis() const { return rep().axis(); }
0050 
0051 int DDDivision::nReplicas() const { return rep().nReplicas(); }
0052 
0053 double DDDivision::width() const { return rep().width(); }
0054 
0055 double DDDivision::offset() const { return rep().offset(); }
0056 
0057 const DDLogicalPart& DDDivision::parent() const { return rep().parent(); }