CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloSamples.h
Go to the documentation of this file.
1 #ifndef CALOSAMPLES_H
2 #define CALOSAMPLES_H 1
3 
4 #include <ostream>
6 
15 class CaloSamples {
16 public:
17  CaloSamples();
18  explicit CaloSamples(const DetId& id, int size);
19 
21  DetId id() const { return id_; }
22 
24  int size() const { return size_; }
26  double& operator[](int i) { return data_[i]; }
28  double operator[](int i) const { return data_[i]; }
29 
31  int presamples() const { return presamples_; }
33  void setPresamples(int pre);
34 
36  CaloSamples& scale(double value);
38  CaloSamples& operator*=(double value) { return scale(value); }
39 
41  CaloSamples& operator+=(double value);
42 
44  // between values
45  CaloSamples& offsetTime(double offset);
46 
47  void setDetId( DetId detId ) { id_ = detId ; }
48 
49  void setSize( unsigned int size ) { size_ = size ; }
50 
51  bool isBlank() const ; // are the samples blank (zero?)
52 
53  void setBlank() ; // keep id, presamples, size but zero out data
54 
55  static const int MAXSAMPLES=10;
56 private:
58  double data_[MAXSAMPLES]; //
60 };
61 
62 std::ostream& operator<<(std::ostream& s, const CaloSamples& samps);
63 
64 #endif
int i
Definition: DBlmapReader.cc:9
CaloSamples & scale(double value)
multiply each item by this value
Definition: CaloSamples.cc:21
static const int MAXSAMPLES
Definition: CaloSamples.h:55
void setSize(unsigned int size)
Definition: CaloSamples.h:49
double & operator[](int i)
mutable operator to access samples
Definition: CaloSamples.h:26
int presamples() const
access presample information
Definition: CaloSamples.h:31
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
bool isBlank() const
Definition: CaloSamples.cc:56
void setDetId(DetId detId)
Definition: CaloSamples.h:47
void setBlank()
Definition: CaloSamples.cc:66
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:15
unsigned int offset(bool)
double operator[](int i) const
const operator to access samples
Definition: CaloSamples.h:28
Definition: DetId.h:20
int size() const
get the size
Definition: CaloSamples.h:24
CaloSamples & offsetTime(double offset)
shift all the samples by a time, in ns, interpolating
Definition: CaloSamples.cc:35
int presamples_
Definition: CaloSamples.h:59
CaloSamples & operator+=(double value)
add a value to all samples
Definition: CaloSamples.cc:28
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
CaloSamples & operator*=(double value)
scale all samples
Definition: CaloSamples.h:38