Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:12

0001 #include <memory>
0002 /** \file MuonNavigationTest
0003  *
0004  *  \author Chang Liu
0005  */
0006 
0007 #include "FWCore/Framework/interface/Frameworkfwd.h"
0008 #include "FWCore/Framework/interface/EDAnalyzer.h"
0009 
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014 
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 
0017 #include "RecoMuon/Navigation/interface/MuonNavigationPrinter.h"
0018 #include "RecoMuon/Navigation/interface/MuonNavigationSchool.h"
0019 //#include "RecoMuon/Navigation/interface/MuonTkNavigationSchool.h"
0020 #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h"
0021 #include "RecoMuon/Navigation/interface/MuonNavigationPrinter.h"
0022 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
0023 //#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
0024 //#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"
0025 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0026 
0027 class MuonNavigationTest : public edm::EDAnalyzer {
0028 public:
0029   explicit MuonNavigationTest(const edm::ParameterSet&);
0030   ~MuonNavigationTest();
0031 
0032   virtual void analyze(const edm::Event&, const edm::EventSetup&);
0033 
0034 private:
0035 };
0036 
0037 // constructor
0038 
0039 MuonNavigationTest::MuonNavigationTest(const edm::ParameterSet& iConfig) {
0040   std::cout << "Muon Navigation Printer Begin:" << std::endl;
0041 }
0042 
0043 MuonNavigationTest::~MuonNavigationTest() { std::cout << "Muon Navigation Printer End. " << std::endl; }
0044 
0045 void MuonNavigationTest::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0046   using namespace edm;
0047 
0048   //choose ONE and ONLY one to be true
0049   bool testMuon = true;
0050   //   bool testMuonTk = true;
0051   //
0052   // get Geometry
0053   //
0054   edm::ESHandle<MuonDetLayerGeometry> muon;
0055   iSetup.get<MuonRecoGeometryRecord>().get(muon);
0056   const MuonDetLayerGeometry* mm(&(*muon));
0057 
0058   if (testMuon) {
0059     MuonNavigationSchool school(mm);
0060     MuonNavigationPrinter* printer = new MuonNavigationPrinter(mm, school);
0061     delete printer;
0062   }
0063   /*
0064    if ( testMuonTk ) {
0065      edm::ESHandle<GeometricSearchTracker> tracker;
0066      iSetup.get<TrackerRecoGeometryRecord>().get(tracker);
0067 
0068      edm::ESHandle<MagneticField> theMF;
0069      iSetup.get<IdealMagneticFieldRecord>().get(theMF);
0070 
0071      const GeometricSearchTracker * tt(&(*tracker));
0072      const MagneticField * field(&(*theMF));
0073 
0074      MuonTkNavigationSchool school(mm,tt,field);
0075      MuonNavigationPrinter* printer = new MuonNavigationPrinter(mm, tt);
0076      delete printer;
0077   }
0078 */
0079 }
0080 
0081 //define this as a plug-in
0082 DEFINE_FWK_MODULE(MuonNavigationTest);