Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
MuonAnalysis
MomentumScaleCalibration
plugins
TestResolution.h
Go to the documentation of this file.
1
#ifndef TESTRESOLUTION_HH
2
#define TESTRESOLUTION_HH
3
4
// -*- C++ -*-
5
//
6
// Package: TestResolution
7
// Class: TestResolution
8
//
16
//
17
// Original Author: Marco De Mattia
18
// Created: Thu Sep 11 12:16:00 CEST 2008
19
// $Id: TestResolution.h,v 1.6 2010/10/22 17:48:08 wmtan Exp $
20
//
21
//
22
23
// system include files
24
#include <memory>
25
#include <string>
26
#include <vector>
27
28
// user include files
29
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
30
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
31
#include "
FWCore/Framework/interface/Event.h
"
32
#include "
FWCore/Framework/interface/MakerMacros.h
"
33
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
34
35
#include "
DataFormats/TrackReco/interface/Track.h
"
36
#include "
DataFormats/MuonReco/interface/Muon.h
"
37
#include "
DataFormats/MuonReco/interface/MuonFwd.h
"
38
#include "
DataFormats/Candidate/interface/Candidate.h
"
39
#include "
RecoMuon/TrackingTools/interface/MuonPatternRecoDumper.h
"
40
#include "
RecoMuon/TrackingTools/interface/MuonServiceProxy.h
"
41
42
#include "
DataFormats/Candidate/interface/LeafCandidate.h
"
43
44
// For the momentum scale resolution
45
#include "
MuonAnalysis/MomentumScaleCalibration/interface/ResolutionFunction.h
"
46
47
#include "TFile.h"
48
#include "TProfile.h"
49
50
//
51
// class decleration
52
//
53
54
class
TestResolution
:
public
edm::EDAnalyzer
{
55
public
:
56
explicit
TestResolution
(
const
edm::ParameterSet
&);
57
~TestResolution
();
58
59
private
:
60
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&);
61
virtual
void
endJob
() {};
62
template
<
typename
T>
63
std::vector<reco::LeafCandidate>
fillMuonCollection
(
const
std::vector<T>&
tracks
) {
64
std::vector<reco::LeafCandidate>
muons
;
65
typename
std::vector<T>::const_iterator track;
66
for
(track = tracks.begin(); track != tracks.end(); ++track){
67
// Where 0.011163612 is the squared muon mass.
68
reco::Particle::LorentzVector
mu
(track->px(),track->py(),track->pz(),
69
sqrt
(track->p()*track->p() + 0.011163612));
70
reco::LeafCandidate
muon
(track->charge(),
mu
);
71
// Store muon
72
// ----------
73
muons.push_back (
muon
);
74
}
75
return
muons
;
76
}
77
78
// ----------member data ---------------------------
79
80
// Collections labels
81
// ------------------
82
edm::InputTag
theMuonLabel_
;
83
84
int
theMuonType_
;
85
std::string
theRootFileName_
;
86
TFile *
outputFile_
;
87
88
TProfile *
sigmaPt_
;
89
90
int
eventCounter_
;
91
92
std::auto_ptr<ResolutionFunction>
resolutionFunction_
;
93
};
94
95
#endif // TESTRESOLUTION_HH
reco::LeafCandidate
Definition:
LeafCandidate.h:18
TestResolution
Definition:
TestResolution.h:54
TestResolution::TestResolution
TestResolution(const edm::ParameterSet &)
Definition:
TestResolution.cc:20
LeafCandidate.h
TestResolution::eventCounter_
int eventCounter_
Definition:
TestResolution.h:90
MuonServiceProxy.h
Event.h
MakerMacros.h
TestResolution::theRootFileName_
std::string theRootFileName_
Definition:
TestResolution.h:85
ResolutionFunction.h
Frameworkfwd.h
TestResolution::~TestResolution
~TestResolution()
Definition:
TestResolution.cc:36
MuonFwd.h
TestResolution::outputFile_
TFile * outputFile_
Definition:
TestResolution.h:86
ParameterSet.h
TestResolution::theMuonType_
int theMuonType_
Definition:
TestResolution.h:84
Candidate.h
TestResolution::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
TestResolution.cc:63
MuonPatternRecoDumper.h
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:46
TestResolution::resolutionFunction_
std::auto_ptr< ResolutionFunction > resolutionFunction_
Definition:
TestResolution.h:92
edm::EventSetup
Definition:
EventSetup.h:44
RPCpg::mu
const int mu
Definition:
Constants.h:23
Muon.h
edm::EDAnalyzer
Definition:
EDAnalyzer.h:14
EDAnalyzer.h
TestResolution::fillMuonCollection
std::vector< reco::LeafCandidate > fillMuonCollection(const std::vector< T > &tracks)
Definition:
TestResolution.h:63
metsig::muon
Definition:
SignAlgoResolutions.h:41
testEve_cfg.tracks
tuple tracks
Definition:
testEve_cfg.py:39
TestResolution::sigmaPt_
TProfile * sigmaPt_
Definition:
TestResolution.h:88
edm::InputTag
Definition:
InputTag.h:12
patZpeak.muons
tuple muons
Definition:
patZpeak.py:38
TestResolution::endJob
virtual void endJob()
Definition:
TestResolution.h:61
edm::ParameterSet
Definition:
ParameterSet.h:35
TestResolution::theMuonLabel_
edm::InputTag theMuonLabel_
Definition:
TestResolution.h:82
edm::Event
Definition:
Event.h:50
Track.h
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Particle.h:25
Generated for CMSSW Reference Manual by
1.8.5