7 dataLength_(conf.getParameter<uint32_t>(
"DataLength")),
8 nCellsInModule_(conf.getParameter<uint32_t>(
"MaxCellsInModule")),
9 linLSB_(conf.getParameter<double>(
"linLSB")),
10 adcsaturation_(conf.getParameter<double>(
"adcsaturation")),
11 adcnBits_(conf.getParameter<uint32_t>(
"adcnBits")),
12 tdcsaturation_(conf.getParameter<double>(
"tdcsaturation")),
13 tdcnBits_(conf.getParameter<uint32_t>(
"tdcnBits")),
14 tdcOnsetfC_(conf.getParameter<double>(
"tdcOnsetfC")),
15 triggerCellTruncationBits_(conf.getParameter<uint32_t>(
"triggerCellTruncationBits")),
16 TCThreshold_fC_(conf.getParameter<double>(
"TCThreshold_fC"))
35 std::unordered_map<uint32_t, uint32_t> data_map;
37 for(
const auto& triggercell : data.
payload)
39 data_map.emplace(triggercell.detId(), triggercell.hwPt());
40 if (triggercell.hwPt()>0) size++;
44 if(data.
payload.size()==0)
return result;
52 for(
const auto& triggercell_id : trigger_cells_in_module)
55 const auto& data_itr = data_map.find(triggercell_id);
57 if(data_itr==data_map.end())
67 <<
"Number of trigger cells in module too large for available data payload\n";
69 uint32_t
value = data_itr->second;
99 for(
const auto& triggercell : trigger_cells_in_module)
104 <<
"Number of trigger cells in module too large for available data payload\n";
112 if(data[ibit]) value |= (0x1<<
i);
120 value, 0, 0, 0, triggercell);
124 result.
payload.back().setP4(p4);
125 result.
payload.back().setPosition(point);
137 std::vector<std::pair<HGCalDetId, uint32_t > >& linearized_dataframes)
139 double amplitude; uint32_t amplitude_int;
142 for(
const auto& frame : dataframes) {
143 if (frame[2].
mode()) {
150 amplitude_int = uint32_t (floor(amplitude/
linLSB_+0.5));
151 if (amplitude_int>65535) amplitude_int = 65535;
153 linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int));
162 if(linearized_dataframes.size()==0)
return;
163 std::map<HGCalDetId, uint32_t>
payload;
165 for(
const auto& frame : linearized_dataframes)
171 payload.insert( std::make_pair(triggercellid, 0) );
172 uint32_t
value = frame.second;
173 payload[triggercellid] +=
value;
179 for(
const auto& id_value : payload)
184 id_value.second, 0, 0, 0, id_value.first.rawId());
192 for (
size_t i = 0;
i<data.
payload.size();
i++){
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
Geom::Phi< T > phi() const
uint32_t triggerCellSaturationBits_
void linearize(const std::vector< HGCDataFrame< HGCalDetId, HGCSample >> &, std::vector< std::pair< HGCalDetId, uint32_t > > &)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
payload
payload postfix for testing
data_type decode(const std::vector< bool > &, const uint32_t, const HGCalTriggerGeometryBase &) const
std::vector< bool > encode(const data_type &, const HGCalTriggerGeometryBase &) const
trigger_cell_list payload
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
void thresholdSelect(data_type &)
std::set< unsigned > geom_ordered_set
char data[epos_bytes_allocation]
HGCalTriggerCellThresholdCodecImpl(const edm::ParameterSet &conf)
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< HGCalDetId, uint32_t > > &, data_type &)
virtual unsigned getTriggerCellFromCell(const unsigned cell_det_id) const =0
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Power< A, B >::type pow(const A &a, const B &b)
*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
uint32_t triggerCellTruncationBits_