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 // make edm (and ecal client) happy
33 public:
35  typedef EBDataFrame Digi;
37 
38  EBDigiCollection(size_type istride=MAXSAMPLES) :
39  EcalDigiCollection(istride, EcalBarrel){}
41 };
42 
44 public:
46  typedef EEDataFrame Digi;
48 
49  EEDigiCollection(size_type istride=MAXSAMPLES) :
50  EcalDigiCollection(istride, EcalEndcap){}
52 };
53 
55 {
56  public:
58  typedef ESDataFrame Digi;
60 
61  static const size_type NSAMPLE = ESDataFrame::MAXSAMPLES ;
62  ESDigiCollection(size_type istride=NSAMPLE) :
65 
66  void push_back( unsigned int i )
67  {
68  DataFrameContainer::push_back( i ) ;
69  }
70 
71  void push_back( const Digi& digi )
72  {
73  uint16_t esdata[NSAMPLE] ;
74  for( unsigned int i ( 0 ) ; i != NSAMPLE; ++i )
75  {
76  static const int offset ( 65536 ) ; // for int16 to uint16
77  const int16_t dshort ( digi[i].raw() ) ;
78  const int dint ( (int) dshort + // add offset for uint16 conversion
79  ( (int16_t) 0 > dshort ?
80  offset : (int) 0 ) ) ;
81  esdata[i] = dint ;
82  }
83  EcalDigiCollection::push_back( digi.id()(), esdata ) ;
84  }
85 };
86 
87 
88 // Free swap functions
89 inline
91  lhs.swap(rhs);
92 }
93 
94 inline
96  lhs.swap(rhs);
97 }
98 
99 inline
101  lhs.swap(rhs);
102 }
103 
104 inline
106  lhs.swap(rhs);
107 }
108 
112 
118 
119 #endif
int i
Definition: DBlmapReader.cc:9
edm::DataFrameContainer::size_type size_type
void swap(EBDigiCollection &other)
edm::SortedCollection< EcalMatacqDigi > EcalMatacqDigiCollection
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
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
edm::SortedCollection< EcalTimeDigi > EcalTimeDigiCollection
edm::DataFrameContainer::size_type size_type
static const size_type MAXSAMPLES
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
void swap(DataFrameContainer &other)
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 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