1 |
#ifndef l1menu_MenuRatePlots_h
|
2 |
#define l1menu_MenuRatePlots_h
|
3 |
|
4 |
#include <vector>
|
5 |
#include <cstddef> // required to define NULL
|
6 |
|
7 |
#include <l1menu/TriggerRatePlot.h>
|
8 |
|
9 |
//
|
10 |
// Forward declarations
|
11 |
//
|
12 |
class TDirectory;
|
13 |
class TH1;
|
14 |
namespace l1menu
|
15 |
{
|
16 |
class TriggerMenu;
|
17 |
}
|
18 |
|
19 |
|
20 |
namespace l1menu
|
21 |
{
|
22 |
/** @brief Class that makes rate versus threshold plots for each of the triggers in the given menu.
|
23 |
*
|
24 |
* Note that when an instance goes out of scope the root histograms it has created are deleted, unless
|
25 |
* releaseAllPlots() is called before hand.
|
26 |
*
|
27 |
* @author Mark Grimes (mark.grimes@bristol.ac.uk)
|
28 |
* @date 24/May/2013
|
29 |
*/
|
30 |
class MenuRatePlots
|
31 |
{
|
32 |
public:
|
33 |
/** @brief Sets the triggers that plots should be made for and the directory to put them in.
|
34 |
*
|
35 |
* @param[in] triggerMenu The trigger menu with each of the triggers plots are required for. Any relevant
|
36 |
* parameters for each trigger (e.g. eta cuts) should be set before this is called.
|
37 |
* A reference to the menu is not kept so changes to the menu and/or triggers will
|
38 |
* have no effect after this constructor is called.
|
39 |
* @param[in] pDirectory A pointer to the root TDirectory where the plots should be created. Plots are
|
40 |
* created directly inside this directory so it's advised this is empty to avoid
|
41 |
* name clashes. Defaults to NULL which means the histograms will be held in memory
|
42 |
* only.
|
43 |
*/
|
44 |
MenuRatePlots( const l1menu::TriggerMenu& triggerMenu, TDirectory* pDirectory=NULL );
|
45 |
|
46 |
explicit MenuRatePlots( const TDirectory* pPreExistingPlotDirectory );
|
47 |
|
48 |
void addEvent( const l1menu::IEvent& event );
|
49 |
|
50 |
void addSample( const l1menu::ISample& sample );
|
51 |
|
52 |
/** @brief Set the root TDirectory where the histograms will reside. */
|
53 |
void setDirectory( TDirectory* pDirectory );
|
54 |
|
55 |
std::vector<TH1*> getPlots();
|
56 |
|
57 |
/** @brief Relinquish ownership of all the root TH1 plots.
|
58 |
*
|
59 |
* If this is not called the plots will be deleted when this instance goes out of scope. The
|
60 |
* pointers are still held however, so operations like addEvent() are still possible.*/
|
61 |
void relinquishOwnershipOfPlots();
|
62 |
protected:
|
63 |
std::vector<l1menu::TriggerRatePlot> triggerPlots_;
|
64 |
};
|
65 |
}
|
66 |
#endif
|