ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.h
Revision: 1.8
Committed: Wed Feb 13 10:05:48 2013 UTC (12 years, 2 months ago) by lantonel
Content type: text/plain
Branch: MAIN
Changes since 1.7: +3 -1 lines
Log Message:
added plotAllObjectsInPassingEvents parameter

File Contents

# User Rev Content
1 lantonel 1.1 #ifndef OSU_ANALYSIS
2    
3     #define OSU_ANALYSIS
4    
5     #include <map>
6     #include <string>
7     #include <vector>
8    
9 lantonel 1.6 #include "TH1.h"
10 lantonel 1.1 #include "TH1D.h"
11     #include "TH2D.h"
12     #include "TLorentzVector.h"
13    
14     #include "FWCore/Framework/interface/EDAnalyzer.h"
15     #include "FWCore/Framework/interface/Event.h"
16     #include "FWCore/Framework/interface/EventSetup.h"
17     #include "FWCore/ParameterSet/interface/ParameterSet.h"
18     #include "FWCore/ServiceRegistry/interface/Service.h"
19     #include "DataFormats/Common/interface/Handle.h"
20     #include "CommonTools/UtilAlgos/interface/TFileService.h"
21     #include "FWCore/Framework/interface/MakerMacros.h"
22    
23     #include "ProductArea/BNcollections/interface/BNbxlumi.h"
24     #include "ProductArea/BNcollections/interface/BNelectron.h"
25     #include "ProductArea/BNcollections/interface/BNevent.h"
26     #include "ProductArea/BNcollections/interface/BNjet.h"
27     #include "ProductArea/BNcollections/interface/BNmcparticle.h"
28     #include "ProductArea/BNcollections/interface/BNmet.h"
29     #include "ProductArea/BNcollections/interface/BNmuon.h"
30     #include "ProductArea/BNcollections/interface/BNphoton.h"
31     #include "ProductArea/BNcollections/interface/BNprimaryvertex.h"
32     #include "ProductArea/BNcollections/interface/BNskimbits.h"
33     #include "ProductArea/BNcollections/interface/BNsupercluster.h"
34     #include "ProductArea/BNcollections/interface/BNtrack.h"
35     #include "ProductArea/BNcollections/interface/BNtrigger.h"
36     #include "ProductArea/BNcollections/interface/BNtrigobj.h"
37     #include "ProductArea/BNcollections/interface/BNtau.h"
38     #include "ProductArea/BNcollections/interface/BNgenjet.h"
39    
40     #include "OSUT3Analysis/AnaTools/interface/CutFlow.h"
41    
42    
43    
44    
45     using namespace std;
46    
47     class OSUAnalysis : public edm::EDAnalyzer
48     {
49     public:
50     OSUAnalysis (const edm::ParameterSet &);
51     ~OSUAnalysis ();
52    
53     void analyze (const edm::Event &, const edm::EventSetup &);
54     bool evaluateComparison (double, string, double);
55 lantonel 1.2 bool evaluateTriggers (vector<string>,const BNtriggerCollection*);
56 lantonel 1.3 double applyFunction(string, double);
57    
58 lantonel 1.4 double valueLookup (const BNjet* object, string variable, string function = "");
59     double valueLookup (const BNmuon* object, string variable, string function = "");
60     double valueLookup (const BNelectron* object, string variable, string function = "");
61     double valueLookup (const BNevent* object, string variable, string function = "");
62     double valueLookup (const BNtau* object, string variable, string function = "");
63     double valueLookup (const BNmet* object, string variable, string function = "");
64     double valueLookup (const BNtrack* object, string variable, string function = "");
65     double valueLookup (const BNgenjet* object, string variable, string function = "");
66     double valueLookup (const BNmcparticle* object, string variable, string function = "");
67     double valueLookup (const BNprimaryvertex* object, string variable, string function = "");
68     double valueLookup (const BNbxlumi* object, string variable, string function = "");
69     double valueLookup (const BNphoton* object, string variable, string function = "");
70     double valueLookup (const BNsupercluster* object, string variable, string function = "");
71 lantonel 1.1 //BNskimbits
72     //BNtrigobj
73    
74     vector<string> splitString (string);
75    
76    
77     private:
78    
79     //flagMap:
80     //string holds input collection type
81     //outer vector corresponds to each cut
82     //inner vector corresponds to each object in input collection
83     //bool tells if object passes or fails cuts
84     typedef map<string, vector < vector<bool> > > flagMap;
85    
86     //counterMap:
87     //string holds input collection type
88     //vector corresponds to each cut
89     //int holds number of objects passing all cuts up to that point
90     typedef map<string ,vector <int> > counterMap;
91    
92     // Remember to define parameters to be retrieved from the configuration file.
93     edm::InputTag jets_;
94     edm::InputTag muons_;
95     edm::InputTag electrons_;
96     edm::InputTag events_;
97     edm::InputTag taus_;
98     edm::InputTag mets_;
99     edm::InputTag tracks_;
100     edm::InputTag genjets_;
101     edm::InputTag mcparticles_;
102     edm::InputTag primaryvertexs_;
103     edm::InputTag bxlumis_;
104     edm::InputTag photons_;
105     edm::InputTag superclusters_;
106 lantonel 1.2 edm::InputTag triggers_;
107 lantonel 1.1
108 ahart 1.7 BNprimaryvertex *primaryVertex_;
109 lantonel 1.1
110     vector<edm::ParameterSet> channels_;
111 lantonel 1.4 vector<edm::ParameterSet> histogramSets_;
112 lantonel 1.1
113 lantonel 1.8 bool plotAllObjectsInPassingEvents;
114    
115 lantonel 1.1 vector<map<string, TH1D*> > oneDHists_;
116 lantonel 1.6 vector<map<string, TH2D*> > twoDHists_;
117 lantonel 1.1
118     edm::Service<TFileService> fs_;
119    
120     CutFlow *masterCutFlow_;
121     vector<CutFlow *> cutFlows_;
122    
123 lantonel 1.4 typedef struct {
124     string name;
125     string title;
126     vector<double> bins;
127     string inputCollection;
128 lantonel 1.6 vector<string> inputVariables;
129 lantonel 1.4 string function;
130     } histogram;
131 lantonel 1.1
132     struct cut {
133     string inputCollection;
134     string variable;
135     string comparativeOperator;
136 lantonel 1.2 string function;
137 lantonel 1.1 double cutValue;
138     int numberRequired;
139     string eventComparativeOperator;
140     string name;
141     };
142    
143     struct channel {
144     string name;
145 lantonel 1.2 vector<string> triggers;
146 lantonel 1.1 vector<cut> cuts;
147     };
148    
149 lantonel 1.4 vector<string> objectsToPlot;
150 lantonel 1.1 vector<string> allNecessaryObjects;
151     vector<channel> channels;
152 lantonel 1.4 vector<histogram> histograms;
153 lantonel 1.1
154     template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string);
155 lantonel 1.8 template <class InputCollection> void fillHistogram(TH1*, histogram, InputCollection, vector<bool>);
156 lantonel 1.1
157    
158    
159     };
160    
161     #endif