41 int main(
int argc,
char **argv)
56 JParser<> zap(
"Example program to monitor acoustic events.");
58 zap[
'f'] =
make_field(inputFile,
"output of JAcousticEventBuilder[.sh]");
59 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
68 catch(
const exception &error) {
69 FATAL(error.what() << endl);
83 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
84 receivers[i->getID()] = i->getLocation();
100 string.size(), -0.5,
string.size() - 0.5,
104 for (Int_t i = 1; i <= H2->GetXaxis()->GetNbins(); ++i) {
105 H2->GetXaxis()->SetBinLabel(i,
MAKE_CSTRING(
string.at(i-1)));
106 H3->GetXaxis()->SetBinLabel(i,
MAKE_CSTRING(
string.at(i-1)));
109 for (Int_t i = 1; i <= H2->GetYaxis()->GetNbins(); ++i) {
125 for (JTreeScanner_t::iterator event = in.begin();
event != in.end() && counter != inputFile.getLimit(); ++event, ++counter) {
127 if (counter%1000 == 0) {
128 STATUS(
"event " << setw(8) << counter <<
'\r');
DEBUG(endl);
131 const JEvent evt = *event;
135 for (JEvent::const_iterator i = evt.begin(); i != evt.end(); ++i) {
139 HA[evt.
getID()]->Fill((
double) evt.size());
143 HC[evt.
getID()]->Fill(
log10(evt.begin()->getToE() - toe[evt.
getID()]));
149 toe[evt.
getID()] = evt.begin()->getToE();
151 TH1D* hq = HQ[evt.
getID()];
153 TH2D* h2 = H2[evt.
getID()];
154 TH2D* h3 = H3[evt.
getID()];
158 for (JEvent::const_iterator i = evt.begin(); i != evt.end(); ++i) {
159 buffer[i->getID()].insert(i->getQ());
162 for (
map<
int,
set<double> >::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
164 hq->Fill(
log10(*(i->second.rbegin())));
165 h1->Fill((
double) i->second.size());
167 if (receivers.has(i->first)) {
169 const JLocation& location = receivers[i->first];
173 if (i->second.size() > 1
u) {
185 out << HA << HB << HC << HD << HE << HQ << H1 << H2 << H3;
Utility class to parse command line options.
int getOverlays() const
Get overlays.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
int getFloor() const
Get floor number.
General purpose class for hash map of unique elements.
ROOT TTree parameter settings.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
#define MAKE_CSTRING(A)
Make C-string.
then for HISTOGRAM in h0 h1
General purpose class for a hash collection of unique elements.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Long64_t counter_type
Type definition for counter.
Dynamic ROOT object management.
Template definition for direct access of elements in ROOT TChain.
Data structure for detector geometry and calibration.
Auxiliary class for defining the range of iterations of objects.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
I/O formatting auxiliaries.
Logical location of module.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
set_variable E_E log10(E_{fit}/E_{#mu})"
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
int getIndex()
Get index for user I/O manipulation.
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Base class for JTreeScanner.
int getString() const
Get string number.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Acoustic trigger parameters.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
int getID() const
Get identifier.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
#define DEBUG(A)
Message macros.