73 using namespace KM3NETDAQ;
76 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
78 JParallelFileScanner_t inputFile;
89 JParser<> zap(
"Program to evaluate hit probabilities.");
93 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
100 catch(
const exception& error) {
101 FATAL(error.what() << endl);
109 WARNING(
"Number of prefits " <<
parameters.numberOfPrefits <<
" != " << 1 << endl);
135 while (inputFile.hasNext()) {
137 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
139 multi_pointer_type ps = inputFile.next();
144 DEBUG(
"event: " << *tev << endl);
146 summary.update(*tev);
152 buildL0(*tev, router,
true, back_inserter(dataL0));
154 for (JEvt::const_iterator track = in->begin(); track != in->end(); ++track) {
156 DEBUG(
"track: " << *track << endl);
172 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
174 JHitW0 hit(*i, summary.getRate(*i));
185 sort(data.begin(), data.end(), compare);
187 JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
198 <<
FIXED(12,3) << tz.getX() <<
' '
199 <<
FIXED(12,3) << tz.getY() <<
' '
200 <<
FIXED(12,3) << tz.getZ() <<
' '
201 <<
FIXED(12,3) << tz.getT() <<
' '
202 <<
FIXED(12,1) << E_GeV <<
' '
203 <<
FIXED( 8,3) << track->getQ() << endl);
222 for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
224 const double x = hit->getX() - tz.getX();
225 const double y = hit->getY() - tz.getY();
226 const double z = hit->getZ() - tz.getZ();
227 const double R = sqrt(x*x + y*y);
235 const double theta =
u.getTheta();
236 const double phi = fabs(
u.getPhi());
239 const double E = E_GeV;
240 const double dt = T_ns.constrain(hit->getT() - t1);
247 const double chi2 = H1.getChi2() - H0.getChi2();
250 << setw(10) << hit->getModuleID() <<
':' << setw( 2) << setfill(
'0') << hit->getPMTAddress() << setfill(
' ') <<
' '
251 <<
FIXED(12,1) << E <<
' '
252 <<
FIXED( 9,1) << R <<
' '
253 <<
FIXED( 6,4) << theta <<
' '
254 <<
FIXED( 6,4) << phi <<
' '
255 <<
FIXED( 8,3) << dt <<
' '
256 <<
FIXED(12,3) << chi2 << endl);
261 DEBUG(
"quality: " <<
FIXED(8,3) << Q <<
' ' <<
distance(data.begin(), __end) << endl);
266 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
278 for (JModule::iterator pmt = module.begin(); pmt != module.end(); ++pmt) {
280 const double R = sqrt(pmt->getX()*pmt->getX() + pmt->getY()*pmt->getY());
281 const double theta = pmt->getTheta();
282 const double phi = fabs(pmt->getPhi());
283 const double y = npe.calculate(1.0, R, theta, phi);
286 << setw(10) << module.
getID() <<
':' << setw( 2) << setfill(
'0') <<
distance(module.begin(),pmt) << setfill(
' ') <<
' '
287 <<
FIXED(9,1) << R <<
' '
288 <<
FIXED(6,4) << theta <<
' '
289 <<
FIXED(6,4) << phi <<
' '
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
Data structure for direction in three dimensions.
Data structure for a composite optical module.
double getQuality(const double chi2, const int NDF)
Get quality of fit.
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)...
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
Auxiliary data structure for floating point format specification.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
Auxiliary class for defining the range of iterations of objects.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
JDirection3D getDirection(const Vec &dir)
Get direction.
JFunction1D_t::result_type result_type
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int getID() const
Get identifier.
JPosition3D getPosition(const Vec &pos)
Get position.
File router for fast addressing of summary data.
Data structure for fit parameters.
then usage $script[distance] fi case set_variable R
Auxiliary data structure for muon PDF.
Auxiliary class for a hit with background rate value.
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.
void transform(const JRotation3D &R, const JVector3D &pos)
Transformation of geometry (see method JGEOMETRY3D::JPosition3D::transform(const JRotation3D&, const JVector3D&)).
const double getInverseSpeedOfLight()
Get inverse speed of light.
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
Data structure for fit of straight line paralel to z-axis.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
Data structure for position in three dimensions.
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 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
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Auxiliary data structure for floating point format specification.
#define DEBUG(A)
Message macros.