ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/SFrameTools/src/Selection.cxx
Revision: 1.1
Committed: Fri May 25 09:31:04 2012 UTC (12 years, 11 months ago) by peiffer
Content type: text/plain
Branch: MAIN
Log Message:
move files to SFrameTools

File Contents

# Content
1 #include "../include/Selection.h"
2
3
4 Selection::Selection(std::string name):
5 m_logger ( name.c_str() ){
6 clearSelectionModulesList();
7 }
8
9 void Selection::addSelectionModule(SelectionModule* sel){
10 m_cuts.push_back(sel);
11 m_cutflow.push_back(0);
12 }
13
14 void Selection::clearSelectionModulesList(){
15 m_cuts.clear();
16 m_cutflow.clear();
17 }
18
19 bool Selection::passSelection(BaseCycleContainer *bcc){
20 if(m_cuts.size()!=m_cutflow.size()){
21 m_logger << WARNING << "size of cut list != number of entries in cut flow table "<< SLogger::endmsg;
22 }
23 for(unsigned int i=0; i<m_cuts.size(); ++i){
24 if(!m_cuts[i]->pass(bcc)) return false;
25 m_cutflow[i]++;
26 }
27 return true;
28 }
29
30 bool Selection::passInvertedSelection(BaseCycleContainer *bcc){
31
32 for(unsigned int i=0; i<m_cuts.size(); ++i){
33 if(!m_cuts[i]->pass(bcc)) return true;
34 }
35 return false;
36 }
37
38 void Selection::printCutFlow(){
39 m_logger << INFO << "--------------- Cut Flow Table ---------------"<< SLogger::endmsg;
40 if(m_cuts.size()!=m_cutflow.size()){
41 m_logger << WARNING << "size of cut list != number of entries in cut flow table "<< SLogger::endmsg;
42 }
43 else{
44 for(unsigned int i=0; i<m_cuts.size(); ++i){
45 m_logger << INFO << m_cutflow[i] << " " << m_cuts[i]->description() << SLogger::endmsg;
46 }
47 }
48 m_logger << INFO << "----------------------------------------------"<< SLogger::endmsg;
49
50 }