CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes
FCDTask Class Reference

#include <FCDTask.h>

Inheritance diagram for FCDTask:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  FCDChannel
 

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 FCDTask (edm::ParameterSet const &)
 
 ~FCDTask () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Protected Attributes

std::map< HcalElectronicsId, MonitorElement * > _cADC
 
std::map< HcalElectronicsId, MonitorElement * > _cADC_vs_TS
 
std::vector< FCDChannel_channels
 
std::map< HcalElectronicsId, MonitorElement * > _cTDC
 
std::map< HcalElectronicsId, MonitorElement * > _cTDCTime
 
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
 
HcalElectronicsMap const * _emap
 
std::vector< HcalElectronicsId_fcd_eids
 
edm::InputTag _tagQIE10
 
edm::EDGetTokenT< QIE10DigiCollection_tokQIE10
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 13 of file FCDTask.h.

Constructor & Destructor Documentation

FCDTask::FCDTask ( edm::ParameterSet const &  ps)

Definition at line 9 of file FCDTask.cc.

References _channels, _tagQIE10, _tokQIE10, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and mps_fire::i.

10 {
11  // tags
12  _tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10",
13  edm::InputTag("hcalDigis", "ZDC"));
14  _tokQIE10 = consumes<QIE10DigiCollection>(_tagQIE10);
15 
16  // channels
17  edm::ParameterSet channelPSet = ps.getParameter<edm::ParameterSet>("fcdChannels");
18  std::vector<int32_t> crates = channelPSet.getUntrackedParameter<std::vector<int32_t> >("crate");
19  std::vector<int32_t> slots = channelPSet.getUntrackedParameter<std::vector<int32_t> >("slot");
20  std::vector<int32_t> fibers = channelPSet.getUntrackedParameter<std::vector<int32_t> >("fiber");
21  std::vector<int32_t> fiberChannels = channelPSet.getUntrackedParameter<std::vector<int32_t> >("fiber_channel");
22  for (unsigned int i = 0; i < crates.size(); ++i) {
23  _channels.push_back({crates[i], slots[i], fibers[i], fiberChannels[i]});
24  }
25 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag _tagQIE10
Definition: FCDTask.h:34
std::vector< FCDChannel > _channels
Definition: FCDTask.h:44
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: FCDTask.h:35
FCDTask::~FCDTask ( )
inlineoverride

Definition at line 25 of file FCDTask.h.

References analyze(), and bookHistograms().

25 {}

Member Function Documentation

void FCDTask::analyze ( edm::Event const &  e,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 77 of file FCDTask.cc.

References _cADC, _cADC_vs_TS, _cTDC, _cTDCTime, _ehashmap, _fcd_eids, _tagQIE10, _tokQIE10, ecalMGPA::adc(), edm::DataFrameContainer::begin(), DEFINE_FWK_MODULE, QIE10DataFrame::detid(), runTauDisplay::eid, edm::DataFrameContainer::end(), spr::find(), edm::Event::getByToken(), mps_fire::i, edm::InputTag::instance(), edm::InputTag::label(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), and QIE10DataFrame::samples().

Referenced by ~FCDTask().

78 {
80  if (!e.getByToken(_tokQIE10, digis))
81  edm::LogError("Collection QIE10DigiCollection for ZDC isn't available"
82  + _tagQIE10.label() + " " + _tagQIE10.instance());
83 
84  for ( auto it = digis->begin(); it != digis->end(); it++ ) {
85  const QIE10DataFrame digi = static_cast<const QIE10DataFrame>(*it);
86  HcalGenericDetId const& gdid = digi.detid();
88  if (std::find(_fcd_eids.begin(), _fcd_eids.end(), eid) == _fcd_eids.end()) {
89  continue;
90  }
91 
92  for ( int i = 0; i < digi.samples(); i++ ) {
93  // iter over all samples
94  _cADC[eid]->Fill(digi[i].adc());
95  _cADC_vs_TS[eid]->Fill(i, digi[i].adc());
96  _cTDC[eid]->Fill(digi[i].le_tdc());
97  if (digi[i].le_tdc() <= 50.) {
98  double tdctime = 25. * i + 0.5 * digi[i].le_tdc();
99  _cTDCTime[eid]->Fill(tdctime);
100  }
101  }
102  }
103 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
std::map< HcalElectronicsId, MonitorElement * > _cADC
Definition: FCDTask.h:38
const_iterator begin() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< HcalElectronicsId > _fcd_eids
Definition: FCDTask.h:43
std::map< HcalElectronicsId, MonitorElement * > _cTDCTime
Definition: FCDTask.h:41
DetId detid() const
Get the detector id.
edm::InputTag _tagQIE10
Definition: FCDTask.h:34
std::map< HcalElectronicsId, MonitorElement * > _cADC_vs_TS
Definition: FCDTask.h:39
std::string const & label() const
Definition: InputTag.h:36
const_iterator end() const
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: FCDTask.h:35
std::map< HcalElectronicsId, MonitorElement * > _cTDC
Definition: FCDTask.h:40
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: FCDTask.h:46
void FCDTask::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 27 of file FCDTask.cc.

References _cADC, _cADC_vs_TS, _channels, _cTDC, _cTDCTime, _ehashmap, _emap, _fcd_eids, HcalElectronicsMap::allPrecisionId(), DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), HcalElectronicsId::crateId(), runTauDisplay::eid, hcaldqm::electronicsmap::fD2EHashMap, HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), edm::EventSetup::get(), HcalDbService::getHcalMapping(), HcalGenericDetId::HcalGenZDC, hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), DQMStore::IBooker::setCurrentFolder(), HcalElectronicsId::slot(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~FCDTask().

29 {
31  es.get<HcalDbRecord>().get(dbService);
32  _emap = dbService->getHcalMapping();
34 
35  ib.cd();
36 
37  //book histos per channel
38  std::string histoname;
39  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
40  for (auto& it_gid : gids) {
41  if (it_gid.genericSubdet() != HcalGenericDetId::HcalGenZDC) {
42  continue;
43  }
45  for (auto& it_channel : _channels) {
46  if ((eid.crateId() == it_channel.crate) && (eid.slot() == it_channel.slot) && (eid.fiberIndex() == it_channel.fiber) && (eid.fiberChanId() == it_channel.fiberChannel)) {
47  _fcd_eids.push_back(eid);
48  }
49  }
50  }
51  for (auto& it_eid : _fcd_eids) {
52  // EM Pos
53  histoname = std::to_string(it_eid.crateId()) + "-" + std::to_string(it_eid.slot()) + "-" + std::to_string(it_eid.fiberIndex()) + "-" + std::to_string(it_eid.fiberChanId());
54  ib.setCurrentFolder("Hcal/FCDTask/ADC");
55  _cADC[it_eid] = ib.book1D( histoname.c_str(), histoname.c_str(), 256, 0, 256);
56  _cADC[it_eid]->setAxisTitle("ADC", 1);
57  _cADC[it_eid]->setAxisTitle("N", 2);
58 
59  ib.setCurrentFolder("Hcal/FCDTask/ADC_vs_TS"),
60  _cADC_vs_TS[it_eid] = ib.book2D( histoname.c_str(), histoname.c_str(), 10, 0, 10, 64, 0, 256);
61  _cADC_vs_TS[it_eid]->setAxisTitle("TS", 1);
62  _cADC_vs_TS[it_eid]->setAxisTitle("ADC", 2);
63 
64  ib.setCurrentFolder("Hcal/FCDTask/TDCTime");
65  _cTDCTime[it_eid] = ib.book1D( histoname.c_str(), histoname.c_str(), 500, 0., 250.);
66  _cTDCTime[it_eid]->setAxisTitle("TDC time [ns]", 1);
67 
68 
69  ib.setCurrentFolder("Hcal/FCDTask/TDC");
70  _cTDC[it_eid] = ib.book1D( histoname.c_str(), histoname.c_str(), 64, -0.5, 63.5);
71  _cTDC[it_eid]->setAxisTitle("TDC", 1);
72 
73  }
74 }
std::map< HcalElectronicsId, MonitorElement * > _cADC
Definition: FCDTask.h:38
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
std::vector< HcalElectronicsId > _fcd_eids
Definition: FCDTask.h:43
std::map< HcalElectronicsId, MonitorElement * > _cTDCTime
Definition: FCDTask.h:41
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::vector< HcalGenericDetId > allPrecisionId() const
constexpr int crateId() const
get the readout VME crate number
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::vector< FCDChannel > _channels
Definition: FCDTask.h:44
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::map< HcalElectronicsId, MonitorElement * > _cADC_vs_TS
Definition: FCDTask.h:39
constexpr int slot() const
get the htr or uHTR slot
const HcalElectronicsMap * getHcalMapping() const
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
HcalElectronicsMap const * _emap
Definition: FCDTask.h:45
std::map< HcalElectronicsId, MonitorElement * > _cTDC
Definition: FCDTask.h:40
Readout chain identification for Hcal.
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: FCDTask.h:46

Member Data Documentation

std::map<HcalElectronicsId, MonitorElement*> FCDTask::_cADC
protected

Definition at line 38 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

std::map<HcalElectronicsId, MonitorElement*> FCDTask::_cADC_vs_TS
protected

Definition at line 39 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

std::vector<FCDChannel> FCDTask::_channels
protected

Definition at line 44 of file FCDTask.h.

Referenced by bookHistograms(), and FCDTask().

std::map<HcalElectronicsId, MonitorElement*> FCDTask::_cTDC
protected

Definition at line 40 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

std::map<HcalElectronicsId, MonitorElement*> FCDTask::_cTDCTime
protected

Definition at line 41 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

hcaldqm::electronicsmap::ElectronicsMap FCDTask::_ehashmap
protected

Definition at line 46 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

HcalElectronicsMap const* FCDTask::_emap
protected

Definition at line 45 of file FCDTask.h.

Referenced by bookHistograms().

std::vector<HcalElectronicsId> FCDTask::_fcd_eids
protected

Definition at line 43 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag FCDTask::_tagQIE10
protected

Definition at line 34 of file FCDTask.h.

Referenced by analyze(), and FCDTask().

edm::EDGetTokenT<QIE10DigiCollection> FCDTask::_tokQIE10
protected

Definition at line 35 of file FCDTask.h.

Referenced by analyze(), and FCDTask().