1 |
ptan |
1.1 |
#ifndef _EdmAnalysisTools_h_
|
2 |
|
|
#define _EdmAnalysisTools_h_
|
3 |
|
|
|
4 |
|
|
#include "DataFormats/JetReco/interface/CaloJetCollection.h"
|
5 |
|
|
#include "DataFormats/JetReco/interface/Jet.h"
|
6 |
|
|
#include "SimDataFormats/Track/interface/SimTrack.h"
|
7 |
|
|
#include "SimDataFormats/Track/interface/SimTrackContainer.h"
|
8 |
|
|
#include "DataFormats/TrackReco/interface/Track.h"
|
9 |
|
|
#include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
|
10 |
|
|
#include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
|
11 |
|
|
|
12 |
|
|
#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
|
13 |
|
|
|
14 |
|
|
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
|
15 |
|
|
#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
#include "DataFormats/MuonReco/interface/Muon.h"
|
19 |
|
|
#include "DataFormats/MuonReco/interface/MuonFwd.h"
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
#include "TLorentzVector.h"
|
23 |
|
|
#include "TVector3.h"
|
24 |
|
|
|
25 |
|
|
#include <DataFormats/VertexReco/interface/VertexFwd.h>
|
26 |
|
|
|
27 |
|
|
#include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
// MC jet flavor truth matching
|
31 |
|
|
#include "SimDataFormats/JetMatching/interface/JetFlavour.h"
|
32 |
|
|
#include "SimDataFormats/JetMatching/interface/JetFlavourMatching.h"
|
33 |
|
|
#include "SimDataFormats/JetMatching/interface/MatchedPartons.h"
|
34 |
|
|
#include "SimDataFormats/JetMatching/interface/JetMatchedPartons.h"
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
#include "math.h"
|
38 |
|
|
#include "kinematics.h"
|
39 |
|
|
|
40 |
|
|
using namespace reco;
|
41 |
|
|
using namespace edm;
|
42 |
|
|
using namespace std;
|
43 |
|
|
|
44 |
|
|
float btaggingAssociation(Jet jet, const reco::JetTagCollection *btags, float matching_deltaR=0.1);
|
45 |
|
|
|
46 |
|
|
float mcflavorAssociation(Jet jet, edm::Handle<reco::JetFlavourMatchingCollection> tagList, float matching_deltaR=0.1);
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
void calPtRel(reco::CaloJetCollection::const_iterator jet, const reco::MuonCollection *recoMuons, _jet_ *myJet, float coneSize=0.3, float scale = 1.0);
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
float trackIsolation(const reco::Track & theTrack, const reco::TrackCollection &tracks,
|
53 |
|
|
double threshold, double larger_th,
|
54 |
|
|
int *nTracks,
|
55 |
|
|
float *arger_iso, int *larger_nTrks);
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
float trackIsolation(const reco::GsfTrack & theTrack, const reco::TrackCollection &tracks,
|
59 |
|
|
double threshold, double larger_th,
|
60 |
|
|
int *nTracks,
|
61 |
|
|
float *larger_iso, int *larger_nTrks);
|
62 |
|
|
|
63 |
|
|
float jetIsolation(const reco::Jet & jet, const reco::CaloJetCollection & jets, double threshold);
|
64 |
|
|
|
65 |
|
|
const SimTrack *closestSimTrack(const reco::Track &atrack, const edm::SimTrackContainer *simTrkColl);
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
// with calotowers and global muons only
|
69 |
|
|
void calMet(const CaloTowerCollection *caloTowers, const reco::MuonCollection *muons, double &px, double &py);
|
70 |
|
|
|
71 |
|
|
double calIsolation( const CaloTowerCollection *caloTowers, reco::MuonCollection::const_iterator muon, double threshold = 0.3);
|
72 |
|
|
double calIsolation( const CaloTowerCollection *caloTowers, reco::GsfElectronCollection::const_iterator electron, double threshold = 0.3);
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
// check if a muon candidate is associated with any primary vertex
|
77 |
|
|
const reco::Vertex *vertexAssociation(const TrackBaseRef &track, Handle<reco::VertexCollection> recVtxs);
|
78 |
|
|
int whichVertex(const TrackBaseRef &track, Handle<reco::VertexCollection> recVtxs, float &distance);
|
79 |
|
|
|
80 |
|
|
#endif
|