File indexing completed on 2024-04-06 11:57:53
0001 #include <cassert>
0002 #include <iostream>
0003 #include <math.h>
0004 #include <time.h>
0005 #include <unistd.h>
0006 #include <stdio.h>
0007 #include <fstream>
0008 #include <stdlib.h>
0009 #include <string>
0010 #include <sstream>
0011 #include <vector>
0012 #include <map>
0013 using namespace std;
0014
0015
0016 #include "../../interface/ME.h"
0017 #include "../../interface/MEGeom.h"
0018 #include "MusEcal.hh"
0019 #include "MERunManager.hh"
0020
0021 int main(int argc, char **argv)
0022 {
0023 int type = ME::iLaser;
0024 int ivar = ME::iAPD_MEAN;
0025 int color = ME::iBlue;
0026
0027 int c;
0028 while ( (c = getopt( argc, argv, "v:t:w:" ) ) != EOF )
0029 {
0030 switch (c)
0031 {
0032 case 'v': ivar = atoi( optarg ); break;
0033 case 't': type = atoi( optarg ); break;
0034 case 'w': color = atoi( optarg ); break;
0035 }
0036 }
0037 MusEcal::verbose = false;
0038 MusEcal* me;
0039 me = new MusEcal( type, color );
0040
0041 TFile* outfile_ = TFile::Open( "outfile.root", "RECREATE" );
0042 int ii(0);
0043 me->histConfig();
0044 me->bookHistograms();
0045 do
0046 {
0047 cout << "\nSequence=" << ii << " starting ";
0048 time_t t_ = me->curMgr()->curKey();
0049 cout << ctime(&t_) << endl;
0050 me->fillHistograms();
0051 outfile_->cd();
0052 me->writeGlobalHistograms();
0053 ii++;
0054 }
0055 while( me->nextSequence() );
0056 cout << "number of sequences " << ii << endl;
0057 outfile_->Close();
0058
0059 return(0);
0060 }