ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/lucieg/src/LucieAnalyzer.cc
Revision: 1.2
Committed: Wed May 26 17:21:26 2010 UTC (14 years, 11 months ago) by lucieg
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #include "PFAnalyses/CommonTools/interface/FWLiteTreeAnalyzer.h"
2 #include "PFAnalyses/LucieAnalysis/interface/LucieAnalyzer.h"
3 #include "PFAnalyses/LucieAnalysis/interface/LucieHistograms.h"
4
5 #include "DataFormats/Math/interface/LorentzVector.h"
6
7 #include "FWCore/Utilities/interface/Algorithms.h"
8 #include "FWCore/Utilities/interface/InputTag.h"
9
10 #include "FWCore/ParameterSet/interface/ProcessDesc.h"
11 #include "FWCore/ParameterSet/interface/ParameterSet.h"
12
13 #include "FWCore/PythonParameterSet/interface/PythonProcessDesc.h"
14
15 #include <iostream>
16 #include <map>
17
18 using namespace std;
19 using namespace reco;
20
21 LucieAnalyzer:: LucieAnalyzer(const std::string & aName):FWLiteAnalyzer(aName){}
22
23 LucieAnalyzer::~LucieAnalyzer(){
24
25 std::cout<<"LucieAnalyzer::~LucieAnalyzer()"<<std::endl;
26
27 delete LucieHistos_;
28 }
29
30
31 void LucieAnalyzer::initialize(const edm::ParameterSet& ps,
32 TFileDirectory& aDir,
33 std::strbitset *aSelections) {
34
35 verbose_ = ps.getParameter<bool>("verbose");
36 jetLabel_ = ps.getParameter<edm::InputTag>("jetLabel");
37 ht_=0.;
38
39 ///The histograms for this analyzer will be saved into "TestHistos"
40 ///directory of the ROOT file. One can have many sets of the
41 ///histograms, each saved into a separate subdirectory, ie.
42 ///TestHistos/Type1 and TestHistos/Type2
43 LucieHistos_ = new LucieHistograms(&aDir,"SubDir");
44 }
45
46 void LucieAnalyzer::registerCuts(){
47 }
48
49 void LucieAnalyzer::addBranch(TTree *tree){
50 }
51
52 void LucieAnalyzer::addCutHistos(TList *aList){
53 }
54
55 bool LucieAnalyzer::analyze(const edm::EventBase& iEvent){
56
57 if(verbose_) std::cout<<iEvent.id()<<std::endl;
58
59 using namespace reco;
60
61 edm::Handle<pat::JetCollection> pfJets;
62
63 iEvent.getByLabel(jetLabel_, pfJets);
64
65 typedef pat::JetCollection::const_iterator JI;
66
67 for(JI ji = pfJets->begin(); ji!=pfJets->end(); ++ji) {
68 ht_+= ji->pt();
69 }
70
71 LucieHistos_->AnalysisHistograms::fill1DHistogram("HtJets",ht_, 1);
72
73 return true;
74 }
75
76
77