CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/SimCalorimetry/EcalElectronicsEmulation/interface/EcalFEtoDigi.h

Go to the documentation of this file.
00001 #ifndef ECALFETODIGI_H
00002 #define ECALFETODIGI_H
00003 
00004 /* Class: EcalFEtoDigi
00005  * Description:
00006  *  produces Ecal trigger primitive digis from TCC input flat files
00007  * Original Author: Nuno Leonardo, P. Paganini, E. Perez
00008  * Created:  Thu Feb 22 11:32:53 CET 2007
00009  */
00010 
00011 #include "FWCore/Framework/interface/Frameworkfwd.h"
00012 #include "FWCore/Framework/interface/EDProducer.h"
00013 #include "FWCore/Framework/interface/Event.h"
00014 #include "FWCore/Framework/interface/MakerMacros.h"
00015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00017 #include "FWCore/Utilities/interface/Exception.h"
00018 #include "FWCore/Framework/interface/EventSetup.h"
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020 
00021 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00022 //#include "Geometry/EcalMapping/interface/EcalElectronicsMapping.h" 
00023 
00024 #include <memory>
00025 #include <iostream>
00026 #include <fstream>
00027 #include <vector>
00028 #include <iomanip>
00029 
00030 #include "SimCalorimetry/EcalElectronicsEmulation/interface/TCCinput.h"
00031 
00032 struct TCCinput; 
00033 typedef std::vector<TCCinput> TCCInputData;
00034 const int N_SM = 36; //number of ecal barrel supermodules
00035 
00036 class EcalFEtoDigi : public edm::EDProducer {
00037 
00038 public:
00039 
00040   explicit EcalFEtoDigi(const edm::ParameterSet&);
00041   ~EcalFEtoDigi(){}
00042   
00043 private:
00044 
00045   virtual void beginJob() ;
00046   virtual void produce(edm::Event&, const edm::EventSetup&);
00047   virtual void endJob();
00048 
00049   void readInput();
00050   EcalTrigTowerDetId         create_TTDetId (TCCinput);
00051   EcalTriggerPrimitiveSample create_TPSample(TCCinput, const edm::EventSetup&);
00052   EcalTriggerPrimitiveSample create_TPSampleTcp(TCCinput, const edm::EventSetup&);
00053   int SMidToTCCid(const int) const;
00054   void getLUT(unsigned int * lut, const int towerId,  const edm::EventSetup&) const ;
00055 
00056   TCCInputData inputdata_[N_SM];
00057 
00058   std::string basename_;
00059   bool useIdentityLUT_;
00060   int sm_;
00061   bool singlefile;
00062 
00063   int fileEventOffset_;
00064   bool debug_;
00065   std::ofstream outfile;
00066 
00067 };
00068 
00069 #endif