CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/interface/EcnaAnalyzer.h

Go to the documentation of this file.
00001 #ifndef CL_EcnaAnalyzer_H
00002 #define CL_EcnaAnalyzer_H
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    EcalCorrelatedNoiseAnalysisModules
00007 // Class:      EcnaAnalyzer
00008 // 
00016 //
00017 // Original Author:  Bernard Fabbro
00018 //         Created:  Fri Jun  2 10:27:01 CEST 2006
00019 // $Id: EcnaAnalyzer.h,v 1.2 2011/03/21 14:57:41 fabbro Exp $
00020 //
00021 //
00022 
00023 // system include files
00024 #include <memory>
00025 #include <iostream>
00026 #include <fstream>
00027 #include <iomanip>
00028 #include <string>
00029 #include <vector>
00030 #include <time.h>
00031 #include "Riostream.h"
00032 
00033 #include <sys/time.h>
00034 #include <signal.h>
00035 
00036 // ROOT include files
00037 #include "TObject.h"
00038 #include "TSystem.h"
00039 #include "TString.h"
00040 #include "TVectorD.h"
00041 #include "TTreeIndex.h"
00042 
00043 // CMSSW include files
00044 #include "FWCore/Framework/interface/EDAnalyzer.h"
00045 #include "FWCore/Framework/interface/Event.h"
00046 #include "FWCore/Framework/interface/EventSetup.h"
00047 #include "DataFormats/Common/interface/Handle.h"
00048 #include "FWCore/Framework/interface/ESHandle.h"
00049 #include "FWCore/Framework/interface/Frameworkfwd.h"
00050 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00051 #include "CondCore/DBCommon/interface/Time.h"
00052 
00053 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00054 
00055 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
00056 #include "DataFormats/EcalDigi/interface/EcalMGPASample.h"
00057 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00058 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00059 #include "DataFormats/Provenance/interface/EventID.h"
00060 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00061 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00062 
00063 #include "DataFormats/Provenance/interface/Timestamp.h"
00064 //#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h"
00065 //#include "Geometry/EcalMapping/interface/EcalMappingRcd.h"
00066 
00067 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
00068 
00069 // user include files
00070 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaObject.h"
00071 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaRun.h"
00072 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParPaths.h"
00073 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParEcal.h"
00074 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00075 
00122 
00123 //
00124 // class declaration
00125 //
00126 
00127 class EcnaAnalyzer : public edm::EDAnalyzer {
00128 
00129  public:
00130   
00131   enum { kChannels = 1700, kGains = 3, kFirstGainId = 1 };
00132   
00133   explicit EcnaAnalyzer(const edm::ParameterSet&);
00134   ~EcnaAnalyzer();  
00135   
00136   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00137   TString runtype(const Int_t&);
00138   Int_t   gainvalue(const Int_t&);
00139   void    CheckMsg(const Int_t&, const Int_t&);
00140   void    CheckMsg(const Int_t&);
00141   Bool_t  AnalysisOutcome(const TString);
00142 
00143  private:
00144 
00145   Int_t   fgMaxCar;   // Max nb of caracters for char*
00146   TString fTTBELL;
00147 
00148   // ----------member data ---------------------------
00149   unsigned int verbosity_;
00150   Int_t  nChannels_;
00151   Int_t  iEvent_; // should be removed when we can access class EventID
00152   string eventHeaderProducer_;
00153   string digiProducer_;
00154   string eventHeaderCollection_;
00155   string EBdigiCollection_;
00156   string EEdigiCollection_;
00157 
00158   TString  sAnalysisName_;
00159   TString  sNbOfSamples_;
00160   TString  sFirstReqEvent_;
00161   TString  sLastReqEvent_;
00162   TString  sReqNbOfEvts_;
00163   TString  sStexName_;
00164   TString  sStexNumber_;
00165 
00166   Bool_t   fOutcomeError;
00167 
00168   Int_t   fEvtNumber;
00169   Int_t   fEvtNumberMemo;
00170   Int_t   fRecNumber;
00171   Int_t   fCurrentEventNumber;
00172   Int_t   fNbOfSelectedEvents;
00173 
00174   Int_t*   fBuildEventDistribBad;
00175   Int_t*   fBuildEventDistribGood;
00176 
00177   TString  fCfgAnalyzerParametersFilePath;  // absolute path for the analyzer parameters files (/afs/etc...)
00178   TString  fCfgAnalyzerParametersFileName;  // name of the analyzer parameters file 
00179   ifstream fFcin_f;
00180 
00181   TString fAnalysisName;
00182   Int_t   fChozenGainNumber;     // determined from fAnalysisName
00183   Int_t   fChozenRunTypeNumber;  // determined from fAnalysisName
00184   TString fDynBaseLineSub;       // determined from fAnalysisName
00185 
00186   Int_t   fNbOfSamples;
00187   Int_t   fRunNumber;
00188   Int_t   fRunTypeNumber;
00189   Int_t   fFirstReqEvent;
00190   Int_t   fLastReqEvent;
00191   TString fStexName;
00192   Int_t   fStexNumber;
00193 
00194   Int_t fReqNbOfEvts;
00195   Int_t fMgpaGainNumber;
00196 
00197   Int_t fSMIndexBegin;
00198   Int_t fSMIndexStop;
00199   Int_t fDeeIndexBegin;
00200   Int_t fDeeIndexStop;
00201   Int_t fStexIndexBegin;
00202   Int_t fStexIndexStop;
00203 
00204   Int_t    fFedTcc;
00205   Int_t*   fSMFromFedTcc;
00206   Int_t*   fESFromFedTcc;
00207   Int_t*   fDeeFromFedTcc;
00208   Int_t    fTreatedFedOrder;
00209   Int_t*   fFedStatusOrder;
00210   Int_t    fFedId;
00211   TString* fDeeNumberString;
00212 
00213   Int_t  fMaxTreatedStexCounter;
00214   Int_t  fDeeDS5Memo1;
00215   Int_t  fDeeDS5Memo2;
00216   Int_t* fStexDigiOK;
00217   Int_t* fStexNbOfTreatedEvents;
00218   Int_t* fStexStatus;
00219 
00220   Int_t  fMaxFedUnitCounter;
00221   Int_t* fFedStatus;
00222   Int_t* fFedDigiOK;
00223   Int_t* fFedNbOfTreatedEvents;
00224 
00225   Int_t  fMemoCutOK;
00226   Int_t  fNbOfTreatedStexs;
00227   Int_t* fNbOfTreatedFedsInDee;
00228   Int_t* fNbOfTreatedFedsInStex;
00229 
00230   Int_t fPEDESTAL_STD;
00231   Int_t fPEDESTAL_GAP;
00232   Int_t fLASER_STD;
00233   Int_t fPEDSIM;
00234 
00235   time_t*  fTimeFirst;
00236   time_t*  fTimeLast;  
00237   TString* fDateFirst;
00238   TString* fDateLast;
00239 
00240   Int_t* fMemoDateFirstEvent;
00241 
00242   TEcnaObject* fMyEcnaEBObjectManager;
00243   TEcnaObject* fMyEcnaEEObjectManager;
00244 
00245   TEcnaRun** fMyCnaEBSM;
00246   TEcnaRun** fMyCnaEEDee;
00247 
00248   TEcnaNumbering* fMyEBNumbering; 
00249   TEcnaParEcal*   fMyEBEcal;
00250 
00251   TEcnaNumbering* fMyEENumbering; 
00252   TEcnaParEcal*   fMyEEEcal; 
00253 
00254   //  Int_t** fT2d_LastEvt; // 2D array[channel][sample] max nb of evts read for a given (channel,sample) 
00255   //  Int_t*  fT1d_LastEvt;
00256 
00257   Int_t  fMaxRunTypeCounter;
00258   Int_t* fRunTypeCounter;
00259 
00260   Int_t  fMaxMgpaGainCounter;
00261   Int_t* fMgpaGainCounter;
00262 
00263   Int_t  fMaxFedIdCounter;
00264   Int_t* fFedIdCounter;
00265 
00266   Int_t  fMaxCounterQuad;
00267   Int_t* fCounterQuad;
00268 };
00269 
00270 #endif