fwlite::Scanner<C>, a way to inspect or plots elements of a collection C by using the StringParser.
More...
|
void | addEventSelector (fwlite::EventSelector *selector) |
|
void | clearEventSelector () |
|
size_t | count (const char *cut) |
|
size_t | countEvents () |
|
TH1 * | draw (const char *expr, const char *cut, TString drawopt, TH1 *hist) |
|
TH1 * | draw (const char *expr, const char *cut="", TString drawopt="", const char *hname="htemp", const TH1 *htemplate=0) |
|
TH1 * | draw (const char *expr, int nbins, double xlow, double xhigh, const char *cut="", const char *drawopt="", const char *hname="htemp") |
|
TH1 * | draw (const char *expr, int nbins, double *xbins, const char *cut="", const char *drawopt="", const char *hname="htemp") |
|
TH2 * | draw2D (TString xexpr, TString yexpr, const char *cut, TString drawopt, TH2 *hist) |
| Just like draw() except that it uses TH2. Note that the order is (x,y) while in ROOT it's usually (y,x)! More...
|
|
TH2 * | draw2D (TString xexpr, TString yexpr, const char *cut="", TString drawopt="", const char *hname="htemp", TH2 *htemplate=0) |
|
TH2 * | draw2D (TString xexpr, int xbins, double xlow, double xhigh, TString yexpr, int ybins, double ylow, double yhigh, const char *cut="", const char *drawopt="", const char *hname="htemp") |
| Just like draw() except that it uses TH2. Note that the order is (x,y) while in ROOT it's usually (y,x)! More...
|
|
TGraph * | drawGraph (TString xexpr, TString yexpr, const char *cut, TString drawopt, TGraph *graph) |
|
TGraph * | drawGraph (TString xexpr, TString yexpr, const char *cut="", TString drawopt="AP", const char *gname="htemp") |
|
TProfile * | drawProf (TString xexpr, TString yexpr, const char *cut, TString drawopt, TProfile *hist) |
| Just like draw() except that it uses TProfile. Note that the order is (x,y) while in ROOT it's usually (y,x)! More...
|
|
TProfile * | drawProf (TString xexpr, TString yexpr, const char *cut="", TString drawopt="", const char *hname="htemp", TProfile *htemplate=0) |
| Just like draw() except that it uses TProfile. Note that the order is (x,y) while in ROOT it's usually (y,x)! More...
|
|
TProfile * | drawProf (TString xexpr, int bins, double xlow, double xhigh, TString yexpr, const char *cut="", const char *drawopt="", const char *hname="htemp") |
| Just like draw() except that it uses TProfile. Note that the order is (x,y) while in ROOT it's usually (y,x)! More...
|
|
TObjArray & | eventSelectors () |
|
RooDataSet * | fillDataSet (const char *realvars, const char *boolvars, const char *cut="", const char *name="data") |
|
void | scan (const char *exprs, const char *cut="", int nmax=-1) |
|
| Scanner (fwlite::EventBase *ev, const char *label, const char *instance="", const char *process="") |
|
bool | selectEvent (const fwlite::EventBase &ev) const |
|
void | setExpressionSeparator (TString separator) |
|
void | setIgnoreExceptions (bool ignoreThem) |
|
void | setMaxEvents (int max) |
|
void | setMaxLinesToPrint (int lines) |
|
void | setPrintFullEventId (bool printIt=true) |
|
template<typename Collection>
class fwlite::Scanner< Collection >
fwlite::Scanner<C>, a way to inspect or plots elements of a collection C by using the StringParser.
fwlite::Scanner<C>, a way to inspect or plots elements of a collection C by using the StringParser.
The collection can be something as easy as std::vector<T>, but also some other fancy EDM collections like RefVector, RefToBaseVector and OwnVector (and probably PtrVector, but it was not tested)
If you're using something other than std::vector, you must provide the full typename, including all optional template parameters; e.g. you can't have C = edm::RefVector<reco::MuonCollection>, but you need C = edm::RefVector<vector<reco::Muon>,reco::Muon,edm::refhelper::FindUsingAdvance<vector<reco::Muon>,reco::Muon> > In order to figure out what is the correct full name for a collection in an event, open it in ROOT/FWLite, get the branch name including the trailing ".obj" (hint: Events->GetAlias("label")) usually works), and then do Events->GetBranch("xxx.obj")->GetClassName() to get something like edm::Wrapper<X>. then X is what you want to use to create the fwlite::Scanner. Don't use typedefs, they don't work.
Definition at line 44 of file Scanner.h.
template<typename Collection >
TH1* fwlite::Scanner< Collection >::draw |
( |
const char * |
expr, |
|
|
const char * |
cut, |
|
|
TString |
drawopt, |
|
|
TH1 * |
hist |
|
) |
| |
|
inline |
Plot the expression expr for events passing 'cut, into histogram hist. hist is not reset before filling it, so it will add to the existing content.
If "NORM" is specified in the draw options, the output histogram is normalized If "GOFF" is specified in the draw options, the output histogram is not drawn
See setMaxEvents() to specify how many events to loop on when plotting. Events can be further selected by using addEventSelector().
Definition at line 185 of file Scanner.h.
template<typename Collection >
void fwlite::Scanner< Collection >::scan |
( |
const char * |
exprs, |
|
|
const char * |
cut = "" , |
|
|
int |
nmax = -1 |
|
) |
| |
|
inline |
Scan the first nmax entries of the event and print out the values of some expressions.
The cut is applied to the individual entries. To set Event-wide cuts, use addEventSelector().
The different expressions are separated by ":", unless changed using setExpressionSeparator. The title of each column is the text of the expression, unless one specifies it differently by using the notation "@label=expression"
Each row is prefixed by the event id (Run/LS/Event on Data, entry number within the file for MC) and by the index of the object within the collection. The behaviour can be changed through the setPrintFullEventId() method.
The printing will pause by default every 50 lines (see setMaxLinesToPrint() to change this) Scanning will stop after nmax events.
Definition at line 77 of file Scanner.h.