Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
adding and using an optional detector processor

Introduction

We discuss here the steps one needs to follow in order to add and use an experiment specific detector processor. These types of Processors work in conjunction with their parent processors to provide additional functionality beyond the original processor's intent.

For example, the use of the VandleAtLeribssProcessor is designed to add additional histograms, gates, and other features that need not be used in the original VandleProcessor. These processors may also be used to provide completely new functionality, while still being part of an existing processor.

Not every processor is ready to be used in this way and may require some modifications in order to obtain this functionality. For examples of how to update your processors to use this feature take a look at the GeProcessor and the VandleProcessor.

Getting the Optional Processors

The optional processors are kept in an additional git repository, since they will not all necessarily be useful to everybody who uses this software. They can be downloaded using the following command :

git clone https://github.com/pixie16/ExperimentProcessors.git

Setting up the Environment

To take advantage and ease the use of these new processors, you should export an additional environmental variable in your .bashrc.

export EXTRA_PROCESSORS=/absolute/path/to/extra/processors

By exporting this variable, the Makefile will automatically search the directory for the desired files.

Setup the Makefile

Unfortunately, we still need to add the processor to the Makefile so that it will be compiled and linked with the program. You should add your processor to the list of existing processors.

VANDLEATLERIBSSPROCESSORO = VandleAtLeribssProcessor.$(ObjSuf)

Second, you need to add the new processor to the list of CXX_OBJS

$(VANDLEATLERIBSSPROCESSORO)

You can either add it in its own line or with the other processors, it really doesn't matter.

Setup DetectorDriver

We now need to update the processor list in DetectorDriver. Since we are inheriting from the VandleProcessor, we will change the entry for the VandleProcessor directly. The code that originally looked like this

else if (name == "VandleProcessor") {
double res = processor.attribute("res").as_double(2.0);
double offset = processor.attribute("offset").as_double(200.0);
unsigned int numStarts = processor.attribute("NumStarts").as_int(2);
vector<string> types =
strings::tokenize(processor.attribute("types").as_string(),",");
vecProcess.push_back(new VandleProcessor(types, res, offset, numStarts));
}

Will now look like

else if (name == "VandleProcessor" || name == "VandleAtLeribssProcessor") {
double res = processor.attribute("res").as_double(2.0);
double offset = processor.attribute("offset").as_double(200.0);
unsigned int numStarts = processor.attribute("NumStarts").as_int(2);
vector<string> types =
strings::tokenize(processor.attribute("types").as_string(),",");
if(name == "VandleProcessor")
vecProcess.push_back(new VandleProcessor(types, res, offset, numStarts));
else if (name == "VandleAtLeribssProcessor")
vecProcess.push_back(new VandleAtLeribssProcessor(types, res, offset, numStarts));
}

In addition, we need to add the header file to the list at the top of DetectorDriver.

Setup the Configuration File

Finally, we need to update the Config.xml to use the new processor instead of the stock one.

<Processor name="VandleAtLeribssProcessor"
types="small" res="2" offset="200" numStarts="2"/>

This code will replace the line for the VandleProcessor in the DetectorDriver node.

Tips and Tricks

One thing to keep in mind is that the constructor for the child processor must accept at a minimum the same number of arguments that the parent does. This does not mean that you are limited in any way for a maximum.

In this example we could have added an additional argument to the constructor for the VandleAtLeribssProcessor for the number of the banana that we would like to analyze. This argument would not need to be passed to the constructor for the parent.