CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/SimCalorimetry/EcalElectronicsEmulation/interface/EcalSimpleSource.h

Go to the documentation of this file.
00001 /*
00002  * $Id: EcalSimpleSource.h,v 1.3 2009/11/13 13:39:28 fambrogl Exp $
00003  */
00004 
00005 #ifndef ECALSIMPLESOURCE_H
00006 #define ECALSIMPLESOURCE_H
00007 
00008 #include "FWCore/Framework/interface/GeneratedInputSource.h"
00009 #include <memory>
00010 #include <TFormula.h>
00011 #include <string>
00012 
00042 class EcalSimpleSource: public edm::GeneratedInputSource {
00043 
00044   //constructor(s) and destructor(s)
00045 public:
00050   EcalSimpleSource(const edm::ParameterSet& pset,
00051                    const edm::InputSourceDescription& sdesc);
00052 
00055   virtual ~EcalSimpleSource(){};
00056 
00060   void beginJob(){};
00061 
00065   virtual bool produce(edm::Event& evt);
00066   
00067   //method(s)
00068 public:
00069 private:
00076   void replaceAll(std::string& s, const std::string& from,
00077                   const std::string& to) const;
00078 
00084   int cIndex2iEta(int iEta0) const{
00085     return (iEta0<85)?iEta0-85:iEta0-84;
00086   }
00087   
00093   int cIndex2iPhi(int iPhi0) const{
00094     return (iPhi0+10)%360+1;
00095   }
00096   
00102   int cIndex2iTtEta(int iEta0) const{
00103     return (iEta0<28)?iEta0-28:iEta0-27;
00104   }
00105   
00111   int cIndex2iTtPhi(int iPhi0) const{
00112     return iPhi0+1;
00113   }
00114   
00115   //attribute(s)
00116 protected:
00117 private:
00120   std::auto_ptr<TFormula> formula_;
00121 
00124   std::auto_ptr<TFormula> tpFormula_;
00125 
00128   std::auto_ptr<TFormula> simHitFormula_;
00129   
00132   bool verbose_;
00133 };
00134 
00135 #endif