CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OldThreeThresholdAlgorithm.h
Go to the documentation of this file.
1 #ifndef RECOLOCALTRACKER_SISTRIPCLUSTERIZER_THREETHRESHOLDSTRIPCLUSTERIZER_H
2 #define RECOLOCALTRACKER_SISTRIPCLUSTERIZER_THREETHRESHOLDSTRIPCLUSTERIZER_H
3 
4 //Data Formats
10 
19 
20 #include <vector>
21 #include <algorithm>
22 #include <cmath>
23 #include <string>
24 
27 
29 
31 
32  public:
33 
34  // void setSiStripNoiseService( SiStripNoiseService* in ){ SiStripNoiseService_=in;}
37 
38  void initialize(const edm::EventSetup&);
39 
40  bool stripByStripBegin(uint32_t id) {return false;}
41  void stripByStripAdd(uint16_t strip, uint16_t adc, std::vector<SiStripCluster>& out) {}
42  void stripByStripEnd(std::vector<SiStripCluster>& out) {}
43 
47 
48  private:
49 
50  OldThreeThresholdAlgorithm(float strip_thr, float seed_thr,float clust_thr, int max_holes,std::string qualityLabel) :
51  theChannelThreshold(strip_thr),
52  theSeedThreshold(seed_thr),
53  theClusterThreshold(clust_thr),
54  max_holes_(max_holes),
55  qualityLabel_(qualityLabel){};
56 
57  // SiStripNoiseService* SiStripNoiseService_;
58  template<typename InputDetSet>
60 
65  std::string qualityLabel_;
66 
70 
71  std::vector<SiStripDigi> cluster_digis_; // so it's not recreated for each det for each event!
72 };
73 
74 class AboveSeed {
75  public:
76 
77 
78  // AboveSeed(float aseed,SiStripNoiseService* noise,const uint32_t& detID) : seed(aseed), noise_(noise),detID_(detID) {};
79 
80  AboveSeed(float aseed, const edm::ESHandle<SiStripNoises> & noiseHandle, const SiStripNoises::Range & noiseRange, const edm::ESHandle<SiStripQuality> & qualityHandle, const SiStripQuality::Range & qualityRange)
81  : seed(aseed), noise_(noiseHandle), noiseRange_(noiseRange),quality_(qualityHandle), qualityRange_(qualityRange)
82  {};
83  //,detID_(detID) {};
84 
85  inline bool operator()(const SiStripDigi& digi) {
86  return (
87  !quality_->IsStripBad(qualityRange_,digi.strip())
88  &&
89  digi.adc() >= seed * noise_->getNoise(digi.strip(), noiseRange_)
90  );
91  }
92  private:
93  float seed;
98 };
99 
100 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
void stripByStripEnd(std::vector< SiStripCluster > &out)
void initialize(const edm::EventSetup &)
void clusterizeDetUnit_(const InputDetSet &digis, edmNew::DetSetVector< SiStripCluster >::FastFiller &output)
void stripByStripAdd(uint16_t strip, uint16_t adc, std::vector< SiStripCluster > &out)
edm::ESHandle< SiStripGain > gainHandle_
std::vector< SiStripDigi > cluster_digis_
edm::ESHandle< SiStripNoises > noiseHandle_
const SiStripQuality::Range & qualityRange_
bool operator()(const SiStripDigi &digi)
const uint16_t & strip() const
Definition: SiStripDigi.h:40
const edm::ESHandle< SiStripNoises > & noise_
AboveSeed(float aseed, const edm::ESHandle< SiStripNoises > &noiseHandle, const SiStripNoises::Range &noiseRange, const edm::ESHandle< SiStripQuality > &qualityHandle, const SiStripQuality::Range &qualityRange)
OldThreeThresholdAlgorithm(float strip_thr, float seed_thr, float clust_thr, int max_holes, std::string qualityLabel)
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
tuple out
Definition: dbtoconf.py:99
edm::ESHandle< SiStripQuality > qualityHandle_
const edm::ESHandle< SiStripQuality > & quality_
void clusterizeDetUnit(const edm::DetSet< SiStripDigi > &digis, edmNew::DetSetVector< SiStripCluster >::FastFiller &output)
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:41
const uint16_t & adc() const
Definition: SiStripDigi.h:41
const SiStripNoises::Range & noiseRange_