custom commands in p_ex2
#include <PhHistogramFactory.hh>
hf = PhHistogramFactory::instance();
h1 = hf->CreateH1F("H1", "Channel 0", 101,-49.5,49.5);
h2 = hf->CreateH2F("H2", "Channel 0 vs 1"
int process_event (Event * e)
Packet *p = e->getPacket(1003);
if (fill_h1) h1->Fill (p->iValue(0));
if (fill_h2) h2->Fill (p->iValue(0), p->iValue(1) );
if (fill_h1) cout << "H1 is enabled" << endl;
else cout << "H1 is disabled" << endl;
if (fill_h2) cout << "H2 is enabled" << endl;
else cout << "H2 is disabled" << endl;
All that is in one file, and fill_h1 and fill_h2 are global variables visible to all routines in that file.