|
|
Go to the documentation of this file.
43 #include "CLHEP/Matrix/Matrix.h"
44 #include "CLHEP/Matrix/SymMatrix.h"
80 LogDebug(
"EcalUncalibRecHitInfo") <<
"total # EBdigis: " << EBdigis->
size();
96 LogDebug(
"EcalUncalibRecHitInfo") <<
"total # EEdigis: " << EEdigis->
size();
102 if (!EBdigis && !EEdigis)
130 LogDebug(
"EcalUncalibRecHitDebug") <<
"Fetching EcalTBWeights from DB ";
141 LogDebug(
"EcalUncalibRecHitDebug") <<
"EcalTBWeightMap.size(): " << std::setprecision(3) << wgts->
getMap().size();
147 LogDebug(
"EcalUncalibRecHitDebug") <<
"fetching pedestals....";
154 LogDebug(
"EcalUncalibRecHitDebug") <<
"done.";
159 auto EBuncalibRechits = std::make_unique<EBUncalibratedRecHitCollection>();
160 auto EEuncalibRechits = std::make_unique<EEUncalibratedRecHitCollection>();
168 EcalTBWeights::EcalTBWeightMap::const_iterator wit;
174 if (recTDC->
offset() == -999.) {
175 edm::LogError(
"EcalUncalibRecHitError") <<
"TDC bin completely out of range. Returning";
180 for (
unsigned int idig = 0; idig < EBdigis->
size(); ++idig) {
187 LogDebug(
"EcalUncalibRecHitDebug") <<
"looking up pedestal for crystal: " <<
EBDetId(itdg.
id());
190 if (pedIter == pedMap.
end()) {
192 <<
"error!! could not find pedestals for channel: " <<
EBDetId(itdg.
id())
193 <<
"\n no uncalib rechit will be made for this digi!";
203 pedRMSVec[1] = aped.
rms_x6;
204 pedRMSVec[2] = aped.
rms_x1;
208 LogDebug(
"EcalUncalibRecHitDebug") <<
"looking up gainRatios for crystal: " <<
EBDetId(itdg.
id());
211 if (gainIter == gainMap.
end()) {
213 <<
"error!! could not find gain ratios for channel: " <<
EBDetId(itdg.
id())
214 <<
"\n no uncalib rechit will be made for this digi!";
218 double gainRatios[3];
225 if (git == grpMap.
end()) {
227 <<
"No group id found for this crystal. something wrong with EcalWeightXtalGroups in your DB?"
228 <<
"\n no uncalib rechit will be made for digi with id: " <<
EBDetId(itdg.
id());
234 double sampleGainRef = 1;
235 int sampleSwitch = 999;
238 if (gainSample != sampleGainRef) {
239 sampleGainRef = gainSample;
247 if (recTDC->
offset() <= 0.)
249 else if (recTDC->
offset() >= 1.)
256 <<
"TDC bin out of range " << tdcBin <<
" offset " << recTDC->
offset();
273 wit = wgts->
getMap().find(std::make_pair(gid, tdcid));
274 if (wit == wgts->
getMap().end()) {
276 <<
"No weights found for EcalGroupId: " << gid.
id() <<
" and EcalTDCId: " << tdcid
277 <<
"\n skipping digi with id: " <<
EBDetId(itdg.
id());
285 LogDebug(
"EcalUncalibRecHitDebug") <<
"accessing matrices of weights...";
306 EBuncalibRechits->push_back(aHit);
309 LogDebug(
"EcalUncalibRecHitDebug") <<
"processed EBDataFrame with id: " <<
EBDetId(itdg.
id()) <<
"\n"
310 <<
"uncalib rechit amplitude: " << aHit.
amplitude();
319 for (
unsigned int idig = 0; idig < EEdigis->
size(); ++idig) {
326 LogDebug(
"EcalUncalibRecHitDebug") <<
"looking up pedestal for crystal: " <<
EEDetId(itdg.
id());
330 if (pedIter == pedMap.
end()) {
332 <<
"error!! could not find pedestals for channel: " <<
EEDetId(itdg.
id())
333 <<
"\n no uncalib rechit will be made for this digi!";
343 pedRMSVec[1] = aped.
rms_x6;
344 pedRMSVec[2] = aped.
rms_x1;
348 LogDebug(
"EcalUncalibRecHitDebug") <<
"looking up gainRatios for crystal: " <<
EEDetId(itdg.
id());
352 if (gainIter == gainMap.
end()) {
354 <<
"error!! could not find gain ratios for channel: " <<
EEDetId(itdg.
id())
355 <<
"\n no uncalib rechit will be made for this digi!";
359 double gainRatios[3];
366 if (git == grpMap.
end()) {
368 <<
"No group id found for this crystal. something wrong with EcalWeightXtalGroups in your DB?"
369 <<
"\n no uncalib rechit will be made for digi with id: " <<
EEDetId(itdg.
id());
375 double sampleGainRef = 1;
376 int sampleSwitch = 999;
379 if (gainSample != sampleGainRef) {
380 sampleGainRef = gainSample;
388 if (recTDC->
offset() <= 0.)
390 else if (recTDC->
offset() >= 1.)
397 <<
"TDC bin out of range " << tdcBin <<
" offset " << recTDC->
offset();
414 wit = wgts->
getMap().find(std::make_pair(gid, tdcid));
415 if (wit == wgts->
getMap().end()) {
417 <<
"No weights found for EcalGroupId: " << gid.
id() <<
" and EcalTDCId: " << tdcid
418 <<
"\n skipping digi with id: " <<
EEDetId(itdg.
id());
426 LogDebug(
"EcalUncalibRecHitDebug") <<
"accessing matrices of weights...";
448 EEuncalibRechits->push_back(aHit);
451 LogDebug(
"EcalUncalibRecHitDebug") <<
"processed EEDataFrame with id: " <<
EEDetId(itdg.
id()) <<
"\n"
452 <<
"uncalib rechit amplitude: " << aHit.
amplitude()
const self & getMap() const
T const * product() const
const_iterator end() const
EcalMGPASample sample(int i) const
const EcalTBWeightMap & getMap() const
T const * product() const
EcalUncalibRecHitRecWeightsAlgo< EEDataFrame > EEalgo_
~EcalTBWeightUncalibRecHitProducer() override
T getUntrackedParameter(std::string const &, T const &) const
const EEShape testbeamEEShape
EcalUncalibRecHitRecWeightsAlgo< EBDataFrame > EBalgo_
math::Matrix< 3, 10 >::type EcalWeightMatrix
int gainId() const
get the gainId (2 bits)
const_iterator find(uint32_t rawId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
EcalWeightMatrix & getWeightsAfterGainSwitch()
edm::InputTag EEdigiCollection_
float gain12Over6() const
std::string EEhitCollection_
EcalWeightMatrix & getWeightsBeforeGainSwitch()
std::string EBhitCollection_
bool use2004OffsetConvention_
EcalTBWeightUncalibRecHitProducer(const edm::ParameterSet &ps)
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
T getParameter(std::string const &) const
constexpr uint32_t rawId() const
get the raw id
void produce(edm::Event &evt, const edm::EventSetup &es) override
edm::InputTag tdcRecInfoCollection_
virtual EcalUncalibratedRecHit makeRecHit(const C &dataFrame, const double *pedestals, const double *pedestalsRMS, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalShapeBase &testbeamPulseShape)
Compute parameters.
edm::InputTag EBdigiCollection_
std::vector< Item >::const_iterator const_iterator
const EBShape testbeamEBShape