Skip to content
Jonas Kunze edited this page Mar 24, 2015 · 1 revision

General downscaling

The PC-Farm provides two config parameters called L1/L2DownscaleFactor. Running with e.g. --L1DownscaleFacor=3 only every third event will be processed by the L1 algorithm. The other events are rejected (L1 trigger type word 0) without reading the data.

Algorithm specific downscaling

The Trigger Processors provide a mechanism to configure a trigger specific downscaling factor. This means that you can configure to only process a specific algorithm with only every N'th event arriving at this point of the trigger algorithm.

Registering a downscaling algorithm

The first thing to do is to register a new algorithm if you want to use the downscaling mechanism for it. This is simply done by calling L1Downscaling::registerAlgorithm(youAlgoName) with a string identifying your algorithm and storing the return value. See following example:

void L1TriggerProcessor::registerDownscalingAlgorithms() {
	cedarAlgorithmId = L1Downscaling::registerAlgorithm("CEDAR");
}

This code automatically generates a program parameter called --algodownscaling_CEDAR with the default value of 1 (no downscaling). If you run the the PC-Farm with e.g. --algodownscaling_CEDAR=10 following code will process the CEDAR algorithm only with every 10th event:

if (L1Downscaling::processAlgorithm(cedarAlgorithmId)) {
    KtagAlgo::processKtagTrigger(decoder);
} else {
    cedarTriggerWord = 0xFF;
}