AmpTools
AmpVecs Struct Reference

#include <AmpVecs.h>

Collaboration diagram for AmpVecs:

Public Member Functions

 AmpVecs ()
 
 ~AmpVecs ()
 
void allocateTerms (const IntensityManager &intenMan, bool bAllocIntensity=false)
 
void allocateCPUAmpStorage (const IntensityManager &intenMan)
 
void loadData (DataReader *pDataReader, bool bForceNegativeWeight=false)
 
void loadEvent (const Kinematics *pKinematics, unsigned long long iEvent=0, unsigned long long iNTrueEvents=1, bool bForceNegativeWeight=false)
 
KinematicsgetEvent (int i)
 
void deallocAmpVecs ()
 

Public Attributes

unsigned long long m_iNEvents
 
unsigned long long m_iNTrueEvents
 
double m_dAbsSumWeights
 
unsigned int m_iNParticles
 
unsigned int m_iNTerms
 
unsigned int m_maxFactPerEvent
 
GDoublem_pdData
 
GDoublem_pdWeights
 
GDoublem_pdAmps
 
GDoublem_pdAmpFactors
 
GDoublem_pdIntegralMatrix
 
GDoublem_pdIntensity
 
bool m_termsValid
 
bool m_integralValid
 
GPUManager m_gpuMan
 

Detailed Description

This class is intended to be a helper structure that serves as a place to pack data, amplitudes, and intensities for a particular data set. Internally these data are stored as flat arrays to improve speed of the code. The data-packing in this structure is not the most user friendly, but the design is such that the user never really needs to interact with the contents of this structure.

Definition at line 62 of file AmpVecs.h.

Constructor & Destructor Documentation

◆ AmpVecs()

AmpVecs::AmpVecs ( )

The constructor. All array pointers are set to zero in the constructor. No memory is allocated at construction time.

Definition at line 49 of file AmpVecs.cc.

◆ ~AmpVecs()

AmpVecs::~AmpVecs ( )
inline

This destructor frees all of the allocated memory that holds all of the data and amplitude calculations.

See also
deallocAmpVecs

Definition at line 175 of file AmpVecs.h.

Here is the call graph for this function:

Member Function Documentation

◆ allocateCPUAmpStorage()

void AmpVecs::allocateCPUAmpStorage ( const IntensityManager intenMan)

This will allocate CPU memory for storage and copying of amplitudes and amplitude factors from the GPU. For most production operations this wastes CPU memory and is unnecessary since all amplitudes are maintained on the GPU. However for some debugging operations, this functionality is useful.

Parameters
[in]intenMana reference to the IntensityManager to use as a guide for allocating the arrays for terms, factors, and intensities

Definition at line 280 of file AmpVecs.cc.

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

◆ allocateTerms()

void AmpVecs::allocateTerms ( const IntensityManager intenMan,
bool  bAllocIntensity = false 
)

This routine allocates space to store the calculated terms and (optionally) the calculated intensities. It should be passed a reference to the IntensityManager AFTER the IntensityManager has been setup and configured to compute the intensity.

Parameters
[in]intenMana reference to the IntensityManager to use as a guide for allocating the arrays for terms, factors, and intensities
[in]bAllocIntensityif set to true this will allocate space for the intensity calculation

Definition at line 235 of file AmpVecs.cc.

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

◆ deallocAmpVecs()

void AmpVecs::deallocAmpVecs ( )

This deallocates all allocated memory, which effective erases the entire contents (data and amplitudes) of AmpVecs

Definition at line 73 of file AmpVecs.cc.

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

◆ getEvent()

Kinematics * AmpVecs::getEvent ( int  i)

A helper routine to get an event i from the array of data and weights. This routine allows the AmpVecs class to behave in the same way that a DataReader would.

See also
DataReader::getEvent

Definition at line 299 of file AmpVecs.cc.

Here is the caller graph for this function:

◆ loadData()

void AmpVecs::loadData ( DataReader pDataReader,
bool  bForceNegativeWeight = false 
)

This routine uses the pointer to the data reader that is provided to allocate and fill the array of data and weights. The function will first reset the source and then get events from the data reader until a null pointer is provided (signaling the end of the source).

Parameters
[in]pDataReadera pointer to a user-defined data reader
[in]bForceNegativeWeightsets weight = -abs( weight )
See also
DataReader::resetSource
DataReader::getEvent

Definition at line 193 of file AmpVecs.cc.

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

