1 #ifndef __JRECONSTRUCTION__JMUONPREFIT__ 
    2 #define __JRECONSTRUCTION__JMUONPREFIT__ 
   46 namespace JRECONSTRUCTION {}
 
   47 namespace JPP { 
using namespace JRECONSTRUCTION; }
 
   49 namespace JRECONSTRUCTION {
 
   81     using JEstimator_t::operator();
 
   92                 const int                      debug = 0) :
 
  113                 const int                      debug = 0) :
 
  140       buildL2(event, 
router, !
useL0, back_inserter(dataL1));
 
  148       buffer_type::iterator __end = dataL1.end();
 
  150       __end = unique(dataL1.begin(), __end, equal_to<JDAQModuleIdentifier>());
 
  154       dataL1.erase(__end, dataL1.end());
 
  159         buildL0(event, 
router, 
true, back_inserter(dataL0));
 
  161         __end = dataL0.end();
 
  163         for (buffer_type::iterator i = dataL0.begin(); i != __end; ) {
 
  165           if (match3B.count(*i, dataL1.begin(), dataL1.end()) != 0)
 
  171         dataL0.erase(__end, dataL0.end());
 
  174       return (*
this)(dataL0, dataL1);
 
  191       const double STANDARD_DEVIATIONS    =   3.0;                              
 
  196       data.reserve(dataL0.size() + 
 
  201       for (JOmega3D_t::const_iterator dir = 
omega.begin(); dir != 
omega.end(); ++dir) {
 
  206         buffer_type::iterator __end = 
copy(dataL1.begin(), dataL1.end(), 
data.begin());
 
  208         for (buffer_type::iterator i = 
data.begin(); i != __end; ++i) {
 
  219           partial_sort(
data.begin(), __end, 
data.end(), 
cmz);
 
  229           buffer_type::iterator p = __end;                                     
 
  230           buffer_type::iterator q = 
copy(dataL0.begin(), dataL0.end(), p);     
 
  232           for (buffer_type::iterator i = p; i != q; ++i) {
 
  234             if (find_if(
data.begin(), __end, bind2nd(equal_to<JDAQModuleIdentifier>(), i->getModuleID())) == __end) {
 
  238               if (match1D.count(*i, 
data.begin(), __end) != 0) {
 
  249         if (
distance(
data.begin(), __end) <= NUMBER_OF_PARAMETERS) {
 
  257         double   chi2 = numeric_limits<double>::max();
 
  258         int      NDF  = 
distance(
data.begin(), __end) - NUMBER_OF_PARAMETERS;
 
  266           if (number_of_outliers > NDF - 1) {
 
  267             number_of_outliers = NDF - 1;
 
  270           double ymin = numeric_limits<double>::max();
 
  272           buffer_type::iterator __end1 = __end;
 
  274           for (
int n = 0; 
n <= number_of_outliers; ++
n, --__end1) {
 
  286                 (*this)(
data.begin(), __end1);
 
  295                 if (y <= -(STANDARD_DEVIATIONS * STANDARD_DEVIATIONS)) {
 
  297                   WARNING(endl << 
"chi2(1) " << y << endl);
 
  309                     NDF  = 
distance(
data.begin(), __end1) - NUMBER_OF_PARAMETERS;
 
  318             ymin -= STANDARD_DEVIATIONS * STANDARD_DEVIATIONS;
 
  323           const int number_of_outliers = NDF - 1;
 
  327             (*this)(
data.begin(), __end);
 
  334             for (
int n = 0; 
n <= number_of_outliers; ++
n) {
 
  339               for (
size_t i = 0; i != 
Y.size(); ++i) {
 
  349               if (ymax < STANDARD_DEVIATIONS * STANDARD_DEVIATIONS) {
 
  355               this->update(
data.begin(), __end, 
V);
 
  369         if (chi2 != numeric_limits<double>::max()) {
 
  383         JEvt::iterator __end = out.end();
 
  385         if (
parameters.numberOfPrefits < out.size()) {
 
  402           JEvt::iterator __p = __end;
 
  417         out.erase(__end, out.end());
 
  431     static const struct {
 
JMuonPrefit(const JMuonPrefitParameters_t ¶meters, const JModuleRouter &router, const int debug=0)
Constructor. 
 
static struct JTRIGGER::JHitR1::@84 compare
Auxiliary data structure for sorting of hits. 
 
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
 
Wrapper class to make pre-fit of muon trajectory. 
 
Linear fit of straight line parallel to z-axis to set of hits (objects with position and time)...
 
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member. 
 
Match operator for Cherenkov light from muon with given direction. 
 
double getQuality(const double chi2, const int NDF)
Get quality of fit. 
 
void set(const JVector3D &pos, T __begin, T __end, const double alpha, const double sigma)
Set co-variance matrix. 
 
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back. 
 
JEvt operator()(const KM3NETDAQ::JDAQEvent &event)
Fit function. 
 
bool useL0
option for L0 hit use 
 
Algorithms for hit clustering and sorting. 
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance. 
 
Router for direct addressing of module data in detector data structure. 
 
Data structure for fit parameters. 
 
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
 
int getNumberOfPMTs(const JModule &module)
Get number of PMTs. 
 
*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
 
Direction set covering (part of) solid angle. 
 
Linear fit of JFIT::JLine1Z. 
 
Template definition of linear fit. 
 
static struct JTRIGGER::@80 clusterizeWeight
Anonymous struct for weighed clustering of hits. 
 
static const JModuleCounter getNumberOfModules
Function object to count unique modules. 
 
void update(const size_t k, const double value)
Update inverted matrix at given diagonal element. 
 
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results. 
 
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
 
int numberOfOutliers
maximum number of outliers 
 
double roadWidth_m
road width [m] 
 
static const int JMUONPREFIT
 
Determination of the time residual vector of hits for a track along z-axis (JFIT::JLine1Z). 
 
Match operator for Cherenkov light from muon in any direction. 
 
Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z). 
 
JTRIGGER::JHitR1 hit_type
 
static struct JRECONSTRUCTION::JMuonPrefit::@62 cmz
Auxiliary data structure for sorting of hits. 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
double gridAngle_deg
grid angle for directions [deg] 
 
JMuonPrefit(const JMuonPrefitParameters_t ¶meters, const JModuleRouter &router, const JOmega3D &omega, const int debug=0)
Constructor. 
 
static const double PI
Mathematical constants. 
 
void set(const JLine1Z &track, T __begin, T __end)
Set time residual vector. 
 
static struct JTRIGGER::@78 clusterize
Anonymous structure for clustering of hits. 
 
then usage $script[distance] fi case set_variable R
 
General purpose messaging. 
 
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter. 
 
JEstimator< JLine1Z > JEstimator_t
 
double TMaxLocal_ns
time window for local coincidences [ns] 
 
void invert()
Invert matrix according LDU decomposition. 
 
Direct access to module in detector data structure. 
 
Data structure for L2 parameters. 
 
double getDZ() const 
Get Z-slope. 
 
int factoryLimit
factory limit for combinatorics 
 
Reduced data structure for L1 hit. 
 
const JClass_t & getReference() const 
Get reference to object. 
 
const double getSpeedOfLight()
Get speed of light. 
 
Data structure for set of track fit results. 
 
JFit getFit(const int id, const JMODEL::JString &string)
Get fit parameters of string. 
 
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. 
 
int getCount(const T &hit)
Get hit count. 
 
void copy(const Head &from, JHead &to)
Copy header from from to to. 
 
const JModuleRouter & router
 
Reduced data structure for L1 hit. 
 
void configure()
Configure internal buffer(s). 
 
JEvt operator()(const buffer_type &dataL0, const buffer_type &dataL1)
Fit function. 
 
std::vector< hit_type > buffer_type
 
double ctMin
minimal cosine space angle between PMT axes 
 
double sigma_ns
time resolution [ns] 
 
3D match criterion with road width. 
 
int NMaxHits
maximal number of hits