CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTBDigiProducer Class Reference

#include <EcalTBDigiProducer.h>

Inheritance diagram for EcalTBDigiProducer:
EcalDigiProducer DigiAccumulatorMixMod

Public Member Functions

 EcalTBDigiProducer (const edm::ParameterSet &params, edm::ProducesCollector, edm::ConsumesCollector &iC)
 
void finalizeEvent (edm::Event &, edm::EventSetup const &) override
 
void initializeEvent (edm::Event const &, edm::EventSetup const &) override
 
 ~EcalTBDigiProducer () override
 
- Public Member Functions inherited from EcalDigiProducer
void accumulate (edm::Event const &e, edm::EventSetup const &c) override
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) override
 
 EcalDigiProducer (const edm::ParameterSet &params, edm::ConsumesCollector &iC)
 
 EcalDigiProducer (const edm::ParameterSet &params, edm::ProducesCollector, edm::ConsumesCollector &iC)
 
void setEBNoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
void setEENoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
void setESNoiseSignalGenerator (EcalBaseSignalGenerator *noiseGenerator)
 
 ~EcalDigiProducer () override
 
- Public Member Functions inherited from DigiAccumulatorMixMod
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Member Functions

void cacheEBDigis (const EBDigiCollection *ebDigiPtr) const override
 
void cacheEEDigis (const EEDigiCollection *eeDigiPtr) const override
 
void fillTBTDCRawInfo (EcalTBTDCRawInfo &theTBTDCRawInfo)
 
void setPhaseShift (const DetId &detId)
 

Private Attributes

bool m_doPhaseShift
 
bool m_doReadout
 
std::string m_EBdigiFinalTag
 
std::unique_ptr< EBDigiCollectionm_ebDigis
 
std::string m_EBdigiTempTag
 
std::string m_ecalTBInfoLabel
 
std::unique_ptr< EEDigiCollectionm_eeDigis
 
std::unique_ptr< EcalTBTDCRawInfom_TDCproduct
 
std::vector< EcalTBTDCRecInfoAlgo::EcalTBTDCRangesm_tdcRanges
 
EcalTBReadoutm_theTBReadout
 
const EcalTrigTowerConstituentsMap m_theTTmap
 
double m_thisPhaseShift
 
double m_tunePhaseShift
 
bool m_use2004OffsetConvention
 

Additional Inherited Members

- Protected Attributes inherited from EcalDigiProducer
std::unique_ptr< EBHitResponsem_EBResponse
 
std::unique_ptr< EEHitResponsem_EEResponse
 
std::unique_ptr< const EcalSimParameterMapm_ParameterMap
 

Detailed Description

Definition at line 20 of file EcalTBDigiProducer.h.

Constructor & Destructor Documentation

◆ EcalTBDigiProducer()

EcalTBDigiProducer::EcalTBDigiProducer ( const edm::ParameterSet params,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector iC 
)

Definition at line 14 of file EcalTBDigiProducer.cc.

17  : EcalDigiProducer(params, producesCollector, iC) {
18  std::string const instance("simEcalUnsuppressedDigis");
19  m_EBdigiFinalTag = params.getParameter<std::string>("EBdigiFinalCollection");
20  m_EBdigiTempTag = params.getParameter<std::string>("EBdigiCollection");
21 
22  producesCollector.produces<EBDigiCollection>(instance + m_EBdigiFinalTag); // after selective readout
23  producesCollector.produces<EcalTBTDCRawInfo>(instance);
24 
25  const bool syncPhase(params.getParameter<bool>("syncPhase"));
26 
27  // possible phase shift for asynchronous trigger (e.g. test-beam)
28 
30  m_thisPhaseShift = 1.;
31 
32  typedef std::vector<edm::ParameterSet> Parameters;
33  Parameters ranges = params.getParameter<Parameters>("tdcRanges");
34  for (Parameters::iterator itRanges = ranges.begin(); itRanges != ranges.end(); ++itRanges) {
36  aRange.runRanges.first = itRanges->getParameter<int>("startRun");
37  aRange.runRanges.second = itRanges->getParameter<int>("endRun");
38  aRange.tdcMin = itRanges->getParameter<std::vector<double>>("tdcMin");
39  aRange.tdcMax = itRanges->getParameter<std::vector<double>>("tdcMax");
40  m_tdcRanges.push_back(std::move(aRange));
41  }
42 
43  m_use2004OffsetConvention = params.getUntrackedParameter<bool>("use2004OffsetConvention", false);
44 
45  m_ecalTBInfoLabel = params.getUntrackedParameter<std::string>("EcalTBInfoLabel", "SimEcalTBG4Object");
46 
47  m_doReadout = params.getParameter<bool>("doReadout");
48 
50 
51  m_tunePhaseShift = params.getParameter<double>("tunePhaseShift");
52 
53  if (m_doPhaseShift) {
55  edm::InputTag(params.getUntrackedParameter<std::string>("EcalTBInfoLabel", "SimEcalTBG4Object")));
56  }
57 }

References edm::ConsumesCollector::consumes(), HLT_2018_cff::InputTag, instance, m_doPhaseShift, m_doReadout, m_EBdigiFinalTag, m_EBdigiTempTag, m_ecalTBInfoLabel, m_tdcRanges, m_theTBReadout, m_thisPhaseShift, m_tunePhaseShift, m_use2004OffsetConvention, eostools::move(), CalibrationSummaryClient_cfi::params, edm::ProducesCollector::produces(), diffTwoXMLs::ranges, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::runRanges, AlCaHLTBitMon_QueryRunRegistry::string, ecalSimParameterMap_cff::syncPhase, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMax, and EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMin.

◆ ~EcalTBDigiProducer()

EcalTBDigiProducer::~EcalTBDigiProducer ( )
override

Definition at line 59 of file EcalTBDigiProducer.cc.

59 {}

Member Function Documentation

◆ cacheEBDigis()

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

Reimplemented from EcalDigiProducer.

Definition at line 140 of file EcalTBDigiProducer.cc.

140  {
141  m_ebDigis.reset(new EBDigiCollection);
142  *m_ebDigis = *ebDigiPtr;
143 }

References m_ebDigis.

◆ cacheEEDigis()

void EcalTBDigiProducer::cacheEEDigis ( const EEDigiCollection eeDigiPtr) const
overrideprivatevirtual

Reimplemented from EcalDigiProducer.

Definition at line 145 of file EcalTBDigiProducer.cc.

145  {
146  std::cout << "===**** EcalTBDigiProducer: number of endcap digis = " << eeDigiPtr->size() << std::endl;
147 }

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

◆ fillTBTDCRawInfo()

void EcalTBDigiProducer::fillTBTDCRawInfo ( EcalTBTDCRawInfo theTBTDCRawInfo)
private

Definition at line 126 of file EcalTBDigiProducer.cc.

126  {
127  const unsigned int thisChannel(1);
128 
129  const unsigned int thisCount((unsigned int)(m_thisPhaseShift * (m_tdcRanges[0].tdcMax[0] - m_tdcRanges[0].tdcMin[0]) +
130  m_tdcRanges[0].tdcMin[0]));
131 
132  EcalTBTDCSample theTBTDCSample(thisChannel, thisCount);
133 
134  const unsigned int sampleIndex(0);
135  theTBTDCRawInfo.setSample(sampleIndex, theTBTDCSample);
136 
137  LogDebug("EcalDigi") << theTBTDCSample << "\n" << theTBTDCRawInfo;
138 }

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

Referenced by initializeEvent().

◆ finalizeEvent()

void EcalTBDigiProducer::finalizeEvent ( edm::Event event,
edm::EventSetup const &  eventSetup 
)
overridevirtual

Reimplemented from EcalDigiProducer.

Definition at line 83 of file EcalTBDigiProducer.cc.

83  {
84  m_ebDigis.reset(new EBDigiCollection);
85 
87 
88  const EBDigiCollection *barrelResult(&*m_ebDigis);
89 
90  std::unique_ptr<EBDigiCollection> barrelReadout(new EBDigiCollection());
91  if (m_doReadout) {
92  m_theTBReadout->performReadout(event, m_theTTmap, *barrelResult, *barrelReadout);
93  } else {
94  *barrelReadout = *barrelResult;
95  }
96 
97  std::cout << "===**** EcalTBDigiProducer: number of barrel digis = " << barrelReadout->size() << std::endl;
98 
99  std::string const instance("simEcalUnsuppressedDigis");
100  event.put(std::move(barrelReadout), instance + m_EBdigiFinalTag);
101  event.put(std::move(m_TDCproduct), instance);
102 
103  m_ebDigis.reset(); // release memory
104  m_eeDigis.reset(); // release memory
105 }

References gather_cfg::cout, options_cfi::eventSetup, EcalDigiProducer::finalizeEvent(), instance, m_doReadout, m_EBdigiFinalTag, m_ebDigis, m_eeDigis, m_TDCproduct, m_theTBReadout, m_theTTmap, eostools::move(), EcalTBReadout::performReadout(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ initializeEvent()

void EcalTBDigiProducer::initializeEvent ( edm::Event const &  event,
edm::EventSetup const &  eventSetup 
)
overridevirtual

Reimplemented from EcalDigiProducer.

Definition at line 61 of file EcalTBDigiProducer.cc.

61  {
62  std::cout << "====****Entering EcalTBDigiProducer produce()" << std::endl;
64  eventSetup.get<CaloGeometryRecord>().get(hGeometry);
65  const std::vector<DetId> &theBarrelDets(hGeometry->getValidDetIds(DetId::Ecal, EcalBarrel));
66 
67  m_theTBReadout->setDetIds(theBarrelDets);
68 
69  m_TDCproduct.reset(new EcalTBTDCRawInfo(1));
70  if (m_doPhaseShift) {
71  edm::Handle<PEcalTBInfo> theEcalTBInfo;
72  event.getByLabel(m_ecalTBInfoLabel, theEcalTBInfo);
73  m_thisPhaseShift = theEcalTBInfo->phaseShift();
74 
75  DetId detId(DetId::Ecal, 1);
76  setPhaseShift(detId);
77 
78  fillTBTDCRawInfo(*m_TDCproduct); // fill the TDC info in the event
79  }
81 }

References gather_cfg::cout, DetId::Ecal, EcalBarrel, options_cfi::eventSetup, fillTBTDCRawInfo(), get, CaloGeometry::getValidDetIds(), EcalDigiProducer::initializeEvent(), m_doPhaseShift, m_ecalTBInfoLabel, m_TDCproduct, m_theTBReadout, m_thisPhaseShift, PEcalTBInfo::phaseShift(), EcalTBReadout::setDetIds(), and setPhaseShift().

◆ setPhaseShift()

void EcalTBDigiProducer::setPhaseShift ( const DetId detId)
private

Definition at line 107 of file EcalTBDigiProducer.cc.

107  {
108  const CaloSimParameters &parameters(EcalDigiProducer::m_ParameterMap->simParameters(detId));
109 
110  if (!parameters.syncPhase()) {
111  const int myDet(detId.subdetId());
112 
113  LogDebug("EcalDigi") << "Setting the phase shift " << m_thisPhaseShift << " and the offset " << m_tunePhaseShift
114  << " for the subdetector " << myDet;
115 
116  if (myDet == 1) {
117  double passPhaseShift(m_thisPhaseShift + m_tunePhaseShift);
119  passPhaseShift = 1. - passPhaseShift;
120  EcalDigiProducer::m_EBResponse->setPhaseShift(passPhaseShift);
121  EcalDigiProducer::m_EEResponse->setPhaseShift(passPhaseShift);
122  }
123  }
124 }

References LogDebug, EcalDigiProducer::m_EBResponse, EcalDigiProducer::m_EEResponse, EcalDigiProducer::m_ParameterMap, m_thisPhaseShift, m_tunePhaseShift, m_use2004OffsetConvention, and DetId::subdetId().

Referenced by initializeEvent().

Member Data Documentation

◆ m_doPhaseShift

bool EcalTBDigiProducer::m_doPhaseShift
private

Definition at line 43 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and initializeEvent().

◆ m_doReadout

bool EcalTBDigiProducer::m_doReadout
private

Definition at line 46 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and finalizeEvent().

◆ m_EBdigiFinalTag

std::string EcalTBDigiProducer::m_EBdigiFinalTag
private

Definition at line 40 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and finalizeEvent().

◆ m_ebDigis

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

Definition at line 53 of file EcalTBDigiProducer.h.

Referenced by cacheEBDigis(), and finalizeEvent().

◆ m_EBdigiTempTag

std::string EcalTBDigiProducer::m_EBdigiTempTag
private

Definition at line 41 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer().

◆ m_ecalTBInfoLabel

std::string EcalTBDigiProducer::m_ecalTBInfoLabel
private

Definition at line 39 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and initializeEvent().

◆ m_eeDigis

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

Definition at line 54 of file EcalTBDigiProducer.h.

Referenced by finalizeEvent().

◆ m_TDCproduct

std::unique_ptr<EcalTBTDCRawInfo> EcalTBDigiProducer::m_TDCproduct
mutableprivate

Definition at line 55 of file EcalTBDigiProducer.h.

Referenced by finalizeEvent(), and initializeEvent().

◆ m_tdcRanges

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

Definition at line 48 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and fillTBTDCRawInfo().

◆ m_theTBReadout

EcalTBReadout* EcalTBDigiProducer::m_theTBReadout
private

Definition at line 37 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), finalizeEvent(), and initializeEvent().

◆ m_theTTmap

const EcalTrigTowerConstituentsMap EcalTBDigiProducer::m_theTTmap
private

Definition at line 36 of file EcalTBDigiProducer.h.

Referenced by finalizeEvent().

◆ m_thisPhaseShift

double EcalTBDigiProducer::m_thisPhaseShift
private

◆ m_tunePhaseShift

double EcalTBDigiProducer::m_tunePhaseShift
private

Definition at line 51 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and setPhaseShift().

◆ m_use2004OffsetConvention

bool EcalTBDigiProducer::m_use2004OffsetConvention
private

Definition at line 49 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and setPhaseShift().

PEcalTBInfo::phaseShift
double phaseShift() const
Definition: PEcalTBInfo.h:37
diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMin
std::vector< double > tdcMin
Definition: EcalTBTDCRecInfoAlgo.h:16
ecalSimParameterMap_cff.syncPhase
syncPhase
Definition: ecalSimParameterMap_cff.py:11
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EcalDigiProducer::m_EEResponse
std::unique_ptr< EEHitResponse > m_EEResponse
Definition: EcalDigiProducer.h:121
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalTBDigiProducer::m_theTBReadout
EcalTBReadout * m_theTBReadout
Definition: EcalTBDigiProducer.h:37
EcalTBReadout::performReadout
void performReadout(edm::Event &event, const EcalTrigTowerConstituentsMap &theTTmap, const EBDigiCollection &input, EBDigiCollection &output)
master function to be called once per event
Definition: EcalTBReadout.cc:150
EcalDigiProducer::EcalDigiProducer
EcalDigiProducer(const edm::ParameterSet &params, edm::ProducesCollector, edm::ConsumesCollector &iC)
Definition: EcalDigiProducer.cc:55
edm::Handle
Definition: AssociativeIterator.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
EcalTBDigiProducer::m_ebDigis
std::unique_ptr< EBDigiCollection > m_ebDigis
Definition: EcalTBDigiProducer.h:53
DetId
Definition: DetId.h:17
Ecal2004TBTDCRanges_cff.tdcMin
tdcMin
Definition: Ecal2004TBTDCRanges_cff.py:3
EcalDigiProducer::finalizeEvent
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
Definition: EcalDigiProducer.cc:371
EcalTBDigiProducer::m_tdcRanges
std::vector< EcalTBTDCRecInfoAlgo::EcalTBTDCRanges > m_tdcRanges
Definition: EcalTBDigiProducer.h:48
CaloSimParameters
Main class for Parameters in different subdetectors.
Definition: CaloSimParameters.h:14
edm::ESHandle< CaloGeometry >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
EcalTBDigiProducer::m_doReadout
bool m_doReadout
Definition: EcalTBDigiProducer.h:46
EcalTBDigiProducer::fillTBTDCRawInfo
void fillTBTDCRawInfo(EcalTBTDCRawInfo &theTBTDCRawInfo)
Definition: EcalTBDigiProducer.cc:126
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
EcalDigiProducer::m_EBResponse
std::unique_ptr< EBHitResponse > m_EBResponse
Definition: EcalDigiProducer.h:120
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTBTDCSample
Definition: EcalTBTDCSample.h:14
EcalDigiProducer::m_ParameterMap
std::unique_ptr< const EcalSimParameterMap > m_ParameterMap
Definition: EcalDigiProducer.h:111
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMax
std::vector< double > tdcMax
Definition: EcalTBTDCRecInfoAlgo.h:17
EcalTBTDCRawInfo::setSample
void setSample(unsigned int i, const EcalTBTDCSample &sam)
Definition: EcalTBTDCRawInfo.h:31
EcalTBDigiProducer::m_doPhaseShift
bool m_doPhaseShift
Definition: EcalTBDigiProducer.h:43
EBDigiCollection
Definition: EcalDigiCollections.h:32
EcalTBDigiProducer::m_TDCproduct
std::unique_ptr< EcalTBTDCRawInfo > m_TDCproduct
Definition: EcalTBDigiProducer.h:55
PEcalTBInfo
Definition: PEcalTBInfo.h:18
EcalTBTDCRecInfoAlgo::EcalTBTDCRanges
Definition: EcalTBTDCRecInfoAlgo.h:14
EcalTBTDCRawInfo
Definition: EcalTBTDCRawInfo.h:13
EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::runRanges
std::pair< int, int > runRanges
Definition: EcalTBTDCRecInfoAlgo.h:15
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
Ecal2004TBTDCRanges_cff.tdcMax
tdcMax
Definition: Ecal2004TBTDCRanges_cff.py:4
DetId::Ecal
Definition: DetId.h:27
get
#define get
EcalDigiProducer::initializeEvent
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
Definition: EcalDigiProducer.cc:269
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
EcalTBDigiProducer::m_EBdigiFinalTag
std::string m_EBdigiFinalTag
Definition: EcalTBDigiProducer.h:40
EcalTBReadout
Definition: EcalTBReadout.h:19
eostools.move
def move(src, dest)
Definition: eostools.py:511
EcalTBDigiProducer::m_eeDigis
std::unique_ptr< EEDigiCollection > m_eeDigis
Definition: EcalTBDigiProducer.h:54
CaloGeometry::getValidDetIds
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
EcalTBDigiProducer::m_tunePhaseShift
double m_tunePhaseShift
Definition: EcalTBDigiProducer.h:51
EcalTBDigiProducer::m_ecalTBInfoLabel
std::string m_ecalTBInfoLabel
Definition: EcalTBDigiProducer.h:39
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
EcalTBDigiProducer::m_theTTmap
const EcalTrigTowerConstituentsMap m_theTTmap
Definition: EcalTBDigiProducer.h:36
EcalTBDigiProducer::m_EBdigiTempTag
std::string m_EBdigiTempTag
Definition: EcalTBDigiProducer.h:41
EcalTBDigiProducer::m_use2004OffsetConvention
bool m_use2004OffsetConvention
Definition: EcalTBDigiProducer.h:49
event
Definition: event.py:1
Parameters
vector< ParameterSet > Parameters
Definition: HLTMuonPlotter.cc:25
EcalTBDigiProducer::m_thisPhaseShift
double m_thisPhaseShift
Definition: EcalTBDigiProducer.h:44
EcalTBReadout::setDetIds
void setDetIds(const std::vector< DetId > &detIds)
tell the readout which cells exist
Definition: EcalTBReadout.h:25
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
EcalTBDigiProducer::setPhaseShift
void setPhaseShift(const DetId &detId)
Definition: EcalTBDigiProducer.cc:107