rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
Rivet::Multiplexer< T > Class Template Reference

Type-specific multiplexed YODA analysis object. More...

#include <RivetYODA.hh>

Inheritance diagram for Rivet::Multiplexer< T >:
Rivet::MultiplexedAO

Public Types

using Inner = T
 Typedef for the YODA type being represented.
 

Public Member Functions

 Multiplexer (const vector< string > &weightNames, const T &p)
 
T::Ptr active () const
 
template<typename U = T>
auto binning () const -> std::enable_if_t< hasBinning< T >::value, const typename U::BinningT & >
 
string basePath () const
 Get the AO path of the object, without variation suffix.
 
string baseName () const
 Get the AO name of the object, without variation suffix.
 
 operator bool () const
 
bool operator! () const
 
T * operator-> ()
 Forwarding dereference-call operator.
 
T * operator-> () const
 Forwarding dereference-call operator.
 
T & operator* ()
 Forwarding dereference operator.
 
const T & operator* () const
 Forwarding dereference operator.
 
bool operator== (const MultiplexedAO &p)
 Test for equality.
 
bool operator!= (const MultiplexedAO &p)
 Test for inequality.
 
const vector< bool > & fillOutcomes () const
 
const vector< double > & fillFractions () const
 
Access methods
void setActiveWeightIdx (size_t iWeight)
 Set the active-object pointer to point at a variation in the persistent set.
 
void setActiveFinalWeightIdx (size_t iWeight)
 Set the active-object pointer to point at a variation in the final set.
 
void unsetActiveWeight ()
 Unset the active-object pointer.
 
void reset ()
 Clear the active object pointer.
 
void newSubEvent ()
 Create a new FillCollector for the next sub-event.
 
void collapseEventGroup (const vector< std::valarray< double > > &weights, const double nlowfrac=0.0)
 Pushes the (possibly collapsed) fill(s) into the persistent objects.
 
void collapseSubevents (const vector< std::valarray< double > > &weights, const double nlowfrac)
 
void pushToFinal ()
 
const vector< typename T::Ptr > & persistent () const
 
T::Ptr persistent (const size_t iWeight)
 Direct access to the persistent object in weight stream iWeight.
 
const vector< typename T::Ptr > & final () const
 
T::Ptr final (const size_t iWeight)
 Direct access to the finalized object in weight stream iWeight.
 
YODA::AnalysisObjectPtr activeAO () const
 Get the currently active analysis object.
 
void initBootstrap ()
 Helper method to resize aux vectors to AO size.
 

Friends

class Analysis
 
bool operator== (const Multiplexer &a, const Multiplexer &b)
 Equality operator.
 
bool operator!= (const Multiplexer &a, const Multiplexer &b)
 Inequality operator.
 
bool operator< (const Multiplexer a, const Multiplexer &b)
 Less-than operator.
 

Detailed Description

template<typename T>
class Rivet::Multiplexer< T >

Type-specific multiplexed YODA analysis object.

Specialisations of this class (to each type of YODA object) are effectively the user-facing types in Rivet analyses, modulo a further wrapping via the MultplexAOPtr (which is a customised std::shared_pointer around the Multiplexer).

Multiplexers instantiate one AO for each of the multiweights (x2 for pre- and post-finalize copies). They can expose either FillCollector<T> or T active pointers, for the analyze() and finalize() steps, respectively.

Todo:
Some things are not really well-defined here. For instance: fill() in the finalize() method and integral() in the analyze() method. Should we throw?

Member Function Documentation

◆ active()

template<typename T >
T::Ptr Rivet::Multiplexer< T >::active ( ) const
inline

Get the current active analysis object (may be either persistent or final, depending on stage)

Referenced by Rivet::Multiplexer< T >::operator*(), Rivet::Multiplexer< T >::operator*(), Rivet::Multiplexer< T >::operator->(), Rivet::Multiplexer< T >::operator->(), and Rivet::Multiplexer< T >::reset().

◆ activeAO()

template<typename T >
YODA::AnalysisObjectPtr Rivet::Multiplexer< T >::activeAO ( ) const
inlinevirtual

Get the currently active analysis object.

Implements Rivet::MultiplexedAO.

◆ basePath()

template<typename T >
string Rivet::Multiplexer< T >::basePath ( ) const
inlinevirtual

Get the AO path of the object, without variation suffix.

Implements Rivet::MultiplexedAO.

◆ collapseEventGroup()

