56 bool operator()(
const T&
first,
const T& second)
const
60 using namespace KM3NETDAQ;
62 if (equal_to<JDAQPMTIdentifier>()(first, second))
63 return less<JHit>()(first, second);
65 return less<JDAQPMTIdentifier>()(first, second);
78 int main(
int argc,
char **argv)
82 using namespace KM3NETDAQ;
85 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
87 JParallelFileScanner_t inputFile;
98 JParser<> zap(
"Program to perform detector calibration using reconstructed muon trajectories.");
102 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
109 catch(
const exception& error) {
110 FATAL(error.what() << endl);
118 WARNING(
"Number of prefits " <<
parameters.numberOfPrefits <<
" != " << 1 << endl);
144 while (inputFile.hasNext()) {
146 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
148 multi_pointer_type ps = inputFile.next();
153 DEBUG(
"event: " << *tev << endl);
161 buildL0(*tev, router,
true, back_inserter(dataL0));
163 for (JEvt::const_iterator track = in->begin(); track != in->end(); ++track) {
165 DEBUG(
"track: " << *track << endl);
181 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
183 double rate_Hz = summary.
getRate(*i);
185 if (rate_Hz <= 0.0) {
200 sort(data.begin(), data.end(), compare);
202 JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
213 <<
FIXED(12,3) << tz.getX() <<
' '
214 <<
FIXED(12,3) << tz.getY() <<
' '
215 <<
FIXED(12,3) << tz.getZ() <<
' '
216 <<
FIXED(12,3) << tz.getT() <<
' '
217 <<
FIXED(12,1) << E_GeV <<
' '
218 <<
FIXED( 8,3) << track->getQ() << endl);
237 for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
239 const double x = hit->getX() - tz.getX();
240 const double y = hit->getY() - tz.getY();
241 const double z = hit->getZ() - tz.getZ();
242 const double R = sqrt(x*x + y*y);
250 const double theta =
u.getTheta();
251 const double phi = fabs(
u.getPhi());
254 const double E = E_GeV;
255 const double dt = T_ns.
constrain(hit->getT() - t1);
262 const double chi2 = H1.getChi2() - H0.getChi2();
265 << setw(10) << hit->getModuleID() <<
':' << setw( 2) << setfill(
'0') << hit->getPMTAddress() << setfill(
' ') <<
' '
266 <<
FIXED(12,1) << E <<
' '
267 <<
FIXED( 9,1) << R <<
' '
268 <<
FIXED( 6,4) << theta <<
' '
269 <<
FIXED( 6,4) << phi <<
' '
270 <<
FIXED( 8,3) << dt <<
' '
271 <<
FIXED(12,3) << chi2 << endl);
276 DEBUG(
"quality: " <<
FIXED(8,3) << Q <<
' ' <<
distance(data.begin(), __end) << endl);
281 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
293 for (JModule::iterator pmt = module.begin(); pmt != module.end(); ++pmt) {
295 const double R = sqrt(pmt->getX()*pmt->getX() + pmt->getY()*pmt->getY());
296 const double theta = pmt->getTheta();
297 const double phi = fabs(pmt->getTheta());
298 const double y = npe.
calculate(1.0, R, theta, phi);
301 << setw(10) << module.
getID() <<
':' << setw( 2) << setfill(
'0') <<
distance(module.begin(),pmt) << setfill(
' ') <<
' '
302 <<
FIXED(9,1) << R <<
' '
303 <<
FIXED(6,4) << theta <<
' '
304 <<
FIXED(6,4) << phi <<
' '
Utility class to parse command line options.
double calculate(const double E, const double R, const double theta, const double phi) const
Get PDF.
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.
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.
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 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...
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.
Data structure for detector geometry and calibration.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Basic data structure for L0 hit.
result_type calculate(const double E, const double R, const double theta, const double phi, const double t1) const
Get PDF.
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.
JFunction1D_t::result_type result_type
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
do set_variable OUTPUT_DIRECTORY $WORKDIR T
int getID() const
Get identifier.
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
JPosition3D getPosition(const Vec &pos)
Get position.
File router for fast addressing of summary data.
Auxiliary data structure for muon PDF.
Data structure for fit parameters.
General purpose messaging.
Auxiliary data structure for muon PDF.
Direct access to module in detector data structure.
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.
Utility class to parse command line options.
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 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 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 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.
Auxiliary data structure for floating point format specification.
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
then usage $script[input file[working directory[option]]] nWhere option can be E