CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaWrite.h

Go to the documentation of this file.
00001 #ifndef ZTR_TEcnaWrite
00002 #define ZTR_TEcnaWrite
00003 
00004 #include <Riostream.h>
00005 
00006 #include "TObject.h"
00007 #include "TSystem.h"
00008 #include "Riostream.h"
00009 #include <math.h>
00010 #include <time.h>
00011 
00012 #include "TVectorD.h"
00013 #include "TMatrixD.h"
00014 
00015 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00016 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParEcal.h"
00017 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParPaths.h"
00018 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParCout.h"
00019 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaHeader.h"
00020 
00021 //------------------------ TEcnaWrite.h -----------------
00022 //
00023 //   For questions or comments, please send e-mail to:
00024 //
00025 //   Bernard Fabbro             
00026 //   fabbro@hep.saclay.cea.fr 
00027 //--------------------------------------------------------
00028 
00029 class TEcnaWrite : public TObject {
00030 
00031  private:
00032 
00033   //..... Attributes
00034 
00035   Int_t fgMaxCar;   // Max nb of caracters for char*
00036   Int_t fCnew,     fCdelete;
00037   Int_t fCnewRoot, fCdeleteRoot;
00038 
00039   TString fTTBELL;
00040 
00041   Int_t fCnaCommand, fCnaError;
00042 
00043   //...............................................................
00044 
00045   Int_t fFlagPrint;
00046   Int_t fCodePrintComments, fCodePrintWarnings, fCodePrintAllComments, fCodePrintNoComment;
00047 
00048   TEcnaParEcal *fEcal;
00049   TString fFlagSubDet;
00050 
00051   TEcnaNumbering *fEcalNumbering;
00052   TEcnaParPaths   *fCnaParPaths;
00053   TEcnaParCout    *fCnaParCout;
00054 
00055   ofstream fFcout_f;
00056 
00057   //...................................... Codes for file names
00058   Int_t fCodeHeaderAscii;
00059   Int_t fCodeRoot;
00060 
00061   Int_t fCodeNbOfEvts;
00062   Int_t fCodePed;
00063   Int_t fCodeTno;
00064   Int_t fCodeLfn;
00065   Int_t fCodeHfn;
00066   Int_t fCodeMeanCorss;
00067   Int_t fCodeSigCorss;
00068 
00069   Int_t fCodeCovCss;
00070   Int_t fCodeCorCss;
00071   
00072   Int_t fCodeAdcEvt;
00073   Int_t fCodeMSp;  
00074   Int_t fCodeSSp;
00075   
00076   Int_t fCodeAvPed;  
00077   Int_t fCodeAvTno;
00078   Int_t fCodeAvMeanCorss;
00079   Int_t fCodeAvSigCorss;
00080   
00081   Int_t fCodeLfCov;
00082   Int_t fCodeLfCor;
00083   Int_t fCodeHfCov;
00084   Int_t fCodeHfCor;
00085   
00086   Int_t fCodeLFccMoStins;
00087   Int_t fCodeHFccMoStins;
00088   
00089   //..........................................................................
00090   Int_t fSectChanSizeX, fSectChanSizeY;
00091   Int_t fSectSampSizeX, fSectSampSizeY;
00092 
00093   Int_t fNbChanByLine; // Nb channels by line (for ASCII results file)
00094   Int_t fNbSampByLine; // Nb samples by line  (for ASCII results file)
00095   Int_t fUserSamp;     // Current sample  number (for ASCII results file)
00096   Int_t fStexStinUser; // Current Stin number in Stex 
00097   Int_t fStinEchaUser; // Current electronic channel number in Stin
00098                        // for ASCII results file ([0,24] for EB, [1,25] for EE)
00099 
00100 
00101   Double_t**  fjustap_2d_ev;
00102   Double_t*   fjustap_1d_ev;
00103 
00104   Double_t**  fjustap_2d_var;
00105   Double_t*   fjustap_1d_var;
00106 
00107   Double_t**  fjustap_2d_cc;
00108   Double_t*   fjustap_1d_cc;
00109 
00110   Double_t**  fjustap_2d_ss;
00111   Double_t*   fjustap_1d_ss;
00112 
00113   //.................... Private methods
00114 
00115   void     fAsciiFileWriteHeader(const Int_t&);
00116   void     fT2dWriteAscii(const Int_t&, const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
00117 
00118  public:
00119 
00120   //..... Public attributes
00121 
00122   TString  fAnaType;
00123   Int_t    fNbOfSamples;
00124   Int_t    fRunNumber;
00125   Int_t    fFirstReqEvtNumber;
00126   Int_t    fLastReqEvtNumber;
00127   Int_t    fReqNbOfEvts;
00128   Int_t    fStexNumber;
00129   TString  fStexName;
00130   TString  fStinName;
00131 
00132   TString  fPathForAsciiFiles;
00133   TString  fStartDate, fStopDate;
00134   time_t   fStartTime, fStopTime;
00135 
00136   // Int_t    fMaxSampADC;
00137 
00138   TString  fRootFileNameShort;  // name of  the results ROOT file 
00139   TString  fRootFileName;       // name of  the results ROOT file with its path = fPathRoot/fRootFileNameShort
00140 
00141   TString  fAsciiFileName;      // name of  the results ASCII file
00142   TString  fAsciiFileNameShort; // name of  the results ASCII file = fPathAscii/fAsciiFileNameShort
00143 
00144   //..... Methods
00145 
00146            TEcnaWrite();
00147            TEcnaWrite(const TString, const TEcnaParPaths*, const TEcnaParCout*,
00148                      const TEcnaParEcal*, const TEcnaNumbering*);
00149   virtual  ~TEcnaWrite();
00150 
00151   void     Init();
00152   void     SetEcalSubDetector(const TString, const TEcnaParEcal*, const TEcnaNumbering*);
00153 
00154   //...................................................... making file name method
00155   void     fMakeResultsFileName();                // => default: arg = fCodeRoot
00156   void     fMakeResultsFileName(const Int_t&);
00157 
00158   //=============================================================================================
00159   //
00160   //           ci-dessous:     ==> WriteAsciiSampleMeans()
00161   //                               WriteAsciiSampleSigmas()
00162   //      methodes a remettre ?
00163   //
00164   //=============================================================================================
00165   //.................................... ASCII writing file methods 
00166   // void    WriteAsciiSampleMeans();
00167   // void    WriteAsciiSampleSigmas();
00168 
00169   void WriteAsciiCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
00170   void WriteAsciiCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
00171 
00172 
00173   void WriteAsciiHisto(const TString, const Int_t&, const TVectorD&);
00174 
00175   TString GetAsciiFileName();
00176   TString GetRootFileName();
00177   TString GetRootFileNameShort();
00178   TString GetAnalysisName();
00179   Int_t GetNbOfSamples();
00180   Int_t GetRunNumber();
00181   Int_t GetFirstReqEvtNumber();
00182   Int_t GetReqNbOfEvts();
00183   Int_t GetStexNumber();
00184 
00185   Int_t NumberOfEvents(Int_t**, const Int_t&, const Int_t&, const Int_t&);
00186   Int_t NumberOfEvents(Int_t*,  const Int_t&, const Int_t&);
00187 
00188   void RegisterFileParameters(const TString, const Int_t&, const Int_t&, const Int_t&,
00189                               const Int_t&,  const Int_t&, const Int_t&, const TString, const TString,
00190                               const time_t,  const time_t);
00191   
00192   void RegisterFileParameters(const TString, const Int_t&, const Int_t&, const Int_t&,
00193                               const Int_t&,  const Int_t&, const Int_t&);
00194   
00195   ClassDef(TEcnaWrite,1)// Writing in file (.ascii, .root) methods for CNA (Correlated Noises Analysis)
00196     };
00197     
00198 #endif   //    ZTR_TEcnaParameter
00199