CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibTracker/SiStripAPVAnalysis/interface/ApvAnalysisFactory.h

Go to the documentation of this file.
00001 #ifndef ApvAnalysisFactory_h
00002 #define ApvAnalysisFactory_h
00003 //#define DEBUG_INSTANCE_COUNTING
00004 
00005 
00006 #include "CalibTracker/SiStripAPVAnalysis/interface/ApvAnalysis.h"
00007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00008 #include "CalibTracker/SiStripAPVAnalysis/interface/TkStateMachine.h"
00009 #include "CalibTracker/SiStripAPVAnalysis/interface/TkCommonMode.h"
00010 #include "CalibTracker/SiStripAPVAnalysis/interface/TT6ApvMask.h"
00011 #include "CalibTracker/SiStripAPVAnalysis/interface/TT6NoiseCalculator.h"
00012 #include "CalibTracker/SiStripAPVAnalysis/interface/TT6PedestalCalculator.h"
00013 #include "CalibTracker/SiStripAPVAnalysis/interface/TT6CommonModeCalculator.h"
00014 #include "CalibTracker/SiStripAPVAnalysis/interface/MedianCommonModeCalculator.h"
00015 #include "CalibTracker/SiStripAPVAnalysis/interface/SimplePedestalCalculator.h"
00016 #include "CalibTracker/SiStripAPVAnalysis/interface/SimpleNoiseCalculator.h"
00017 #include <vector>
00018 #include <iostream>
00019 #include<map>
00020 #include<algorithm>
00021 #include<string>
00022 
00023 
00024 
00025 class ApvAnalysisFactory 
00026 {
00027  public:
00028   typedef std::vector<ApvAnalysis *> ApvAnalysisVector;
00029 
00030   ApvAnalysisFactory(std::string theAlgorithmType,
00031                      int theNumCMstripsInGroup,
00032                      int theMaskCalcFlag,
00033                      float theMaskNoiseCut,
00034                      float theMaskDeadCut,
00035                      float theMaskTruncCut,
00036                      float theCutToAvoidSignal,
00037                      int  theEventInitNumber,
00038                      int theEventIterNumber);
00039   ApvAnalysisFactory(const edm::ParameterSet& pset );
00040   ~ApvAnalysisFactory();
00041 
00042   bool instantiateApvs(uint32_t det_id, int numberOfApvs);
00043 
00044   ApvAnalysisVector getApvAnalysis( const uint32_t nDET_ID);
00045 
00046   void getPedestal(uint32_t det_id , int apvNumber,   ApvAnalysis::PedestalType& peds);
00047   void getPedestal(uint32_t det_id , ApvAnalysis::PedestalType& peds);
00048   float getStripPedestal(uint32_t det_id, int stripNumber);
00049 
00050   void getMask(uint32_t det_id, TkApvMask::MaskType& tmp);
00051   void getCommonMode(uint32_t det_id, ApvAnalysis::PedestalType& tmp);
00052   std::vector<float> getCommonMode(uint32_t det_id, int apvNumber);
00053 
00054   void getNoise(uint32_t det_id, int apvNumber,  ApvAnalysis::PedestalType& noise);
00055   void getNoise(uint32_t det_id,  ApvAnalysis::PedestalType& noise);
00056   float getStripNoise(uint32_t det_id, int stripNumber);
00057 
00058   void getRawNoise(uint32_t det_id, int apvNumber,  ApvAnalysis::PedestalType& noise);
00059   void getRawNoise(uint32_t det_id,  ApvAnalysis::PedestalType& noise);
00060   float getStripRawNoise(uint32_t det_id, int stripNumber);
00061 
00062   void getCommonModeSlope(uint32_t det_id, ApvAnalysis::PedestalType& tmp);
00063   float getCommonModeSlope(uint32_t det_id, int apvNumber);
00064 
00065   void update(uint32_t det_id, const edm::DetSet<SiStripRawDigi>& in);
00066   void updatePair(uint32_t det_id, int apvPair, const edm::DetSet<SiStripRawDigi>& in);
00067 
00068   std::string getStatus(uint32_t det_id);
00069 
00070    bool isUpdating(uint32_t detId); 
00071 
00072    
00073   typedef std::map < uint32_t, ApvAnalysisVector> ApvAnalysisMap;
00074   typedef std::map < ApvAnalysis *,int > MapNumberingPosition;
00075   typedef std::map < ApvAnalysis *,  uint32_t> InverseMap;
00076 
00077  private:
00078   //  void  constructAuxiliaryApvClasses (ApvAnalysis* thisApv);
00079   void  constructAuxiliaryApvClasses (ApvAnalysis* theApv, uint32_t det_id, int thisApv);
00080   void deleteApv(ApvAnalysis* apv);
00081   ApvAnalysisMap apvMap_;
00082   std::string theAlgorithmType_;
00083   int theNumCMstripsInGroup_;
00084   int theMaskCalcFlag_;
00085   float theMaskNoiseCut_; 
00086   float theMaskDeadCut_;
00087   float theMaskTruncCut_;
00088   float theCutToAvoidSignal_;
00089   int  theEventInitNumber_; 
00090   int theEventIterNumber_;
00091   std::string theCMType_;
00092   bool useDB_;
00093 
00094 };  
00095 #endif