61 long long int Tmax_s = 600;
63 double sigma_deg = 1.0;
65 int numberOfOutliers = 0;
82 zap[
'f'] =
make_field(inputFile,
"output of JConvertDB -q ahrs");
93 catch(
const exception &error) {
136 string.size(), -0.5,
string.size() - 0.5,
140 h2.GetXaxis()->SetBinLabel(i,
MAKE_CSTRING(
string.at(i-1)));
155 for (JMultipleFileScanner_t::const_iterator file_name = inputFile.begin(); file_name != inputFile.end(); ++file_name) {
157 STATUS(
"processing file " << *file_name <<
endl);
163 const JAHRS* parameters = in.next();
166 data[router.
getModule(parameters->
DOMID).getString()].push_back(*parameters);
176 long long int t1 = p->UNIXTIME;
177 long long int t2 = t1;
181 for ( ; p != i->second.end() && p->UNIXTIME < t1 + Tmax_s * 1000; t2 = (p++)->UNIXTIME) {
185 const JModule&
module = router.getModule(p->DOMID);
187 if (
module.getFloor() != 0 && !
module.has(COMPASS_DISABLE)) {
189 const JCompass compass(*p, calibration.get(p->DOMID));
191 const JQuaternion3D Q =
module.getQuaternion() * compass.getQuaternion();
193 buffer.push_back(
JHit(p->DOMID,
module.getZ(), Q, sigma_deg));
211 for (
int ns = 0; ns != numberOfOutliers; ++ns) {
229 if (xmax > stdev * sigma_deg) {
243 cout <<
"remove " << location <<
' '
249 swap(*out, *--__end);
261 simplex.step.resize(4);
268 const double chi2 = simplex(
getChi2, buffer.begin(), __end);
269 const int ndf =
distance(buffer.begin(), __end) * 4 - simplex.step.size();
294 count[
hit->getID()] += 1;
298 HN[i->first]->Fill(i->second);
311 for (JManager_t::iterator i = p->begin(); i != p->end(); ++i) {
323 if (
detector.setToLatestVersion()) {
331 JModule&
module = detector[router.getIndex(i->first)];
335 module.setQuaternion(Q.normalise());
Compass event data types.
ROOT TTree parameter settings.
ROOT TTree parameter settings.
Data structure for detector geometry and calibration.
Recording of objects on file according a format that follows from the file name extension.
Dynamic ROOT object management.
General purpose messaging.
Direct access to module in detector data structure.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Direct access to string in detector data structure.
Logical location of module.
int getFloor() const
Get floor number.
int getString() const
Get string number.
Router for direct addressing of module data in detector data structure.
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Utility class to parse parameter values.
Simple fit method based on Powell's algorithm, see reference: Numerical Recipes in C++,...
Data structure for unit quaternion in three dimensions.
static const JQuaternion3D & getIdentity()
Get identity quaternion.
Template definition of a multi-dimensional oscillation probability interpolation table.
JEvt getEvt(const JHead &header, const JModel &model)
Get event.
floor_range getRangeOfFloors(const JDetector &detector)
Get range of floors.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
double getChi2(const double P)
Get chi2 corresponding to given probability.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
static const JVector3D JVector3Z_t(0, 0, 1)
unit z-vector
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
int getIndex()
Get index for user I/O manipulation.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool is_valid(const json &js)
Check validity of JSon data.
int main(int argc, char **argv)
Auxiliary data structure for floating point format specification.
Model for fit to acoustics data.
Auxiliary data structure for chi2 evaluation.
static const int NUMBER_OF_PARAMETERS
number of parameters of fit per quaternion
Auxiliary class to map module identifier to AHRS calibration.
Auxiliary data structure to check validity of AHRS data.
long long int UNIXTIME
[ms]
Router for mapping of string identifier to index.
static int debug
debug level (default is off).
Auxiliary data structure for decomposition of quaternion in twist and swing quaternions.
This class represents a rotation around the x-axis.
This class represents a rotation around the y-axis.
This class represents a rotation around the z-axis.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
static counter_type max()
Get maximum counter value.
Auxiliary base class for list of file names.