CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripCluster.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_SISTRIPCLUSTER_H
2 #define DATAFORMATS_SISTRIPCLUSTER_H
3 
5 #include <vector>
7 
9 public:
10 
11  typedef std::vector<SiStripDigi>::const_iterator SiStripDigiIter;
12  typedef std::pair<SiStripDigiIter,SiStripDigiIter> SiStripDigiRange;
13 
18  SiStripCluster() : error_x( -99999.9 ) {}
19 
20  explicit SiStripCluster(const SiStripDigiRange& range);
21 
22  template<typename Iter>
23  SiStripCluster(const uint16_t& firstStrip,
24  Iter begin, Iter end ):
25  amplitudes_(begin,end), firstStrip_(firstStrip),
26  // ggiurgiu@fnal.gov, 01/05/12
27  // Initialize the split cluster errors to un-physical values.
28  // The CPE will check these errors and if they are not un-physical,
29  // it will recognize the clusters as split and assign these (increased)
30  // errors to the corresponding rechit.
31  error_x(-99999.9){}
32 
35  uint16_t firstStrip() const {return firstStrip_;}
36 
48  const std::vector<uint8_t>& amplitudes() const {return amplitudes_;}
49 
53  float barycenter() const;
54 
55  float getSplitClusterError () const { return error_x; }
56  void setSplitClusterError ( float errx ) { error_x = errx; }
57 
58 
59 private:
60 
61  std::vector<uint8_t> amplitudes_;
62 
63  uint16_t firstStrip_;
64 
65  // ggiurgiu@fnal.gov, 01/05/12
66  // Add cluster errors to be used by rechits from split clusters.
67  // A rechit from a split cluster has larger errors than rechits from normal clusters.
68  // However, when presented with a cluster, the CPE does not know if the cluster comes
69  // from a splitting procedure or not. That's why we have to instruct the CPE to use
70  // appropriate errors for split clusters.
71  // To avoid increase of data size on disk,these new data members are set as transient in:
72  // DataFormats/SiStripCluster/src/classes_def.xml
73  float error_x;
74 
75 };
76 
77 // Comparison operators
78 inline bool operator<( const SiStripCluster& one, const SiStripCluster& other) {
79  return one.firstStrip() < other.firstStrip();
80 }
81 
82 inline bool operator<(const SiStripCluster& cluster, const uint16_t& firstStrip) {
83  return cluster.firstStrip() < firstStrip;
84 }
85 
86 inline bool operator<(const uint16_t& firstStrip,const SiStripCluster& cluster) {
87  return firstStrip < cluster.firstStrip();
88 }
89 #endif // DATAFORMATS_SISTRIPCLUSTER_H
std::pair< SiStripDigiIter, SiStripDigiIter > SiStripDigiRange
uint16_t firstStrip() const
float getSplitClusterError() const
SiStripCluster(const uint16_t &firstStrip, Iter begin, Iter end)
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
float barycenter() const
#define end
Definition: vmac.h:37
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
void setSplitClusterError(float errx)
#define begin
Definition: vmac.h:30
std::vector< uint8_t > amplitudes_
uint16_t firstStrip_
const std::vector< uint8_t > & amplitudes() const