CMS 3D CMS Logo

FTLDataFrameT.h
Go to the documentation of this file.
1 #ifndef DIGIFTL_FTLDATAFRAMET_H
2 #define DIGIFTL_FTLDATAFRAMET_H
3 
4 #include <vector>
5 #include <ostream>
6 #include <iostream>
7 
13 template <class D, class S, class DECODE>
15 public:
19  typedef D key_type;
20 
25  FTLDataFrameT(const D& id) : id_(id), maxSampleSize_(15) { data_.resize(maxSampleSize_); }
27 
31  const D& id() const { return id_; }
32 
36  const int row() const { return DECODE::row(id_, data_); }
37 
41  const int column() const { return DECODE::col(id_, data_); }
42 
46  int size() const { return data_.size() & 0xf; }
47 
51  void resize(size_t s) { data_.resize(s); }
52 
56  const S& operator[](int i) const { return data_[i]; }
57  const S& sample(int i) const { return data_[i]; }
58  void setSample(int i, const S& sample) {
59  if (i < (int)data_.size())
60  data_[i] = sample;
61  }
62  void print(std::ostream& out = std::cout) {
63  for (size_t i = 0; i < data_.size(); i++) {
64  out << "[" << i << "] ";
65  data_[i].print(out);
66  }
67  }
68 
69 private:
70  //collection of samples
71  std::vector<S> data_;
72 
73  // det id for this data frame
74  D id_;
75 
76  //number of samples and maximum available
78 };
79 
80 #endif
FTLDataFrameT::print
void print(std::ostream &out=std::cout)
Definition: FTLDataFrameT.h:62
FTLDataFrameT::id
const D & id() const
det id
Definition: FTLDataFrameT.h:31
FTLDataFrameT::FTLDataFrameT
FTLDataFrameT(const FTLDataFrameT &o)
Definition: FTLDataFrameT.h:26
mps_fire.i
i
Definition: mps_fire.py:428
FTLDataFrameT::key_type
D key_type
key to sort the collection
Definition: FTLDataFrameT.h:19
FTLDataFrameT::id_
D id_
Definition: FTLDataFrameT.h:74
cuy.col
col
Definition: cuy.py:1010
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FTLDataFrameT::column
const int column() const
column
Definition: FTLDataFrameT.h:41
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FTLDataFrameT::setSample
void setSample(int i, const S &sample)
Definition: FTLDataFrameT.h:58
FTLDataFrameT::FTLDataFrameT
FTLDataFrameT(const D &id)
Definition: FTLDataFrameT.h:25
FTLDataFrameT::sample
const S & sample(int i) const
Definition: FTLDataFrameT.h:57
FTLDataFrameT::FTLDataFrameT
FTLDataFrameT()
CTOR.
Definition: FTLDataFrameT.h:24
FTLDataFrameT::maxSampleSize_
size_t maxSampleSize_
Definition: FTLDataFrameT.h:77
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
FTLDataFrameT
Readout digi for HGC.
Definition: FTLDataFrameT.h:14
FTLDataFrameT::resize
void resize(size_t s)
allow to set size
Definition: FTLDataFrameT.h:51
FTLDataFrameT::data_
std::vector< S > data_
Definition: FTLDataFrameT.h:71
S
Definition: CSCDBL1TPParametersExtended.h:16
FTLDataFrameT::row
const int row() const
row
Definition: FTLDataFrameT.h:36
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
FTLDataFrameT::size
int size() const
total number of samples in the digi
Definition: FTLDataFrameT.h:46
FTLDataFrameT::operator[]
const S & operator[](int i) const
assess/set specific samples
Definition: FTLDataFrameT.h:56