ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/L1Menu/interface/l1menu/MenuRatePlots.h
Revision: 1.4
Committed: Tue Jul 2 23:30:35 2013 UTC (11 years, 10 months ago) by grimes
Content type: text/plain
Branch: MAIN
Changes since 1.3: +1 -4 lines
Log Message:
Various changes to make interface conformance better, and dropping old unrequired methods

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 grimes 1.3 class L1TriggerDPGEvent;
18 grimes 1.2 class ReducedMenuSample;
19 grimes 1.3 class ReducedEvent;
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 grimes 1.4 void addEvent( const l1menu::IEvent& event );
50 grimes 1.3
51     void addSample( const l1menu::ISample& sample );
52 grimes 1.2
53 grimes 1.1 /** @brief Set the root TDirectory where the histograms will reside. */
54     void setDirectory( TDirectory* pDirectory );
55    
56 grimes 1.2 std::vector<TH1*> getPlots();
57    
58 grimes 1.1 /** @brief Relinquish ownership of all the root TH1 plots.
59     *
60     * If this is not called the plots will be deleted when this instance goes out of scope. The
61     * pointers are still held however, so operations like addEvent() are still possible.*/
62     void relinquishOwnershipOfPlots();
63     protected:
64     std::vector<l1menu::TriggerRatePlot> triggerPlots_;
65     };
66     }
67     #endif