Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:55

0001 #ifndef MERun_hh
0002 #define MERun_hh
0003 
0004 #include <iostream>
0005 #include <map>
0006 #include <vector>
0007 
0008 #include <TString.h>
0009 #include <TFile.h>
0010 #include <TH2.h>
0011 #include <TTree.h>
0012 
0013 #include "../../interface/ME.h"
0014 #include "../../interface/MEEBGeom.h"
0015 #include "../../interface/MEEEGeom.h"
0016 
0017 class MERun 
0018 {
0019   // only a run manager can create one of those
0020   friend class MERunManager;
0021   MERun( ME::Header header, ME::Settings settings, TString fname );
0022 
0023 public:
0024 
0025   virtual ~MERun();
0026   
0027   bool operator==( const MERun& o ) const;
0028 
0029   unsigned int run() const { return _header.run; }
0030   unsigned int lb() const  { return _header.lb;  }
0031   ME::Time time() const;
0032   ME::TimeStamp timestamp() const    { return _header.ts_beg; }
0033   TString rundir() const  { return _header.rundir; }
0034 
0035   TFile* laserPrimFile( bool refresh=false );
0036   void closeLaserPrimFile();
0037 
0038   float getVal( int table, int var, int ix=0, int iy=0 );
0039 
0040   const ME::Header   header()   const { return _header;   }
0041   const ME::Settings settings() const { return _settings; }
0042 
0043   void print( std::ostream& o ) const;
0044 
0045 private :
0046 
0047   ME::Header     _header;
0048   ME::Settings _settings;
0049   int _type;
0050   int _color;
0051 
0052   TString _fname;
0053   TFile*  _file;  
0054 
0055   // get 2-D histogram from the file
0056   TH2* APDHist( int var );
0057   std::map< TString, TH2* > _h;
0058   
0059   TTree* PNTable();
0060   TTree* pn_t;
0061   std::map< TString, unsigned int    > pn_i;
0062   std::map< TString, float > pn_d;
0063 
0064   TTree* MTQTable();
0065   TTree* mtq_t;
0066   std::map< TString, unsigned int    > mtq_i;
0067   std::map< TString, float > mtq_d;
0068 
0069   ClassDef( MERun, 0 ) // MERun -- a Laser monitoring run
0070 };
0071 
0072 // struct SortMERun
0073 // {
0074 //   bool operator()( const MERun* r1, const MERun* r2 ) const
0075 //   {
0076 //     int color1 = r1->settings().wavelength;
0077 //     int color2 = r2->settings().wavelength;
0078 //     if( color1!=color2 )
0079 //       {
0080 //  return color1<color2;
0081 //       }
0082 //     int dcc1 = r1->header().dcc;
0083 //     int dcc2 = r2->header().dcc;
0084 //     if( dcc1!=dcc2 )
0085 //       {
0086 //  return dcc1<dcc2;
0087 //       }
0088 //     int side1 = r1->header().side;
0089 //     int side2 = r2->header().side;
0090 //     if( side1!=side2 )
0091 //       {
0092 //  return side1<side2;
0093 //       }
0094 //     float TS1 = r1->header().ts_beg;
0095 //     float TS2 = r2->header().ts_beg;
0096 //     if( TS1!=TS2 )
0097 //       {
0098 //  return TS1<TS2;
0099 //       }
0100 //   }
0101 //};
0102 
0103 #endif