#!/usr/bin/perl
open(MACRO, ">addToChain.C");
print MACRO "void addToChain(TChain\* chainPtr) {\n";
open(FIND, "find -L $ENV{OUTPUT_DIR} -name fdcCathodeResidTest.root |");
while (<FIND>) {
    chomp;
    print MACRO "  chainPtr->Add(\"$_\");\n";
}
close(FIND);
print MACRO "  return;\n\}\n";
close (MACRO);
exit;
