MONA - Mass Ordering Nikhef Analysis
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
EventSelection Class Reference

This class inherits from EventFilter and can be used to define event selections when looping over SummaryEvent's. More...

#include <EventSelection.h>

Inheritance diagram for EventSelection:
EventFilter

Public Member Functions

 EventSelection (reco reco_type, TString selection_name="", Bool_t TreeMode=kFALSE, Int_t ebins=40, Double_t emin=1., Double_t emax=100., Int_t ctbins=40, Double_t ctmin=-1., Double_t ctmax=1., Int_t bybins=1, Double_t bymin=0., Double_t bymax=1.)
 Constructor of an EventSelection. More...
 
 EventSelection (const EventSelection &evsel)
 Copy constructor. More...
 
 ~EventSelection ()
 Destructor. More...
 
void Fill (SummaryEvent *evt, Double_t w=1.)
 Fill function that fills a SummaryEvent to member histograms if the event passes the cuts set for this event selection. More...
 
void WriteToFile (TString fname)
 Write the histograms to file. More...
 
TString Get_SelName ()
 Get the selection name. More...
 
TH2D * Get_h_E_costh ()
 Get the pointer to E_costh histo. More...
 
TH3D * Get_h_E_costh_by ()
 Get the pointer to E_costh_by histo. More...
 
- Public Member Functions inherited from EventFilter
 EventFilter (reco reco_type=EventFilter::mc_truth)
 Constructor. More...
 
 ~EventFilter ()
 Destructor. More...
 
Bool_t PassesCuts (SummaryEvent *evt)
 Function to determine whether the event passes the cuts defined for this event filter. More...
 
void SetObservables (SummaryEvent *evt)
 Function that copies variables from a SummaryEvent to member observables, depending on reco type. More...
 
void AddCut (std::function< Double_t(SummaryEvent &)> getter_ptr, std::function< bool(double, double)> comp_ptr, Double_t value, Bool_t AndCut)
 Function to add an 'and' cut or an 'or' cut to this event filter. More...
 
void SetObsFuncPtrs (Double_t(*E)(SummaryEvent *), TVector3(*ct)(SummaryEvent *), TVector3(*pos)(SummaryEvent *), Double_t(*by)(SummaryEvent *))
 This function has to be used to set the function pointers when reconstruction type "customreco" is used. More...
 

Private Attributes

TString fSelName
 name of the selection More...
 
TH2D * fh_E_costh
 Energy vs CosTheta histogram. More...
 
TH3D * fh_E_costh_by
 Energy vs CosTheta vs by histogram. More...
 

Additional Inherited Members

- Public Types inherited from EventFilter
enum  reco { mc_truth, track, shower, customreco }
 enum to determine which reco type is used in filling hists in inheriting classes More...
 
- Public Attributes inherited from EventFilter
reco fRecoType
 variable to determine which reco type is used More...
 
Double_t fEnergy
 energy observable for inheriting classes, depending on reco type More...
 
TVector3 fPos
 position observable for inheriting classes, depending on reco type More...
 
TVector3 fDir
 direction observable for inheriting classes, depending on reco type More...
 
Double_t fBy
 bjorken-y observable for inheriting classes, depending on reco type More...
 

Detailed Description

This class inherits from EventFilter and can be used to define event selections when looping over SummaryEvent's.

At the init of the class the user selects the reconstruction type that is used for filling member histograms. Then, the function EventFilter::AddCut can be used to define selection cuts for the events of this selection. The method EventSelection::Fill stores a SummaryEvent for this selection if the event passes the selection cuts.

The class always fills member histograms when Fill is called. TO-BE-IMPLEMENTED: Additionally, when TreeMode flag is specified, the code saves the reco variables to a TTree, such that fitter_software can be used to perform an un-binned fit to data.

Definition at line 19 of file EventSelection.h.

Constructor & Destructor Documentation

EventSelection::EventSelection ( reco  reco_type,
TString  selection_name = "",
Bool_t  TreeMode = kFALSE,
Int_t  ebins = 40,
Double_t  emin = 1.,
Double_t  emax = 100.,
Int_t  ctbins = 40,
Double_t  ctmin = -1.,
Double_t  ctmax = 1.,
Int_t  bybins = 1,
Double_t  bymin = 0.,
Double_t  bymax = 1. 
)

Constructor of an EventSelection.

Parameters
reco_typeReco type used for filling histograms, e.g. EventSelection::track
selection_nameString identifier for this selection
TreeModeSave the events to a TTree to perform un-binned fits to data (currently not implemented)
ebinsNumber of energy bins for histogram(s)
eminMinimum energy for histogram(s)
emaxMaximum energy for histogram(s)
ctbinsNumber of $cos\theta$ bins for histogram(s)
ctminMinimum $cos\theta$ for histogram(s)
ctmaxMaximum $cos\theta$ for histogram(s)
bybinsNumber of bjorken-y bins for histogram(s)
byminMinimum bjorken-y for histogram(s)
bymaxMaximum bjorken-y for histogram(s)

Definition at line 29 of file EventSelection.C.

EventSelection::EventSelection ( const EventSelection evsel)

Copy constructor.

The cuts are copied by the default copy constructor of the EventFilter, here the ROOT members (histograms, TTree) are taken care of.

Parameters
evselAnother instance of EventSelection

Definition at line 70 of file EventSelection.C.

EventSelection::~EventSelection ( )

Destructor.

Definition at line 86 of file EventSelection.C.

Member Function Documentation

void EventSelection::Fill ( SummaryEvent evt,
Double_t  w = 1. 
)

Fill function that fills a SummaryEvent to member histograms if the event passes the cuts set for this event selection.

Parameters
evtPointer to the SummaryEvent.
wEvent weight when filled to histograms.

Definition at line 102 of file EventSelection.C.

TH2D* EventSelection::Get_h_E_costh ( )
inline

Get the pointer to E_costh histo.

Definition at line 34 of file EventSelection.h.

TH3D* EventSelection::Get_h_E_costh_by ( )
inline

Get the pointer to E_costh_by histo.

Definition at line 35 of file EventSelection.h.

TString EventSelection::Get_SelName ( )
inline

Get the selection name.

Definition at line 33 of file EventSelection.h.

void EventSelection::WriteToFile ( TString  fname)

Write the histograms to file.

Parameters
fnameName of the root file data is written to.

Definition at line 124 of file EventSelection.C.

Member Data Documentation

TH2D* EventSelection::fh_E_costh
private

Energy vs CosTheta histogram.

Definition at line 39 of file EventSelection.h.

TH3D* EventSelection::fh_E_costh_by
private

Energy vs CosTheta vs by histogram.

Definition at line 40 of file EventSelection.h.

TString EventSelection::fSelName
private

name of the selection

Definition at line 38 of file EventSelection.h.


The documentation for this class was generated from the following files: