This page will describe the process for adding a new Processor to the analysis. In principle, you can add a Processor to handle specific detector types, or to handle those that already exist.
To add a new detector first a class must be constructed which defines its behavior by creating a .hpp and .cpp file. For example, the following section defines a new detector class called "Template".
The hpp file should look something like
#ifndef __TEMPLATEPROCESSOR_HPP__
#define __TEMPLATEPROCESSOR_HPP__
public:
}
private:
std::vector<ChanEvent*>
evts_;
};
#endif // __TEMPLATEPROCESSOR_HPP__
The cpp file should look something like
#include <iostream>
namespace dettemplate {
}
}
associatedTypes.insert("template");
}
associatedTypes.insert("template");
a_ = a;
}
"Template Energy vs. Pulser Energy");
}
return(false);
evts_ = event.GetSummary("template")->GetList();
for(vector<ChanEvent*>::const_iterator it = evts_.begin();
it != evts_.end(); it++) {
unsigned int location = (*it)->GetChanID().GetLocation();
if(location == 0)
}
return(true);
}
return(false);
static const vector<ChanEvent*> & pulserEvents =
event.GetSummary("pulser")->GetList();
for(vector<ChanEvent*>::const_iterator it = evts_.begin();
it != evts_.end(); it++) {
unsigned int loc = (*it)->GetChanID().GetLocation();
for(vector<ChanEvent*>::const_iterator itA = pulserEvents.begin();
itA != pulserEvents.end(); itA++) {
if(loc == 0)
(*itA)->GetEnergy());
}
}
return(true);
}
Once a class exists for your new detector you must create an instance of it in the DetectorDriver. Include the proper file in DetectorDriver.cpp
Be sure that you put the proper detector type into the "associated types" vector in the constructor. This will ensure that whenever this detector type is in the event the processor will be called.
Next initialize it with the other processors in the constructor of DetectorDriver.
...
} else if (name == "TemplateProcessor") {
}
...
Finally, your new processor simply needs to be added to the Config.xml and you are ready to do your analysis.
Adding a new detector type needs only minimal additional changes to the DetectorLibrary. To the list of known detectors
const unsigned int detTypes = 2;
const string detectorStrings[detTypes] = {
"3hen", "beta_scint", "dssd_front", "dssd_back", "ge", "generic",
"idssd_front", "ignore", "ion_chamber", "liquid_scint", "logic",
"mcp", "mtc", "neutron_scint", "position", "pulser", "si", "ssd",
"timeclass", "tvandle", "vandle", "template"
};