7 nData_(conf.getParameter<uint32_t>(
"NData")),
8 dataLength_(conf.getParameter<uint32_t>(
"DataLength")),
9 nCellsInModule_(conf.getParameter<uint32_t>(
"MaxCellsInModule")),
10 linLSB_(conf.getParameter<double>(
"linLSB")),
11 linnBits_(conf.getParameter<uint32_t>(
"linnBits")),
12 adcsaturation_(conf.getParameter<double>(
"adcsaturation")),
13 adcnBits_(conf.getParameter<uint32_t>(
"adcnBits")),
14 tdcsaturation_(conf.getParameter<double>(
"tdcsaturation")),
15 tdcnBits_(conf.getParameter<uint32_t>(
"tdcnBits")),
16 tdcOnsetfC_(conf.getParameter<double>(
"tdcOnsetfC")),
17 triggerCellTruncationBits_(conf.getParameter<uint32_t>(
"triggerCellTruncationBits")),
18 thickness_corrections_(conf.getParameter<
std::vector<double>>(
"ThicknessCorrections"))
39 if(data.
payload.empty())
return result;
45 std::unordered_map<uint32_t, uint32_t> data_map;
46 for(
const auto& triggercell : data.
payload)
48 data_map.emplace(triggercell.detId(), triggercell.hwPt());
53 for(
const auto& triggercell_id : trigger_cells_in_module)
56 const auto& data_itr = data_map.find(triggercell_id);
58 if(data_itr==data_map.end())
68 <<
"Number of trigger cells in module too large for available data payload\n";
70 uint32_t
value = data_itr->second;
76 <<
"encode: Number of non-zero trigger cells larger than codec parameter\n"\
77 <<
" : Number of energy values = "<<nData_<<
"\n";
105 <<
"decode: data length ("<<data.size()<<
") inconsistent with codec parameters:\n"\
107 <<
" : Number of energy values = "<<
nData_<<
"\n"\
111 size_t iselected = 0;
113 for(
const auto& triggercell : trigger_cells_in_module)
118 <<
"Number of trigger cells in module too large for available data payload\n";
126 if(data[ibit]) value |= (0x1<<
i);
134 value, 0, 0, 0, triggercell);
138 result.
payload.back().setP4(p4);
139 result.
payload.back().setPosition(point);
151 std::vector<std::pair<DetId, uint32_t > >& linearized_dataframes)
154 uint32_t amplitude_int = 0;
155 const int kIntimeSample = 2;
157 for(
const auto& frame : dataframes) {
159 if (frame[kIntimeSample].
mode()) {
163 amplitude = double(frame[kIntimeSample].
data()) *
adcLSB_;
166 amplitude_int = uint32_t (floor(amplitude/
linLSB_+0.5));
170 amplitude_int = frame[kIntimeSample].data();
174 linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int));
183 if(linearized_dataframes.empty())
return;
184 std::map<HGCalDetId, uint32_t>
payload;
186 for(
const auto& frame : linearized_dataframes)
188 DetId cellid(frame.first);
192 payload.insert( std::make_pair(triggercellid, 0) );
193 uint32_t
value = frame.second;
210 value = (double)value*thickness_correction;
212 payload[triggercellid] +=
value;
218 for(
const auto& id_value : payload)
223 id_value.second, 0, 0, 0, id_value.first.rawId());
236 return a.
hwPt() >
b.hwPt();
trigger_cell_list payload
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
void linearize(const std::vector< HGCDataFrame< DetId, HGCSample >> &, std::vector< std::pair< DetId, uint32_t > > &)
const HGCalTopology & eeTopology() const
Geom::Phi< T > phi() const
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, data_type &)
uint32_t triggerCellSaturationBits_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
data_type decode(const std::vector< bool > &, const uint32_t, const HGCalTriggerGeometryBase &) const
int waferTypeL(int wafer) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< double > thickness_corrections_
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
const HGCalDDDConstants & dddConstants() const
HGCalTriggerCellBestChoiceCodecImpl(const edm::ParameterSet &conf)
std::set< unsigned > geom_ordered_set
char data[epos_bytes_allocation]
uint32_t triggerCellTruncationBits_
Detector det() const
get the detector field from this detid
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< bool > encode(const data_type &, const HGCalTriggerGeometryBase &) const
Power< A, B >::type pow(const A &a, const B &b)
const HGCalTopology & fhTopology() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
void bestChoiceSelect(data_type &)