![]() |
AmpTools
|
#include <AmpVecs.h>
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) |
Kinematics * | getEvent (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 |
GDouble * | m_pdData |
GDouble * | m_pdWeights |
GDouble * | m_pdAmps |
GDouble * | m_pdAmpFactors |
GDouble * | m_pdIntegralMatrix |
GDouble * | m_pdIntensity |
bool | m_termsValid |
bool | m_integralValid |
GPUManager | m_gpuMan |
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.
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.
|
inline |
This destructor frees all of the allocated memory that holds all of the data and amplitude calculations.
Definition at line 175 of file AmpVecs.h.
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.
[in] | intenMan | a 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.
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.
[in] | intenMan | a reference to the IntensityManager to use as a guide for allocating the arrays for terms, factors, and intensities |
[in] | bAllocIntensity | if set to true this will allocate space for the intensity calculation |
Definition at line 235 of file AmpVecs.cc.
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.
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.
Definition at line 299 of file AmpVecs.cc.
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).
[in] | pDataReader | a pointer to a user-defined data reader |
[in] | bForceNegativeWeight | sets weight = -abs( weight ) |
Definition at line 193 of file AmpVecs.cc.
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.
[in] | pKinematics | a pointer to a Kinematics object |
[in] | iEvent | an event counter (increment this for every event loaded) |
[in] | iNTrueEvents | the total number of events to be loaded |
[in] | bForceNegativeWeight | sets weight = -abs( weight ) |
Definition at line 128 of file AmpVecs.cc.
double AmpVecs::m_dAbsSumWeights |
GPUManager AmpVecs::m_gpuMan |
unsigned long long AmpVecs::m_iNEvents |
unsigned int AmpVecs::m_iNParticles |
bool AmpVecs::m_integralValid |
unsigned int AmpVecs::m_iNTerms |
An integer that stores the number of amplitudes for a particular configuration of the AmplitudeManager.
unsigned long long AmpVecs::m_iNTrueEvents |
unsigned int AmpVecs::m_maxFactPerEvent |
GDouble* AmpVecs::m_pdAmpFactors |
GDouble* AmpVecs::m_pdAmps |
GDouble* AmpVecs::m_pdData |
GDouble* AmpVecs::m_pdIntegralMatrix |
GDouble* AmpVecs::m_pdIntensity |
GDouble* AmpVecs::m_pdWeights |
bool AmpVecs::m_termsValid |