ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/L1Menu/src/MenuRatePlots.cpp
(Generate patch)

Comparing UserCode/grimes/L1Menu/src/MenuRatePlots.cpp (file contents):
Revision 1.9 by grimes, Fri Jun 28 14:30:08 2013 UTC vs.
Revision 1.10 by grimes, Sat Jun 29 16:14:45 2013 UTC

# Line 14 | Line 14 | l1menu::MenuRatePlots::MenuRatePlots( co
14          // Before making any histograms make sure errors are done properly
15          TH1::SetDefaultSumw2();
16  
17 +        // This is always useful
18 +        const l1menu::TriggerTable& triggerTable=l1menu::TriggerTable::instance();
19 +
20          // Loop over each of the triggers in the menu, book a histogram for it and then create
21          // a l1menu::TriggerRate plot for it.
22          for( size_t triggerNumber=0; triggerNumber<triggerMenu.numberOfTriggers(); ++triggerNumber )
# Line 22 | Line 25 | l1menu::MenuRatePlots::MenuRatePlots( co
25                  // Figure out the parameter names of all the possible thresholds.
26                  const std::vector<std::string> thresholdNames=l1menu::tools::getThresholdNames(*pTrigger);
27  
28 +                //
29 +                // If there is more than one threshold add a plot where all of the thresholds are scaled together.
30 +                //
31 +                if( thresholdNames.size()>1 )
32 +                {
33 +                        const std::string& mainThreshold=thresholdNames.front();
34 +                        unsigned int numberOfBins=100;
35 +                        float lowerEdge=0;
36 +                        float upperEdge=100;
37 +                        try
38 +                        {
39 +                                numberOfBins=triggerTable.getSuggestedNumberOfBins( pTrigger->name(), mainThreshold );
40 +                                lowerEdge=triggerTable.getSuggestedLowerEdge( pTrigger->name(), mainThreshold );
41 +                                upperEdge=triggerTable.getSuggestedUpperEdge( pTrigger->name(), mainThreshold );
42 +                        }
43 +                        catch( std::exception& error) { /* Do nothing. If no binning suggestions have been set for this trigger use the defaults I set above. */ }
44 +
45 +                        std::unique_ptr<TH1> pHistogram( new TH1F( (pTrigger->name()+"_v_allThresholdsScaled").c_str(), "This title gets changed by TriggerRatePlot anyway", numberOfBins, lowerEdge, upperEdge ) );
46 +                        pHistogram->SetDirectory( pDirectory );
47 +                        // Passing thresholdNames tells the TriggerRatePlot to scale all parameters named in that
48 +                        // vector along with mainThreshold.
49 +                        triggerPlots_.push_back( std::move(l1menu::TriggerRatePlot(*pTrigger,std::move(pHistogram),mainThreshold,thresholdNames)) );
50 +
51 +                }
52 +
53                  // When a threshold is tested, I want all the other thresholds to be zero. I'll run through
54                  // and zero all of them now.
55                  for( std::vector<std::string>::const_iterator iName=thresholdNames.begin(); iName!=thresholdNames.end(); ++iName )
# Line 38 | Line 66 | l1menu::MenuRatePlots::MenuRatePlots( co
66                          float upperEdge=100;
67                          try
68                          {
41                                const l1menu::TriggerTable& triggerTable=l1menu::TriggerTable::instance();
69                                  numberOfBins=triggerTable.getSuggestedNumberOfBins( pTrigger->name(), *iThresholdName );
70                                  lowerEdge=triggerTable.getSuggestedLowerEdge( pTrigger->name(), *iThresholdName );
71                                  upperEdge=triggerTable.getSuggestedUpperEdge( pTrigger->name(), *iThresholdName );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines