Go to the documentation of this file.00001 #ifndef TESTRESOLUTION_HH
00002 #define TESTRESOLUTION_HH
00003
00004
00005
00006
00007
00008
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <memory>
00025 #include <string>
00026 #include <vector>
00027
00028
00029 #include "FWCore/Framework/interface/Frameworkfwd.h"
00030 #include "FWCore/Framework/interface/EDAnalyzer.h"
00031 #include "FWCore/Framework/interface/Event.h"
00032 #include "FWCore/Framework/interface/MakerMacros.h"
00033 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00034
00035 #include "DataFormats/TrackReco/interface/Track.h"
00036 #include "DataFormats/MuonReco/interface/Muon.h"
00037 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00038 #include "DataFormats/Candidate/interface/Candidate.h"
00039 #include "RecoMuon/TrackingTools/interface/MuonPatternRecoDumper.h"
00040 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
00041
00042 #include "DataFormats/Candidate/interface/LeafCandidate.h"
00043
00044
00045 #include "MuonAnalysis/MomentumScaleCalibration/interface/ResolutionFunction.h"
00046
00047 #include "TFile.h"
00048 #include "TProfile.h"
00049
00050
00051
00052
00053
00054 class TestResolution : public edm::EDAnalyzer {
00055 public:
00056 explicit TestResolution(const edm::ParameterSet&);
00057 ~TestResolution();
00058
00059 private:
00060 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00061 virtual void endJob() {};
00062 template<typename T>
00063 std::vector<reco::LeafCandidate> fillMuonCollection (const std::vector<T>& tracks) {
00064 std::vector<reco::LeafCandidate> muons;
00065 typename std::vector<T>::const_iterator track;
00066 for (track = tracks.begin(); track != tracks.end(); ++track){
00067
00068 reco::Particle::LorentzVector mu(track->px(),track->py(),track->pz(),
00069 sqrt(track->p()*track->p() + 0.011163612));
00070 reco::LeafCandidate muon(track->charge(),mu);
00071
00072
00073 muons.push_back (muon);
00074 }
00075 return muons;
00076 }
00077
00078
00079
00080
00081
00082 edm::InputTag theMuonLabel_;
00083
00084 int theMuonType_;
00085 std::string theRootFileName_;
00086 TFile * outputFile_;
00087
00088 TProfile * sigmaPt_;
00089
00090 int eventCounter_;
00091
00092 std::auto_ptr<ResolutionFunction> resolutionFunction_;
00093 };
00094
00095 #endif // TESTRESOLUTION_HH