31 int main(
int argc ,
char** argv){
34 JLimit_t& numberOfEvents = inputFiles.getLimit();
53 zap[
'n'] =
make_field(numberOfEvents ) = JLimit::max();
56 zap[
'l'] =
make_field(wavelength ,
"LED wavelength [nm]") = 400.0;
57 zap[
'T'] =
make_field(selector ) = default_pmts;
61 catch(
const exception &error) {
62 ERROR(error.what() << endl);
70 JHitBuffer triggerBuffer;
71 JHitBuffer snapshotBuffer;
87 timeDifferences =
new JManager < int, TH2D > (
new TH2D(
"%",
"", npairs, 0.5, npairs+0.5, 501, -250.5, 250.5) );
93 triggerBuffer .clear();
94 snapshotBuffer.clear();
96 builder(*event, moduleRouter,
true , back_inserter(snapshotBuffer));
97 builder(*event, moduleRouter,
false , back_inserter( triggerBuffer));
99 JHitBuffer::iterator __end = partition(triggerBuffer.begin(), triggerBuffer.end(), selector);
100 if(triggerBuffer.begin() != __end){
102 sort(triggerBuffer.begin(), __end, less<JHit>());
103 JHitBuffer::iterator triggeredHit = triggerBuffer.begin();
105 if( moduleRouter.
hasModule( triggeredHit -> getModuleID() ) ){
106 const JModule& triggeredModule = moduleRouter.
getModule( triggeredHit -> getModuleID() );
108 for(JHitBuffer::const_iterator snapshotHit = snapshotBuffer.begin(); snapshotHit != snapshotBuffer.end(); ++snapshotHit){
110 if( moduleRouter.
hasModule( snapshotHit -> getModuleID() ) ){
111 const JModule& snapshotModule = moduleRouter.
getModule( snapshotHit -> getModuleID() );
116 double Dt = snapshotHit->getT() - triggeredHit->getT();
117 double ToF =
getDistance( triggeredHit->getPosition(), snapshotHit->getPosition() ) / cw;
121 (*timeDifferences)[triggeredModule.
getString()]->Fill(xbin,Dt-ToF);
125 FATAL(
"JModuleRouter trying to access non existing identifier: " << snapshotHit->getModuleID() );
130 FATAL(
"JModuleRouter trying to access non existing identifier: " << triggeredHit->getModuleID() );
134 TFile output(outFile.c_str() ,
"recreate") ;
135 timeDifferences -> Write(output);
int main(int argc, char **argv)
Data structure for detector geometry and calibration.
Basic data structure for L0 hit.
Dynamic ROOT object management.
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
ROOT TTree parameter settings of various packages.
int getFloor() const
Get floor number.
int getString() const
Get string number.
Router for direct addressing of module data in detector data structure.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
bool hasModule(const JObjectID &id) const
Has module.
Data structure for a composite optical module.
Utility class to parse command line options.
virtual double getIndexOfRefractionGroup(const double lambda) const
Index of refraction for group velocity.
Implementation of dispersion for water in deep sea.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
Data structure for L0 hit.
file Auxiliary data structures and methods for detector calibration.
int getNumberOfFloors(const JDetector &detector)
Get number of floors.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
bool comparepair(const pair_type &A, const pair_type &B)
const double getSpeedOfLight()
Get speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Auxiliary class to set-up Hit.
Auxiliary class for defining the range of iterations of objects.
Auxiliary data structure for set of PMT identifiers.