CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
EcalDigiProducer.cc File Reference
#include "FWCore/Framework/interface/Event.h"
#include "SimCalorimetry/EcalSimProducers/interface/EcalDigiProducer.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EBHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EEHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESHitResponse.h"
#include "SimCalorimetry/CaloSimAlgos/interface/CaloHitResponse.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EcalSimParameterMap.h"
#include "SimCalorimetry/EcalSimAlgos/interface/APDSimParameters.h"
#include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EcalCoder.h"
#include "SimCalorimetry/EcalSimAlgos/interface/EcalElectronicsSim.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSimFast.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSim.h"
#include "SimCalorimetry/EcalSimAlgos/interface/ESDigitizer.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "CalibFormats/CaloObjects/interface/CaloSamples.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.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 "SimGeneral/MixingModule/interface/PileUpEventPrincipal.h"
#include "SimDataFormats/CaloHit/interface/PCaloHit.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "CondFormats/EcalObjects/interface/EcalPedestals.h"
#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h"
#include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h"
#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h"
#include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbRecord.h"
#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h"
#include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h"
#include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
#include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h"
#include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
#include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h"
#include "CondFormats/ESObjects/interface/ESMIPToGeVConstant.h"
#include "CondFormats/DataRecord/interface/ESMIPToGeVConstantRcd.h"
#include "CondFormats/ESObjects/interface/ESGain.h"
#include "CondFormats/DataRecord/interface/ESGainRcd.h"
#include "CondFormats/ESObjects/interface/ESPedestals.h"
#include "CondFormats/DataRecord/interface/ESPedestalsRcd.h"
#include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h"

Go to the source code of this file.

Functions

 m_EECorrNoise ({{0, 0, 0}})
 

Function Documentation

m_EECorrNoise ( {{0, 0, 0}}  )

Definition at line 153 of file EcalDigiProducer.cc.

153  { {nullptr, nullptr, nullptr} } )
154 {
155  if(m_apdSeparateDigi) mixMod.produces<EBDigiCollection>(m_apdDigiTag);
156 
157  mixMod.produces<EBDigiCollection>(m_EBdigiCollection);
158  mixMod.produces<EEDigiCollection>(m_EEdigiCollection);
159  mixMod.produces<ESDigiCollection>(m_ESdigiCollection);
160 
161  if( m_doEB ) iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEB"));
162  if( m_doEE ) iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsEE"));
163  if( m_doES ) iC.consumes<std::vector<PCaloHit> >(edm::InputTag(m_hitsProducerTag, "EcalHitsES"));
164 
165  const std::vector<double> ebCorMatG12 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG12");
166  const std::vector<double> eeCorMatG12 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG12");
167  const std::vector<double> ebCorMatG06 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG06");
168  const std::vector<double> eeCorMatG06 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG06");
169  const std::vector<double> ebCorMatG01 = params.getParameter< std::vector<double> >("EBCorrNoiseMatrixG01");
170  const std::vector<double> eeCorMatG01 = params.getParameter< std::vector<double> >("EECorrNoiseMatrixG01");
171 
172  const bool applyConstantTerm = params.getParameter<bool> ("applyConstantTerm");
173  const double rmsConstantTerm = params.getParameter<double> ("ConstantTerm");
174 
175  const bool addNoise = params.getParameter<bool> ("doENoise");
176  const bool cosmicsPhase = params.getParameter<bool> ("cosmicsPhase");
177  const double cosmicsShift = params.getParameter<double> ("cosmicsShift");
178 
179 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
180 
181  // further phase for cosmics studies
182  if( cosmicsPhase )
183  {
184  if( m_doEB ) m_EBResponse->setPhaseShift( 1. + cosmicsShift ) ;
185  if( m_doEE ) m_EEResponse->setPhaseShift( 1. + cosmicsShift ) ;
186  }
187 
188  EcalCorrMatrix ebMatrix[ 3 ] ;
189  EcalCorrMatrix eeMatrix[ 3 ] ;
190 
191  assert( ebCorMatG12.size() == m_readoutFrameSize ) ;
192  assert( eeCorMatG12.size() == m_readoutFrameSize ) ;
193  assert( ebCorMatG06.size() == m_readoutFrameSize ) ;
194  assert( eeCorMatG06.size() == m_readoutFrameSize ) ;
195  assert( ebCorMatG01.size() == m_readoutFrameSize ) ;
196  assert( eeCorMatG01.size() == m_readoutFrameSize ) ;
197 
198  assert( 1.e-7 > fabs( ebCorMatG12[0] - 1.0 ) ) ;
199  assert( 1.e-7 > fabs( ebCorMatG06[0] - 1.0 ) ) ;
200  assert( 1.e-7 > fabs( ebCorMatG01[0] - 1.0 ) ) ;
201  assert( 1.e-7 > fabs( eeCorMatG12[0] - 1.0 ) ) ;
202  assert( 1.e-7 > fabs( eeCorMatG06[0] - 1.0 ) ) ;
203  assert( 1.e-7 > fabs( eeCorMatG01[0] - 1.0 ) ) ;
204 
205  for ( unsigned int row ( 0 ) ; row != m_readoutFrameSize ; ++row )
206  {
207  assert( 0 == row || 1. >= ebCorMatG12[row] ) ;
208  assert( 0 == row || 1. >= ebCorMatG06[row] ) ;
209  assert( 0 == row || 1. >= ebCorMatG01[row] ) ;
210  assert( 0 == row || 1. >= eeCorMatG12[row] ) ;
211  assert( 0 == row || 1. >= eeCorMatG06[row] ) ;
212  assert( 0 == row || 1. >= eeCorMatG01[row] ) ;
213  for ( unsigned int column ( 0 ) ; column <= row ; ++column )
214  {
215  const unsigned int index ( row - column ) ;
216  ebMatrix[0]( row, column ) = ebCorMatG12[ index ] ;
217  eeMatrix[0]( row, column ) = eeCorMatG12[ index ] ;
218  ebMatrix[1]( row, column ) = ebCorMatG06[ index ] ;
219  eeMatrix[1]( row, column ) = eeCorMatG06[ index ] ;
220  ebMatrix[2]( row, column ) = ebCorMatG01[ index ] ;
221  eeMatrix[2]( row, column ) = eeCorMatG01[ index ] ;
222  }
223  }
224 
225  m_EBCorrNoise[0].reset( new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[0] ) );
226  m_EECorrNoise[0].reset( new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[0] ) );
227  m_EBCorrNoise[1].reset( new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[1] ) );
228  m_EECorrNoise[1].reset( new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[1] ) );
229  m_EBCorrNoise[2].reset( new CorrelatedNoisifier<EcalCorrMatrix>( ebMatrix[2] ) );
230  m_EECorrNoise[2].reset( new CorrelatedNoisifier<EcalCorrMatrix>( eeMatrix[2] ) );
231 
232  m_Coder.reset( new EcalCoder( addNoise ,
233  m_PreMix1 ,
234  m_EBCorrNoise[0].get() ,
235  m_EECorrNoise[0].get() ,
236  m_EBCorrNoise[1].get() ,
237  m_EECorrNoise[1].get() ,
238  m_EBCorrNoise[2].get() ,
239  m_EECorrNoise[2].get() ) );
240 
241  m_ElectronicsSim.reset( new EcalElectronicsSim( m_ParameterMap.get() ,
242  m_Coder.get() ,
243  applyConstantTerm ,
244  rmsConstantTerm ) );
245 
246  if( m_apdSeparateDigi )
247  {
248  m_APDCoder.reset( new EcalCoder( false ,
249  m_EBCorrNoise[0].get() ,
250  m_EECorrNoise[0].get() ,
251  m_EBCorrNoise[1].get() ,
252  m_EECorrNoise[1].get() ,
253  m_EBCorrNoise[2].get() ,
254  m_EECorrNoise[2].get() ) );
255 
256  m_APDElectronicsSim.reset( new EcalElectronicsSim( m_ParameterMap.get() ,
257  m_APDCoder.get() ,
258  applyConstantTerm ,
259  rmsConstantTerm ) );
260 
261  m_APDDigitizer.reset( new EBDigitizer( m_APDResponse.get() ,
262  m_APDElectronicsSim.get() ,
263  false ) );
264  }
265 
266  if( m_doEB ) {
267  m_BarrelDigitizer.reset( new EBDigitizer( m_EBResponse.get() ,
268  m_ElectronicsSim.get() ,
269  addNoise ) );
270  }
271 
272  if ( m_doEE ) {
273  m_EndcapDigitizer.reset( new EEDigitizer( m_EEResponse.get() ,
274  m_ElectronicsSim.get() ,
275  addNoise ) );
276  }
277 }
adds noise to the given frame.
Definition: EcalCoder.h:11
EcalTDigitizer< EEDigitizerTraits > EEDigitizer
assert(m_qm.get())
math::ErrorD< CaloSamples::MAXSAMPLES >::type EcalCorrMatrix
EcalTDigitizer< EBDigitizerTraits > EBDigitizer
m_EECorrNoise({{0, 0, 0}})
volatile std::atomic< bool > shutdown_flag false