CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixTcp.h

Go to the documentation of this file.
00001 #ifndef ECAL_FENIX_TCP_H
00002 #define ECAL_FENIX_TCP_H
00003 
00004 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixEtTot.h>
00005 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixBypassLin.h>
00006 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixMaxof2.h>
00007 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixTcpFormat.h>
00008 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixFgvbEB.h>
00009 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixTcpFgvbEE.h>
00010 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixTcpsFgvbEB.h>
00011 
00012 
00013 #include <DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h>
00014 #include <DataFormats/EcalDigi/interface/EBDataFrame.h>
00015 #include <DataFormats/EcalDigi/interface/EEDataFrame.h>
00016 
00017 #include "FWCore/Framework/interface/EventSetup.h"
00018 
00019 #include <vector> 
00020 #include <iostream>
00021 
00022 class EcalTPGFineGrainEBGroup;
00023 class EcalTPGLutGroup;
00024 class EcalTPGLutIdMap;
00025 class EcalTPGFineGrainEBIdMap;
00026 class EcalTPGFineGrainTowerEE;
00027 class EcalTrigTowerDetId;
00028 class EcalTPGTowerStatus;
00029 
00034 class EcalFenixTcp {
00035 
00036  private:
00037   bool debug_;
00038 
00039   int nbMaxStrips_;
00040 
00041   EcalFenixMaxof2 *maxOf2_;
00042   std::vector<EcalFenixBypassLin *> bypasslin_;
00043   EcalFenixEtTot *adder_;
00044   EcalFenixFgvbEB *fgvbEB_;
00045   EcalFenixTcpFgvbEE *fgvbEE_;
00046   EcalFenixTcpsFgvbEB *sfgvbEB_;  
00047 
00048   EcalFenixTcpFormat *formatter_;
00049 
00050   // permanent data structures
00051   std::vector<std::vector<int> > bypasslin_out_;
00052   std::vector<int> adder_out_;
00053   std::vector<int> maxOf2_out_;
00054   std::vector<int> fgvb_out_;
00055   std::vector<int> strip_fgvb_out_;
00056    
00057  public:
00058   // temporary, for timing tests
00059   void setPointers(  const EcalTPGFineGrainEBGroup * ecaltpgFgEBGroup,
00060                      const EcalTPGLutGroup * ecaltpgLutGroup,
00061                      const EcalTPGLutIdMap * ecaltpgLut,
00062                      const EcalTPGFineGrainEBIdMap * ecaltpgFineGrainEB,
00063                      const EcalTPGFineGrainTowerEE * ecaltpgFineGrainTowerEE,
00064                      const EcalTPGTowerStatus * ecaltpgBadTT,
00065                      const EcalTPGSpike * ecaltpgSpike)
00066     {
00067       ecaltpgFgEBGroup_=ecaltpgFgEBGroup;
00068       ecaltpgLutGroup_=ecaltpgLutGroup;
00069       ecaltpgLut_=ecaltpgLut;
00070       ecaltpgFineGrainEB_=ecaltpgFineGrainEB;
00071       ecaltpgFineGrainTowerEE_=ecaltpgFineGrainTowerEE;
00072       ecaltpgBadTT_=ecaltpgBadTT;
00073       ecaltpgSpike_=ecaltpgSpike;
00074    }
00075   // end temporary, for timing tests
00076 
00077   EcalFenixTcp(const edm::EventSetup & setup, bool tcpFormat, bool debug, bool famos, int binOfMax, int maxNrSamples,int nbMaxStrips);
00078   virtual ~EcalFenixTcp() ;
00079 
00080   void process(const edm::EventSetup & setup,
00081                std::vector <EBDataFrame> &bid,             //dummy argument for template call 
00082                std::vector<std::vector<int> > & tpframetow, int nStr,
00083                std::vector< EcalTriggerPrimitiveSample> & tptow,
00084                std::vector< EcalTriggerPrimitiveSample> & tptow2,
00085                bool isInInnerRings, EcalTrigTowerDetId thisTower);
00086   void process(const edm::EventSetup & setup,
00087                std::vector <EEDataFrame> &bid,             //dummy argument for template call 
00088                std::vector<std::vector<int> > & tpframetow, int nStr,
00089                std::vector< EcalTriggerPrimitiveSample> & tptow,
00090                std::vector< EcalTriggerPrimitiveSample> & tptow2,
00091                bool isInInnerRings, EcalTrigTowerDetId thisTower);
00092 
00093   void process_part1(std::vector<std::vector<int> > &tpframetow, int nStr,int bitMask);
00094 
00095   void  process_part2_barrel(std::vector<std::vector<int> > &, int nStr,int bitMask,
00096                              const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup,
00097                              const EcalTPGLutGroup*ecaltpgLutGroup,
00098                              const EcalTPGLutIdMap *ecaltpgLut,
00099                              const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB,
00100                              const EcalTPGTowerStatus *ecaltpgBadTT,
00101                              const EcalTPGSpike * ecaltpgSpike,
00102                              std::vector< EcalTriggerPrimitiveSample> &tptow,
00103                              std::vector< EcalTriggerPrimitiveSample> &tptow2,
00104                              EcalTrigTowerDetId towid);
00105                                
00106   void  process_part2_endcap(std::vector<std::vector<int> > &, int nStr,int bitMask,
00107                              const EcalTPGLutGroup *ecaltpgLutGroup,
00108                              const EcalTPGLutIdMap *ecaltpgLut,
00109                              const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE,
00110                              const EcalTPGTowerStatus *ecaltpgBadTT,
00111                              std::vector< EcalTriggerPrimitiveSample> &tptow,
00112                              std::vector< EcalTriggerPrimitiveSample> &tptow2,bool isInInnerRings,      
00113                              EcalTrigTowerDetId towid);
00114                                    
00115 
00116   EcalFenixBypassLin *getBypasslin(int i) const {return bypasslin_[i];}
00117   EcalFenixEtTot *getAdder() const { return  adder_;}
00118   EcalFenixMaxof2 *getMaxOf2() const {return maxOf2_;}
00119   EcalFenixTcpFormat *getFormatter() const {return formatter_;}
00120   EcalFenixFgvbEB *getFGVBEB() const {return fgvbEB_;}
00121   EcalFenixTcpFgvbEE *getFGVBEE() const {return fgvbEE_;}
00122   EcalFenixTcpsFgvbEB *getsFGVBEB() const {return sfgvbEB_;}
00123                               
00124   const EcalTPGFineGrainEBGroup * ecaltpgFgEBGroup_;
00125   const EcalTPGLutGroup * ecaltpgLutGroup_;
00126   const EcalTPGLutIdMap * ecaltpgLut_;
00127   const EcalTPGFineGrainEBIdMap * ecaltpgFineGrainEB_;
00128   const EcalTPGFineGrainTowerEE * ecaltpgFineGrainTowerEE_;
00129   const EcalTPGTowerStatus * ecaltpgBadTT_;
00130   const EcalTPGSpike * ecaltpgSpike_;
00131 };
00132 
00133 
00134 #endif