29 void init()
override ;
34 "The crunching time (unit ms)", 200 } ;
37 "Smearing factor on the crunching time using a gaussian generator (unit ms)", 0 } ;
46 setDescription(
"CPUCrunchingProcessor crunch CPU time for n milliseconds" ) ;
55 log<DEBUG>() <<
"CPUCrunchingProcessor::init() called" << std::endl ;
65 std::default_random_engine generator( randomSeed );
66 std::normal_distribution<clock::duration_rep> distribution(0,
_crunchSigma);
68 log<MESSAGE>() <<
"Will use total crunch time of " << totalCrunchTime <<
" ms" << std::endl ;
70 clock::crunchFor<clock::milliseconds>(totalCrunchTime) ;
void setValidator(ValidatorFunctionT< T > validator)
Set the validator function.
void init() override
Initialize the processor.
void processEvent(EventStore *evt) override
Process an input event.
#define MARLINMT_DECLARE_PROCESSOR(Class)
void setDescription(const std::string &desc)
Set the component description.
static unsigned int getRandomSeed(const Processor *const proc, EventStore *event)
Get a random seed from the event.
FloatParameter _crunchSigma
Simple processor crunching CPU time for n milliseconds.
void printParameters() const
Print the component parameters.
static void registerForRandomSeeds(Processor *const proc)
Register the processor to get random seeds.