ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/SFrameTools/include/Selection.h
Revision: 1.6
Committed: Wed Jun 13 09:37:33 2012 UTC (12 years, 10 months ago) by peiffer
Content type: text/plain
Branch: MAIN
CVS Tags: Jan-17-2013-v2, Jan-17-2013-v1, Jan-16-2012-v1, Jan-09-2012-v2, Jan-09-2012-v1, Dec-26-2012-v1, Dec-20-2012-v1, Dec-17-2012-v1, Nov-30-2012-v2, Nov-30-2012-v1
Changes since 1.5: +31 -0 lines
Log Message:
doxygen info comments

File Contents

# User Rev Content
1 rkogler 1.3 // Dear emacs, this is -*- c++ -*-
2 peiffer 1.1 #ifndef Selection_H
3     #define Selection_H
4    
5 rkogler 1.3 #include <TString.h>
6 peiffer 1.1 #include "Objects.h"
7     #include "BaseCycleContainer.h"
8 peiffer 1.4 #include "ObjectHandler.h"
9 peiffer 1.2 #include "../../core/include/SLogger.h"
10 peiffer 1.1
11 peiffer 1.6 /**
12     * @short basic class for selection modules
13     * @author Thomas Peiffer
14     */
15    
16 peiffer 1.1 class SelectionModule{
17     public:
18 peiffer 1.6 //Default constructor
19 peiffer 1.1 SelectionModule(){};
20 peiffer 1.6 //Default destructor
21 peiffer 1.1 virtual ~SelectionModule(){};
22    
23     virtual bool pass(BaseCycleContainer*)=0;
24     virtual std::string description()=0;
25     };
26    
27 peiffer 1.6 /**
28     * @short basic class for a selection
29     *
30     * contains a list of SelectionModules
31     * and produces cut flow tables
32     *
33     * @author Thomas Peiffer
34     */
35 peiffer 1.1
36     class Selection{
37     public:
38    
39     //Selection(){};
40 peiffer 1.6 /// Default constructor
41 rkogler 1.3 Selection(std::string name);
42 peiffer 1.6 /// Default destructor
43 peiffer 1.1 ~Selection(){};
44    
45 peiffer 1.6 /// add a new SelectionModule to the event selection
46 peiffer 1.1 void addSelectionModule(SelectionModule*);
47 peiffer 1.6 /// remove all booked SelectionModules
48 peiffer 1.1 void clearSelectionModulesList();
49 peiffer 1.6 /// set all entries in the cut flow table to 0
50 peiffer 1.5 void resetCutFlow();
51 peiffer 1.6
52     /**
53     * loop over all booked SelectionModules and call the pass() routine of each module for a given BaseCycleContainer
54     * @see passSelection()
55     * @see SelectionModule::pass(BaseCycleContainer*)
56     */
57 peiffer 1.1 bool passSelection(BaseCycleContainer *bcc);
58     bool passInvertedSelection(BaseCycleContainer *bcc);
59 peiffer 1.6 /**
60     * same as passSelection(BaseCycleContainer *bcc) but takes BaseCycleContainer from ObjectHandler
61     * @see passSelection(BaseCycleContainer *bcc)
62     */
63 peiffer 1.4 bool passSelection();
64     bool passInvertedSelection();
65 peiffer 1.1
66 peiffer 1.6 /// print the cut-flow table for the booked SelectionModules, to be called in the EndInputData routine of a cycle
67 peiffer 1.1 void printCutFlow();
68    
69 rkogler 1.3 TString GetName() {return m_name;}
70     void SetName(TString name) { m_name = name;}
71    
72 peiffer 1.1 private:
73 rkogler 1.3 TString m_name;
74 peiffer 1.1 mutable SLogger m_logger;
75     std::vector<SelectionModule*> m_cuts;
76     std::vector<int> m_cutflow;
77 rkogler 1.3 int Ntotal;
78 peiffer 1.4
79 peiffer 1.1 };
80    
81    
82    
83 rkogler 1.3 #endif // Selection_H