17 #include <Eigen/Dense> 36 : reco_(conf.getParameter<
int>(
"recoMethod")),
37 saturationFlagSetter_(nullptr),
39 correctionMethodEM_(conf.getParameter<
int>(
"correctionMethodEM")),
40 correctionMethodHAD_(conf.getParameter<
int>(
"correctionMethodHAD")),
41 correctionMethodRPD_(conf.getParameter<
int>(
"correctionMethodRPD")),
42 ootpuRatioEM_(conf.getParameter<double>(
"ootpuRatioEM")),
43 ootpuRatioHAD_(conf.getParameter<double>(
"ootpuRatioHAD")),
44 ootpuRatioRPD_(conf.getParameter<double>(
"ootpuRatioRPD")),
45 ootpuFracEM_(conf.getParameter<double>(
"ootpuFracEM")),
46 ootpuFracHAD_(conf.getParameter<double>(
"ootpuFracHAD")),
47 ootpuFracRPD_(conf.getParameter<double>(
"ootpuFracRPD")),
48 chargeRatiosEM_(conf.getParameter<
std::
vector<double>>(
"chargeRatiosEM")),
49 chargeRatiosHAD_(conf.getParameter<
std::
vector<double>>(
"chargeRatiosHAD")),
50 chargeRatiosRPD_(conf.getParameter<
std::
vector<double>>(
"chargeRatiosRPD")),
51 bxTs_(conf.getParameter<
std::
vector<unsigned
int>>(
"bxTs")),
52 nTs_(conf.getParameter<
int>(
"nTs")),
53 forceSOI_(conf.getParameter<
bool>(
"forceSOI")),
54 signalSOI_(conf.getParameter<
std::
vector<unsigned
int>>(
"signalSOI")),
55 noiseSOI_(conf.getParameter<
std::
vector<unsigned
int>>(
"noiseSOI")),
56 setSaturationFlags_(conf.getParameter<
bool>(
"setSaturationFlags")),
57 dropZSmarkedPassed_(conf.getParameter<
bool>(
"dropZSmarkedPassed")),
58 skipRPD_(conf.getParameter<
bool>(
"skipRPD")) {
67 if (!strcasecmp(subd.c_str(),
"ZDC")) {
70 produces<ZDCRecHitCollection>();
71 }
else if (!strcasecmp(subd.c_str(),
"CALIB")) {
74 produces<HcalCalibRecHitCollection>();
76 std::cout <<
"ZdcHitReconstructor_Run3 is not associated with a specific subdetector!" << std::endl;
88 htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
89 paramsToken_ = esConsumes<HcalLongRecoParams, HcalLongRecoParamsRcd, edm::Transition::BeginRun>();
92 sevToken_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
113 std::vector<unsigned int> mySignalTS;
114 std::vector<unsigned int> myNoiseTS;
121 auto rec = std::make_unique<ZDCRecHitCollection>();
122 rec->reserve(digi->
size());
128 bool isRPD = cell.
section() == 4;
160 myNoiseTS = myParams->
noiseTS();
166 (rec->back()).setFlags(0);
181 desc.add<
bool>(
"dropZSmarkedPassed",
true);
182 desc.add<
bool>(
"skipRPD",
true);
183 desc.add<
int>(
"recoMethod", 1);
184 desc.add<
int>(
"correctionMethodEM", 1);
185 desc.add<
int>(
"correctionMethodHAD", 1);
186 desc.add<
int>(
"correctionMethodRPD", 0);
187 desc.add<
double>(
"ootpuRatioEM", 3.0);
188 desc.add<
double>(
"ootpuRatioHAD", 3.0);
189 desc.add<
double>(
"ootpuRatioRPD", -1.0);
190 desc.add<
double>(
"ootpuFracEM", 1.0);
191 desc.add<
double>(
"ootpuFracHAD", 1.0);
192 desc.add<
double>(
"ootpuFracRPD", 0.0);
193 desc.add<std::vector<double>>(
"chargeRatiosEM",
200 desc.add<std::vector<double>>(
"chargeRatiosHAD",
207 desc.add<std::vector<double>>(
"chargeRatiosRPD",
214 desc.add<std::vector<unsigned int>>(
"bxTs",
220 desc.add<
int>(
"nTs", 6);
221 desc.add<
bool>(
"forceSOI",
false);
222 desc.add<std::vector<unsigned int>>(
"signalSOI",
226 desc.add<std::vector<unsigned int>>(
"noiseSOI",
230 desc.add<
bool>(
"setSaturationFlags",
false);
233 psd0.
add<
int>(
"maxADCvalue", 255);
236 descriptions.
add(
"zdcrecoRun3",
desc);
void setZDCSaturation(ZDCRecHit rh, QIE10DataFrame &digi, int maxValue)
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_
constexpr edm::DataFrame::iterator end()
std::vector< double > chargeRatiosEM_
edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
std::vector< unsigned int > signalSOI_
constexpr edm::DataFrame::iterator begin()
iterators
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_
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)
edm::EDGetTokenT< QIE10DigiCollection > tok_input_QIE10
bool dropChannel(const uint32_t &mystatus) const