53 bool operator()(
const T&
first,
const T& second)
const
57 using namespace KM3NETDAQ;
59 if (equal_to<JDAQPMTIdentifier>()(first, second))
60 return less<JHit>()(first, second);
62 return less<JDAQPMTIdentifier>()(first, second);
75 int main(
int argc,
char **argv)
79 using namespace KM3NETDAQ;
82 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
84 JParallelFileScanner_t inputFile;
95 JParser<> zap(
"Program to evaluate hit probabilities.");
99 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
106 catch(
const exception& error) {
107 FATAL(error.what() << endl);
114 WARNING(
"Number of prefits " <<
parameters.numberOfPrefits <<
" != " << 1 << endl);
139 while (inputFile.hasNext()) {
141 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
143 multi_pointer_type ps = inputFile.next();
148 DEBUG(
"event: " << *tev << endl);
156 buildL0(*tev, router,
true, back_inserter(dataL0));
158 for (JEvt::const_iterator shower = in->begin(); shower != in->end(); ++shower) {
160 DEBUG(
"shower: " << *shower << endl);
171 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
173 double rate_Hz = summary.
getRate(*i);
175 if (rate_Hz <= 0.0) {
190 sort(data.begin(), data.end(),
compare);
192 JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
195 <<
FIXED(12,3) << vx.getX() <<
' '
196 <<
FIXED(12,3) << vx.getY() <<
' '
197 <<
FIXED(12,3) << vx.getZ() <<
' '
198 <<
FIXED(12,3) << vx.getT() <<
' '
199 <<
FIXED( 8,3) << shower->getQ() << endl);
203 for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
208 const double x = hit->getX() - vx.getX();
209 const double y = hit->getY() - vx.getY();
210 const double z = hit->getZ() - vx.getZ();
211 const double cd = z/
D.getLength();
219 const double theta =
u.getTheta();
220 const double phi = fabs(
u.getPhi());
222 const double E = shower->getE();
223 const double dt = T_ns.
constrain(hit->getT() - t1);
225 double H1 = npe.
calculate(E,
D.getLength(), cd, theta, phi);
226 double H0 = hit->getR() * 1e-9 * T_ns.
getLength();
228 double Vmax_npe = 20.0;
229 if (H1 >= Vmax_npe) {
238 << setw(10) << hit->getModuleID() <<
':' << setw( 2) << setfill(
'0') << hit->getPMTAddress() << setfill(
' ') <<
' '
239 <<
FIXED(12,1) << E <<
' '
240 <<
FIXED( 9,1) << R <<
' '
241 <<
FIXED( 6,4) << theta <<
' '
242 <<
FIXED( 6,4) << phi <<
' '
243 <<
FIXED( 8,3) << dt <<
' '
244 <<
FIXED(12,3) << chi2 << endl);
249 DEBUG(
"quality: " <<
FIXED(8,3) << Q <<
' ' <<
distance(data.begin(), __end) << endl);
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
Data structure for direction in three dimensions.
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.
This include file containes various data structures that can be used as specific return types for the...
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
Data structure for vertex fit.
void update(const JDAQHeader &header)
Update router.
Router for direct addressing of module data in detector data structure.
double getRate() const
Get default rate.
Auxiliary data structure for shower PDF.
Auxiliary data structure for muon PDF.
*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...
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.
Data structure for detector geometry and calibration.
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
Basic data structure for L0 hit.
Auxiliary class for defining the range of iterations of objects.
I/O formatting auxiliaries.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
JDirection3D getDirection(const Vec &dir)
Get direction.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
JPosition3D getPosition(const Vec &pos)
Get position.
static struct JACOUSTICS::@4 compare
Auxiliary data structure to sort transmissions.
File router for fast addressing of summary data.
Auxiliary data structure for muon PDF.
General purpose messaging.
Direct access to module in detector data structure.
then JCookie sh JDataQuality D $DETECTOR_ID R
Auxiliary class for a hit with background rate value.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Data structure for fit parameters.
Utility class to parse command line options.
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 position in three dimensions.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
Template specialisation of class JModel to match hit with bright point.
double getChi2(const double P)
Get chi2 corresponding to given probability.
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.
do echo Generating $dir eval D
double calculate(const double E, const double D, const double cd, const double theta, const double phi) const
Get PDF.
#define DEBUG(A)
Message macros.