40 JModule::const_iterator pmt_a = module_a.begin();
41 JModule::const_iterator pmt_b = module_b.begin();
43 for ( ; pmt_a != module_a.end() && pmt_b != module_b.end(); ++pmt_a , ++pmt_b) {
44 q.
put (pmt_a->getT0()-pmt_b->getT0());
65 int main(
int argc,
char **argv)
70 string detectorFile_a;
71 string detectorFile_b;
77 JParser<> zap(
"Auxiliary program to find differences between two detector files.");
85 catch(
const exception &error) {
86 FATAL(error.what() << endl);
93 load(detectorFile_a, detector_a);
99 load(detectorFile_b, detector_b);
105 bool is_equal =
true;
119 if (detector_a.getID() != detector_b.getID()) {
120 DEBUG(
"* Different detector identifiers "
121 << setw(5) << detector_a.getID() <<
" (A) and " << endl
122 << setw(5) << detector_b.getID() <<
" (B)." << endl
128 DEBUG(
"Comparing module by module." << endl);
129 for (JDetector::iterator module = detectorMerged.begin(); module != detectorMerged.end(); ++module) {
130 if (!module_router_b.
hasModule(module->getID())) {
135 if (!module_router_a.
hasModule(module->getID())) {
140 DEBUG(
" Module " << setw(10) << module->getID());
144 for (
unsigned int pmt = 0; pmt < module->size(); ++pmt) {
148 if (mergeType ==
"average") {
150 }
else if (mergeType ==
"odd") {
151 const int floorId = module_a->
getFloor();
153 if (parityId % 2 != 0) {
154 newT0 = pmt_a.
getT0();
156 newT0 = pmt_b.
getT0();
159 module->getPMT(pmt).setT0(newT0);
Utility class to parse command line options.
int getFloor() const
Get floor number.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Router for direct addressing of module data in detector data structure.
Data structure for detector geometry and calibration.
#define ASSERT(A,...)
Assert macro.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for PMT geometry and calibration.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
const JPMT & getPMT(const int index) const
Get PMT.
General purpose messaging.
Direct access to module in detector data structure.
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.
bool hasModule(const JObjectID &id) const
Has module.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
#define DEBUG(A)
Message macros.
double getT0() const
Get time offset.
int main(int argc, char *argv[])