58 : reco_(conf.getParameter<int>(
"firstSample"),
59 conf.getParameter<int>(
"samplesToAdd"),
60 conf.getParameter<bool>(
"correctForTimeslew"),
61 conf.getParameter<bool>(
"correctForPhaseContainment"),
62 conf.getParameter<double>(
"correctionPhaseNS")),
64 firstSample_(conf.getParameter<int>(
"firstSample")),
65 samplesToAdd_(conf.getParameter<int>(
"samplesToAdd")),
66 maxADCvalue_(conf.getParameter<int>(
"maxADCvalue")),
67 tsFromDB_(conf.getParameter<bool>(
"tsFromDB")),
68 setSaturationFlag_(conf.getParameter<bool>(
"setSaturationFlag")),
69 doSaturationCorr_(conf.getParameter<bool>(
"doSaturationCorr")) {
74 if (!strcasecmp(subd.c_str(),
"CASTOR")) {
77 produces<CastorRecHitCollection>();
80 <<
"CastorSimpleReconstructor is not associated with CASTOR subdetector!" << std::endl;
86 tok_satCorr_ = esConsumes<CastorSaturationCorrs, CastorSaturationCorrsRcd>();
106 <<
"Could not handle the CastorRecoParamsRcd correctly, using parameters from cfg file from this event "
107 "onwards... These parameters could be wrong for this run... please check"
118 edm::LogWarning(
"CastorSimpleReconstructor") <<
"Could not handle the CastorSaturationCorrsRcd correctly. We'll "
119 "not try the saturation correction from this event onwards..."
129 auto rec = std::make_unique<CastorRecHitCollection>();
132 for (i = digi->begin(); i != digi->end(); i++) {
141 const CastorQIECoder* channelCoder = conditions->getCastorCoder(cell);
155 double satCorrConst = 1.;
156 satCorrConst = saturationCorr->
getValue();
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EventSetup & c
void resetTimeSamples(int f, int t)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
CastorSimpleReconstructor(const edm::ParameterSet &ps)
edm::ESGetToken< CastorSaturationCorrs, CastorSaturationCorrsRcd > tok_satCorr_
CastorRecHit reconstruct(const CastorDataFrame &digi, const CastorCoder &coder, const CastorCalibrations &calibs) const
CastorSimpleRecAlgo reco_
void produce(edm::Event &e, const edm::EventSetup &c) override
unsigned int samplesToAdd() const
edm::EDGetTokenT< CastorDigiCollection > tok_input_
static const int SubdetectorId
edm::ESGetToken< CastorRecoParams, CastorRecoParamsRcd > tok_recoParams_
unsigned int firstSample() const
void recoverADCSaturation(CastorRecHit &rechit, const CastorCoder &coder, const CastorCalibrations &calibs, const CastorDataFrame &digi, const int &maxADCvalue, const double &satCorrConst) const
edm::ESGetToken< CastorDbService, CastorDbRecord > tok_conditions_
T getParameter(std::string const &) const
~CastorSimpleReconstructor() override
void checkADCSaturation(CastorRecHit &rechit, const CastorDataFrame &digi, const int &maxADCvalue) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning