32int main(
int argc,
char **argv)
44 JParser<> zap(
"Auxiliary program to merge time-over-threshold data.");
46 zap[
'f'] =
make_field(inputFile,
"input file (output from JCalibrateToT).");
52 catch(
const exception &error) {
53 FATAL(error.what() << endl);
57 gErrorIgnoreLevel = kError;
64 for (vector<string>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {
66 DEBUG(
"Processing " << *i << endl) ;
68 TFile in(i->c_str(),
"read");
70 TIter iter(in.GetListOfKeys());
72 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
74 if (TString(key->GetName()).EndsWith(
_2SToT)) {
76 TH2* h2 =
dynamic_cast<TH2*
>(key->ReadObj());
78 map_type::iterator p = zmap.find(h2->GetName());
80 if (p == zmap.end()) {
82 DEBUG(
"Clone " << h2->GetName() << endl);
84 p = zmap.insert(make_pair(h2->GetName(), (TH2*) h2->Clone())).first;
88 DEBUG(
"Add " << h2->GetName() << endl);
95 for (map_type::iterator i = zmap.begin(); i != zmap.end(); ++i) {
96 i->second->SetDirectory(0);
106 for (map_type::iterator i = zmap.begin(); i != zmap.end(); ++i) {
108 if (i->first.EndsWith(
_2SToT)) {
110 TH2D* h2s = (TH2D*) i->second;
118 for (vector<string>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {