AmpTools
IntensityManager Class Referenceabstract

#include <IntensityManager.h>

Inheritance diagram for IntensityManager:

Public Types

enum  Type { kAmplitude, kMoment }
 

Public Member Functions

 IntensityManager (const vector< string > &reaction, const string &reactionName)
 
virtual ~IntensityManager ()
 
virtual Type type () const =0
 
virtual unsigned int maxFactorStoragePerEvent () const =0
 
virtual unsigned int termStoragePerEvent () const =0
 
virtual bool calcTerms (AmpVecs &ampVecs) const =0
 
virtual double calcIntensities (AmpVecs &ampVecs) const =0
 
virtual double calcSumLogIntensity (AmpVecs &ampVecs) const =0
 
virtual void calcIntegrals (AmpVecs &ampVecs, int iNGenEvents) const =0
 
double calcIntensity (const Kinematics *kinematics) const
 
const vector< string > & getTermNames () const
 
const AmpParametergetScale (const string &name) const
 
virtual bool hasTermWithFreeParam () const =0
 
int termIndex (const string &termName) const
 
string reactionName () const
 
complex< double > productionFactor (const string &termName) const
 
complex< double > productionFactor (int termIndex) const
 
void prodFactorArray (double *array) const
 
bool hasTerm (const string &termName) const
 
virtual void setupFromConfigurationInfo (const ConfigurationInfo *configInfo)=0
 
int addTerm (const string &termName, const string &scale="1.0")
 
void setDefaultProductionFactor (const string &termName, complex< double > prodAmp)
 
void setExternalProductionFactor (const string &ampName, const complex< double > *prodAmpPtr)
 
virtual void setParPtr (const string &termName, const string &parName, const double *ampParPtr)
 
virtual void setParValue (const string &termName, const string &parName, double ampParValue)
 
virtual void updatePar (const string &parName) const
 
void resetProductionFactors ()
 
bool termsAreRenormalized () const
 

Protected Member Functions

const NormIntInterfacenormInt () const
 

Detailed Description

Definition at line 53 of file IntensityManager.h.

Member Enumeration Documentation

◆ Type

Enumerator
kAmplitude 
kMoment 

Definition at line 57 of file IntensityManager.h.

Constructor & Destructor Documentation

◆ IntensityManager()

IntensityManager::IntensityManager ( const vector< string > &  reaction,
const string &  reactionName 
)

Definition at line 56 of file IntensityManager.cc.

◆ ~IntensityManager()

virtual IntensityManager::~IntensityManager ( )
inlinevirtual

Definition at line 62 of file IntensityManager.h.

Member Function Documentation

◆ addTerm()

int IntensityManager::addTerm ( const string &  termName,
const string &  scale = "1.0" 
)

This function adds a new term to the intensity calculation with the name termName. The unique index of this term is provided as a return value, which may be helpful in optimization.

Parameters
[in]termNamethe name of the new term. If the term already exists then no new term will be created and the index of the old term will be returned (and a warning message will be printed).
[in]scale(optional) the name of a parameter to use for the the scale factor for the term.
See also
termIndex

Definition at line 86 of file IntensityManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcIntegrals()

virtual void IntensityManager::calcIntegrals ( AmpVecs ampVecs,
int  iNGenEvents 
) const
pure virtual

This routine calculates the average values of A_iA_j*, which is useful for normalizing the PDFs. The results are stored in the AmpVecs object.

Parameters
[in,out]ampVecsa reference to the ampVecs structure from which the terms and factors are to be read.
[in]iNGenEventsthe number of genereated events (N in the above computation)
See also
calcAmplitudes
calcIntensities

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ calcIntensities()

virtual double IntensityManager::calcIntensities ( AmpVecs ampVecs) const
pure virtual

This function calculates the intensity (one number) for all events and stores it in the AmpVecs structure. It returns the maximum intensity in the data set, which is useful for accept/reject MC generation algorithms.

Parameters
[in,out]ampVecsa reference to the AmpVecs storage structure, four vectors will be read from this class and intensities written to it.
See also
calcAmplitudes
calcSumLogIntensity
calcIntegrals

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ calcIntensity()

double IntensityManager::calcIntensity ( const Kinematics kinematics) const

This function calculates the intensity for one event using a Kinematics object. This is only useful for diagnostics on a small number of events. The calcIntensities method should be used to calculate intensities for many events.

Parameters
[in]kinematicsa pointer to a Kinematics object

Definition at line 66 of file IntensityManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcSumLogIntensity()

virtual double IntensityManager::calcSumLogIntensity ( AmpVecs ampVecs) const
pure virtual

This function calculates and returns the sum of the log of the intensities stored in the AmpVecs structure.

Parameters
[in,out]ampVecsa reference to the ampVecs structure from which the intensities are to be read. (This structure may be modified and updated by underlying calls to calcIntensities and calcTerms.)
See also
calcAmplitudes
calcIntensities
calcIntegrals

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ calcTerms()

virtual bool IntensityManager::calcTerms ( AmpVecs ampVecs) const
pure virtual

