44 #ifdef GPU_ACCELERATION 46 #include "cuda_runtime.h" 47 #endif //GPU_ACCELERATION 102 #ifndef GPU_ACCELERATION 124 #endif // GPU_ACCELERATION 129 unsigned long long iNTrueEvents,
bool bForceNegativeWeight ){
139 #ifdef GPU_ACCELERATION 166 #ifndef GPU_ACCELERATION 168 for (
int iParticle = 0; iParticle <
m_iNParticles; iParticle++){
169 m_pdData[4*iEvent*m_iNParticles+4*iParticle+0]=pKinematics->
particle(iParticle).E();
170 m_pdData[4*iEvent*m_iNParticles+4*iParticle+1]=pKinematics->
particle(iParticle).Px();
171 m_pdData[4*iEvent*m_iNParticles+4*iParticle+2]=pKinematics->
particle(iParticle).Py();
172 m_pdData[4*iEvent*m_iNParticles+4*iParticle+3]=pKinematics->
particle(iParticle).Pz();
175 for (
int iParticle = 0; iParticle <
m_iNParticles; iParticle++){
184 -fabsf( pKinematics->
weight() ) :
198 cout<<
"\n ERROR: Trying to load data into a non-empty AmpVecs object\n"<<flush;
208 cout <<
"The data source is empty." << endl;
216 pKinematics = pDataReader->
getEvent();
217 loadEvent(pKinematics, iEvent, m_iNTrueEvents, bForceNegativeWeight );
219 if (iEvent < (m_iNTrueEvents - 1))
delete pKinematics;
224 for (
unsigned long long int iEvent = m_iNTrueEvents; iEvent <
m_iNEvents; iEvent++){
225 loadEvent(pKinematics, iEvent, m_iNTrueEvents, bForceNegativeWeight );
242 cout <<
"ERROR: trying to reallocate terms in AmpVecs after\n" << flush;
243 cout <<
" they have already been allocated. Please\n" << flush;
244 cout <<
" deallocate them first." << endl;
249 cout <<
"ERROR: trying to allocate space for terms in\n" << flush;
250 cout <<
" AmpVecs before any events have been loaded\n" << flush;
257 if( bAllocIntensity )
262 #ifndef GPU_ACCELERATION 272 #endif // GPU_ACCELERATION 278 #ifdef GPU_ACCELERATION 289 cudaError_t cudaErr = cudaGetLastError();
290 if( cudaErr != cudaSuccess ){
292 cout<<
"\n\nHOST MEMORY ALLOCATION ERROR: "<< cudaGetErrorString( cudaErr ) << endl;
304 vector< TLorentzVector > particleList;
310 #ifndef GPU_ACCELERATION 312 int i = iEvent*4*m_iNParticles + 4*iPart;
322 #endif // GPU_ACCELERATION
unsigned long long m_iNEvents
const TLorentzVector & particle(unsigned int index) const
void allocateTerms(const IntensityManager &intenMan, bool bAllocIntensity=false)
virtual unsigned int termStoragePerEvent() const =0
unsigned int m_maxFactPerEvent
void init(const AmpVecs &a)
void allocateCPUAmpStorage(const IntensityManager &intenMan)
const vector< string > & getTermNames() const
virtual unsigned int maxFactorStoragePerEvent() const =0
virtual void resetSource()=0
unsigned long long m_iNTrueEvents
const vector< TLorentzVector > & particleList() const
virtual Kinematics * getEvent()=0
virtual unsigned int numEvents() const =0
unsigned int m_iNParticles
void loadData(DataReader *pDataReader, bool bForceNegativeWeight=false)
Kinematics * getEvent(int i)
static int calcNEventsGPU(int iNEvents)
void loadEvent(const Kinematics *pKinematics, unsigned long long iEvent=0, unsigned long long iNTrueEvents=1, bool bForceNegativeWeight=false)
void copyDataToGPU(const AmpVecs &a)
GDouble * m_pdIntegralMatrix