|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "tbb/parallel_reduce.h"
7 #include "tbb/blocked_range.h"
10 #include "Gaudi/Property.h"
19 #define DIFF(_name, _a, _b) if ( _a != _b ) \
20 ATH_MSG_WARNING( "Difference in " << _name << " " << _a << " ref " << _b ); \
22 ATH_MSG_DEBUG( "Identical " << _name << " " << _a << " ref " << _b );
47 std::cout <<
"wrong RoI descriptor used for RoI" << std::endl;
48 return StatusCode::FAILURE;
62 std::cout <<
"wrong RoI descriptor used for FS" << std::endl;
63 return StatusCode::FAILURE;
69 Gaudi::Hive::setCurrentContext (
m_context);
71 struct timeval
t1{},
t2{};
72 gettimeofday(&
t1,NULL);
75 gettimeofday(&
t2,NULL);
78 if ( !
cell )
continue;
86 std::cout <<
"t lFC : " <<
m_context <<
" " <<
m_etSumRef <<
" " <<
t1.tv_sec <<
" " <<
t1.tv_usec <<
" " <<
t2.tv_sec <<
" " <<
t2.tv_usec <<
" " << ((
t2.tv_sec-
t1.tv_sec)*1e6+(
t2.tv_usec-
t1.tv_usec) )*1
e-6 << std::endl;
90 struct timeval
t1{},
t2{};
91 gettimeofday(&
t1,NULL);
94 gettimeofday(&
t2,NULL);
104 std::cout <<
"t RoI : " <<
m_context <<
" " <<
m_etSumRef <<
" " <<
t1.tv_sec <<
" " <<
t1.tv_usec <<
" " <<
t2.tv_sec <<
" " <<
t2.tv_usec <<
" " << ((
t2.tv_sec-
t1.tv_sec)*1e6+(
t2.tv_usec-
t1.tv_usec) )*1
e-6 << std::endl;
110 Gaudi::Hive::setCurrentContext (
m_context);
118 double maxPhi = -100;
124 for (
const auto cell :
col ) {
125 if ( !
cell )
continue;
138 for (
const auto cell :
sel ) {
165 if ( checkStatus ==
false ) {
169 refIter !=
m_selRef.
end() and thisIter !=
sel.end(); ++refIter, ++thisIter ) {
170 const LArCell* refCell = *refIter;
171 const LArCell* thisCell = *thisIter;
172 if ( thisCell->
et() != refCell->
et() ) {
173 ATH_MSG_WARNING(
"eta/phi/et Reference cell " << refCell->
eta() <<
"/" << refCell->
phi() <<
"/" << refCell->
et()
174 <<
" differ from the one in this request " << thisCell->
eta() <<
"/" << thisCell->
phi() <<
"/" << thisCell->
et() );
199 ISvcLocator* pSvcLocator ) :
201 m_dataAccessSvc(
"TrigCaloDataAccessSvc/TrigCaloDataAccessSvc",
name ),
202 m_emulateRoIs ( true ),
203 m_emulateFixedRoIs (false)
215 return StatusCode::SUCCESS;
221 std::normal_distribution<double>
N1(0.0, 1.7);
222 std::normal_distribution<double>
N2(0.0, 0.2);
223 std::uniform_real_distribution<double> U(0.0, 1.0);
224 std::uniform_real_distribution<double> Uphi(-
M_PI,
M_PI);
228 if ( RoI_eta1 < -2.5 ) RoI_eta1 = -2.5;
229 if ( RoI_eta1 > 2.5 ) RoI_eta1 = 2.5;
236 allRoIs.push_back( afr );
239 if ( chance > 0.6 ) {
242 if ( RoI_eta2 < -2.5 ) RoI_eta2 = -2.5;
243 if ( RoI_eta2 > 2.5 ) RoI_eta2 = 2.5;
248 allRoIs.push_back( afr );
251 for(
int i=0;
i<10;
i++){
253 if ( chance > 0.75 ) {
256 if ( RoI_eta3 < -2.5 ) RoI_eta3 = -2.5;
257 if ( RoI_eta3 > 2.5 ) RoI_eta3 = 2.5;
259 if ( chance > 0.8 )
width=0.3;
264 allRoIs.push_back( afr );
269 if ( chance > 0.6 ) {
272 allRoIs.push_back( afr );
279 std::vector<TrigRoiDescriptor>
rois;
281 0.1, 0.1-0.1, 0.1+0.1,
284 0.2, 0.2-0.2, 0.2+0.2,
287 2.1, 2.1-0.4, 2.1+0.4,
290 1.1, 1.1-1.4, 1.1+1.4,
292 rois.push_back(roi1);
293 rois.push_back(roi2);
294 rois.push_back(roi3);
295 rois.push_back(roi4);
299 allRoIs.push_back(
t1);
302 allRoIs.push_back(
t6);
310 std::vector<ParallelCallTest*> allRoIs;
317 gettimeofday(&ti1,NULL);
319 gettimeofday(&ti2,NULL);
320 std::cout << ti1.tv_sec <<
" " << ti1.tv_usec << std::endl;
321 std::cout << ti2.tv_sec <<
" " << ti2.tv_usec << std::endl;
322 std::cout <<
name() <<
"; time : " << 1
e-6*( 1e6*(ti2.tv_sec - ti1.tv_sec) + ( ti2.tv_usec - ti1.tv_usec ) ) << std::endl;
326 return StatusCode::SUCCESS;
329 return StatusCode::SUCCESS;
std::vector< LUCID_DigitContainer_p2 > t6
const EventContext & m_context
LArTT_Selector< LArCellCont > m_selRef
Provides interface and helper functions to perform stress testing of the thread-safe code.
void emulateRoIs(const EventContext &context, std::vector< ParallelCallTest * > &allRoIs) const
virtual double phi() const override final
get phi (through CaloDetDescrElement)
virtual ~TestCaloDataAccess()
AskForRoI(const EventContext &context, const ServiceHandle< ITrigCaloDataAccessSvc > &svc, const TrigRoiDescriptor &roi)
const ServiceHandle< ITrigCaloDataAccessSvc > & m_svc
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const_iterator end() const
CaloConstCellContainer * m_colRef
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const TrigRoiDescriptor m_roi
std::vector< ALFA_RawDataCollection_p1 > t1
bool callAndCompare() const override
a function that performs request, and compares the results obtained with the result of the first exec...
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
void emulateFixedRoIs(const EventContext &context, std::vector< ParallelCallTest * > &allRoIs) const
An algorithm that can be simultaneously executed in multiple threads.
void clear()
Erase all the elements in the collection.
#define DIFF(_name, _a, _b)
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode execute(const EventContext &context) const override
virtual double et() const override final
get et
const_iterator begin() const
Class to provide easy MsgStream access and capabilities.
#define CHECK(...)
Evaluate an expression and check for errors.
void firstCall() override
a method that will be called to obtain first results from the service It should set the reference qua...
AthROOTErrorHandlerSvc * svc
static bool launchTests(size_t nrepeats, const std::vector< ParallelCallTest * > &tests)
Method to run launch number of tests in parallel (increasing the stress of the calle) It has a potent...
StatusCode request(CaloConstCellContainer &c) const
Data object for LAr calorimeter readout cell.
The test calls for RoI data access for each RoI returned bunch of quantiries are checked,...
std::vector< ALFA_RawDataContainer_p1 > t2
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
StatusCode request(LArTT_Selector< LArCellCont > &sel) const
CaloCellContainer that can accept const cell pointers.
#define ATH_MSG_WARNING(x)
virtual bool isFullscan() const override final
is this a full scan RoI?
virtual StatusCode initialize() override
CaloCellContainer that can accept const cell pointers.
ServiceHandle< ITrigCaloDataAccessSvc > m_dataAccessSvc
virtual double eta() const override final
get eta (through CaloDetDescrElement)