//
// FCaloFINDCALIBS.cc -- standalone program to call the FCaloFINDCALIBS macro. 
//    by Emiliano Mocchiutti
//
//   Version 1.00 (2005/11/07)
//
// Changelog: 
//
// 0.00 - 1.00 : working.
//
#include <TString.h>
#include <iostream>
#include <FCaloFINDCALIBSfun.h>
extern void info();
using namespace std;
//
int main(int numinp, char *inps[]){
  TString program;
  TString name;
  if ( numinp != 3 ){
    if ( numinp > 1 ){
      if ( !strcmp(inps[1],"--version") ){
	info();
	return(0);
      };
    };
    printf("\nUsage:\n\n FCaloFINDCALIBS type file \n");
    printf("\n - type                can be HERE or BEST \n");
    printf(  " - file                must be in the form: /path/to/filesfromyoda/dw_000000_00000.root  \n");
    printf("\nExample: \n\nFCaloFINDCALIBS HERE /home/pamela/filesfromyoda/dw_050301_00100.root \n\n");
    return(0);
    //
  } else {
    printf("\n Welcome to FCaloFINDCALIBS! \n");
    program = (TString)inps[1];
    name = (TString)inps[2];
  };
  //
  if ( !strcmp(program.Data(),"HERE") ){
    printf("\n Calling FCaloOLDFINDCALIBS\n");
    FCaloOLDFINDCALIBS(name);
  };
  if ( !strcmp(program.Data(),"BEST") ){
    printf("\n Calling FCaloFINDCALIBS\n");
    FCaloFINDCALIBS(name);
  };
  //
  return(0);
}
