66 int main(
int argc, 
char **argv)
 
   70   using namespace KM3NETDAQ;
 
   73   typedef JParallelFileScanner_t::multi_pointer_type               multi_pointer_type;
 
   79   JParallelFileScanner_t   inputFile;
 
   83   JCalibration_t           calibrationFile;
 
   87   histogram_type           calibrate;
 
   94     JParser<> zap(
"Program to perform detector calibration using reconstructed muon trajectories.");
 
  101     zap[
'n'] = 
make_field(numberOfEvents)      = JLimit::max();
 
  103     zap[
'c'] = 
make_field(calibrate, 
"Histogram for time calibration per optical module.");
 
  109   catch(
const exception& error) {
 
  110     FATAL(error.what() << endl);
 
  115   if (!calibrate.is_valid()) {
 
  116     FATAL(
"Invalid calibration data " << calibrate << endl);
 
  120     WARNING(
"Number of prefits " << 
parameters.numberOfPrefits << 
" != " << 1 << endl);
 
  135   unique_ptr<JDynamics> dynamics;
 
  141     dynamics->load(calibrationFile);
 
  143   catch(
const exception& error) {
 
  144     if (!calibrationFile.empty()) {
 
  163   TH2D       ha(
"ha", NULL, 256, -0.5, 255.5, 
 
  164                 calibrate.getNumberOfBins(), calibrate.getLowerLimit(), calibrate.getUpperLimit());
 
  166   TProfile   hb(
"hb", NULL, 256, -0.5, 255.5);
 
  168   TProfile   hr(
"hr", NULL,  60,  0.0, 150.0);
 
  171                 calibrate.getNumberOfBins(), calibrate.getLowerLimit(), calibrate.getUpperLimit());
 
  173   JManager_t 
g1(
new TProfile(
"%", NULL, 
detector.size(), -0.5, 
detector.size() - 0.5, -1.0, +1.0));
 
  176   while (inputFile.hasNext()) {
 
  178     STATUS(
"event: " << setw(10) << inputFile.getCounter() << 
'\r'); 
DEBUG(endl);
 
  180     multi_pointer_type ps = inputFile.next();
 
  185     summary.update(*tev);
 
  188       dynamics->update(*tev);
 
  195     buildL0(*tev, router, 
true, back_inserter(dataL0));
 
  197     for (JFIT::JEvt::const_iterator track = in->begin(); track != in->end(); ++track) {
 
  213       for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
 
  215         double rate_Hz = summary.getRate(*i);
 
  217         if (rate_Hz <= 0.0) {
 
  218           rate_Hz = summary.getRate();
 
  232       sort(data.begin(), data.end(), JMuonGandalf::compare);
 
  234       JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
 
  239       if (track->getE() > 0.1)
 
  240         fit.JRegressor_t::E_GeV   = track->getE();
 
  246       for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
 
  247         buffer.insert(hit->getModuleID());
 
  256         if (
distance(data.begin(), q) - fit.parameters.size() > 0) {
 
  258           fit(ta, data.begin(), q);                   
 
  260           for (JDataW0_t::const_iterator hit = q; hit != __end; ++hit) {
 
  262             const int    index    = router.getIndex(*
id);
 
  263             const double t1       = fit.value.getT(hit->getPosition());
 
  264             JTrack3D     gradient = fit(fit.value, *hit).gradient;
 
  268             ha.Fill(hit->getToT(), hit->getT1() - t1);
 
  269             hb.Fill(hit->getToT(), gradient.
getT());
 
  271             hr.Fill(fit.value.getDistance(*hit), gradient.
getT());
 
  273             h2.Fill(index, hit->getT() - t1);
 
  275             g1[
"T"]->Fill(index, gradient.
getT());
 
  276             g1[
"X"]->Fill(index, gradient.
getX());
 
  277             g1[
"Y"]->Fill(index, gradient.
getY());
 
  278             g1[
"Z"]->Fill(index, gradient.
getZ());
 
Utility class to parse command line options. 
 
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member. 
 
int main(int argc, char *argv[])
 
ROOT TTree parameter settings of various packages. 
 
static JDetectorMechanics getMechanics
Function object to get string mechanics. 
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance. 
 
Template specialisation of L0 builder for JHitL0 data type. 
 
Router for direct addressing of module data in detector data structure. 
 
*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
 
General purpose class for parallel reading of objects from a single file or multiple files...
 
Template specialisation of class JModel to match hit with muon trajectory along z-axis. 
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
 
Data structure for fit of straight line in positive z-direction. 
 
Dynamic ROOT object management. 
 
Basic data structure for time and time over threshold information of hit. 
 
Data structure for detector geometry and calibration. 
 
Wrapper class to make final fit of muon trajectory. 
 
Basic data structure for L0 hit. 
 
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...
 
JAxis3D & rotate(const JRotation3D &R)
Rotate axis. 
 
JDirection3D getDirection(const Vec &dir)
Get direction. 
 
Auxiliary class for recursive type list generation. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
 
JPosition3D getPosition(const Vec &pos)
Get position. 
 
JAxis3D & rotate_back(const JRotation3D &R)
Rotate back axis. 
 
Dynamic detector calibration. 
 
File router for fast addressing of summary data. 
 
double getY() const 
Get y position. 
 
void load(const std::string &file_name)
Load mechanical model parameters from file. 
 
Data structure for fit parameters. 
 
double getT(const JVector3D &pos) const 
Get arrival time of Cherenkov light at given position. 
 
General purpose messaging. 
 
Direct access to module in detector data structure. 
 
Dynamic detector calibration. 
 
Auxiliary class for a hit with background rate value. 
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable NORTH set_variable EAST set_variable SOUTH set_variable WEST set_variable WORKDIR tmp set_variable R set_variable CT set_variable YMAX set_variable YMIN if do_usage *then usage $script[distance] fi case set_variable R
 
static const int JSTART_LENGTH_METRES
distance between first and last hits in metres from JStart.cc 
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file. 
 
Data structure for set of track fit results. 
 
General purpose class for object reading from a list of file names. 
 
Utility class to parse command line options. 
 
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
 
Data structure for fit of straight line paralel to z-axis. 
 
double getX() const 
Get x position. 
 
const JLimit & getLimit() const 
Get limit. 
 
do set_variable DETECTOR_TXT $WORKDIR detector
 
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
 
JPosition3D & rotate(const JRotation3D &R)
Rotate. 
 
void select(const JSelector_t &selector)
Select fits. 
 
double getZ() const 
Get z position. 
 
JTOOLS::JRange< double > JZRange
 
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results. 
 
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory. 
 
Double_t g1(const Double_t x)
Function.