CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
EcalDigiProducer.cc File Reference
#include <memory>
#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
#include "FWCore/Framework/interface/Event.h"
#include "SimCalorimetry/CaloSimAlgos/interface/CaloHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/APDSimParameters.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EBHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EEHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSim.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSimFast.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EcalCoder.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EcalElectronicsSim.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EcalSimParameterMap.h"
#include "SimCalorimetry/EcalSimProducers/interface/EcalDigiProducer.h"
#include "CalibFormats/CaloObjects/interface/CaloSamples.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/RandomNumberGenerator.h"
#include "FWCore/Utilities/interface/StreamID.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESDigitizer.h"
#include "SimDataFormats/CaloHit/interface/PCaloHit.h"
#include "SimGeneral/MixingModule/interface/PileUpEventPrincipal.h"
#include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h"

Go to the source code of this file.

Functions

 m_EECorrNoise ({{nullptr, nullptr, nullptr}})
 

Function Documentation

m_EECorrNoise ( {{nullptr, nullptr, nullptr}}  )

Definition at line 139 of file EcalDigiProducer.cc.

139  {{nullptr, nullptr, nullptr}}) {
140  // "produces" statements taken care of elsewhere.
141  // if(m_apdSeparateDigi) mixMod.produces<EBDigiCollection>(m_apdDigiTag);
142  // mixMod.produces<EBDigiCollection>(m_EBdigiCollection);
143  // mixMod.produces<EEDigiCollection>(m_EEdigiCollection);
144  // mixMod.produces<ESDigiCollection>(m_ESdigiCollection);
145  if (m_doEB)
146  iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
147  if (m_doEE)
148  iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsEE"));
149  if (m_doES) {
150  iC.consumes<std::vector<PCaloHit>>(edm::InputTag(m_hitsProducerTag, "EcalHitsES"));
151  m_esGainToken = iC.esConsumes();
152  m_esMIPToGeVToken = iC.esConsumes();
153  m_esPedestalsToken = iC.esConsumes();
154  m_esMIPsToken = iC.esConsumes();
155  }
156 
157  const std::vector<double> ebCorMatG12 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG12");
158  const std::vector<double> eeCorMatG12 = params.getParameter<std::vector<double>>("EECorrNoiseMatrixG12");
159  const std::vector<double> ebCorMatG06 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG06");
160  const std::vector<double> eeCorMatG06 = params.getParameter<std::vector<double>>("EECorrNoiseMatrixG06");
161  const std::vector<double> ebCorMatG01 = params.getParameter<std::vector<double>>("EBCorrNoiseMatrixG01");
162  const std::vector<double> eeCorMatG01 = params.getParameter<std::vector<double>>("EECorrNoiseMatrixG01");
163 
164  const bool applyConstantTerm = params.getParameter<bool>("applyConstantTerm");
165  const double rmsConstantTerm = params.getParameter<double>("ConstantTerm");
166 
167  const bool addNoise = params.getParameter<bool>("doENoise");
168  const bool cosmicsPhase = params.getParameter<bool>("cosmicsPhase");
169  const double cosmicsShift = params.getParameter<double>("cosmicsShift");
170 
171  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
172 
173  // further phase for cosmics studies
174  if (cosmicsPhase) {
175  if (m_doEB)
176  m_EBResponse->setPhaseShift(1. + cosmicsShift);
177  if (m_doEE)
178  m_EEResponse->setPhaseShift(1. + cosmicsShift);
179  }
180 
182  EcalCorrMatrix eeMatrix[3];
183 
184  assert(ebCorMatG12.size() == m_readoutFrameSize);
185  assert(eeCorMatG12.size() == m_readoutFrameSize);
186  assert(ebCorMatG06.size() == m_readoutFrameSize);
187  assert(eeCorMatG06.size() == m_readoutFrameSize);
188  assert(ebCorMatG01.size() == m_readoutFrameSize);
189  assert(eeCorMatG01.size() == m_readoutFrameSize);
190 
191  assert(1.e-7 > fabs(ebCorMatG12[0] - 1.0));
192  assert(1.e-7 > fabs(ebCorMatG06[0] - 1.0));
193  assert(1.e-7 > fabs(ebCorMatG01[0] - 1.0));
194  assert(1.e-7 > fabs(eeCorMatG12[0] - 1.0));
195  assert(1.e-7 > fabs(eeCorMatG06[0] - 1.0));
196  assert(1.e-7 > fabs(eeCorMatG01[0] - 1.0));
197 
198  for (unsigned int row(0); row != m_readoutFrameSize; ++row) {
199  assert(0 == row || 1. >= ebCorMatG12[row]);
200  assert(0 == row || 1. >= ebCorMatG06[row]);
201  assert(0 == row || 1. >= ebCorMatG01[row]);
202  assert(0 == row || 1. >= eeCorMatG12[row]);
203  assert(0 == row || 1. >= eeCorMatG06[row]);
204  assert(0 == row || 1. >= eeCorMatG01[row]);
205  for (unsigned int column(0); column <= row; ++column) {
206  const unsigned int index(row - column);
207  ebMatrix[0](row, column) = ebCorMatG12[index];
208  eeMatrix[0](row, column) = eeCorMatG12[index];
209  ebMatrix[1](row, column) = ebCorMatG06[index];
210  eeMatrix[1](row, column) = eeCorMatG06[index];
211  ebMatrix[2](row, column) = ebCorMatG01[index];
212  eeMatrix[2](row, column) = eeCorMatG01[index];
213  }
214  }
215 
216  m_EBCorrNoise[0] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix>>(ebMatrix[0]);
217  m_EECorrNoise[0] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix>>(eeMatrix[0]);
218  m_EBCorrNoise[1] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix>>(ebMatrix[1]);
219  m_EECorrNoise[1] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix>>(eeMatrix[1]);
220  m_EBCorrNoise[2] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix>>(ebMatrix[2]);
221  m_EECorrNoise[2] = std::make_unique<CorrelatedNoisifier<EcalCorrMatrix>>(eeMatrix[2]);
222 
223  m_Coder = std::make_unique<EcalCoder>(addNoise,
224  m_PreMix1,
225  m_EBCorrNoise[0].get(),
226  m_EECorrNoise[0].get(),
227  m_EBCorrNoise[1].get(),
228  m_EECorrNoise[1].get(),
229  m_EBCorrNoise[2].get(),
230  m_EECorrNoise[2].get());
231 
233  std::make_unique<EcalElectronicsSim_Ph1>(m_ParameterMap.get(), m_Coder.get(), applyConstantTerm, rmsConstantTerm);
234 
235  if (m_apdSeparateDigi) {
236  m_APDCoder = std::make_unique<EcalCoder>(false,
237  m_PreMix1,
238  m_EBCorrNoise[0].get(),
239  m_EECorrNoise[0].get(),
240  m_EBCorrNoise[1].get(),
241  m_EECorrNoise[1].get(),
242  m_EBCorrNoise[2].get(),
243  m_EECorrNoise[2].get());
244 
245  m_APDElectronicsSim = std::make_unique<EcalElectronicsSim_Ph1>(
246  m_ParameterMap.get(), m_APDCoder.get(), applyConstantTerm, rmsConstantTerm);
247 
248  m_APDDigitizer = std::make_unique<EBDigitizer>(m_APDResponse.get(), m_APDElectronicsSim.get(), false);
249  }
250 
251  if (m_doEB) {
252  m_BarrelDigitizer = std::make_unique<EBDigitizer>(m_EBResponse.get(), m_ElectronicsSim.get(), addNoise);
253  }
254 
255  if (m_doEE) {
256  m_EndcapDigitizer = std::make_unique<EEDigitizer>(m_EEResponse.get(), m_ElectronicsSim.get(), addNoise);
257  }
258 }
const bool applyConstantTerm
EcalCorrMatrix_Ph2 ebMatrix[2]
assert(be >=bs)
const bool cosmicsPhase
const double rmsConstantTerm
m_EBCorrNoise[0]
const double cosmicsShift
math::ErrorD< ecalPh1::sampleSize >::type EcalCorrMatrix
const bool addNoise
m_EECorrNoise({{nullptr, nullptr, nullptr}})