This function caculates the various intensity terms for each data event. Since it can also be used to update the terms, it returns true if any term was reclaculated, false if there were no changes.

Parameters
[in,out]ampVecsa reference to the AmpVecs storage structure, four vectors will be read from this class and term caculations will be written to this class
See also
calcIntensities
calcSumLogIntensity
calcIntegrals

Implemented in AmplitudeManager.

◆ getScale()

const AmpParameter & IntensityManager::getScale ( const string &  name) const

The function returns a reference to the parameter that is acting as the scale factor for an amplitude. Even if the user does not set a scale factor, by default a fixed parameter is created and its value is inititalized to 1.

Definition at line 111 of file IntensityManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTermNames()

const vector< string > & IntensityManager::getTermNames ( ) const

This function returns a vector of strings. Each string corresponds to the name of a unique amplitude in the amplitude manager. The location of each amplitude in the vector represents the ampIndex, an integer corresponding to each amplitude that is largely used internally.

See also
ampIndex

Definition at line 105 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ hasTerm()

bool IntensityManager::hasTerm ( const string &  termName) const

This class returns a boolean indicating whether or not a term with the provided name exists in the IntensityManager.

Parameters
[in]termNamethe string identifying the term
See also
productionFactor
setExternalProductionFactor
setDefaultProductionFactor
resetProductionFactor

Definition at line 126 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ hasTermWithFreeParam()

virtual bool IntensityManager::hasTermWithFreeParam ( ) const
pure virtual

This function returns a boolean indicating if any term in the IntensityManager contains a free parameter than might be changing with each fit iteration. It is used to trigger the recalculation of normalization integrals at each fit iteration.

See also
setParPtr
setParValue

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ maxFactorStoragePerEvent()

virtual unsigned int IntensityManager::maxFactorStoragePerEvent ( ) const
pure virtual

This function should return the maximum number of doubles required to store all factors for any terms for an event. It is used by the framework for memory allocation.

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ normInt()

const NormIntInterface* IntensityManager::normInt ( ) const
inlineprotected

Definition at line 454 of file IntensityManager.h.

Here is the caller graph for this function:

◆ prodFactorArray()

void IntensityManager::prodFactorArray ( double *  array) const

This fills an array with the real and imaginary parts of the ith production factor in the 2*i and 2*i+1 elements. It is less user friendly, but useful for repeated high-speed access to the data

Parameters
[out]prodArrayarray of size 2*n that will be filled

Definition at line 153 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ productionFactor() [1/2]

complex< double > IntensityManager::productionFactor ( const string &  termName) const

This return returns the production factor ( $ V_i$) for a a single term. In general this is a complex number, for moment fits it will have no imaginary part.

Parameters
[in]ampNamethe string identifying the amplitude
See also
hasTerm
setExternalProductionFactor
setDefaultProductionFactor
resetProductionFactors

Definition at line 134 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ productionFactor() [2/2]

complex< double > IntensityManager::productionFactor ( int  termIndex) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]ampIndexthe index of the amplitude

Definition at line 146 of file IntensityManager.cc.

◆ reactionName()

string IntensityManager::reactionName ( ) const
inline

This returns the name of the final state that was optionally passed to the constructor of the AmplitudeManager.

Definition at line 217 of file IntensityManager.h.

Here is the caller graph for this function:

◆ resetProductionFactors()

void IntensityManager::resetProductionFactors ( )

This resets all of the production amplitudes to their default values. If production amplitudes were referenced from external pointers, this external referencing is broken by this call and the amplitudes are instead derived by internally stored default values.

Definition at line 193 of file IntensityManager.cc.

◆ setDefaultProductionFactor()

void IntensityManager::setDefaultProductionFactor ( const string &  termName,
complex< double >  prodAmp 
)

This is used to set the default production amplitude ( $ V_i $) for a specific amplitude. The production amplitude is the complex number that multiplies the decay amplitude (a collection of amplitude factors) in the construction of the intensity. When fitting, this production amplitude is typically a free parameter or is constrained to some other free parameter in the fit. To generate Monte Carlo, it is useful to be able to set this value to any arbitrary complex number

Parameters
[in]ampNamethe name of the amplitude that is having its production amplitude set
[in]prodAmpthe complex value of the production amplitude to set
See also
productionAmp
setExternalProductionAmplitude
resetProductionAmplitudes

Definition at line 168 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ setExternalProductionFactor()

void IntensityManager::setExternalProductionFactor ( const string &  ampName,
const complex< double > *  prodAmpPtr 
)

This is used to set the memory location to which the AmplitudeManager should look to find the production amplitude for a particular amplitude. Note that the AmplitudeManager does not have control over this memory. This relies on the user to create and preserve the memory that holds the acutal values. This is particularly useful when fitting where the ParameterManager manages and updates the production amplitudes and the AmplitudeManager can just look at this memory to recalculate the intensity.

Parameters
[in]ampNamethe name of the amplitude to set the production parameter for
[in]prodAmpPtra pointer to memory where the AmplitudeManager can look for the production amplitude
See also
productionAmp
setDefaultProductionAmplitude
resetProductionAmplitudes

