CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripAPVRestorer.h
Go to the documentation of this file.
1 #ifndef RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPAPVRESTORER_H
2 #define RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPAPVRESTORER_H
3 
17 
18 #include <vector>
19 #include <stdint.h>
20 
21 typedef std::map< uint16_t, int16_t> DigiMap;
22 typedef std::map< uint16_t, std::vector < int16_t> > RawDigiMap;
23 typedef std::map< uint16_t, int16_t>::iterator DigiMapIter;
24 typedef std::map<uint32_t, std::vector<float> > CMMap; //detId, Vector of MeanCM per detId
25 
26 
28 
30 
31  public:
32 
33  virtual ~SiStripAPVRestorer() {};
34 
35  void init(const edm::EventSetup& es);
36  int16_t inspect(const uint32_t&, std::vector<int16_t>&, const std::vector< std::pair<short,float> >&);
37  void restore(std::vector<int16_t>&);
41  std::vector< DigiMap >& GetSmoothedPoints(){return SmoothedMaps_;}
42 
43  protected:
44 
46 
47  private:
48 
49  //template<typename T>float median( std::vector<T>& );
50  //template<typename T>void IterativeMedian(std::vector<T>&, uint16_t);
51 
52  template<typename T >int16_t NullInspect(std::vector<T>&);
53  template<typename T >int16_t AbnormalBaselineInspect(std::vector<T>&);
54  template<typename T >int16_t BaselineFollowerInspect(std::vector<T>&);
55  template<typename T >int16_t BaselineAndSaturationInspect(std::vector<T>&);
56  template<typename T >void FlatRestore( std::vector<T>& , uint16_t);
57  template<typename T >void BaselineFollowerRestore( std::vector<T>&, uint16_t, float );
58 
59  void BaselineFollower(DigiMap&, std::vector<int16_t>&, float);
60  bool FlatRegionsFinder(std::vector<int16_t>&, DigiMap&, float , uint16_t);
61 
63 
64  float pairMedian( std::vector<std::pair<float,float> >&);
65 
67  uint32_t quality_cache_id;
68 
70  uint32_t noise_cache_id;
71 
72  std::vector<std::string> apvFlags_;
73  std::vector<float> median_;
74  std::vector< DigiMap > SmoothedMaps_;
76 
77 
78  uint32_t detId_;
79 
82 
83 
86  std::string InspectAlgo_;
87  std::string RestoreAlgo_;
89 
90  //--------------------------------------------------
91  // Configurable Parameters of Algorithm
92  //--------------------------------------------------
93 
94  double fraction_; // fraction of strips deviating from nominal baseline
95  uint32_t deviation_; // ADC value of deviation from nominal baseline
96  double restoreThreshold_; // for Null inspect (fraction of adc=0 channels)
97  uint32_t DeltaCMThreshold_; // for BaselineFollower inspect
98 
99  uint32_t nSigmaNoiseDerTh_; // threshold for rejecting hits strips
100  uint32_t consecThreshold_; // minimum length of flat region
101  uint32_t hitStripThreshold_; // height above median when strip is definitely a hit
102  uint32_t nSmooth_; // for smoothing and local minimum determination (odd number)
103  uint32_t minStripsToFit_; // minimum strips to try spline algo (otherwise default to median)
104  uint32_t distortionThreshold_; // (max-min) of flat regions to trigger baseline follower
105  double CutToAvoidSignal_; // for iterative median implementation internal to APV restorer
106  uint32_t nSaturatedStrip_; // for BaselineAndSaturation inspect
107 
108 };
109 
110 #endif
void BaselineFollowerRestore(std::vector< T > &, uint16_t, float)
std::vector< DigiMap > & GetSmoothedPoints()
int16_t AbnormalBaselineInspect(std::vector< T > &)
void CreateCMMap(const edm::DetSetVector< SiStripProcessedRawDigi > &)
void init(const edm::EventSetup &es)
void restore(std::vector< int16_t > &)
std::vector< DigiMap > SmoothedMaps_
int16_t NullInspect(std::vector< T > &)
std::map< uint16_t, int16_t > DigiMap
void fixAPVsCM(edm::DetSet< SiStripProcessedRawDigi > &)
RawDigiMap & GetBaselineMap()
float pairMedian(std::vector< std::pair< float, float > > &)
std::vector< std::string > apvFlags_
edm::InputTag inputTag_
edm::ESHandle< SiStripQuality > qualityHandle
std::map< uint16_t, std::vector< int16_t > > RawDigiMap
int16_t BaselineFollowerInspect(std::vector< T > &)
tuple conf
Definition: dbtoconf.py:185
int16_t BaselineAndSaturationInspect(std::vector< T > &)
void LoadMeanCMMap(edm::Event &)
edm::ESHandle< SiStripNoises > noiseHandle
bool FlatRegionsFinder(std::vector< int16_t > &, DigiMap &, float, uint16_t)
std::map< uint32_t, std::vector< float > > CMMap
std::map< uint16_t, int16_t >::iterator DigiMapIter
void BaselineFollower(DigiMap &, std::vector< int16_t > &, float)
int16_t inspect(const uint32_t &, std::vector< int16_t > &, const std::vector< std::pair< short, float > > &)
std::vector< float > median_
SiStripAPVRestorer(const edm::ParameterSet &conf)
void FlatRestore(std::vector< T > &, uint16_t)