1 |
lethuill |
1.1 |
#include "UserCode/Morgan/interface/JetAnalyzer.h"
|
2 |
|
|
|
3 |
|
|
using namespace std;
|
4 |
|
|
using namespace reco;
|
5 |
|
|
using namespace edm;
|
6 |
|
|
|
7 |
|
|
JetAnalyzer::JetAnalyzer(const edm::ParameterSet& producersNames):verbosity_(0)
|
8 |
|
|
{
|
9 |
|
|
jetProducer_ = producersNames.getParameter<edm::InputTag>("jetProducer");
|
10 |
|
|
}
|
11 |
|
|
|
12 |
|
|
JetAnalyzer::JetAnalyzer(const edm::ParameterSet& producersNames, int verbosity):verbosity_(verbosity)
|
13 |
|
|
{
|
14 |
|
|
jetProducer_ = producersNames.getParameter<edm::InputTag>("jetProducer");
|
15 |
|
|
}
|
16 |
|
|
|
17 |
|
|
JetAnalyzer::~JetAnalyzer()
|
18 |
|
|
{
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
void JetAnalyzer::Process(const edm::Event& iEvent, TClonesArray* rootJets)
|
22 |
|
|
{
|
23 |
|
|
|
24 |
|
|
edm::Handle< reco::CaloJetCollection > recoJets;
|
25 |
|
|
iEvent.getByLabel(jetProducer_, recoJets);
|
26 |
|
|
if(verbosity_>1) std::cout << " Number of jets = " << recoJets->size() << " Label: " << jetProducer_.label() << " Instance: " << jetProducer_.instance() << std::endl;
|
27 |
|
|
for (unsigned int j=0; j<recoJets->size(); j++)
|
28 |
|
|
{
|
29 |
|
|
TRootJet localJet(
|
30 |
|
|
(*recoJets)[j].px()
|
31 |
|
|
,(*recoJets)[j].py()
|
32 |
|
|
,(*recoJets)[j].pz()
|
33 |
|
|
,(*recoJets)[j].energy()
|
34 |
|
|
);
|
35 |
|
|
|
36 |
|
|
Float_t anotherInterestingVariable = 999.;
|
37 |
|
|
localJet.setDummy(anotherInterestingVariable);
|
38 |
|
|
new( (*rootJets)[j] ) TRootJet(localJet);
|
39 |
|
|
if(verbosity_>2) cout << " ["<< setw(3) << j << "] " << localJet << endl;
|
40 |
|
|
}
|
41 |
|
|
|
42 |
|
|
}
|