Definition at line 177 of file IntensityManager.cc.

◆ setParPtr()

void IntensityManager::setParPtr ( const string &  termName,
const string &  parName,
const double *  ampParPtr 
)
virtual

This tells an amplitude to use an external pointer to resolve the value of some parameter inside of an amplitude. The parameter is not a production paramater as discussed above, but instead a parameter that may be floating in the description of the decay, e.g., the mass or width of some state. This routine is here for convenience, one could also get a list of all the amplitude factors and check each one for the parameter and then use the functionality of the Amplitude class to set the parameter pointer.

Parameters
[in]ampNamethe name of the amplitude that contains a factor that contains the paramter of interest
[in]parNamethe name of the parameter
[in]ampParPtra pointer to external memory that tells the amplitude where to find the value of the parameter
See also
setParValue
Amplitude::setParPtr

Reimplemented in AmplitudeManager.

Definition at line 205 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ setParValue()

void IntensityManager::setParValue ( const string &  termName,
const string &  parName,
double  ampParValue 
)
virtual

This tells an amplitude to use a particular value for some parameter inside of an amplitude. The parameter is not a production paramater as discussed above, but instead a parameter that may be floating in the description of the decay, e.g., the mass or width of some state. This routine is here for convenience, one could also get a list of all the amplitude factors and check each one for the parameter and then use the functionality of the Amplitude class to set the parameter value.

Parameters
[in]ampNamethe name of the amplitude that contains a factor that contains the paramter of interest
[in]parNamethe name of the parameter
[in]ampParValuethe value to which to set the parameter
See also
setParValue
Amplitude::setParValue

Reimplemented in AmplitudeManager.

Definition at line 215 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ setupFromConfigurationInfo()

virtual void IntensityManager::setupFromConfigurationInfo ( const ConfigurationInfo configInfo)
pure virtual

This function sets up the IntensityManager based on information provided by a ConfigurationInfo object. It is intended to be the most user-friendly way of configuring the amplitude manager for use.

Parameters
[in]configInfoa pointer to a ConfigurationInfo object

Implemented in AmplitudeManager.

◆ termIndex()

int IntensityManager::termIndex ( const string &  termName) const

This returns the internal index of a term. It is useful for users who may want to index data in an array.

Parameters
[in]termNamethe name of the term to get the index of
See also
getAmpNames

Definition at line 117 of file IntensityManager.cc.

Here is the caller graph for this function:

◆ termsAreRenormalized()

bool IntensityManager::termsAreRenormalized ( ) const
inline

This will cause amplitude manager to renormalize amplitudes in computations of the intensity only. Each amplitude will be multipled by a factor of $ 1 / \lang A_i(x) A_i^*(x) \rang $ that comes from the normalization integral interface.

This scaling is useful when fitting data as it results in a trivial relation between the fit parameters (production amplitudes) and the number of events associated with each amplitude.

This feature should be used with caution when coupled with constraints on the production parameters. If two amplitudes are constrained to have the same production coefficient and have the same scale, turning on renormalization will essentially for the two amplitudes to have the same number of events in the fit.

The default behavior is to have renormalization turned off.

Results of calcAmplitudes or calcIntegrals will remain unchanged. Note that this is necessary to avoid a circular dependency.

(Temporarily disabled until NormIntInterface supports renormalization of amplitudes with free parameters.)

Parameters
[in]normIntthe interface to provide normalization integrals
See also
disableRenormalization
ampsAreRenormalized This function disables renormalization of amplitudes in the calculation of the intensity.

(Temporarily disabled until NormIntInterface supports renormalization of amplitudes with free parameters.)

See also
renormalizeAmps
ampsAreRenormalized This function checks to see whether amplitudes are renormalized in the intensity calculation.
renormalizeTerms
disableRenormalization

Definition at line 450 of file IntensityManager.h.

Here is the caller graph for this function:

◆ termStoragePerEvent()

virtual unsigned int IntensityManager::termStoragePerEvent ( ) const
pure virtual

This function should return the number of doubles required to store all terms for an event. It should be equal to or smaller than that returned by the termFactorStoragePerEvent. The reason being that each term may be composed of multiple factors (for multiple permutations in the case of an amplitude fit). Once the factors are assembled into a term then, as long as the factors don't change, this term (modulo the production factor) remains constant throughout the fit.

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ type()

virtual Type IntensityManager::type ( ) const
pure virtual

This function returns the type of IntensityManager.

The types currently implimented are kAmplitude and kMoment for AmplitudeManager and MomentManager.

Implemented in AmplitudeManager.

Here is the caller graph for this function:

◆ updatePar()

virtual void IntensityManager::updatePar ( const string &  parName) const
inlinevirtual

This function will be called whenever a parameter is updateded.

See also
Amplitude::updatePar

Reimplemented in AmplitudeManager.

Definition at line 390 of file IntensityManager.h.


The documentation for this class was generated from the following files: