42 inline double getRange(
const double E,
const double l_abs)
44 const double precision = 1.0e-6;
45 const double y0 = 1.0e-3;
50 for (
int i = 0;
i != 1000; ++
i) {
52 const double x = 0.5 * (xmin +
xmax);
53 const double R = 1.0e3 *
pow(10.0, x);
55 const double y = E * 2.0e-9 *
exp(-R/l_abs) /
R;
57 if (fabs(y - y0) <= precision) {
67 return pow(10.0, 0.5 * (xmin + xmax));
76 int main(
int argc,
char **argv)
88 size_t numberOfEvents;
98 double ZMax_m = 150.0;
112 JParser<> zap(
" Auxiliary program to write signal acoustic data.");
114 zap[
'a'] =
make_field(detectorFile,
"detector.");
118 zap[
'E'] =
make_field(E_GeV,
"neutrino energy [GeV]");
119 zap[
'R'] =
make_field(run,
"run number") = -1;
120 zap[
'T'] =
make_field(T_s,
"time interval between events [s]");
125 zap[
'W'] =
make_field(
id,
"waveform identifier");
131 catch(
const exception &error) {
132 FATAL(error.what() << endl);
136 gRandom->SetSeed(seed);
150 const JPosition3D center(cylinder.getX(), cylinder.getY(), 0.5 * (cylinder.getZmin() + cylinder.getZmax()));
152 TH1D h1(
"h1", NULL, 60, 6.0, 12.0);
154 for (Int_t
i = 1;
i <= h1.GetXaxis()->GetNbins(); ++
i) {
156 const double x = h1.GetXaxis()->GetBinCenter(
i);
157 const double E =
pow(10.0, x);
172 toa.QUALITYFACTOR = 2.0e3;
173 toa.QUALITYNORMALISATION = 0.0e3;
175 for (
size_t i = 0;
i != numberOfEvents; ++
i) {
177 JPosition3D pos(gRandom->Uniform(
X.getLowerLimit(),
X.getUpperLimit()),
178 gRandom->Uniform(
Y.getLowerLimit(),
Y.getUpperLimit()),
179 gRandom->Uniform(
Z.getLowerLimit(),
Z.getUpperLimit()));
185 gRandom->Sphere(x, y, z, 1.0);
191 const double t0 = T_s *
i;
193 size_t number_of_hits = 0;
195 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
197 if (module->getFloor() != 0) {
204 if (sqrt(
P.getX()*
P.getX() +
P.getY()*
P.getY()) <= RMax_m && fabs(
P.getZ()) <=
parameters.ZMax_m) {
206 const JReceiver receiver(module->getID(), module->getPosition(), module->getT0() * 1.0e-9);
208 const double t1 =
V.getTime(pos.
getDistance(receiver), pos.
getZ(), receiver.getZ());
210 toa.DOMID = receiver.getID();
211 toa.TOA_NS = llrint(1E9*receiver.putT(t0 + t1));
220 STATUS(
"event: " << setw(6) << i <<
' '
221 <<
FIXED(12,2) << t0 <<
' '
222 <<
FIXED(9,2) << (pos.
getX() - center.getX()) <<
' '
223 <<
FIXED(9,2) << (pos.
getY() - center.getY()) <<
' '
224 <<
FIXED(9,2) << (pos.
getZ() - center.getZ()) <<
' '
228 << setw(4) << number_of_hits << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
ROOT TTree parameter settings.
Recording of objects on file according a format that follows from the file name extension.
Utility class to parse parameter values.
*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
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Time-of-arrival data from acoustic piezo sensor or hydrophone.
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.
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
double getDistance(const JVector3D &pos) const
Get distance to point.
Data structure for detector geometry and calibration.
Utility class to parse parameter values.
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound.
Type definition of range.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getDY() const
Get y direction.
double getDX() const
Get x direction.
T pow(const T &x, const double y)
Power .
double getY() const
Get y position.
General purpose messaging.
range_type getRange(TAxis *pAxis)
Get range of given axis.
Implementation for depth dependend velocity of sound.
then JCookie sh JDataQuality D $DETECTOR_ID R
then usage $script[energy[distance[z of PMT]]] fi case set_variable z
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
double getX() const
Get x position.
no fit printf nominal n $STRING awk v X
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
Data structure for position in three dimensions.
do set_variable DETECTOR_TXT $WORKDIR detector
Data structure for normalised vector in three dimensions.
double getZ() const
Get z position.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
double getDZ() const
Get z direction.
JVector3D & add(const JVector3D &vector)
Add vector.