ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.h
(Generate patch)

Comparing UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.h (file contents):
Revision 1.6 by lantonel, Thu Feb 7 14:52:37 2013 UTC vs.
Revision 1.23 by wulsin, Wed Apr 17 15:39:43 2013 UTC

# Line 6 | Line 6
6   #include <string>
7   #include <vector>
8  
9 + #include <fstream>
10 + #include <iostream>
11 + #include <algorithm>
12   #include "TH1.h"
13 + #include "TH2.h"
14   #include "TH1D.h"
15   #include "TH2D.h"
16   #include "TLorentzVector.h"
# Line 19 | Line 23
23   #include "DataFormats/Common/interface/Handle.h"
24   #include "CommonTools/UtilAlgos/interface/TFileService.h"
25   #include "FWCore/Framework/interface/MakerMacros.h"
26 + #include "DataFormats/Math/interface/deltaPhi.h"
27 + #include "DataFormats/Math/interface/deltaR.h"
28  
29   #include "ProductArea/BNcollections/interface/BNbxlumi.h"
30   #include "ProductArea/BNcollections/interface/BNelectron.h"
# Line 38 | Line 44
44   #include "ProductArea/BNcollections/interface/BNgenjet.h"
45  
46   #include "OSUT3Analysis/AnaTools/interface/CutFlow.h"
47 + #include "OSUT3Analysis/AnaTools/interface/PUWeight.h"
48 + #include "OSUT3Analysis/AnaTools/interface/SFWeight.h"
49  
50 <
51 <
50 > #ifdef DISPLACED_SUSY
51 > #include "DisplacedSUSY/Configuration/interface/CTauWeight.h"
52 > #endif
53  
54   using namespace std;
55  
# Line 57 | Line 66 | class OSUAnalysis : public edm::EDAnalyz
66  
67        double valueLookup (const BNjet* object, string variable, string function = "");
68        double valueLookup (const BNmuon* object, string variable, string function = "");
69 +      double valueLookup (const BNmuon* object1, const BNmuon* object2, string variable, string function = "");
70        double valueLookup (const BNelectron* object, string variable, string function = "");
71 +      double valueLookup (const BNelectron* object1, const BNelectron* object2, string variable, string function = "");
72 +      double valueLookup (const BNelectron* object1, const BNmuon* object2, string variable, string function = "");
73 +      double valueLookup (const BNelectron* object1, const BNtrack* object2, string variable, string function = "");
74 +      double valueLookup (const BNmuon* object1, const BNtrack* object2, string variable, string function = "");
75 +      double valueLookup (const BNmuon* object1, const BNtau* object2, string variable, string function = "");
76 +      double valueLookup (const BNtau* object1, const BNtau* object2, string variable, string function = "");
77 +      double valueLookup (const BNtau* object1, const BNtrack* object2, string variable, string function);
78        double valueLookup (const BNevent* object, string variable, string function = "");
79        double valueLookup (const BNtau* object, string variable, string function = "");
80        double valueLookup (const BNmet* object, string variable, string function = "");
81        double valueLookup (const BNtrack* object, string variable, string function = "");
82 +      double valueLookup (const BNtrack* object1, const BNevent* object2, string variable, string function = "");
83        double valueLookup (const BNgenjet* object, string variable, string function = "");
84        double valueLookup (const BNmcparticle* object, string variable, string function = "");
85        double valueLookup (const BNprimaryvertex* object, string variable, string function = "");
86        double valueLookup (const BNbxlumi* object, string variable, string function = "");
87        double valueLookup (const BNphoton* object, string variable, string function = "");
88        double valueLookup (const BNsupercluster* object, string variable, string function = "");
89 +
90 +      int getTrkIsIso (const BNtrack* track1, const BNtrackCollection* trackColl);
91 +      double getTrkPtTrue (const BNtrack* track1, const BNmcparticleCollection* genPartColl);
92 +      double getTrkPtRes (const BNtrack* track1);
93 +      double getTrkIsIso (const BNtrack* track1);
94 +      double getTrkCaloTotRhoCorr(const BNtrack* track);
95 +      void WriteDeadEcal ();
96 +      int getTrkIsMatchedDeadEcal (const BNtrack* track1);
97 +
98        //BNskimbits
99        //BNtrigobj
100  
101        vector<string> splitString (string);
102 <
102 >      void getTwoObjs(string tempInputCollection, string& obj1, string& obj2);
103 >      string getObjToGet(string obj);  
104  
105      private:
106  
# Line 82 | Line 110 | class OSUAnalysis : public edm::EDAnalyz
110        //inner vector corresponds to each object in input collection
111        //bool         tells if object passes or fails cuts
112        typedef map<string, vector < vector<bool> > > flagMap;
113 <      
113 >
114        //counterMap:
115        //string holds input collection type
116        //vector corresponds to each cut
# Line 99 | Line 127 | class OSUAnalysis : public edm::EDAnalyz
127        edm::InputTag tracks_;
128        edm::InputTag genjets_;
129        edm::InputTag mcparticles_;
130 +      edm::InputTag stops_;
131        edm::InputTag primaryvertexs_;
132        edm::InputTag bxlumis_;
133        edm::InputTag photons_;
134        edm::InputTag superclusters_;
135        edm::InputTag triggers_;
136 <
137 <      TVector3 vertexPosition;
138 <
136 >      std::string puFile_;
137 >      std::string deadEcalFile_;
138 >      std::string muonSFFile_;
139 >      std::string dataPU_;
140 >      std::string electronSFID_;
141 >      std::string muonSF_;
142 >      std::string dataset_;
143 >      std::string datasetType_;
144        vector<edm::ParameterSet> channels_;
145        vector<edm::ParameterSet> histogramSets_;
146 +      bool plotAllObjectsInPassingEvents_;
147 +      bool doPileupReweighting_;
148 +      bool printEventInfo_;  
149 +      bool useTrackCaloRhoCorr_;  // to use the calo-based rho correction for the by-hand calculation of the track isolation energy
150 +      vector<double> stopCTau_;
151 +
152 +      struct DeadEcal {
153 +        double etaEcal;
154 +        double phiEcal;
155 +      };
156 +
157 +      std::vector<DeadEcal> DeadEcalVec;
158 +
159 +
160 +      //Collections
161 +      edm::Handle<BNtriggerCollection> triggers;
162 +      edm::Handle<BNjetCollection> jets;
163 +      edm::Handle<BNmuonCollection> muons;
164 +      edm::Handle<BNelectronCollection> electrons;
165 +      edm::Handle<BNeventCollection> events;
166 +      edm::Handle<BNtauCollection> taus;
167 +      edm::Handle<BNmetCollection> mets;
168 +      edm::Handle<BNtrackCollection> tracks;
169 +      edm::Handle<BNgenjetCollection> genjets;
170 +      edm::Handle<BNmcparticleCollection> mcparticles;
171 +      edm::Handle<BNprimaryvertexCollection> primaryvertexs;
172 +      edm::Handle<BNbxlumiCollection> bxlumis;
173 +      edm::Handle<BNphotonCollection> photons;
174 +      edm::Handle<BNsuperclusterCollection> superclusters;
175 +      edm::Handle<double> rhokt6CaloJetsHandle_;  
176 +
177 +      flagMap cumulativeFlags;
178  
179        vector<map<string, TH1D*> > oneDHists_;
180        vector<map<string, TH2D*> > twoDHists_;
# Line 119 | Line 185 | class OSUAnalysis : public edm::EDAnalyz
185        vector<CutFlow *> cutFlows_;
186  
187        typedef struct {
188 <        string name;
189 <        string title;
190 <        vector<double> bins;
191 <        string inputCollection;
192 <        vector<string> inputVariables;
127 <        string function;
188 >        string name;
189 >        string title;
190 >        vector<double> bins;
191 >        string inputCollection;
192 >        vector<string> inputVariables;
193        } histogram;
194  
195        struct cut {
196 <        string inputCollection;
197 <        string variable;
198 <        string comparativeOperator;
199 <        string function;
200 <        double cutValue;
201 <        int    numberRequired;
202 <        string eventComparativeOperator;
203 <        string name;
196 >        string inputCollection;
197 >        vector<string> functions;
198 >        vector<string> variables;
199 >        vector<string> comparativeOperators;// >, <, =, etc.
200 >        vector<double> cutValues;
201 >        vector<string> logicalOperators;//and, or
202 >        int numSubcuts;
203 >        int    numberRequired;
204 >        string eventComparativeOperator;
205 >        string name;
206        };
207  
208        struct channel {
209 <        string name;
210 <        vector<string> triggers;
211 <        vector<cut> cuts;
209 >        string name;
210 >        vector<string> triggers;
211 >        vector<cut> cuts;
212        };
213  
214 +      vector<string>  objectsToGet;
215 +      vector<string>  objectsToCut;
216        vector<string>  objectsToPlot;
148      vector<string>  allNecessaryObjects;
217        vector<channel> channels;
218        vector<histogram> histograms;
219  
220 +      PUWeight *puWeight_;
221 +      MuonSFWeight *muonSFWeight_;
222 +      ElectronSFWeight *electronSFWeight_;
223 + #ifdef DISPLACED_SUSY
224 +      CTauWeight *cTauWeight_;
225 + #endif
226 +      double cTauScaleFactor_;
227 +
228        template <class InputCollection> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection, string);
229 <      template <class InputCollection>  void fillHistogram(TH1*, histogram, InputCollection);
229 >      template <class InputCollection1, class InputCollection2> void setObjectFlags(cut &, uint, flagMap &, flagMap &, InputCollection1, InputCollection2, vector<bool>, vector<bool>, string);
230 >
231 >      template <class InputCollection> void fill1DHistogram(TH1*, histogram, InputCollection, vector<bool>, double);
232 >      template <class InputCollection1, class InputCollection2> void fill1DHistogram(TH1*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double);
233 >      template <class InputCollection> void fill2DHistogram(TH2*, histogram, InputCollection, vector<bool>, double);
234 >      template <class InputCollection1, class InputCollection2> void fill2DHistogram(TH2*, histogram, InputCollection1, InputCollection2, vector<bool>, vector<bool>, vector<bool>, double);
235 >      bool getPreviousCumulativeFlags(uint currentCutIndex, flagMap &individualFlags, string obj1Type, uint object1);  
236 >
237 >      template <class InputObject> int getGenMatchedParticleIndex(InputObject);
238 >      int getPdgIdBinValue(int);
239 >      int findTauMotherIndex(const BNmcparticle*);
240 >
241 >      template <class InputObject> double getGenDeltaRLowest(InputObject);
242  
243  
244 +      const BNprimaryvertex *chosenVertex ();
245 +      const BNmet *chosenMET ();
246 +      const BNelectron *chosenElectron ();
247 +      const BNmuon *chosenMuon ();
248  
249    };
250  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines