CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTBDigiProducer Class Reference

#include <EcalTBDigiProducer.h>

Inheritance diagram for EcalTBDigiProducer:
EcalDigiProducer edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void cacheEBDigis (const EBDigiCollection *ebDigiPtr) const
 
virtual void cacheEEDigis (const EEDigiCollection *eeDigiPtr) const
 
 EcalTBDigiProducer (const edm::ParameterSet &params)
 
virtual void produce (edm::Event &event, const edm::EventSetup &eventSetup)
 
virtual ~EcalTBDigiProducer ()
 
- Public Member Functions inherited from EcalDigiProducer
 EcalDigiProducer (const edm::ParameterSet &params)
 
virtual ~EcalDigiProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void fillTBTDCRawInfo (EcalTBTDCRawInfo &theTBTDCRawInfo)
 
void setPhaseShift (const DetId &detId)
 

Private Attributes

bool m_doPhaseShift
 
bool m_doReadout
 
std::string m_EBdigiFinalTag
 
std::auto_ptr< EBDigiCollectionm_ebDigis
 
std::string m_EBdigiTempTag
 
std::string m_ecalTBInfoLabel
 
std::auto_ptr< EEDigiCollectionm_eeDigis
 
std::vector
< EcalTBTDCRecInfoAlgo::EcalTBTDCRanges
m_tdcRanges
 
EcalTBReadoutm_theTBReadout
 
const EcalTrigTowerConstituentsMap m_theTTmap
 
double m_thisPhaseShift
 
double m_tunePhaseShift
 
bool m_use2004OffsetConvention
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from EcalDigiProducer
void checkCalibrations (const edm::Event &event, const edm::EventSetup &eventSetup)
 
void checkGeometry (const edm::EventSetup &eventSetup)
 
void updateGeometry ()
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from EcalDigiProducer
const bool m_addESNoise
 
EcalCoderm_APDCoder
 
const std::string m_apdDigiTag
 
EBDigitizerm_APDDigitizer
 
EcalElectronicsSimm_APDElectronicsSim
 
const APDSimParametersm_apdParameters
 
EBHitResponsem_APDResponse
 
const bool m_apdSeparateDigi
 
const APDShape m_APDShape
 
EBDigitizerm_BarrelDigitizer
 
EcalCoderm_Coder
 
const bool m_doFastES
 
CorrelatedNoisifier
< EcalCorrMatrix > * 
m_EBCorrNoise [3]
 
const std::string m_EBdigiCollection
 
EBHitResponsem_EBResponse
 
const double m_EBs25notCont
 
const EBShape m_EBShape
 
CorrelatedNoisifier
< EcalCorrMatrix > * 
m_EECorrNoise [3]
 
const std::string m_EEdigiCollection
 
EEHitResponsem_EEResponse
 
const double m_EEs25notCont
 
const EEShape m_EEShape
 
EcalElectronicsSimm_ElectronicsSim
 
EEDigitizerm_EndcapDigitizer
 
const std::string m_ESdigiCollection
 
ESDigitizerm_ESDigitizer
 
ESElectronicsSimm_ESElectronicsSim
 
ESElectronicsSimFastm_ESElectronicsSimFast
 
ESOldDigitizerm_ESOldDigitizer
 
CaloHitResponsem_ESOldResponse
 
ESHitResponsem_ESResponse
 
ESShape m_ESShape
 
const CaloGeometrym_Geometry
 
const std::string m_hitsProducerTag
 
const EcalSimParameterMapm_ParameterMap
 
const unsigned int m_readoutFrameSize
 
bool m_useLCcorrection
 

Detailed Description

Definition at line 10 of file EcalTBDigiProducer.h.

Constructor & Destructor Documentation

EcalTBDigiProducer::EcalTBDigiProducer ( const edm::ParameterSet params)

Definition at line 12 of file EcalTBDigiProducer.cc.

References funct::false, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_doPhaseShift, m_doReadout, m_EBdigiFinalTag, m_EBdigiTempTag, m_ecalTBInfoLabel, m_tdcRanges, m_theTBReadout, m_thisPhaseShift, m_tunePhaseShift, m_use2004OffsetConvention, diffTwoXMLs::ranges, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::runRanges, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMax, and EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMin.

12  :
13  EcalDigiProducer( params )
14 {
15  m_EBdigiFinalTag = params.getParameter<std::string>( "EBdigiFinalCollection" ) ;
16  m_EBdigiTempTag = params.getParameter<std::string>( "EBdigiCollection");
17 
18  produces<EBDigiCollection>( m_EBdigiFinalTag ) ; // after selective readout
19  produces<EcalTBTDCRawInfo>() ;
20 
21  const bool syncPhase ( params.getParameter<bool>("syncPhase") ) ;
22 
23  // possible phase shift for asynchronous trigger (e.g. test-beam)
24 
25  m_doPhaseShift = !syncPhase ;
26  m_thisPhaseShift = 1. ;
27 
28  typedef std::vector< edm::ParameterSet > Parameters;
29  Parameters ranges=params.getParameter<Parameters>( "tdcRanges" ) ;
30  for( Parameters::iterator itRanges = ranges.begin();
31  itRanges != ranges.end(); ++itRanges )
32  {
34  aRange.runRanges.first = itRanges->getParameter<int>("startRun");
35  aRange.runRanges.second = itRanges->getParameter<int>("endRun");
36  aRange.tdcMin = itRanges->getParameter< std::vector<double> >("tdcMin");
37  aRange.tdcMax = itRanges->getParameter< std::vector<double> >("tdcMax");
38  m_tdcRanges.push_back(aRange);
39  }
40 
42  params.getUntrackedParameter< bool >("use2004OffsetConvention",
43  false ) ;
44 
46  params.getUntrackedParameter<std::string>( "EcalTBInfoLabel" ,
47  "SimEcalTBG4Object" ) ;
48 
49  m_doReadout = params.getParameter<bool>( "doReadout" ) ;
50 
51  m_theTBReadout = new EcalTBReadout( m_ecalTBInfoLabel ) ;
52 
53  m_tunePhaseShift = params.getParameter<double>( "tunePhaseShift" ) ;
54 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EcalDigiProducer(const edm::ParameterSet &params)
std::vector< EcalTBTDCRecInfoAlgo::EcalTBTDCRanges > m_tdcRanges
vector< ParameterSet > Parameters
std::string m_EBdigiFinalTag
string ranges
Definition: diffTwoXMLs.py:78
EcalTBReadout * m_theTBReadout
std::string m_EBdigiTempTag
std::string m_ecalTBInfoLabel
EcalTBDigiProducer::~EcalTBDigiProducer ( )
virtual

Definition at line 56 of file EcalTBDigiProducer.cc.

57 {
58 }

Member Function Documentation

void EcalTBDigiProducer::cacheEBDigis ( const EBDigiCollection ebDigiPtr) const
virtual

Reimplemented from EcalDigiProducer.

Definition at line 159 of file EcalTBDigiProducer.cc.

References m_ebDigis.

160 {
161  m_ebDigis.reset( new EBDigiCollection ) ;
162  *m_ebDigis = *ebDigiPtr ;
163 }
std::auto_ptr< EBDigiCollection > m_ebDigis
void EcalTBDigiProducer::cacheEEDigis ( const EEDigiCollection eeDigiPtr) const
virtual

Reimplemented from EcalDigiProducer.

Definition at line 166 of file EcalTBDigiProducer.cc.

References gather_cfg::cout, and edm::DataFrameContainer::size().

167 {
168  std::cout<< "===**** EcalTBDigiProducer: number of endcap digis = "
169  << eeDigiPtr->size()<<std::endl ;
170 }
tuple cout
Definition: gather_cfg.py:121
void EcalTBDigiProducer::fillTBTDCRawInfo ( EcalTBTDCRawInfo theTBTDCRawInfo)
private

Definition at line 141 of file EcalTBDigiProducer.cc.

References LogDebug, m_tdcRanges, m_thisPhaseShift, EcalTBTDCRawInfo::setSample(), Ecal2004TBTDCRanges_cff::tdcMax, and Ecal2004TBTDCRanges_cff::tdcMin.

Referenced by produce().

142 {
143  const unsigned int thisChannel ( 1 ) ;
144 
145  const unsigned int thisCount (
146  (unsigned int)( m_thisPhaseShift*( m_tdcRanges[0].tdcMax[0]
147  - m_tdcRanges[0].tdcMin[0] )
148  + m_tdcRanges[0].tdcMin[0] ) ) ;
149 
150  EcalTBTDCSample theTBTDCSample ( thisChannel, thisCount ) ;
151 
152  const unsigned int sampleIndex ( 0 ) ;
153  theTBTDCRawInfo.setSample( sampleIndex, theTBTDCSample ) ;
154 
155  LogDebug("EcalDigi") << theTBTDCSample << "\n" << theTBTDCRawInfo ;
156 }
#define LogDebug(id)
std::vector< EcalTBTDCRecInfoAlgo::EcalTBTDCRanges > m_tdcRanges
void setSample(unsigned int i, const EcalTBTDCSample &sam)
void EcalTBDigiProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

Produces the EDM products,

Reimplemented from EcalDigiProducer.

Definition at line 60 of file EcalTBDigiProducer.cc.

References gather_cfg::cout, DetId::Ecal, EcalBarrel, fillTBTDCRawInfo(), edm::EventSetup::get(), m_doPhaseShift, m_doReadout, m_EBdigiFinalTag, m_ebDigis, m_ecalTBInfoLabel, m_eeDigis, m_theTBReadout, m_theTTmap, m_thisPhaseShift, EcalTBReadout::performReadout(), EcalDigiProducer::produce(), EcalTBReadout::setDetIds(), and setPhaseShift().

62 {
63  std::cout<<"====****Entering EcalTBDigiProducer produce()"<<std::endl ;
64  edm::ESHandle<CaloGeometry> hGeometry ;
65  eventSetup.get<CaloGeometryRecord>().get( hGeometry ) ;
66  const std::vector<DetId>& theBarrelDets (
67  hGeometry->getValidDetIds(DetId::Ecal, EcalBarrel) ) ;
68 
69  m_theTBReadout->setDetIds( theBarrelDets ) ;
70 
71  std::auto_ptr<EcalTBTDCRawInfo> TDCproduct( new EcalTBTDCRawInfo(1) ) ;
72  if( m_doPhaseShift )
73  {
74  edm::Handle<PEcalTBInfo> theEcalTBInfo ;
75  event.getByLabel( m_ecalTBInfoLabel, theEcalTBInfo ) ;
76  m_thisPhaseShift = theEcalTBInfo->phaseShift() ;
77 
78  DetId detId( DetId::Ecal, 1 ) ;
79  setPhaseShift( detId ) ;
80 
81  fillTBTDCRawInfo( *TDCproduct ) ; // fill the TDC info in the event
82  }
83 
84  m_ebDigis = std::auto_ptr<EBDigiCollection> ( new EBDigiCollection ) ;
85 
86  EcalDigiProducer::produce( event, eventSetup ) ;
87 
88  const EBDigiCollection* barrelResult ( &*m_ebDigis ) ;
89 
90  std::auto_ptr<EBDigiCollection> barrelReadout( new EBDigiCollection() ) ;
91  if( m_doReadout )
92  {
94  m_theTTmap,
95  *barrelResult,
96  *barrelReadout ) ;
97  }
98  else
99  {
100  *barrelReadout = *barrelResult ;
101  }
102 
103  std::cout<< "===**** EcalTBDigiProducer: number of barrel digis = "
104  << barrelReadout->size()<<std::endl ;
105 
106  event.put( barrelReadout, m_EBdigiFinalTag ) ;
107  event.put( TDCproduct ) ;
108 
109  m_ebDigis.reset() ; // release memory
110  m_eeDigis.reset() ; // release memory
111 }
const EcalTrigTowerConstituentsMap m_theTTmap
std::auto_ptr< EBDigiCollection > m_ebDigis
void fillTBTDCRawInfo(EcalTBTDCRawInfo &theTBTDCRawInfo)
void setPhaseShift(const DetId &detId)
std::string m_EBdigiFinalTag
void performReadout(edm::Event &event, const EcalTrigTowerConstituentsMap &theTTmap, const EBDigiCollection &input, EBDigiCollection &output)
master function to be called once per event
void setDetIds(const std::vector< DetId > &detIds)
tell the readout which cells exist
Definition: EcalTBReadout.h:28
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
EcalTBReadout * m_theTBReadout
virtual void produce(edm::Event &event, const edm::EventSetup &eventSetup)
tuple cout
Definition: gather_cfg.py:121
std::auto_ptr< EEDigiCollection > m_eeDigis
std::string m_ecalTBInfoLabel
void EcalTBDigiProducer::setPhaseShift ( const DetId detId)
private

Definition at line 114 of file EcalTBDigiProducer.cc.

References LogDebug, EcalDigiProducer::m_EBResponse, EcalDigiProducer::m_EEResponse, EcalDigiProducer::m_ParameterMap, m_thisPhaseShift, m_tunePhaseShift, m_use2004OffsetConvention, Parameters::parameters, EcalHitResponse::setPhaseShift(), DetId::subdetId(), and CaloSimParameters::syncPhase().

Referenced by produce().

115 {
116  const CaloSimParameters& parameters (
117  EcalDigiProducer::m_ParameterMap->simParameters( detId ) ) ;
118 
119  if ( !parameters.syncPhase() )
120  {
121  const int myDet ( detId.subdetId() ) ;
122 
123  LogDebug("EcalDigi") << "Setting the phase shift "
124  << m_thisPhaseShift
125  << " and the offset "
126  << m_tunePhaseShift
127  << " for the subdetector "
128  << myDet;
129 
130  if( myDet == 1 )
131  {
132  double passPhaseShift ( m_thisPhaseShift + m_tunePhaseShift ) ;
133  if( m_use2004OffsetConvention ) passPhaseShift = 1. - passPhaseShift ;
134  EcalDigiProducer::m_EBResponse->setPhaseShift( passPhaseShift ) ;
135  EcalDigiProducer::m_EEResponse->setPhaseShift( passPhaseShift ) ;
136  }
137  }
138 }
#define LogDebug(id)
dictionary parameters
Definition: Parameters.py:2
const EcalSimParameterMap * m_ParameterMap
Main class for Parameters in different subdetectors.
EBHitResponse * m_EBResponse
void setPhaseShift(double phaseShift)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
EEHitResponse * m_EEResponse

