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::ProducerBase &mixMod, 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::ProducerBase &mixMod, edm::ConsumesCollector &iC)
 
 EcalDigiProducer (const edm::ParameterSet &params, 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 ( const edm::ParameterSet params,
edm::ProducerBase mixMod,
edm::ConsumesCollector iC 
)

Definition at line 15 of file EcalTBDigiProducer.cc.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), instance, m_doPhaseShift, m_doReadout, m_EBdigiFinalTag, m_EBdigiTempTag, m_ecalTBInfoLabel, m_tdcRanges, m_theTBReadout, m_thisPhaseShift, m_tunePhaseShift, m_use2004OffsetConvention, eostools::move(), edm::ProductRegistryHelper::produces(), diffTwoXMLs::ranges, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::runRanges, AlCaHLTBitMon_QueryRunRegistry::string, ecalSimParameterMap_cff::syncPhase, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMax, and EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMin.

18  : EcalDigiProducer(params, mixMod, iC) {
19  std::string const instance("simEcalUnsuppressedDigis");
20  m_EBdigiFinalTag = params.getParameter<std::string>("EBdigiFinalCollection");
21  m_EBdigiTempTag = params.getParameter<std::string>("EBdigiCollection");
22 
23  mixMod.produces<EBDigiCollection>(instance + m_EBdigiFinalTag); // after selective readout
25 
26  const bool syncPhase(params.getParameter<bool>("syncPhase"));
27 
28  // possible phase shift for asynchronous trigger (e.g. test-beam)
29 
31  m_thisPhaseShift = 1.;
32 
33  typedef std::vector<edm::ParameterSet> Parameters;
34  Parameters ranges = params.getParameter<Parameters>("tdcRanges");
35  for (Parameters::iterator itRanges = ranges.begin(); itRanges != ranges.end(); ++itRanges) {
37  aRange.runRanges.first = itRanges->getParameter<int>("startRun");
38  aRange.runRanges.second = itRanges->getParameter<int>("endRun");
39  aRange.tdcMin = itRanges->getParameter<std::vector<double>>("tdcMin");
40  aRange.tdcMax = itRanges->getParameter<std::vector<double>>("tdcMax");
41  m_tdcRanges.push_back(std::move(aRange));
42  }
43 
44  m_use2004OffsetConvention = params.getUntrackedParameter<bool>("use2004OffsetConvention", false);
45 
46  m_ecalTBInfoLabel = params.getUntrackedParameter<std::string>("EcalTBInfoLabel", "SimEcalTBG4Object");
47 
48  m_doReadout = params.getParameter<bool>("doReadout");
49 
50  m_theTBReadout = new EcalTBReadout(m_ecalTBInfoLabel);
51 
52  m_tunePhaseShift = params.getParameter<double>("tunePhaseShift");
53 
54  if (m_doPhaseShift) {
56  edm::InputTag(params.getUntrackedParameter<std::string>("EcalTBInfoLabel", "SimEcalTBG4Object")));
57  }
58 }
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EcalDigiProducer(const edm::ParameterSet &params, edm::ProducerBase &mixMod, edm::ConsumesCollector &iC)
static PFTauRenderPlugin instance
std::vector< EcalTBTDCRecInfoAlgo::EcalTBTDCRanges > m_tdcRanges
vector< ParameterSet > Parameters
std::string m_EBdigiFinalTag
string ranges
Definition: diffTwoXMLs.py:79
EcalTBReadout * m_theTBReadout
std::string m_EBdigiTempTag
std::string m_ecalTBInfoLabel
def move(src, dest)
Definition: eostools.py:511
EcalTBDigiProducer::~EcalTBDigiProducer ( )
override

Definition at line 60 of file EcalTBDigiProducer.cc.

60 {}

Member Function Documentation

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

Reimplemented from EcalDigiProducer.

Definition at line 141 of file EcalTBDigiProducer.cc.

References m_ebDigis.

141  {
142  m_ebDigis.reset(new EBDigiCollection);
143  *m_ebDigis = *ebDigiPtr;
144 }
std::unique_ptr< EBDigiCollection > m_ebDigis
void EcalTBDigiProducer::cacheEEDigis ( const EEDigiCollection eeDigiPtr) const
overrideprivatevirtual

Reimplemented from EcalDigiProducer.

Definition at line 146 of file EcalTBDigiProducer.cc.

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

146  {
147  std::cout << "===**** EcalTBDigiProducer: number of endcap digis = " << eeDigiPtr->size() << std::endl;
148 }
void EcalTBDigiProducer::fillTBTDCRawInfo ( EcalTBTDCRawInfo theTBTDCRawInfo)
private

Definition at line 127 of file EcalTBDigiProducer.cc.

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

Referenced by initializeEvent().

127  {
128  const unsigned int thisChannel(1);
129 
130  const unsigned int thisCount((unsigned int)(m_thisPhaseShift * (m_tdcRanges[0].tdcMax[0] - m_tdcRanges[0].tdcMin[0]) +
131  m_tdcRanges[0].tdcMin[0]));
132 
133  EcalTBTDCSample theTBTDCSample(thisChannel, thisCount);
134 
135  const unsigned int sampleIndex(0);
136  theTBTDCRawInfo.setSample(sampleIndex, theTBTDCSample);
137 
138  LogDebug("EcalDigi") << theTBTDCSample << "\n" << theTBTDCRawInfo;
139 }
#define LogDebug(id)
std::vector< EcalTBTDCRecInfoAlgo::EcalTBTDCRanges > m_tdcRanges
void setSample(unsigned int i, const EcalTBTDCSample &sam)
void EcalTBDigiProducer::finalizeEvent ( edm::Event ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from EcalDigiProducer.

Definition at line 84 of file EcalTBDigiProducer.cc.

References gather_cfg::cout, 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.

84  {
85  m_ebDigis.reset(new EBDigiCollection);
86 
88 
89  const EBDigiCollection *barrelResult(&*m_ebDigis);
90 
91  std::unique_ptr<EBDigiCollection> barrelReadout(new EBDigiCollection());
92  if (m_doReadout) {
93  m_theTBReadout->performReadout(event, m_theTTmap, *barrelResult, *barrelReadout);
94  } else {
95  *barrelReadout = *barrelResult;
96  }
97 
98  std::cout << "===**** EcalTBDigiProducer: number of barrel digis = " << barrelReadout->size() << std::endl;
99 
100  std::string const instance("simEcalUnsuppressedDigis");
101  event.put(std::move(barrelReadout), instance + m_EBdigiFinalTag);
102  event.put(std::move(m_TDCproduct), instance);
103 
104  m_ebDigis.reset(); // release memory
105  m_eeDigis.reset(); // release memory
106 }
const EcalTrigTowerConstituentsMap m_theTTmap
std::unique_ptr< EEDigiCollection > m_eeDigis
static PFTauRenderPlugin instance
std::unique_ptr< EBDigiCollection > m_ebDigis
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
EcalTBReadout * m_theTBReadout
std::unique_ptr< EcalTBTDCRawInfo > m_TDCproduct
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1
void EcalTBDigiProducer::initializeEvent ( edm::Event const &  event,
edm::EventSetup const &  eventSetup 
)
overridevirtual

Reimplemented from EcalDigiProducer.

Definition at line 62 of file EcalTBDigiProducer.cc.

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

62  {
63  std::cout << "====****Entering EcalTBDigiProducer produce()" << std::endl;
65  eventSetup.get<CaloGeometryRecord>().get(hGeometry);
66  const std::vector<DetId> &theBarrelDets(hGeometry->getValidDetIds(DetId::Ecal, EcalBarrel));
67 
68  m_theTBReadout->setDetIds(theBarrelDets);
69 
70  m_TDCproduct.reset(new EcalTBTDCRawInfo(1));
71  if (m_doPhaseShift) {
72  edm::Handle<PEcalTBInfo> theEcalTBInfo;
73  event.getByLabel(m_ecalTBInfoLabel, theEcalTBInfo);
74  m_thisPhaseShift = theEcalTBInfo->phaseShift();
75 
76  DetId detId(DetId::Ecal, 1);
77  setPhaseShift(detId);
78 
79  fillTBTDCRawInfo(*m_TDCproduct); // fill the TDC info in the event
80  }
82 }
void fillTBTDCRawInfo(EcalTBTDCRawInfo &theTBTDCRawInfo)
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
void setPhaseShift(const DetId &detId)
void setDetIds(const std::vector< DetId > &detIds)
tell the readout which cells exist
Definition: EcalTBReadout.h:25
Definition: DetId.h:18
EcalTBReadout * m_theTBReadout
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
double phaseShift() const
Definition: PEcalTBInfo.h:37
std::unique_ptr< EcalTBTDCRawInfo > m_TDCproduct
std::string m_ecalTBInfoLabel
Definition: event.py:1
void EcalTBDigiProducer::setPhaseShift ( const DetId detId)
private

Definition at line 108 of file EcalTBDigiProducer.cc.

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

Referenced by initializeEvent().

108  {
109  const CaloSimParameters &parameters(EcalDigiProducer::m_ParameterMap->simParameters(detId));
110 
111  if (!parameters.syncPhase()) {
112  const int myDet(detId.subdetId());
113 
114  LogDebug("EcalDigi") << "Setting the phase shift " << m_thisPhaseShift << " and the offset " << m_tunePhaseShift
115  << " for the subdetector " << myDet;
116 
117  if (myDet == 1) {
118  double passPhaseShift(m_thisPhaseShift + m_tunePhaseShift);
120  passPhaseShift = 1. - passPhaseShift;
121  EcalDigiProducer::m_EBResponse->setPhaseShift(passPhaseShift);
122  EcalDigiProducer::m_EEResponse->setPhaseShift(passPhaseShift);
123  }
124  }
125 }
#define LogDebug(id)
Main class for Parameters in different subdetectors.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::unique_ptr< EEHitResponse > m_EEResponse
std::unique_ptr< EBHitResponse > m_EBResponse
std::unique_ptr< const EcalSimParameterMap > m_ParameterMap

Member Data Documentation

bool EcalTBDigiProducer::m_doPhaseShift
private

Definition at line 43 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and initializeEvent().

bool EcalTBDigiProducer::m_doReadout
private

Definition at line 46 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and finalizeEvent().

std::string EcalTBDigiProducer::m_EBdigiFinalTag
private

Definition at line 40 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and finalizeEvent().

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

Definition at line 53 of file EcalTBDigiProducer.h.

Referenced by cacheEBDigis(), and finalizeEvent().

std::string EcalTBDigiProducer::m_EBdigiTempTag
private

Definition at line 41 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer().

std::string EcalTBDigiProducer::m_ecalTBInfoLabel
private

Definition at line 39 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and initializeEvent().

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

Definition at line 54 of file EcalTBDigiProducer.h.

Referenced by finalizeEvent().

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

Definition at line 55 of file EcalTBDigiProducer.h.

Referenced by finalizeEvent(), and initializeEvent().

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

Definition at line 48 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and fillTBTDCRawInfo().

EcalTBReadout* EcalTBDigiProducer::m_theTBReadout
private

Definition at line 37 of file EcalTBDigiProducer.h.

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

const EcalTrigTowerConstituentsMap EcalTBDigiProducer::m_theTTmap
private

Definition at line 36 of file EcalTBDigiProducer.h.

Referenced by finalizeEvent().

double EcalTBDigiProducer::m_thisPhaseShift
private
double EcalTBDigiProducer::m_tunePhaseShift
private

Definition at line 51 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and setPhaseShift().

bool EcalTBDigiProducer::m_use2004OffsetConvention
private

Definition at line 49 of file EcalTBDigiProducer.h.

Referenced by EcalTBDigiProducer(), and setPhaseShift().