22 using namespace JDETECTOR;
23 using namespace KM3NETDAQ;
25 int main(
int argc ,
char** argv){
28 JLimit_t& numberOfEvents = inputFiles.getLimit();
41 zap[
'n'] =
make_field(numberOfEvents ) = JLimit::max();
43 zap[
'h'] =
make_field(depth ,
"detector depth [m]" ) = 2500.0;
44 zap[
'l'] =
make_field(wavelength ,
"LED wavelength [nm]") = 400.0;
48 catch(
const exception &error) {
49 ERROR(error.what() << endl);
57 JHitBuffer triggerBuffer;
58 JHitBuffer snapshotBuffer;
60 load(detectorFile , detector);
75 triggerBuffer .clear();
76 snapshotBuffer.clear();
78 builder(*event, moduleRouter,
true , back_inserter(snapshotBuffer));
79 builder(*event, moduleRouter,
false , back_inserter( triggerBuffer));
81 sort(triggerBuffer.begin(),triggerBuffer.end(),less<JHit>());
83 JHitBuffer::const_iterator triggeredHit = triggerBuffer.begin();
85 int triggeredString = moduleRouter.
getModule( triggeredHit -> getModuleID() ).
getString() ;
86 int triggeredFloor = moduleRouter.
getModule( triggeredHit -> getModuleID() ).
getFloor() ;
88 for(JHitBuffer::const_iterator snapshotHit = snapshotBuffer.begin(); snapshotHit != snapshotBuffer.end(); ++snapshotHit){
90 int snapshotString = moduleRouter.
getModule( snapshotHit -> getModuleID() ).
getString() ;
91 int snapshotFloor = moduleRouter.
getModule( snapshotHit -> getModuleID() ).
getFloor() ;
93 double ToF = triggeredHit->getDistance(*snapshotHit) / cw;
94 double Dt = snapshotHit->getT() - triggeredHit->getT();
100 TFile output(outFile.c_str() ,
"recreate") ;
101 timeDifferences -> Write(output);
Auxiliary class to set-up Hit.
Utility class to parse command line options.
virtual const pointer_type & next()
Get next element.
ROOT TTree parameter settings.
int getFloor() const
Get floor number.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Implementation of dispersion for water in deep sea.
Router for direct addressing of module data in detector data structure.
Dynamic ROOT object management.
Data structure for detector geometry and calibration.
#define MAKE_STRING(A)
Make string.
Basic data structure for L0 hit.
Auxiliary class to manage set of compatible ROOT objects (e.g.
Auxiliary class for defining the range of iterations of objects.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Direct access to module in detector data structure.
virtual bool hasNext()
Check availability of next element.
int getString() const
Get string number.
virtual double getIndexOfRefractionGroup(const double lambda) const
Index of refraction for group velocity.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
Data structure for L0 hit.
std::string to_string(const T &value)
Convert value to string.
int main(int argc, char *argv[])