ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/RA2/Selection/interface/Selection.h
Revision: 1.2
Committed: Wed Nov 11 13:05:23 2009 UTC (15 years, 6 months ago) by auterman
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +14 -0 lines
Log Message:
adding examples

File Contents

# User Rev Content
1 auterman 1.1 #ifndef Selection_H
2     #define Selection_H
3    
4     // System include files
5     #include <memory>
6     #include <vector>
7     #include <string>
8     #include <sstream>
9     #include <iostream>
10     #include <iomanip>
11    
12     // Framework include files
13     #include "FWCore/Framework/interface/Frameworkfwd.h"
14     #include "FWCore/Framework/interface/EDFilter.h"
15     #include "FWCore/Framework/interface/Event.h"
16     #include "FWCore/Framework/interface/MakerMacros.h"
17     #include "FWCore/ParameterSet/interface/ParameterSet.h"
18    
19    
20     // SUSY include files
21     #include "SusyAnalysis/EventSelector/interface/SusyEventSelector.h"
22     #include "SusyAnalysis/EventSelector/interface/SelectorSequence.h"
23    
24    
25     //
26     // Class declaration
27     //
28    
29     class Selection : public edm::EDFilter {
30     public:
31     explicit Selection(const edm::ParameterSet&);
32     ~Selection();
33    
34     private:
35     // *** CMSSW interface
36     /// Called once per job, at start
37     virtual void beginJob(const edm::EventSetup&);
38     /// Called for each event: returns the global decision
39     virtual bool filter(edm::Event&, const edm::EventSetup&);
40     /// Called once per job, at end
41     virtual void endJob();
42    
43     // *** Data memebers
44     SelectorSequence sequence_; ///< Interface to selectors
45     std::vector<std::string> filterSelection_; ///< Container for filter selection (i.e., hard cuts)
46     std::vector<size_t> filterSelectionIndices_; ///< Selector indices for filter selection
47 auterman 1.2 edm::InputTag weightName_;
48     double weight_; ///event weight (if available, 1 otherwise)
49     unsigned Nevents;
50    
51     //Statistics
52     struct TStatistics{
53     //@@ FixMe: Make NTotal static!
54     TStatistics():NTotal(0),NSelected(0),Nminus1total(0),Nminus1(0),NCumulative(0){};
55     double NTotal,NSelected, Nminus1total, Nminus1, NCumulative;
56     double Eff(){ return (NTotal==0 ? 0.0 : NSelected/(double)NTotal); };
57     double EffNminus1(){ return (Nminus1total==0 ? 0.0 : Nminus1/(double)Nminus1total); };
58     double EffCumulative(){ return (NTotal==0 ? 0.0 : NCumulative/(double)NTotal); };
59     };
60     std::vector<TStatistics> SelectionStats_;
61 auterman 1.1 };
62    
63     #endif