Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:13

0001 #include <iostream>
0002 #include <math.h>
0003 #include <fstream>
0004 #include <stdlib.h>
0005 #include <string>
0006 #include <sstream>
0007 #include <time.h>
0008 #include <unistd.h>
0009 #include <stdio.h>
0010 #include <vector>
0011 #include <map>
0012 using namespace std;
0013 
0014 #include "MELaserPrim.cc"  // fixme ---> put file in stubs/
0015 
0016 // Creating laser monitoring primitives

0017 
0018 int main(int argc, char **argv)
0019 {
0020   int dcc      = 628;
0021   int color    = MELaserPrim::iIRed;
0022   TString inpath(  "/media/data/malcles/MonitoringResults/LMEB06_PedOK/Laser/Analyzed/" ); // on pcsaccms03

0023   TString outpath( "/afs/cern.ch/user/g/ghm/scratch0/MusEcal/EBSM06/prim/");  // on pcsaccms03

0024   int c;
0025   while ( (c = getopt( argc, argv, "r:s:d:c:i:o:" ) ) != EOF ) 
0026     {
0027       switch (c) 
0028     {
0029     case 'd': dcc      = atoi(optarg);      break;
0030     case 'c': color    = atoi(optarg);      break;
0031       //    case 'i': inpath   = TString( optarg ); break;

0032       //    case 'o': outpath  = TString( optarg ); break;

0033     }
0034     }
0035 
0036 
0037   TString runlistfile(outpath); runlistfile += "runlist_";
0038   switch( color ) 
0039     {
0040     case MELaserPrim::iBlue:  runlistfile+="Blue_"; break;
0041     case MELaserPrim::iRed:   runlistfile+="Red_";  break;
0042     case MELaserPrim::iIRed:  runlistfile+="Red_";  break;  // fixme

0043     default: abort();
0044     }
0045   runlistfile += "Laser";
0046   cout << "read " << runlistfile << endl;
0047   ifstream fin;
0048   fin.open(runlistfile);
0049 
0050   while( fin.peek() != EOF )
0051     {
0052       int run_, ts_;
0053       int dt;
0054       fin >> run_ >> ts_ >> dt;
0055       cout << "Run=" << run_ << " TS=" << ts_ << endl;
0056       //      if( run_!=17158 ) continue;

0057 
0058       TString inpath_(inpath); inpath_ += "h4b.000"; inpath_ += run_; inpath_ += ".A.0.0/";
0059       for( int side_=0; side_<2; side_++ )
0060     {
0061       cout << "Make Primitives for DCC=" << dcc << " Side=" << side_ << " Color=" << color 
0062            << " Run=" << run_  << " TS=" << ts_ << endl;
0063       MELaserPrim prim( dcc, side_, color, run_, ts_, inpath_, outpath );
0064       prim.init();
0065       prim.bookHistograms();
0066       prim.fillHistograms();
0067       prim.writeHistograms();
0068     }
0069     }
0070       
0071 
0072   return(0);
0073 }