File tree Expand file tree Collapse file tree
Detectors/HMPID/simulation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424#include < cmath>
2525#include < cstdlib>
2626#include < vector>
27+ #include < memory>
2728
2829#include " Headers/RAWDataHeader.h"
2930#include " CommonDataFormat/InteractionRecord.h"
@@ -71,11 +72,11 @@ class HmpidCoder2
7172 uint32_t * mPadMap ;
7273 int mEventSizePerEquipment [Geo::MAXEQUIPMENTS];
7374 int mEventPadsPerEquipment [Geo::MAXEQUIPMENTS];
74- int mPailoadBufferDimPerEquipment ;
75+ int mPayloadBufferDimPerEquipment ;
7576 long mPadsCoded ;
7677 bool mSkipEmptyEvents ;
77- std::unique_ptr<uint32_t > mUPayloadBufferPtr ;
78- std::unique_ptr<uint32_t > mUPadMap ;
78+ std::unique_ptr<uint32_t [] > mUPayloadBufferPtr ;
79+ std::unique_ptr<uint32_t [] > mUPadMap ;
7980
8081 LinkSubSpec_t mTheRFWLinks [Geo::MAXEQUIPMENTS];
8182
Original file line number Diff line number Diff line change @@ -40,11 +40,12 @@ HmpidCoder2::HmpidCoder2(int numOfEquipments)
4040 mNumberOfEquipments = numOfEquipments;
4141 mVerbose = 0 ;
4242 mSkipEmptyEvents = true ;
43- mPailoadBufferDimPerEquipment = ((Geo::N_SEGMENTS * (Geo::N_COLXSEGMENT * (Geo::N_DILOGICS * (Geo::N_CHANNELS + 1 ) + 1 ) + 1 )) + 10 );
44- auto UPayloadBufferPtr = std::make_unique<uint32_t []>(sizeof (uint32_t ) * mNumberOfEquipments * mPailoadBufferDimPerEquipment );
45- auto UPadMap = std::make_unique<uint32_t []>(sizeof (uint32_t ) * Geo::N_HMPIDTOTALPADS);
46- mPayloadBufferPtr = UPayloadBufferPtr.get ();
47- mPadMap = UPadMap.get ();
43+ mPayloadBufferDimPerEquipment = ((Geo::N_SEGMENTS * (Geo::N_COLXSEGMENT * (Geo::N_DILOGICS * (Geo::N_CHANNELS + 1 ) + 1 ) + 1 )) + 10 );
44+ mUPayloadBufferPtr = std::make_unique<uint32_t []>(mNumberOfEquipments * mPayloadBufferDimPerEquipment );
45+ mUPadMap = std::make_unique<uint32_t []>(Geo::N_HMPIDTOTALPADS);
46+ mPayloadBufferPtr = mUPayloadBufferPtr .get ();
47+ mPadMap = mUPadMap .get ();
48+ std::memset (mPadMap , 0 , sizeof (uint32_t ) * Geo::N_HMPIDTOTALPADS); // Zero the map for the first event
4849 mBusyTime = 20000 ; // 1 milli sec
4950 mHmpidErrorFlag = 0 ;
5051 mHmpidFrwVersion = 9 ;
You can’t perform that action at this time.
0 commit comments