CMS 3D CMS Logo

MuonAlignmentInputMethod.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     MuonAlignment
00004 // Class  :     MuonAlignmentInputMethod
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Jim Pivarski
00010 //         Created:  Thu Mar  6 14:25:07 CST 2008
00011 // $Id: MuonAlignmentInputMethod.cc,v 1.2 2008/03/20 21:39:26 pivarski Exp $
00012 //
00013 
00014 // system include files
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016 
00017 // user include files
00018 #include "Alignment/MuonAlignment/interface/MuonAlignmentInputMethod.h"
00019 #include "Geometry/Records/interface/MuonNumberingRecord.h"
00020 #include "Geometry/DTGeometryBuilder/src/DTGeometryBuilderFromDDD.h"
00021 #include "Geometry/CSCGeometryBuilder/src/CSCGeometryBuilderFromDDD.h"
00022 
00023 //
00024 // constants, enums and typedefs
00025 //
00026 
00027 //
00028 // static data member definitions
00029 //
00030 
00031 //
00032 // constructors and destructor
00033 //
00034 MuonAlignmentInputMethod::MuonAlignmentInputMethod() {}
00035 
00036 // MuonAlignmentInputMethod::MuonAlignmentInputMethod(const MuonAlignmentInputMethod& rhs)
00037 // {
00038 //    // do actual copying here;
00039 // }
00040 
00041 MuonAlignmentInputMethod::~MuonAlignmentInputMethod() {}
00042 
00043 //
00044 // assignment operators
00045 //
00046 // const MuonAlignmentInputMethod& MuonAlignmentInputMethod::operator=(const MuonAlignmentInputMethod& rhs)
00047 // {
00048 //   //An exception safe implementation is
00049 //   MuonAlignmentInputMethod temp(rhs);
00050 //   swap(rhs);
00051 //
00052 //   return *this;
00053 // }
00054 
00055 //
00056 // member functions
00057 //
00058 
00059 AlignableMuon *MuonAlignmentInputMethod::newAlignableMuon(const edm::EventSetup& iSetup) const {
00060    boost::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup);
00061    boost::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup);
00062 
00063    return new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
00064 }
00065 
00066 boost::shared_ptr<DTGeometry> MuonAlignmentInputMethod::idealDTGeometry(const edm::EventSetup& iSetup) const {
00067    edm::ESHandle<DDCompactView> cpv;
00068    iSetup.get<IdealGeometryRecord>().get(cpv);
00069 
00070    edm::ESHandle<MuonDDDConstants> mdc;
00071    iSetup.get<MuonNumberingRecord>().get(mdc);
00072    DTGeometryBuilderFromDDD DTGeometryBuilder;
00073 
00074    boost::shared_ptr<DTGeometry> boost_dtGeometry = boost::shared_ptr<DTGeometry>(DTGeometryBuilder.build(&(*cpv), *mdc));
00075 
00076    return boost_dtGeometry;
00077 }
00078 
00079 boost::shared_ptr<CSCGeometry> MuonAlignmentInputMethod::idealCSCGeometry(const edm::EventSetup& iSetup) const {
00080    edm::ESHandle<DDCompactView> cpv;
00081    iSetup.get<IdealGeometryRecord>().get(cpv);
00082 
00083    edm::ESHandle<MuonDDDConstants> mdc;
00084    iSetup.get<MuonNumberingRecord>().get(mdc);
00085    CSCGeometryBuilderFromDDD CSCGeometryBuilder;
00086 
00087    boost::shared_ptr<CSCGeometry> boost_cscGeometry(new CSCGeometry);
00088    CSCGeometryBuilder.build(boost_cscGeometry, &(*cpv), *mdc);
00089 
00090    return boost_cscGeometry;
00091 }
00092 
00093 //
00094 // const member functions
00095 //
00096 
00097 //
00098 // static member functions
00099 //

Generated on Tue Jun 9 17:24:12 2009 for CMSSW by  doxygen 1.5.4