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

Comparing UserCode/grimes/L1Menu/src/TriggerMenu.cpp (file contents):
Revision 1.8 by grimes, Mon Jun 24 16:25:26 2013 UTC vs.
Revision 1.10 by grimes, Sat Jun 29 16:14:45 2013 UTC

# Line 139 | Line 139 | l1menu::ITrigger& l1menu::TriggerMenu::a
139          return *triggers_.back();
140   }
141  
142 + l1menu::ITrigger& l1menu::TriggerMenu::addTrigger( const l1menu::ITrigger& triggerToCopy )
143 + {
144 +        std::unique_ptr<l1menu::ITrigger> pNewTrigger=triggerTable_.copyTrigger( triggerToCopy );
145 +        if( pNewTrigger.get()==NULL ) throw std::range_error( "Trigger requested that does not exist" );
146 +
147 +        triggers_.push_back( std::move(pNewTrigger) );
148 +
149 +        // Make sure triggerResults_ is always the same size as triggers_
150 +        triggerResults_.resize( triggers_.size() );
151 +        return *triggers_.back();
152 + }
153 +
154   size_t l1menu::TriggerMenu::numberOfTriggers() const
155   {
156          return triggers_.size();
# Line 165 | Line 177 | std::unique_ptr<l1menu::ITrigger> l1menu
177          return triggerTable_.copyTrigger(*triggers_[position]);
178   }
179  
180 < bool l1menu::TriggerMenu::apply( const l1menu::IEvent& event ) const
180 > bool l1menu::TriggerMenu::apply( const l1menu::L1TriggerDPGEvent& event ) const
181   {
182          bool atLeastOneTriggerHasFired=false;
183  
# Line 219 | Line 231 | void l1menu::TriggerMenu::loadMenuInOldF
231                                          // will have "threshold1" whereas a cross trigger will have "leg1threshold1", "leg2threshold1" etcetera. This
232                                          // utility function will get the threshold names in the correct order.
233                                          const auto& thresholdNames=l1menu::tools::getThresholdNames(newTrigger);
234 <                                        if( thresholdNames.size()>1 ) newTrigger.parameter(thresholdNames[0])=::convertStringToFloat( tableColumns[3] );
235 <                                        if( thresholdNames.size()>2 ) newTrigger.parameter(thresholdNames[1])=::convertStringToFloat( tableColumns[4] );
236 <                                        if( thresholdNames.size()>3 ) newTrigger.parameter(thresholdNames[2])=::convertStringToFloat( tableColumns[5] );
237 <                                        if( thresholdNames.size()>4 ) newTrigger.parameter(thresholdNames[3])=::convertStringToFloat( tableColumns[6] );
234 >                                        if( thresholdNames.size()>=1 ) newTrigger.parameter(thresholdNames[0])=::convertStringToFloat( tableColumns[3] );
235 >                                        if( thresholdNames.size()>=2 ) newTrigger.parameter(thresholdNames[1])=::convertStringToFloat( tableColumns[4] );
236 >                                        if( thresholdNames.size()>=3 ) newTrigger.parameter(thresholdNames[2])=::convertStringToFloat( tableColumns[5] );
237 >                                        if( thresholdNames.size()>=4 ) newTrigger.parameter(thresholdNames[3])=::convertStringToFloat( tableColumns[6] );
238  
239                                          float etaOrRegionCut=::convertStringToFloat( tableColumns[7] );
240                                          // For most triggers, I can just try and set both the etaCut and regionCut parameters

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines