CMS 3D CMS Logo

EcalDigiCollections.h
Go to the documentation of this file.
1 #ifndef DIGIECAL_ECALDIGICOLLECTION_H
2 #define DIGIECAL_ECALDIGICOLLECTION_H
3 
17 
21 
23 public:
25  static const size_type MAXSAMPLES = 10;
26  explicit EcalDigiCollection(size_type istride=MAXSAMPLES, int isubdet=0) :
27  edm::DataFrameContainer(istride, isubdet){}
29 
30 };
31 
32 // make edm (and ecal client) happy
34 public:
36  typedef EBDataFrame Digi;
38 
39  EBDigiCollection(size_type istride=MAXSAMPLES) :
40  EcalDigiCollection(istride, EcalBarrel){}
42  void push_back(const Digi& digi){ DataFrameContainer::push_back(digi.id(), digi.frame().begin()); }
43  void push_back(id_type iid){DataFrameContainer::push_back(iid);}
44  void push_back(id_type iid,data_type const* idata){DataFrameContainer::push_back(iid,idata);}
45 
46 };
47 
49 public:
51  typedef EEDataFrame Digi;
53 
54  EEDigiCollection(size_type istride=MAXSAMPLES) :
55  EcalDigiCollection(istride, EcalEndcap){}
57  void push_back(const Digi& digi){ edm::DataFrameContainer::push_back(digi.id(), digi.frame().begin()); }
58  void push_back(id_type iid){DataFrameContainer::push_back(iid);}
59  void push_back(id_type iid,data_type const* idata){DataFrameContainer::push_back(iid,idata);}
60 
61 };
62 
64 {
65  public:
67  typedef ESDataFrame Digi;
69 
70  static const size_type NSAMPLE = ESDataFrame::MAXSAMPLES ;
71  ESDigiCollection(size_type istride=NSAMPLE) :
74 
75  void push_back( unsigned int i )
76  {
77  DataFrameContainer::push_back( i ) ;
78  }
79 
80  void push_back( const Digi& digi )
81  {
82  uint16_t esdata[NSAMPLE] ;
83  for( unsigned int i ( 0 ) ; i != NSAMPLE; ++i )
84  {
85  static const int offset ( 65536 ) ; // for int16 to uint16
86  const int16_t dshort ( digi[i].raw() ) ;
87  const int dint ( (int) dshort + // add offset for uint16 conversion
88  ( (int16_t) 0 > dshort ?
89  offset : (int) 0 ) ) ;
90  esdata[i] = dint ;
91  }
92  EcalDigiCollection::push_back( digi.id()(), esdata ) ;
93  }
94 };
95 
96 
97 // Free swap functions
98 inline
100  lhs.swap(rhs);
101 }
102 
103 inline
105  lhs.swap(rhs);
106 }
107 
108 inline
110  lhs.swap(rhs);
111 }
112 
113 inline
115  lhs.swap(rhs);
116 }
117 
121 
127 
128 #endif
void push_back(const Digi &digi)
edm::DataFrameContainer::size_type size_type
void swap(EBDigiCollection &other)
key_type id() const
Definition: EBDataFrame.h:31
edm::SortedCollection< EcalMatacqDigi > EcalMatacqDigiCollection
void push_back(id_type iid)
const ESDetId & id() const
Definition: ESDataFrame.h:21
edm::SortedCollection< EcalEBTriggerPrimitiveDigi > EcalEBTrigPrimDigiCollection
EcalDigiCollection(size_type istride=MAXSAMPLES, int isubdet=0)
edm::DataFrameContainer::size_type size_type
edm::SortedCollection< EBSrFlag > EBSrFlagCollection
void push_back(id_type iid, data_type const *idata)
ESDigiCollection(size_type istride=NSAMPLE)
edm::SortedCollection< EESrFlag > EESrFlagCollection
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
edm::SortedCollection< EcalPnDiodeDigi > EcalPnDiodeDigiCollection
Digi::key_type DetId
key_type id() const
Definition: EEDataFrame.h:28
edm::SortedCollection< EcalTimeDigi > EcalTimeDigiCollection
void push_back(id_type iid)
edm::DataFrameContainer::size_type size_type
void push_back(id_type iid, data_type const *idata)
static const size_type MAXSAMPLES
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
void swap(DataFrameContainer &other)
constexpr iterator begin()
Definition: DataFrame.h:48
edm::DataFrame const & frame() const
Definition: EcalDataFrame.h:50
void push_back(unsigned int i)
void push_back(id_type iid, data_type const *idata)
edm::SortedCollection< EcalPseudoStripInputDigi > EcalPSInputDigiCollection
void push_back(const Digi &digi)
HLT enums.
void push_back(const Digi &digi)
void swap(ESDigiCollection &other)
void swap(EEDigiCollection &other)
Digi::key_type DetId
EBDigiCollection(size_type istride=MAXSAMPLES)
edm::DataFrameContainer::size_type size_type
EEDigiCollection(size_type istride=MAXSAMPLES)
void swap(EcalDigiCollection &lhs, EcalDigiCollection &rhs)
Digi::key_type DetId