ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Vuko/WZAnalysis/src/WZMuonSelector.cc
Revision: 1.2
Committed: Thu Nov 22 09:12:56 2007 UTC (17 years, 5 months ago) by vuko
Content type: text/plain
Branch: MAIN
CVS Tags: keti_Aug25_01, keti-Aug5-2008-01, keti-Aug4-2008-01, ym-1-6-12-01, keti_June6_02, keti_June6_01, SB_23Apr08, keti_Apr22_01, vuko-10apr08, srecko_10_Apr_v2, srecko_10_Apr, keti_Apr10_01, keti_Apr9_02, vuko-9apr08-2, keti_Apr9_01, vuko-9apr08, vuko-4apr08, sm_25_feb_08, sm_21_Feb_08, SB_19Feb08, SM_13_FEB_08, SB_13_Fev_08, SB_12_Fev_08, srecko_01_02_08_4, srecko_01_02_08_3, srecko_1_02_08_2, srecko_1_02_08, SB_02_Fev_08, srecko_31_jan_08, vuko_4dec07_prod, vuko_4dec07, vuko_3dec07, HEAD
Changes since 1.1: +1 -1 lines
Log Message:
fixes for initial building

File Contents

# User Rev Content
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);