ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/UHHAnalysis/SFrameTools/src/Selection.cxx
(Generate patch)

Comparing UserCode/UHHAnalysis/SFrameTools/src/Selection.cxx (file contents):
Revision 1.4 by peiffer, Fri Jun 8 14:01:43 2012 UTC vs.
Revision 1.5 by rkogler, Tue Jan 29 10:44:08 2013 UTC

# Line 8 | Line 8 | Selection::Selection(std::string name):
8    m_name = name.c_str();
9    clearSelectionModulesList();
10    Ntotal=0;
11 +  m_isactive = true;
12   }
13  
14   void Selection::resetCutFlow(){
# Line 30 | Line 31 | void Selection::clearSelectionModulesLis
31   }
32  
33   bool Selection::passSelection(BaseCycleContainer *bcc){
34 +
35 +  if (!m_isactive) return true; // always true if the selection is not active
36 +
37    Ntotal++;
38    if(m_cuts.size()!=m_cutflow.size()){
39      m_logger << WARNING << "size of cut list != number of entries in cut flow table "<< SLogger::endmsg;
# Line 42 | Line 46 | bool Selection::passSelection(BaseCycleC
46   }
47  
48   bool Selection::passInvertedSelection(BaseCycleContainer *bcc){
49 +
50 +  if (!m_isactive) return true; // always true if the selection is not active
51    
52    for(unsigned int i=0; i<m_cuts.size(); ++i){
53      if(!m_cuts[i]->pass(bcc)) return true;
# Line 65 | Line 71 | void Selection::printCutFlow(){
71  
72    using namespace std;
73  
74 <  m_logger << INFO << "-------------------------- Cut Flow Table -------------------------"<< SLogger::endmsg;
74 >  m_logger << INFO << "--------------- Cut Flow Table of Selection " << m_name << " ---------------"<< SLogger::endmsg;
75 >  if (!m_isactive){
76 >    m_logger << INFO <<  "Selection was not active." << SLogger::endmsg;
77 >    m_logger << INFO << "-----------------------------------------------------------------------------"<< SLogger::endmsg;
78 >    return;
79 >  }
80 >
81    if(m_cuts.size()!=m_cutflow.size()){
82      m_logger << WARNING << "size of cut list != number of entries in cut flow table "<< SLogger::endmsg;
83    }
# Line 77 | Line 89 | void Selection::printCutFlow(){
89        m_logger << INFO << setw(12) << m_cutflow[i] << " | left after: " << m_cuts[i]->description() << SLogger::endmsg;
90      }
91    }
92 <  m_logger << INFO << "-------------+-----------------------------------------------------"<< SLogger::endmsg;
92 >  m_logger << INFO << "-------------+---------------------------------------------------------------"<< SLogger::endmsg;
93  
94   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines