CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/Alignment/MuonAlignment/src/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.4 2010/05/14 21:07:59 pivarski Exp $
00012 //
00013 
00014 // system include files
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016 #include "FWCore/Framework/interface/ESTransientHandle.h"
00017 
00018 // user include files
00019 #include "Alignment/MuonAlignment/interface/MuonAlignmentInputMethod.h"
00020 #include "Geometry/Records/interface/MuonNumberingRecord.h"
00021 #include "Geometry/DTGeometryBuilder/src/DTGeometryBuilderFromDDD.h"
00022 #include "Geometry/CSCGeometryBuilder/src/CSCGeometryBuilderFromDDD.h"
00023 
00024 //
00025 // constants, enums and typedefs
00026 //
00027 
00028 //
00029 // static data member definitions
00030 //
00031 
00032 //
00033 // constructors and destructor
00034 //
00035 MuonAlignmentInputMethod::MuonAlignmentInputMethod() {}
00036 
00037 // MuonAlignmentInputMethod::MuonAlignmentInputMethod(const MuonAlignmentInputMethod& rhs)
00038 // {
00039 //    // do actual copying here;
00040 // }
00041 
00042 MuonAlignmentInputMethod::~MuonAlignmentInputMethod() {}
00043 
00044 //
00045 // assignment operators
00046 //
00047 // const MuonAlignmentInputMethod& MuonAlignmentInputMethod::operator=(const MuonAlignmentInputMethod& rhs)
00048 // {
00049 //   //An exception safe implementation is
00050 //   MuonAlignmentInputMethod temp(rhs);
00051 //   swap(rhs);
00052 //
00053 //   return *this;
00054 // }
00055 
00056 //
00057 // member functions
00058 //
00059 
00060 AlignableMuon *MuonAlignmentInputMethod::newAlignableMuon(const edm::EventSetup& iSetup) const {
00061    boost::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup);
00062    boost::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup);
00063 
00064    return new AlignableMuon(&(*dtGeometry), &(*cscGeometry));
00065 }
00066 
00067 boost::shared_ptr<DTGeometry> MuonAlignmentInputMethod::idealDTGeometry(const edm::EventSetup& iSetup) const {
00068    edm::ESTransientHandle<DDCompactView> cpv;
00069    iSetup.get<IdealGeometryRecord>().get(cpv);
00070 
00071    edm::ESHandle<MuonDDDConstants> mdc;
00072    iSetup.get<MuonNumberingRecord>().get(mdc);
00073    DTGeometryBuilderFromDDD DTGeometryBuilder;
00074 
00075    boost::shared_ptr<DTGeometry> boost_dtGeometry(new DTGeometry );
00076    DTGeometryBuilder.build(boost_dtGeometry, &(*cpv), *mdc);
00077 
00078    return boost_dtGeometry;
00079 }
00080 
00081 boost::shared_ptr<CSCGeometry> MuonAlignmentInputMethod::idealCSCGeometry(const edm::EventSetup& iSetup) const {
00082    edm::ESTransientHandle<DDCompactView> cpv;
00083    iSetup.get<IdealGeometryRecord>().get(cpv);
00084 
00085    edm::ESHandle<MuonDDDConstants> mdc;
00086    iSetup.get<MuonNumberingRecord>().get(mdc);
00087    CSCGeometryBuilderFromDDD CSCGeometryBuilder;
00088 
00089    boost::shared_ptr<CSCGeometry> boost_cscGeometry(new CSCGeometry);
00090    CSCGeometryBuilder.build(boost_cscGeometry, &(*cpv), *mdc);
00091 
00092    return boost_cscGeometry;
00093 }
00094 
00095 //
00096 // const member functions
00097 //
00098 
00099 //
00100 // static member functions
00101 //