#include <Selection.h>
Classes | |
class | const_iterator |
struct | Count |
Public Types | |
typedef const value_type & | const_reference |
typedef std::vector< Filter * > ::iterator | iterator |
typedef value_type & | reference |
typedef C::size_type | size_type |
typedef C::value_type | value_type |
Public Member Functions | |
std::map< std::string, bool > | accept (edm::Event &iEvent) |
const_iterator | begin () const |
iterator | begin () |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
bool | makeAllButOnePlots () |
bool | makeContentPlots () |
bool | makeCumulativePlots () |
bool | makeFinalPlots () |
bool | makeSummaryTable () |
const std::string & | name () |
bool | ntuplize () |
const_reference | operator[] (size_type i) |
void | print (bool description=true) |
void | printDetailledPrintoutHeader () |
Selection (const C &c, const Selector &sel) | |
Selection (std::string name, const edm::ParameterSet &iConfig) | |
size_type | size () const |
Private Attributes | |
std::map< std::string, Count > | counts_ |
std::string | detailledPrintoutCategory_ |
std::vector< Filter * > | filters_ |
bool | makeAllButOnePlots_ |
bool | makeContentPlots_ |
bool | makeCumulativePlots_ |
bool | makeDetailledPrintout_ |
bool | makeFinalPlots_ |
bool | makeSummaryTable_ |
std::string | name_ |
unsigned int | nMonitor_ |
unsigned int | nSeen_ |
bool | ntuplize_ |
Selector | select_ |
StoreContainer | selected_ |
Friends | |
class | Selections |
Definition at line 8 of file Selection.h.
typedef const value_type& Selection< C, Selector, StoreContainer >::const_reference |
Definition at line 13 of file Selection.h.
typedef std::vector<Filter*>::iterator Selection< C, Selector, StoreContainer >::iterator |
Definition at line 112 of file Selections.h.
typedef value_type& Selection< C, Selector, StoreContainer >::reference |
Definition at line 12 of file Selection.h.
typedef C::size_type Selection< C, Selector, StoreContainer >::size_type |
Definition at line 11 of file Selection.h.
typedef C::value_type Selection< C, Selector, StoreContainer >::value_type |
Definition at line 10 of file Selection.h.
Selection< C, Selector, StoreContainer >::Selection | ( | const C & | c, |
const Selector & | sel | ||
) | [inline] |
Definition at line 14 of file Selection.h.
References i, Selection< C, Selector, StoreContainer >::select_, and Selection< C, Selector, StoreContainer >::selected_.
Selection< C, Selector, StoreContainer >::Selection | ( | std::string | name, |
const edm::ParameterSet & | iConfig | ||
) | [inline] |
Definition at line 115 of file Selections.h.
References Selection< C, Selector, StoreContainer >::detailledPrintoutCategory_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), Selection< C, Selector, StoreContainer >::makeDetailledPrintout_, and Selection< C, Selector, StoreContainer >::nMonitor_.
: name_(name), ntuplize_(iConfig.getParameter<bool>("ntuplize")), makeContentPlots_(iConfig.getParameter<bool>("makeContentPlots")), makeFinalPlots_(iConfig.getParameter<bool>("makeFinalPlots")), makeCumulativePlots_(iConfig.getParameter<bool>("makeCumulativePlots")), makeAllButOnePlots_(iConfig.getParameter<bool>("makeAllButOnePlots")), nSeen_(0), makeSummaryTable_(iConfig.getParameter<bool>("makeSummaryTable")), makeDetailledPrintout_(iConfig.exists("detailledPrintoutCategory")) { if (iConfig.exists("nMonitor")) nMonitor_=iConfig.getParameter<unsigned int>("nMonitor"); else nMonitor_=0; if (makeDetailledPrintout_) detailledPrintoutCategory_ = iConfig.getParameter<std::string>("detailledPrintoutCategory"); }
std::map<std::string, bool> Selection< C, Selector, StoreContainer >::accept | ( | edm::Event & | iEvent | ) | [inline] |
Definition at line 139 of file Selections.h.
References Selection< C, Selector, StoreContainer >::begin(), prof2calltree::count, Selection< C, Selector, StoreContainer >::counts_, Selection< C, Selector, StoreContainer >::detailledPrintoutCategory_, Selection< C, Selector, StoreContainer >::end(), edm::EventID::event(), alcazmumu_cfi::filter, edm::EventBase::id(), Selection< C, Selector, StoreContainer >::makeDetailledPrintout_, Selection< C, Selector, StoreContainer >::name(), Selection< C, Selector, StoreContainer >::Count::nCumulative_, Selection< C, Selector, StoreContainer >::nMonitor_, Selection< C, Selector, StoreContainer >::Count::nPass_, Selection< C, Selector, StoreContainer >::Count::nSeen_, Selection< C, Selector, StoreContainer >::nSeen_, Selection< C, Selector, StoreContainer >::print(), run_regression::ret, edm::EventID::run(), and edmLumisInFiles::summary.
{ nSeen_++; if (nMonitor_!=0 && nSeen_%nMonitor_==0){ if (nSeen_==nMonitor_) print(); else print(false); } std::map<std::string, bool> ret; bool global=true; for (iterator filter=begin(); filter!=end();++filter){ const std::string & fName=(*filter)->name(); Count & count=counts_[fName]; count.nSeen_++; bool decision=(*filter)->accept(iEvent); ret[fName]=decision; if (decision) count.nPass_++; global=global && decision; if (global) count.nCumulative_++; } if (makeDetailledPrintout_){ std::stringstream summary; summary<<std::setw(20)<<name().substr(0,19)<<" : " <<std::setw(10)<<iEvent.id().run()<<" : " <<std::setw(10)<<iEvent.id().event(); for (iterator filter=begin(); filter!=end();++filter){ const std::string & fName=(*filter)->name(); summary<<" : "<<std::setw(10)<<(ret[fName]?"pass":"reject"); } edm::LogVerbatim(detailledPrintoutCategory_)<<summary.str(); } return ret; }
const_iterator Selection< C, Selector, StoreContainer >::begin | ( | void | ) | const [inline] |
Definition at line 48 of file Selection.h.
References Selection< C, Selector, StoreContainer >::selected_.
Referenced by Selection< C, Selector, StoreContainer >::accept(), Selection< C, Selector, StoreContainer >::print(), and Selection< C, Selector, StoreContainer >::printDetailledPrintoutHeader().
{ return const_iterator( selected_.begin() ); }
iterator Selection< C, Selector, StoreContainer >::begin | ( | void | ) | [inline] |
Definition at line 136 of file Selections.h.
References Selection< C, Selector, StoreContainer >::filters_.
{ return filters_.begin();}
bool Selection< C, Selector, StoreContainer >::empty | ( | ) | const [inline] |
Definition at line 51 of file Selection.h.
References Selection< C, Selector, StoreContainer >::selected_.
{ return selected_.empty(); }
iterator Selection< C, Selector, StoreContainer >::end | ( | void | ) | [inline] |
Definition at line 137 of file Selections.h.
References Selection< C, Selector, StoreContainer >::filters_.
{ return filters_.end();}
const_iterator Selection< C, Selector, StoreContainer >::end | ( | void | ) | const [inline] |
Definition at line 49 of file Selection.h.
References Selection< C, Selector, StoreContainer >::selected_.
Referenced by Selection< C, Selector, StoreContainer >::accept(), Selection< C, Selector, StoreContainer >::print(), and Selection< C, Selector, StoreContainer >::printDetailledPrintoutHeader().
{ return const_iterator( selected_.end() ); }
bool Selection< C, Selector, StoreContainer >::makeAllButOnePlots | ( | ) | [inline] |
Definition at line 242 of file Selections.h.
References Selection< C, Selector, StoreContainer >::makeAllButOnePlots_.
{ return makeAllButOnePlots_;}
bool Selection< C, Selector, StoreContainer >::makeContentPlots | ( | ) | [inline] |
Definition at line 239 of file Selections.h.
References Selection< C, Selector, StoreContainer >::makeContentPlots_.
{ return makeContentPlots_;}
bool Selection< C, Selector, StoreContainer >::makeCumulativePlots | ( | ) | [inline] |
Definition at line 241 of file Selections.h.
References Selection< C, Selector, StoreContainer >::makeCumulativePlots_.
{ return makeCumulativePlots_;}
bool Selection< C, Selector, StoreContainer >::makeFinalPlots | ( | ) | [inline] |
Definition at line 240 of file Selections.h.
References Selection< C, Selector, StoreContainer >::makeFinalPlots_.
{ return makeFinalPlots_;}
bool Selection< C, Selector, StoreContainer >::makeSummaryTable | ( | ) | [inline] |
Definition at line 243 of file Selections.h.
References Selection< C, Selector, StoreContainer >::makeSummaryTable_.
{ return makeSummaryTable_;}
const std::string& Selection< C, Selector, StoreContainer >::name | ( | void | ) | [inline] |
Definition at line 135 of file Selections.h.
References Selection< C, Selector, StoreContainer >::name_.
Referenced by Selection< C, Selector, StoreContainer >::accept(), and Selection< C, Selector, StoreContainer >::print().
{return name_;}
bool Selection< C, Selector, StoreContainer >::ntuplize | ( | ) | [inline] |
Definition at line 238 of file Selections.h.
References Selection< C, Selector, StoreContainer >::ntuplize_.
{return ntuplize_;}
const_reference Selection< C, Selector, StoreContainer >::operator[] | ( | size_type | i | ) | [inline] |
Definition at line 52 of file Selection.h.
References i, and Selection< C, Selector, StoreContainer >::selected_.
void Selection< C, Selector, StoreContainer >::print | ( | bool | description = true | ) | [inline] |
Definition at line 186 of file Selections.h.
References Selection< C, Selector, StoreContainer >::begin(), python::rootplot::argparse::category, prof2calltree::count, Selection< C, Selector, StoreContainer >::counts_, gather_cfg::cout, idDealer::description, Selection< C, Selector, StoreContainer >::end(), alcazmumu_cfi::filter, Selection< C, Selector, StoreContainer >::makeSummaryTable_, Selection< C, Selector, StoreContainer >::name(), Selection< C, Selector, StoreContainer >::Count::nCumulative_, Selection< C, Selector, StoreContainer >::Count::nPass_, Selection< C, Selector, StoreContainer >::Count::nSeen_, Selection< C, Selector, StoreContainer >::nSeen_, and edmLumisInFiles::summary.
Referenced by Selection< C, Selector, StoreContainer >::accept().
{ if (!makeSummaryTable_) return; unsigned int maxFnameSize = 20; for (iterator filter=begin(); filter!=end();++filter){ if ((*filter)->name().size() > maxFnameSize) maxFnameSize = (*filter)->name().size()+1; } // const std::string category ="Selections|"+name(); const std::string category ="Selections"; std::stringstream summary; summary<<" Summary table for selection: "<<name()<<" with: "<<nSeen_<<" events run."<<std::endl; if (nSeen_==0) return; if (description){ for (iterator filter=begin(); filter!=end();++filter){ const std::string & fName=(*filter)->name(); summary<<"filter: "<<std::right<<std::setw(10)<<fName<<"\n" <<(*filter)->descriptionText()<<"\n"; } } summary<<" filter stand-alone pass: "<<std::endl; summary<<std::right<<std::setw(maxFnameSize)<<"total read"<<": " <<std::right<<std::setw(10)<<nSeen_<<std::endl; for (iterator filter=begin(); filter!=end();++filter){ const std::string & fName=(*filter)->name(); const Count & count=counts_[fName]; summary<<std::right<<std::setw(maxFnameSize)<<fName<<": " <<std::right<<std::setw(10)<<count.nPass_<<" passed events. " <<std::right<<std::setw(10)<<std::setprecision (5)<<(count.nPass_/(float)count.nSeen_)*100.<<" [%]"<<std::endl; } summary<<" filter cumulative pass:"<<std::endl; summary<<std::right<<std::setw(maxFnameSize)<<"total read"<<": " <<std::right<<std::setw(10)<<nSeen_<<std::endl; unsigned int lastCount=nSeen_; for (iterator filter=begin(); filter!=end();++filter){ const std::string & fName=(*filter)->name(); const Count & count=counts_[fName]; summary<<std::right<<std::setw(maxFnameSize)<<fName<<": " <<std::right<<std::setw(10)<<count.nCumulative_<<" passed events. " <<std::right<<std::setw(10)<<std::setprecision (5)<<(count.nCumulative_/(float)count.nSeen_)*100.<<" [%]"; if (lastCount!=0) summary<<" (to previous count) "<<std::right<<std::setw(10)<<std::setprecision (5)<<(count.nCumulative_/(float)lastCount)*100.<<" [%]"; summary <<std::endl; lastCount = count.nCumulative_; } summary<<"-------------------------------------\n"; edm::LogVerbatim(category)<<summary.str(); std::cout<<summary.str(); };
void Selection< C, Selector, StoreContainer >::printDetailledPrintoutHeader | ( | ) | [inline] |
Definition at line 173 of file Selections.h.
References Selection< C, Selector, StoreContainer >::begin(), Selection< C, Selector, StoreContainer >::detailledPrintoutCategory_, Selection< C, Selector, StoreContainer >::end(), alcazmumu_cfi::filter, Selection< C, Selector, StoreContainer >::makeDetailledPrintout_, and edmLumisInFiles::summary.
{ if (makeDetailledPrintout_){ std::stringstream summary; summary<<std::setw(20)<<" selection name "<<" : " <<std::setw(10)<<" run "<<" : " <<std::setw(10)<<" event "; for (iterator filter=begin(); filter!=end();++filter){ summary<<" : "<<std::setw(10)<<(*filter)->name().substr(0,9); } edm::LogVerbatim(detailledPrintoutCategory_)<<summary.str(); } }
size_type Selection< C, Selector, StoreContainer >::size | ( | void | ) | const [inline] |
Definition at line 50 of file Selection.h.
References Selection< C, Selector, StoreContainer >::selected_.
{ return selected_.size(); }
friend class Selections [friend] |
Definition at line 113 of file Selections.h.
std::map<std::string, Count> Selection< C, Selector, StoreContainer >::counts_ [private] |
Definition at line 263 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::accept(), and Selection< C, Selector, StoreContainer >::print().
std::string Selection< C, Selector, StoreContainer >::detailledPrintoutCategory_ [private] |
Definition at line 266 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::accept(), Selection< C, Selector, StoreContainer >::printDetailledPrintoutHeader(), and Selection< C, Selector, StoreContainer >::Selection().
std::vector<Filter*> Selection< C, Selector, StoreContainer >::filters_ [private] |
Definition at line 247 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::begin(), Selection< C, Selector, StoreContainer >::end(), and Selections::Selections().
bool Selection< C, Selector, StoreContainer >::makeAllButOnePlots_ [private] |
Definition at line 253 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::makeAllButOnePlots().
bool Selection< C, Selector, StoreContainer >::makeContentPlots_ [private] |
Definition at line 250 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::makeContentPlots().
bool Selection< C, Selector, StoreContainer >::makeCumulativePlots_ [private] |
Definition at line 252 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::makeCumulativePlots().
bool Selection< C, Selector, StoreContainer >::makeDetailledPrintout_ [private] |
Definition at line 265 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::accept(), Selection< C, Selector, StoreContainer >::printDetailledPrintoutHeader(), and Selection< C, Selector, StoreContainer >::Selection().
bool Selection< C, Selector, StoreContainer >::makeFinalPlots_ [private] |
Definition at line 251 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::makeFinalPlots().
bool Selection< C, Selector, StoreContainer >::makeSummaryTable_ [private] |
Definition at line 264 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::makeSummaryTable(), and Selection< C, Selector, StoreContainer >::print().
std::string Selection< C, Selector, StoreContainer >::name_ [private] |
Definition at line 246 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::name().
unsigned int Selection< C, Selector, StoreContainer >::nMonitor_ [private] |
Definition at line 256 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::accept(), and Selection< C, Selector, StoreContainer >::Selection().
unsigned int Selection< C, Selector, StoreContainer >::nSeen_ [private] |
Definition at line 255 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::accept(), and Selection< C, Selector, StoreContainer >::print().
bool Selection< C, Selector, StoreContainer >::ntuplize_ [private] |
Definition at line 249 of file Selections.h.
Referenced by Selection< C, Selector, StoreContainer >::ntuplize().
Selector Selection< C, Selector, StoreContainer >::select_ [private] |
Definition at line 54 of file Selection.h.
Referenced by Selection< C, Selector, StoreContainer >::Selection().
StoreContainer Selection< C, Selector, StoreContainer >::selected_ [private] |
Definition at line 55 of file Selection.h.
Referenced by Selection< C, Selector, StoreContainer >::begin(), Selection< C, Selector, StoreContainer >::empty(), Selection< C, Selector, StoreContainer >::end(), Selection< C, Selector, StoreContainer >::operator[](), Selection< C, Selector, StoreContainer >::Selection(), and Selection< C, Selector, StoreContainer >::size().