template<typename T >
void Rivet::Multiplexer< T >::collapseEventGroup ( const vector< std::valarray< double > > &  weights,
const double  nlowfrac = 0.0 
)
inlinevirtual

Pushes the (possibly collapsed) fill(s) into the persistent objects.

Todo:
If we don't multiplex (Binned)Estimates, perhaps we can get rid of this protection?

Implements Rivet::MultiplexedAO.

References Rivet::Multiplexer< T >::collapseSubevents(), and Rivet::Multiplexer< T >::initBootstrap().

◆ collapseSubevents()

template<typename T >
void Rivet::Multiplexer< T >::collapseSubevents ( const vector< std::valarray< double > > &  weights,
const double  nlowfrac 
)
inline

Collapse the set of FillCollectors (i.e. _evgroup) into combined fills of the persistent objects, using fractional fills if there are subevents

Note
The number of fills could be different between sub-events, in which case we will first add a padding of "empty" fills. We also take the transpose of subevents vs fills.
Todo:
Do we really need the transposing??

Referenced by Rivet::Multiplexer< T >::collapseEventGroup().

◆ final()

template<typename T >
const vector< typename T::Ptr > & Rivet::Multiplexer< T >::final ( ) const
inline

Get the set of final analysis objects, as used by Analysis::finalize() and written out

◆ initBootstrap()

template<typename T >
void Rivet::Multiplexer< T >::initBootstrap ( )
inlinevirtual

Helper method to resize aux vectors to AO size.

Implements Rivet::MultiplexedAO.

Referenced by Rivet::Multiplexer< T >::collapseEventGroup().

◆ newSubEvent()

template<typename T >
void Rivet::Multiplexer< T >::newSubEvent ( )
inlinevirtual

Create a new FillCollector for the next sub-event.

Called every sub-event by AnalysisHandler::analyze() before dispatch to Analysis::analyze(). The fill values will be redistributed over variations by collapseEventGroup().

Implements Rivet::MultiplexedAO.

◆ operator bool()

template<typename T >
Rivet::Multiplexer< T >::operator bool ( ) const
inlineexplicit

Test for object validity.

Note
Don't use active() here: assert will catch.

◆ operator!()

template<typename T >
bool Rivet::Multiplexer< T >::operator! ( ) const
inline

Test for object invalidity.

Note
Don't use active() here: assert will catch.

◆ operator*()

template<typename T >
const T & Rivet::Multiplexer< T >::operator* ( ) const
inlinevirtual

Forwarding dereference operator.

Implements Rivet::MultiplexedAO.

References Rivet::Multiplexer< T >::active().

◆ operator->() [1/2]

template<typename T >
T * Rivet::Multiplexer< T >::operator-> ( )
inlinevirtual

Forwarding dereference-call operator.

Implements Rivet::MultiplexedAO.

References Rivet::Multiplexer< T >::active().

◆ operator->() [2/2]

template<typename T >
T * Rivet::Multiplexer< T >::operator-> ( ) const
inlinevirtual

Forwarding dereference-call operator.

Implements Rivet::MultiplexedAO.

References Rivet::Multiplexer< T >::active().

◆ persistent()

template<typename T >
const vector< typename T::Ptr > & Rivet::Multiplexer< T >::persistent ( ) const
inline

Get the set of persistent (i.e. after whole event groups) live objects, as used by Analysis::analyze().

◆ pushToFinal()

template<typename T >
void Rivet::Multiplexer< T >::pushToFinal ( )
inlinevirtual

Copy all variations from the "live" persistent set to the final collection used by Analysis::finalize()

Implements Rivet::MultiplexedAO.

◆ setActiveFinalWeightIdx()

template<typename T >
void Rivet::Multiplexer< T >::setActiveFinalWeightIdx ( size_t  iWeight)
inlinevirtual

Set the active-object pointer to point at a variation in the final set.

Implements Rivet::MultiplexedAO.

◆ setActiveWeightIdx()

template<typename T >
void Rivet::Multiplexer< T >::setActiveWeightIdx ( size_t  iWeight)
inlinevirtual

Set the active-object pointer to point at a variation in the persistent set.

Implements Rivet::MultiplexedAO.

◆ unsetActiveWeight()

template<typename T >
void Rivet::Multiplexer< T >::unsetActiveWeight ( )
inlinevirtual

Unset the active-object pointer.

Implements Rivet::MultiplexedAO.


The documentation for this class was generated from the following file:
  • /Users/chrisg/software/rivet/include/Rivet/Tools/RivetYODA.hh