Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#include <cassert>
#include <iostream>
#include <math.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <fstream>
#include <stdlib.h>
#include <string>
#include <sstream>
#include <vector>
#include <map>
using namespace std;

// simple test program
#include "../../interface/ME.h"
#include "../../interface/MEGeom.h"
#include "MusEcal.hh"
#include "MERunManager.hh"

int main(int argc, char **argv)
{
  int type  = ME::iLaser;
  int ivar  = ME::iAPD_MEAN;
  int color = ME::iBlue; 

  int c;
  while ( (c = getopt( argc, argv, "v:t:w:" ) ) != EOF ) 
    {
      switch (c) 
	{
	case 'v': ivar     = atoi( optarg );    break;
	case 't': type     = atoi( optarg );    break;
	case 'w': color    = atoi( optarg );    break;
	}
    }
  MusEcal::verbose = false;
  MusEcal* me;
  me = new MusEcal( type, color );

  TFile* outfile_ = TFile::Open( "outfile.root", "RECREATE" );
  int ii(0);
  me->histConfig();
  me->bookHistograms();
  do
    {
      cout << "\nSequence=" << ii << " starting ";
      time_t t_ =  me->curMgr()->curKey();
      cout << ctime(&t_) << endl;
      me->fillHistograms();
      outfile_->cd();
      me->writeGlobalHistograms();	
      ii++;
    }
  while( me->nextSequence() );
  cout << "number of sequences " << ii << endl;
  outfile_->Close();

  return(0);
}