/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Control/BesServices/BesServices-00-00-11/test/AtRndmGen_test.cxx File Reference

unit test for AtRndSvc More...

#include <cassert>
#include <iostream>
#include "TestTools/initGaudi.h"
#include "GaudiKernel/ISvcLocator.h"
#include "AthenaKernel/IAtRndmGenSvc.h"
#include "StoreGate/tools/hash_functions.h"
#include "CLHEP/Random/RandomEngine.h"

Go to the source code of this file.

Functions

int main ()


Detailed Description

unit test for AtRndSvc

based on ATLAS software

Definition in file AtRndmGen_test.cxx.


Function Documentation

int main (  ) 

Definition at line 21 of file AtRndmGen_test.cxx.

00021            {
00022   ISvcLocator* pSvcLoc(0);
00023   if (!initGaudi("AtRndmGen_test.txt", pSvcLoc)) {
00024     cerr << "This test can not be run" << endl;
00025     return 0;
00026   }  
00027   assert(pSvcLoc);
00028 
00029   IAtRndmGenSvc* pAtRndmGen(0);
00030   assert((pSvcLoc->service("AtRndmGenSvc", pAtRndmGen, true)).isSuccess());
00031   assert(pAtRndmGen);
00032   //  this depends on AtRndmGen_test.txt
00033   HepRandomEngine* pEng(pAtRndmGen->GetEngine("PITHIA_INIT"));
00034   assert(pEng);
00035   const long* seeds(pEng->getSeeds());
00036   assert(1 == seeds[1]-seeds[0]);
00037 
00038   pEng=pAtRndmGen->setOnDefinedSeeds(1,"PITHIA");
00039   assert(pEng);
00040   seeds = pEng->getSeeds();
00041   //  this depends on the details of setOnDefinedSeeds
00042   assert(9000 == seeds[0]-seeds[1]);
00043   assert(SG::simpleStringHash("PITHIA") == seeds[0] - 10000);
00044 
00045   cout << "*** AtRndSvc_test OK ***" <<endl;
00046   return 0;
00047 }


Generated on Tue Nov 29 23:14:53 2016 for BOSS_7.0.2 by  doxygen 1.4.7