Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-26 00:00:09

0001 // -*- C++ -*-
0002 //
0003 // Package:    KVFTest
0004 // Class:      KVFTest
0005 //
0006 /**\class KVFTest KVFTest.cc RecoVertex/KVFTest/src/KVFTest.cc
0007 
0008  Description: steers tracker primary vertex reconstruction and storage
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 
0014 // system include files
0015 #include <memory>
0016 
0017 // user include files
0018 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0019 #include "FWCore/Framework/interface/Event.h"
0020 #include "FWCore/Framework/interface/EventSetup.h"
0021 #include "FWCore/Framework/interface/Frameworkfwd.h"
0022 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 #include "MagneticField/Engine/interface/MagneticField.h"
0025 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0026 #include "RecoVertex/KalmanVertexFit/interface/SimpleVertexTree.h"
0027 #include "SimDataFormats/Associations/interface/TrackToTrackingParticleAssociator.h"
0028 #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertexContainer.h"
0029 #include "SimDataFormats/Vertex/interface/SimVertex.h"
0030 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0031 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0032 #include <TFile.h>
0033 
0034 /**
0035    * This is a very simple test analyzer mean to test the KalmanVertexFitter
0036    */
0037 
0038 class KVFTest : public edm::one::EDAnalyzer<> {
0039 public:
0040   explicit KVFTest(const edm::ParameterSet&);
0041   ~KVFTest() override;
0042 
0043   void analyze(const edm::Event&, const edm::EventSetup&) override;
0044 
0045   void beginJob() override;
0046   void endJob() override;
0047 
0048 private:
0049   TrackingVertex getSimVertex(const edm::Event& iEvent) const;
0050 
0051   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> estoken_MF;
0052   const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> estoken_TTB;
0053 
0054   edm::ParameterSet theConfig;
0055   edm::ParameterSet kvfPSet;
0056   std::unique_ptr<SimpleVertexTree> tree;
0057   TFile* rootFile_;
0058 
0059   std::string outputFile_;  // output file
0060   edm::EDGetTokenT<reco::TrackCollection> token_tracks;
0061   edm::EDGetTokenT<TrackingParticleCollection> token_TrackTruth;
0062   edm::EDGetTokenT<TrackingVertexCollection> token_VertexTruth;
0063   edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator> token_associatorForParamAtPca;
0064 };