CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/CalibTracker/SiStripAPVAnalysis/interface/ApvAnalysis.h

Go to the documentation of this file.
00001 #ifndef Tracker_APVAnalysis_h
00002 #define Tracker_APVAnalysis_h
00003 
00004 
00005 #include <vector>
00006 #include <iostream>
00007 // user include files
00008 #include "FWCore/Framework/interface/Frameworkfwd.h"
00009 #include "DataFormats/Common/interface/DetSetVector.h"
00010 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00011 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
00012 
00013 #include "FWCore/Framework/interface/Event.h"
00014 #include "boost/cstdint.hpp"
00015 
00016 
00017 //#define DEBUG_INSTANCE_COUNTING
00018 
00019 #ifdef DEBUG_INSTANCE_COUNTING
00020 #include "CommonDet/DetUtilities/interface/InstanceCounting.h"
00021 #endif
00022 
00023 class TkApvMask;
00024 class TkCommonModeCalculator;
00025 class TkPedestalCalculator;
00026 class TkNoiseCalculator;
00027 
00028 #include <vector>
00029 #include <utility>
00030 
00041 class ApvAnalysis 
00042 #ifdef DEBUG_INSTANCE_COUNTING
00043   : public InstanceCounting<ApvAnalysis>
00044 #endif
00045 {
00046  public:
00047   typedef edm::DetSet<SiStripRawDigi> RawSignalType;
00048   typedef std::vector<float> PedestalType;
00049   
00050   ApvAnalysis(int nev);
00051   ~ApvAnalysis(){;}
00052 
00053   //
00054   // Tell ApvAnalysis which algorithms to use.
00055   //
00056 
00057   void setCommonModeCalculator (TkCommonModeCalculator& in ){theTkCommonModeCalculator = &in;} 
00058   void setPedestalCalculator (TkPedestalCalculator& in ){theTkPedestalCalculator = &in;} 
00059   void setNoiseCalculator(TkNoiseCalculator& in){theTkNoiseCalculator = &in;} 
00060   void setMask(TkApvMask& in){theTkApvMask=&in;}
00061   
00062   TkCommonModeCalculator& commonModeCalculator() {return *theTkCommonModeCalculator;}
00063   TkPedestalCalculator& pedestalCalculator() {return *theTkPedestalCalculator;}
00064   TkNoiseCalculator& noiseCalculator() {return *theTkNoiseCalculator;}
00065   TkApvMask& mask() {return *theTkApvMask;}
00066   
00067   //
00068   // Give store/load commands to the TkPedestalCalculator and to 
00069   // TkNoiseCalculator, will use ApvEventReader.
00070   // Has to be done here because they have no access to the reader.
00071   //
00073   void updateCalibration(edm::DetSet<SiStripRawDigi>& in) ;
00074   void newEvent() const;
00075 
00076   
00077  private:
00078   TkCommonModeCalculator* theTkCommonModeCalculator;
00079   TkPedestalCalculator* theTkPedestalCalculator;
00080   TkNoiseCalculator* theTkNoiseCalculator;
00081   TkApvMask* theTkApvMask;
00082   int nEventsForNoiseCalibration_;
00083   int eventsRequiredToUpdate_;
00084 };
00085 #endif
00086