1 |
vuko |
1.1 |
//--- muon AOD:
|
2 |
|
|
#include "DataFormats/JetReco/interface/CaloJetCollection.h"
|
3 |
|
|
#include "DataFormats/EgammaCandidates/interface/Electron.h"
|
4 |
|
|
#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
|
5 |
|
|
#include "DataFormats/MuonReco/interface/MuonFwd.h"
|
6 |
|
|
#include "DataFormats/MuonReco/interface/Muon.h"
|
7 |
|
|
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
|
8 |
|
|
#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
#include "DataFormats/MuonReco/interface/MuonIsolation.h"
|
12 |
|
|
|
13 |
|
|
|
14 |
vuko |
1.2 |
#include "Vuko/WZAnalysis/interface/WZMuonSelector.h"
|
15 |
vuko |
1.1 |
|
16 |
|
|
|
17 |
|
|
void WZMuonSelector::beginJob(edm::EventSetup const& iSetup) {
|
18 |
|
|
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
WZMuonSelector::WZMuonSelector(const edm::ParameterSet& conf) : conf_(conf) {
|
22 |
|
|
|
23 |
|
|
muonLabel_ = conf_.getParameter<std::string>("muonLabel");
|
24 |
|
|
muonProducer_ = conf_.getParameter<std::string>("muonProducer");
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
// Added by Vuko: produces also clone collection with accepted electrons
|
28 |
|
|
produces<reco::CandidateCollection>();
|
29 |
|
|
|
30 |
|
|
|
31 |
|
|
}
|
32 |
|
|
|
33 |
|
|
WZMuonSelector::~WZMuonSelector() {
|
34 |
|
|
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
void WZMuonSelector::produce(edm::Event& e, const edm::EventSetup& c) {
|
38 |
|
|
|
39 |
|
|
using namespace edm;
|
40 |
|
|
using namespace reco;
|
41 |
|
|
// Read in muons
|
42 |
|
|
Handle<MuonCollection> muons;
|
43 |
|
|
e.getByLabel(muonProducer_,muonLabel_,muons);
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
// Read in muons
|
47 |
|
|
// Handle<MuonCollection> muons;
|
48 |
|
|
// e.getByLabel( theRecoMuonCollectionLabel, muons);
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
// Initialize output muon collection
|
52 |
|
|
std::auto_ptr<reco::CandidateCollection> passedMuonsCollection( new reco::CandidateCollection );
|
53 |
|
|
|
54 |
|
|
// access muons. from Riccardo Bellan
|
55 |
|
|
for (MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon){
|
56 |
|
|
// this is the track which contains both the tracker and the muon's info
|
57 |
|
|
// muon-> will give you exactly the same info as glbTrack for pt, eta, phi
|
58 |
|
|
// TrackRef knows all the methods of the Track class
|
59 |
|
|
//
|
60 |
|
|
|
61 |
|
|
/// reference to Track reconstructed in both tracked and muon detector
|
62 |
|
|
TrackRef glbTrack = muon->combinedMuon();
|
63 |
|
|
|
64 |
|
|
/// reference to Track reconstructed in the tracker only
|
65 |
|
|
TrackRef ctfTrack = muon->track();
|
66 |
|
|
|
67 |
|
|
/// reference to Track reconstructed in the muon detector only
|
68 |
|
|
TrackRef staMuon = muon->standAloneMuon();
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
// Vuko: Add output muon collection (only for cut based)
|
72 |
|
|
|
73 |
|
|
passedMuonsCollection->push_back( muon->clone() );
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
}
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
// Vuko: add passed muon collection to the event
|
81 |
|
|
e.put( passedMuonsCollection);
|
82 |
|
|
|
83 |
|
|
}
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
//define this as a plug-in
|
87 |
|
|
// DEFINE_FWK_MODULE(WZMuonSelector);
|