31{
   34 
   36  JFileRecorder       <JTYPELIST<JAAnetTypes_t, JMeta>::typelist> 
outputFile;
 
   37  JLimit_t&   numberOfEvents = inputFile.getLimit();
 
   38  double      xshift;
   39  double      yshift;
   40  double      zshift;
   42 
   43  try {
   44 
   45    JParser<> zap(
"Auxiliary program to shift the generated tracks according a given offset.");
 
   46 
   54 
   55    zap(argc, argv);
   56  }
   57  catch(const exception& error) {
   58    FATAL(error.what() << endl);
 
   59  }
   60 
   61 
   63 
   65 
   66  const Vec offset(xshift,yshift,zshift);
 
   67 
   68  NOTICE(
"Offset applied to true tracks is: " << offset << endl);
 
   69 
   71 
   72  try {
   73 
   75 
   77 
   79 
   84  
   85    buffer.simul.push_back(info);
   86    
   88 
   91 
   92    if (can_found) {
   93      NOTICE(
"can found" << endl);
 
   94    }
   95    if (fixedcan_found) {
   96      NOTICE(
"fixedcan found" << endl);
 
   97    }
   98 
   99    if        (can_found      && !fixedcan_found) {
  100 
  101      buffer.fixedcan.xcenter = xshift;
  102      buffer.fixedcan.ycenter = yshift;
  103      buffer.fixedcan.zmin    = buffer.can.zmin + zshift;
  104      buffer.fixedcan.zmax    = buffer.can.zmax + zshift;
  105      buffer.fixedcan.radius  = buffer.can.r;
  106 
  108 
  110 
  111    } else if (fixedcan_found && !can_found) {
  112 
  113      buffer.fixedcan.xcenter = buffer.fixedcan.xcenter + xshift;
  114      buffer.fixedcan.ycenter = buffer.fixedcan.ycenter + yshift;
  115      buffer.fixedcan.zmin    = buffer.fixedcan.zmin    + zshift;
  116      buffer.fixedcan.zmax    = buffer.fixedcan.zmax    + zshift;
  117 
  118    } else if (!can_found     && !fixedcan_found) {
  119 
  120      FATAL(
"Neither can nor fixedcan is found" << endl);
 
  121 
  122    } else {
  123 
  124      FATAL(
"Both can and fixedcan are found"   << endl);
 
  125    }
  126 
  127    copy(buffer, header);
 
  128  }
  130    FATAL(error << endl);
 
  131  }
  132 
  134 
  135 
  137 
  139 
  141      track->pos += offset;
  142    }
  143 
  145  }
  146 
  148}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::vector< JAANET::simul > simul
JAANET::fixedcan fixedcan
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
void copy(const Head &from, JHead &to)
Copy header from from to to.
const char * getGITVersion()
Get GIT version.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
const char * getTime()
Get current local time conform ISO-8601 standard.
const char * getDate()
Get current local date conform ISO-8601 standard.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
std::string time
processing time
std::string date
processing date
std::string program
program name
std::string version
program version
Generator for simulation.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
The Vec class is a straightforward 3-d vector, which also works in pyroot.