Member Data Documentation

bool EcalTBDigiProducer::m_doPhaseShift
private

Definition at line 37 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and produce().

bool EcalTBDigiProducer::m_doReadout
private

Definition at line 40 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and produce().

std::string EcalTBDigiProducer::m_EBdigiFinalTag
private

Definition at line 34 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and produce().

std::auto_ptr<EBDigiCollection> EcalTBDigiProducer::m_ebDigis
mutableprivate

Definition at line 47 of file EcalTBDigiProducer.h.

Referenced by cacheEBDigis(), and produce().

std::string EcalTBDigiProducer::m_EBdigiTempTag
private

Definition at line 35 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer().

std::string EcalTBDigiProducer::m_ecalTBInfoLabel
private

Definition at line 33 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and produce().

std::auto_ptr<EEDigiCollection> EcalTBDigiProducer::m_eeDigis
mutableprivate

Definition at line 48 of file EcalTBDigiProducer.h.

Referenced by produce().

std::vector<EcalTBTDCRecInfoAlgo::EcalTBTDCRanges> EcalTBDigiProducer::m_tdcRanges
private

Definition at line 42 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and fillTBTDCRawInfo().

EcalTBReadout* EcalTBDigiProducer::m_theTBReadout
private

Definition at line 31 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and produce().

const EcalTrigTowerConstituentsMap EcalTBDigiProducer::m_theTTmap
private

Definition at line 30 of file EcalTBDigiProducer.h.

Referenced by produce().

double EcalTBDigiProducer::m_thisPhaseShift
private

Definition at line 38 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), fillTBTDCRawInfo(), produce(), and setPhaseShift().

double EcalTBDigiProducer::m_tunePhaseShift
private

Definition at line 45 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and setPhaseShift().

bool EcalTBDigiProducer::m_use2004OffsetConvention
private

Definition at line 43 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and setPhaseShift().