17 #include <Eigen/Dense> 34 : reco_(conf.getParameter<
int>(
"recoMethod")),
35 saturationFlagSetter_(nullptr),
37 correctionMethodEM_(conf.getParameter<
int>(
"correctionMethodEM")),
38 correctionMethodHAD_(conf.getParameter<
int>(
"correctionMethodHAD")),
39 correctionMethodRPD_(conf.getParameter<
int>(
"correctionMethodRPD")),
40 ootpuRatioEM_(conf.getParameter<double>(
"ootpuRatioEM")),
41 ootpuRatioHAD_(conf.getParameter<double>(
"ootpuRatioHAD")),
42 ootpuRatioRPD_(conf.getParameter<double>(
"ootpuRatioRPD")),
43 ootpuFracEM_(conf.getParameter<double>(
"ootpuFracEM")),
44 ootpuFracHAD_(conf.getParameter<double>(
"ootpuFracHAD")),
45 ootpuFracRPD_(conf.getParameter<double>(
"ootpuFracRPD")),
46 chargeRatiosEM_(conf.getParameter<
std::
vector<double>>(
"chargeRatiosEM")),
47 chargeRatiosHAD_(conf.getParameter<
std::
vector<double>>(
"chargeRatiosHAD")),
48 chargeRatiosRPD_(conf.getParameter<
std::
vector<double>>(
"chargeRatiosRPD")),
49 bxTs_(conf.getParameter<
std::
vector<unsigned
int>>(
"bxTs")),
50 nTs_(conf.getParameter<
int>(
"nTs")),
51 forceSOI_(conf.getParameter<
bool>(
"forceSOI")),
52 signalSOI_(conf.getParameter<
std::
vector<unsigned
int>>(
"signalSOI")),
53 noiseSOI_(conf.getParameter<
std::
vector<unsigned
int>>(
"noiseSOI")),
54 setSaturationFlags_(conf.getParameter<
bool>(
"setSaturationFlags")),
55 dropZSmarkedPassed_(conf.getParameter<
bool>(
"dropZSmarkedPassed")),
56 skipRPD_(conf.getParameter<
bool>(
"skipRPD")) {
65 if (!strcasecmp(subd.c_str(),
"ZDC")) {
68 produces<ZDCRecHitCollection>();
69 }
else if (!strcasecmp(subd.c_str(),
"CALIB")) {
72 produces<HcalCalibRecHitCollection>();
74 std::cout <<
"ZdcHitReconstructor_Run3 is not associated with a specific subdetector!" << std::endl;
86 htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
87 paramsToken_ = esConsumes<HcalLongRecoParams, HcalLongRecoParamsRcd, edm::Transition::BeginRun>();
90 sevToken_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
111 std::vector<unsigned int> mySignalTS;
112 std::vector<unsigned int> myNoiseTS;
119 auto rec = std::make_unique<ZDCRecHitCollection>();
120 rec->reserve(digi->
size());
126 bool isRPD = cell.
section() == 4;
158 myNoiseTS = myParams->
noiseTS();
164 (rec->back()).setFlags(0);
179 desc.add<
bool>(
"dropZSmarkedPassed",
true);
180 desc.add<
bool>(
"skipRPD",
true);
181 desc.add<
int>(
"recoMethod", 1);
182 desc.add<
int>(
"correctionMethodEM", 1);
183 desc.add<
int>(
"correctionMethodHAD", 1);
184 desc.add<
int>(
"correctionMethodRPD", 0);
185 desc.add<
double>(
"ootpuRatioEM", 3.0);
186 desc.add<
double>(
"ootpuRatioHAD", 3.0);
187 desc.add<
double>(
"ootpuRatioRPD", -1.0);
188 desc.add<
double>(
"ootpuFracEM", 1.0);
189 desc.add<
double>(
"ootpuFracHAD", 1.0);
190 desc.add<
double>(
"ootpuFracRPD", 0.0);
191 desc.add<std::vector<double>>(
"chargeRatiosEM",
198 desc.add<std::vector<double>>(
"chargeRatiosHAD",
205 desc.add<std::vector<double>>(
"chargeRatiosRPD",
212 desc.add<std::vector<unsigned int>>(
"bxTs",
218 desc.add<
int>(
"nTs", 6);
219 desc.add<
bool>(
"forceSOI",
false);
220 desc.add<std::vector<unsigned int>>(
"signalSOI",
224 desc.add<std::vector<unsigned int>>(
"noiseSOI",
228 desc.add<
bool>(
"setSaturationFlags",
true);
231 psd0.
add<
int>(
"maxADCvalue", 255);
234 descriptions.
add(
"zdcrecoRun3",
desc);
edm::ESGetToken< HcalLongRecoParams, HcalLongRecoParamsRcd > paramsToken_
T getParameter(std::string const &) const
std::vector< unsigned int > noiseSOI_
constexpr edm::DataFrame::id_type id() const
~ZdcHitReconstructor_Run3() override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
ZDCRecHit reconstruct(const QIE10DataFrame &digi, const std::vector< unsigned int > &myNoiseTS, const std::vector< unsigned int > &mySignalTS, const HcalCoder &coder, const HcalCalibrations &calibs, const HcalPedestal &effPeds) const
constexpr bool zsMarkAndPass() const
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
std::vector< double > chargeRatiosEM_
edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
std::vector< unsigned int > signalSOI_
void produce(edm::Event &e, const edm::EventSetup &c) final
constexpr void setFlagField(uint32_t value, int base, int width=1)
ZdcSimpleRecAlgo_Run3 reco_
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< unsigned int > bxTs_
std::unique_ptr< HcalLongRecoParams > longRecoParams_
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
void initRatioSubtraction(const float ratio, const float frac, const int ZdcSection)
void endRun(edm::Run const &r, edm::EventSetup const &es) final
#define DEFINE_FWK_MODULE(type)
std::vector< double > chargeRatiosHAD_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
uint32_t getValue() const
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
const_iterator end() const
std::vector< double > chargeRatiosRPD_
HcalOtherSubdetector subdetOther_
void setZDCSaturation(ZDCRecHit &rh, QIE10DataFrame &digi, int maxValue)
const_iterator begin() const
The iterator returned can not safely be used across threads.
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_
constexpr uint32_t rawId() const
get the raw id
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< unsigned int > signalTS() const
constexpr Section section() const
get the section
ZdcHitReconstructor_Run3(const edm::ParameterSet &ps)
void initTemplateFit(const std::vector< unsigned int > &bxTs, const std::vector< double > &chargeRatios, const int nTs, const int ZdcSection)
static constexpr int32_t SubdetectorId
constexpr int32_t channel() const
get the channel
HcalADCSaturationFlag * saturationFlagSetter_
std::vector< unsigned int > noiseTS() const
void initCorrectionMethod(const int method, const int ZdcSection)
constexpr int samples() const
total number of samples in the digi
edm::EDGetTokenT< QIE10DigiCollection > tok_input_QIE10
uint16_t *__restrict__ uint16_t const *__restrict__ adc
bool dropChannel(const uint32_t &mystatus) const