ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.h
Revision: 1.5
Committed: Mon Feb 4 17:08:34 2013 UTC (12 years, 3 months ago) by lantonel
Content type: text/plain
Branch: MAIN
Changes since 1.4: +1 -0 lines
Log Message:
added global variable for vertex in event

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