◆ loadEvent()

void AmpVecs::loadEvent ( const Kinematics pKinematics,
unsigned long long  iEvent = 0,
unsigned long long  iNTrueEvents = 1,
bool  bForceNegativeWeight = false 
)

This routine fills the arrays of data and weights event by event rather than all at once. If the data arrays pointers are null, then memory is allocated according to the iNTrueEvents argument that is passed in – this should be set to the number of events the user plans to load. The iEvent argument is the location in the data array where the event should be loaded.

Parameters
[in]pKinematicsa pointer to a Kinematics object
[in]iEventan event counter (increment this for every event loaded)
[in]iNTrueEventsthe total number of events to be loaded
[in]bForceNegativeWeightsets weight = -abs( weight )
See also
loadData

Definition at line 128 of file AmpVecs.cc.

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

Member Data Documentation

◆ m_dAbsSumWeights

double AmpVecs::m_dAbsSumWeights

A double that stores the absolute value of the sum of the weights. (For cases where all weights are unity, this is simply the number of true events.)

Definition at line 83 of file AmpVecs.h.

◆ m_gpuMan

GPUManager AmpVecs::m_gpuMan

The GPU Manager for this data set.

Definition at line 159 of file AmpVecs.h.

◆ m_iNEvents

unsigned long long AmpVecs::m_iNEvents

An integer that stores the number of events.

Definition at line 68 of file AmpVecs.h.

◆ m_iNParticles

unsigned int AmpVecs::m_iNParticles

An integer that stores the number of particles in the final state.

Definition at line 88 of file AmpVecs.h.

◆ m_integralValid

bool AmpVecs::m_integralValid

A boolean that tracks if integrals are filled for the current data set in m_pdData and terms in m_pdAmps. This variable will be managed by classes outside of AmpVecs. It can only be invalidated (set to false) by the AmpVecs class itself.

Definition at line 153 of file AmpVecs.h.

◆ m_iNTerms

unsigned int AmpVecs::m_iNTerms

An integer that stores the number of amplitudes for a particular configuration of the AmplitudeManager.

Definition at line 94 of file AmpVecs.h.

◆ m_iNTrueEvents

unsigned long long AmpVecs::m_iNTrueEvents

An integer that stores the true number of events. For GPU calculations it is necessary to pad iNEvents up to the next power of 2. This integer stores the actual number of unique events.

Definition at line 75 of file AmpVecs.h.

◆ m_maxFactPerEvent

unsigned int AmpVecs::m_maxFactPerEvent

An integer that is number of doubles required to store all factors and permutations for any term for an event.

Definition at line 100 of file AmpVecs.h.

◆ m_pdAmpFactors

GDouble* AmpVecs::m_pdAmpFactors

An array of length 2 * iNAmpFactorsAndPerms * iNEvents that stores the real and imaginary parts for every factor of the decay amplitude and every permutation.

Definition at line 124 of file AmpVecs.h.

◆ m_pdAmps

GDouble* AmpVecs::m_pdAmps

An array of length 2 * iNAmps * iNEvents that stores the real and imaginary parts of the complete decay amplitude (product of factors) for each event.

Definition at line 117 of file AmpVecs.h.

◆ m_pdData

GDouble* AmpVecs::m_pdData

An array of length 4 * iNEvents * iNParticles that stores the four-vectors for the entire data set.

Definition at line 106 of file AmpVecs.h.

◆ m_pdIntegralMatrix

GDouble* AmpVecs::m_pdIntegralMatrix

An array of length 2 * iNTerms * iNTerms that holds the sums of the prodcuts of A_i A_j* for all data events and all terms i,j that is useful for calculating normalization integrals.

Definition at line 132 of file AmpVecs.h.

◆ m_pdIntensity

GDouble* AmpVecs::m_pdIntensity

An array of length iNEvents that stores the intensity for each event.

Definition at line 137 of file AmpVecs.h.

◆ m_pdWeights

GDouble* AmpVecs::m_pdWeights

An array of length iNEvents that stores the event weights for each event.

Definition at line 111 of file AmpVecs.h.

◆ m_termsValid

bool AmpVecs::m_termsValid

A boolean that tracks if m_pdAmps and m_pdAmpFactors are filled for the current data set in m_pdData. This variable will be managed by classes outside of AmpVecs. It can only be invalidated (set to false) by the AmpVecs class itself.

Definition at line 145 of file AmpVecs.h.


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