4 |
|
#include "l1menu/ITrigger.h" |
5 |
|
#include "l1menu/TriggerMenu.h" |
6 |
|
#include "l1menu/TriggerRatePlot.h" |
7 |
< |
#include "l1menu/tools.h" |
7 |
> |
#include "l1menu/tools/tools.h" |
8 |
|
#include "l1menu/ReducedMenuSample.h" |
9 |
< |
#include "l1menu/IReducedEvent.h" |
9 |
> |
#include "l1menu/ReducedEvent.h" |
10 |
|
#include <TH1F.h> |
11 |
|
|
12 |
|
l1menu::MenuRatePlots::MenuRatePlots( const l1menu::TriggerMenu& triggerMenu, TDirectory* pDirectory ) |
13 |
|
{ |
14 |
+ |
// Before making any histograms make sure errors are done properly |
15 |
+ |
TH1::SetDefaultSumw2(); |
16 |
|
|
17 |
|
// Loop over each of the triggers in the menu, book a histogram for it and then create |
18 |
|
// a l1menu::TriggerRate plot for it. |
20 |
|
{ |
21 |
|
std::unique_ptr<l1menu::ITrigger> pTrigger=triggerMenu.getTriggerCopy(triggerNumber); |
22 |
|
// Figure out the parameter names of all the possible thresholds. |
23 |
< |
const std::vector<std::string> thresholdNames= l1menu::getThresholdNames(*pTrigger); |
23 |
> |
const std::vector<std::string> thresholdNames=l1menu::tools::getThresholdNames(*pTrigger); |
24 |
|
|
25 |
|
// When a threshold is tested, I want all the other thresholds to be zero. I'll run through |
26 |
|
// and zero all of them now. |
42 |
|
numberOfBins=triggerTable.getSuggestedNumberOfBins( pTrigger->name(), *iThresholdName ); |
43 |
|
lowerEdge=triggerTable.getSuggestedLowerEdge( pTrigger->name(), *iThresholdName ); |
44 |
|
upperEdge=triggerTable.getSuggestedUpperEdge( pTrigger->name(), *iThresholdName ); |
43 |
– |
upperEdge*=5; // I'm getting incomplete ReducedSamples, I think because there is the odd overflow event. |
45 |
|
} |
46 |
|
catch( std::exception& error) { /* Do nothing. If no binning suggestions have been set for this trigger use the defaults I set above. */ } |
47 |
|
|
53 |
|
} // end of loop over the triggers in the menu |
54 |
|
} |
55 |
|
|
56 |
< |
void l1menu::MenuRatePlots::addEvent( const l1menu::IEvent& event ) |
56 |
> |
void l1menu::MenuRatePlots::addEvent( const l1menu::L1TriggerDPGEvent& event ) |
57 |
|
{ |
58 |
|
// Loop over each of the TriggerRatePlots and add the event to each of them. |
59 |
|
for( auto& ratePlot : triggerPlots_ ) |
71 |
|
} |
72 |
|
} |
73 |
|
|
74 |
< |
void l1menu::MenuRatePlots::addEvent( const l1menu::IReducedEvent& event ) |
74 |
> |
void l1menu::MenuRatePlots::addEvent( const l1menu::ReducedEvent& event ) |
75 |
|
{ |
76 |
|
// Loop over each of the TriggerRatePlots and add the event to each of them. |
77 |
|
for( auto& ratePlot : triggerPlots_ ) |
80 |
|
} |
81 |
|
} |
82 |
|
|
83 |
+ |
void l1menu::MenuRatePlots::addSample( const l1menu::ISample& sample ) |
84 |
+ |
{ |
85 |
+ |
// Loop over each of the TriggerRatePlots and add the sample to each of them. |
86 |
+ |
for( auto& ratePlot : triggerPlots_ ) |
87 |
+ |
{ |
88 |
+ |
ratePlot.addSample( sample ); |
89 |
+ |
} |
90 |
+ |
} |
91 |
+ |
|
92 |
|
void l1menu::MenuRatePlots::setDirectory( TDirectory* pDirectory ) |
93 |
|
{ |
94 |
|
// Loop over each of the TriggerRatePlots and individually set the directory. |