ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/L1Menu/interface/l1menu/MenuRatePlots.h
Revision: 1.2
Committed: Fri May 31 01:29:10 2013 UTC (11 years, 11 months ago) by grimes
Content type: text/plain
Branch: MAIN
Changes since 1.1: +8 -0 lines
Log Message:
Various improvements, including protobuf input and output for ReducedMenuSamples.

File Contents

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