39int main(
int argc,
char **argv)
46 JLimit_t& numberOfEvents = inputFile.getLimit();
58 JParser<> zap(
"Auxiliary program to determine time slewing from K40 data.");
73 catch(
const exception &error) {
74 FATAL(error.what() << endl);
80 if (!multiplicity.
is_valid()) {
FATAL(
"Invalid multiplicity " << multiplicity << endl); }
81 if ( multiplicity.
getLowerLimit() < 2) {
FATAL(
"Invalid multiplicity " << multiplicity << endl); }
82 if (!totVeto_ns .
is_valid()) {
FATAL(
"Invalid time over threshold " << totVeto_ns << endl); }
96 FATAL(
"Empty detector." << endl);
104 TH1D h0(
"h0", NULL, 41, -TMax_ns, +TMax_ns);
105 TH1D h1(
"h1", NULL, 50, -0.5, 49.5);
106 TProfile2D hx(
"hx", NULL, 50, -0.5, 49.5, 50, -0.5, 49.5, -2*TMax_ns, +2*TMax_ns);
107 TProfile h2(
"h2", NULL, 100, 0.5, 100.5, -2*TMax_ns, +2*TMax_ns);
123 for (JDAQTimeslice::const_iterator super_frame = timeslice->begin(); super_frame != timeslice->end(); ++super_frame) {
125 if (router.
hasModule(super_frame->getModuleID()) && !super_frame->empty()) {
131 buffer.resize(super_frame->size());
140 sort(buffer.begin(), buffer.end());
146 while (++q != buffer.end() && q->getT() - p->getT() <= TMax_ns ) {}
152 for (vector<JHitR0>::const_iterator __p = p; __p != q; ++__p) {
153 for (vector<JHitR0>::const_iterator __q = __p; ++__q != q; ) {
156 module.
getPMT(__q->getPMT()));
160 h0.Fill(__q->getT() - __p->getT());
161 h1.Fill(__q->getToT());
162 hx.Fill(__p->getToT(), __q->getToT(), __q->getT() - __p->getT());
164 if (totVeto_ns(__p->getToT())) {
165 h2.Fill(__q->getToT(), __q->getT() - __p->getT());
184 TF1 f1(
"f1",
"[0]*exp([1]*sqrt(x) + [2]*x) + [3]");
186 f1.SetParameter(0, h2.GetMaximum());
187 f1.SetParameter(1, -0.01);
188 f1.SetParameter(2, -0.05);
189 f1.SetParameter(3, h2.GetMinimum());
191 h2.ProjectionX()->Fit(&f1,
"",
"same");
193 for (
int i = 0; i != f1.GetNpar(); ++i) {
194 cout <<
"\tstatic double p" << i <<
"() { return " << setw(9) << setprecision(5) << f1.GetParameter(i) <<
"; }" << endl;
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.