CMS 3D CMS Logo

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

#include <FCDTask.h>

Inheritance diagram for FCDTask:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

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 &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Public Attributes

tuple fcd_channels
 
list fcd_channels_tuple
 
tuple fcdTask
 

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

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
 
edm::ESGetToken< HcalDbService,
HcalDbRecord
hcalDbServiceToken_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 

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(), mps_fire::i, and HLT_FULL_cff::InputTag.

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

Definition at line 24 of file FCDTask.h.

24 {}

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 72 of file FCDTask.cc.

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

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

Implements DQMEDAnalyzer.

Definition at line 26 of file FCDTask.cc.

References _cADC, _cADC_vs_TS, _channels, _cTDC, _cTDCTime, _ehashmap, _emap, _fcd_eids, HcalElectronicsMap::allPrecisionId(), dqm::implementation::IBooker::book1DD(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), HcalElectronicsId::crateId(), runTauDisplay::eid, hcaldqm::electronicsmap::fD2EHashMap, HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), edm::EventSetup::getHandle(), hcalDbServiceToken_, HcalGenericDetId::HcalGenZDC, hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), dqm::implementation::NavigatorBase::setCurrentFolder(), HcalElectronicsId::slot(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::impl::to_string().

26  {
27  edm::ESHandle<HcalDbService> dbService = es.getHandle(hcalDbServiceToken_);
28  _emap = dbService->getHcalMapping();
30 
31  ib.cd();
32 
33  //book histos per channel
34  std::string histoname;
35  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
36  for (auto& it_gid : gids) {
37  if (it_gid.genericSubdet() != HcalGenericDetId::HcalGenZDC) {
38  continue;
39  }
41  for (auto& it_channel : _channels) {
42  if ((eid.crateId() == it_channel.crate) && (eid.slot() == it_channel.slot) &&
43  (eid.fiberIndex() == it_channel.fiber) && (eid.fiberChanId() == it_channel.fiberChannel)) {
44  _fcd_eids.push_back(eid);
45  }
46  }
47  }
48  for (auto& it_eid : _fcd_eids) {
49  // EM Pos
50  histoname = std::to_string(it_eid.crateId()) + "-" + std::to_string(it_eid.slot()) + "-" +
51  std::to_string(it_eid.fiberIndex()) + "-" + std::to_string(it_eid.fiberChanId());
52  ib.setCurrentFolder("Hcal/FCDTask/ADC");
53  _cADC[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
54  _cADC[it_eid]->setAxisTitle("ADC", 1);
55  _cADC[it_eid]->setAxisTitle("N", 2);
56 
57  ib.setCurrentFolder("Hcal/FCDTask/ADC_vs_TS"),
58  _cADC_vs_TS[it_eid] = ib.book2D(histoname.c_str(), histoname.c_str(), 10, 0, 10, 64, 0, 256);
59  _cADC_vs_TS[it_eid]->setAxisTitle("TS", 1);
60  _cADC_vs_TS[it_eid]->setAxisTitle("ADC", 2);
61 
62  ib.setCurrentFolder("Hcal/FCDTask/TDCTime");
63  _cTDCTime[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 500, 0., 250.);
64  _cTDCTime[it_eid]->setAxisTitle("TDC time [ns]", 1);
65 
66  ib.setCurrentFolder("Hcal/FCDTask/TDC");
67  _cTDC[it_eid] = ib.book1DD(histoname.c_str(), histoname.c_str(), 64, -0.5, 63.5);
68  _cTDC[it_eid]->setAxisTitle("TDC", 1);
69  }
70 }
std::map< HcalElectronicsId, MonitorElement * > _cADC
Definition: FCDTask.h:37
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: FCDTask.h:34
std::string to_string(const V &value)
Definition: OMSAccess.h:71
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:155
std::vector< HcalElectronicsId > _fcd_eids
Definition: FCDTask.h:42
std::map< HcalElectronicsId, MonitorElement * > _cTDCTime
Definition: FCDTask.h:40
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...
std::vector< FCDChannel > _channels
Definition: FCDTask.h:43
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
std::map< HcalElectronicsId, MonitorElement * > _cADC_vs_TS
Definition: FCDTask.h:38
constexpr int slot() const
get the htr or uHTR slot
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
HcalElectronicsMap const * _emap
Definition: FCDTask.h:44
std::map< HcalElectronicsId, MonitorElement * > _cTDC
Definition: FCDTask.h:39
Readout chain identification for Hcal.
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: FCDTask.h:45

Member Data Documentation

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

Definition at line 37 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 38 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 43 of file FCDTask.h.

Referenced by bookHistograms(), and FCDTask().

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

Definition at line 39 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 40 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 45 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

HcalElectronicsMap const* FCDTask::_emap
protected

Definition at line 44 of file FCDTask.h.

Referenced by bookHistograms().

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

Definition at line 42 of file FCDTask.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag FCDTask::_tagQIE10
protected

Definition at line 32 of file FCDTask.h.

Referenced by analyze(), and FCDTask().

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

Definition at line 33 of file FCDTask.h.

Referenced by analyze(), and FCDTask().

tuple FCDTask.fcd_channels
Initial value:
1 = cms.PSet(
2  crate = cms.untracked.vint32(),
3  slot = cms.untracked.vint32(),
4  fiber = cms.untracked.vint32(),
5  fiber_channel = cms.untracked.vint32()
6 )

Definition at line 61 of file FCDTask.py.

list FCDTask.fcd_channels_tuple
Initial value:
1 = [
2  (-1, 5, -98),
3  (-1, 6, -98),
4  (-1, 7, -98),
5  (-1, 8, -98),
6  (-1, 9, -98),
7  (-1, 10, -98),
8  (-1, 11, -98),
9  (-1, 12, -98),
10  (-1, 13, -98),
11  (-1, 14, -98),
12  (-1, 15, -98),
13  (-1, 16, -98),
14  (-1, 17, -98),
15  (-1, 18, -98),
16  (-1, 19, -98),
17  (-1, 20, -98),
18  (-1, 21, -98),
19  (-1, 22, -98),
20  (-1, 23, -98),
21  (-1, 24, -98),
22  (-1, 25, -98),
23  (-1, 26, -98),
24  (-1, 27, -98),
25  (-1, 28, -98),
26 ]

Definition at line 6 of file FCDTask.py.

tuple FCDTask.fcdTask
Initial value:
2  "FCDTask",
3  # standard parameters
4  name = cms.untracked.string("FDCTask"),
5  debug = cms.untracked.int32(0),
6  runkeyVal = cms.untracked.int32(0),
7  runkeyName = cms.untracked.string("pp_run"),
8  ptype = cms.untracked.int32(0),
9  mtype = cms.untracked.bool(True),
10  subsystem = cms.untracked.string("Hcal"),
11 
12  # tags
13  tagFCDDigis = cms.untracked.InputTag('hcalDigis', 'ZDC'),
14 
15  fcdChannels = fcd_channels,
16 )

Definition at line 73 of file FCDTask.py.

edm::ESGetToken<HcalDbService, HcalDbRecord> FCDTask::hcalDbServiceToken_
protected

Definition at line 34 of file FCDTask.h.

Referenced by bookHistograms().