7 dataLength_(conf.getParameter<uint32_t>(
"DataLength")),
8 nCellsInModule_(conf.getParameter<uint32_t>(
"MaxCellsInModule")),
9 linLSB_(conf.getParameter<double>(
"linLSB")),
10 linnBits_(conf.getParameter<uint32_t>(
"linnBits")),
11 adcsaturation_(conf.getParameter<double>(
"adcsaturation")),
12 adcnBits_(conf.getParameter<uint32_t>(
"adcnBits")),
13 tdcsaturation_(conf.getParameter<double>(
"tdcsaturation")),
14 tdcnBits_(conf.getParameter<uint32_t>(
"tdcnBits")),
15 tdcOnsetfC_(conf.getParameter<double>(
"tdcOnsetfC")),
16 adcsaturationBH_(conf.getParameter<double>(
"adcsaturationBH")),
17 adcnBitsBH_(conf.getParameter<uint32_t>(
"adcnBitsBH")),
18 triggerCellTruncationBits_(conf.getParameter<uint32_t>(
"triggerCellTruncationBits")),
19 TCThreshold_fC_(conf.getParameter<double>(
"TCThreshold_fC")),
20 TCThresholdBH_MIP_(conf.getParameter<double>(
"TCThresholdBH_MIP")),
21 thickness_corrections_(conf.getParameter<
std::vector<double>>(
"ThicknessCorrections"))
43 std::unordered_map<uint32_t, uint32_t> data_map;
45 for(
const auto& triggercell : data.
payload)
47 data_map.emplace(triggercell.detId(), triggercell.hwPt());
48 if (triggercell.hwPt()>0) size++;
52 if(data.
payload.empty())
return result;
60 for(
const auto& triggercell_id : trigger_cells_in_module)
63 const auto& data_itr = data_map.find(triggercell_id);
65 if(data_itr==data_map.end())
75 <<
"Number of trigger cells in module too large for available data payload\n";
77 uint32_t
value = data_itr->second;
105 size_t iselected = 0;
107 for(
const auto& triggercell : trigger_cells_in_module)
112 <<
"Number of trigger cells in module too large for available data payload\n";
120 if(data[ibit]) value |= (0x1<<
i);
128 value, 0, 0, 0, triggercell);
132 result.
payload.back().setP4(p4);
133 result.
payload.back().setPosition(point);
144 linearize(
const std::vector<HGCalDataFrame>& dataframes,
145 std::vector<std::pair<DetId, uint32_t > >& linearized_dataframes)
148 uint32_t amplitude_int = 0;
149 const int kIntimeSample = 2;
151 for(
const auto& frame : dataframes) {
153 if (frame[kIntimeSample].
mode()) {
157 amplitude = double(frame[kIntimeSample].
data()) *
adcLSB_;
160 amplitude_int = uint32_t (floor(amplitude/
linLSB_+0.5));
164 amplitude_int = frame[kIntimeSample].data();
168 linearized_dataframes.push_back(std::make_pair (frame.id(), amplitude_int));
177 if(linearized_dataframes.empty())
return;
178 std::map<HGCalDetId, uint32_t>
payload;
180 for(
const auto& frame : linearized_dataframes)
182 DetId cellid(frame.first);
186 payload.insert( std::make_pair(triggercellid, 0) );
187 uint32_t
value = frame.second;
204 value = (double)value*thickness_correction;
206 payload[triggercellid] +=
value;
212 for(
const auto& id_value : payload)
217 id_value.second, 0, 0, 0, id_value.first.rawId());
225 for (
size_t i = 0;
i<data.
payload.size();
i++){
virtual geom_ordered_set getOrderedTriggerCellsFromModule(const unsigned trigger_cell_det_id) const =0
const HGCalTopology & eeTopology() const
Geom::Phi< T > phi() const
double TCThresholdBH_MIP_
uint32_t triggerCellSaturationBits_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
data_type decode(const std::vector< bool > &, const uint32_t, const HGCalTriggerGeometryBase &) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void triggerCellSums(const HGCalTriggerGeometryBase &, const std::vector< std::pair< DetId, uint32_t > > &, data_type &)
int waferTypeL(int wafer) 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
const HGCalDDDConstants & dddConstants() const
void thresholdSelect(data_type &)
std::set< unsigned > geom_ordered_set
char data[epos_bytes_allocation]
HGCalTriggerCellThresholdCodecImpl(const edm::ParameterSet &conf)
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)
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
uint32_t triggerCellTruncationBits_
void linearize(const std::vector< HGCalDataFrame > &, std::vector< std::pair< DetId, uint32_t > > &)
constexpr Detector det() const
get the detector field from this detid
std::vector< double > thickness_corrections_