CMS 3D CMS Logo

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

#include <Demo/L1TCaloLayer1Summary/plugins/L1TCaloLayer1Summary.cc>

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

Public Member Functions

 L1TCaloLayer1Summary (const edm::ParameterSet &)
 
- 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< l1t::CICADABxCollectioncaloLayer1CICADAScoreToken_
 
edm::EDGetTokenT< L1CaloRegionCollectioncaloLayer1RegionsToken_
 
edm::EDGetTokenT< FEDRawDataCollectionfedRawData_
 
edm::EDGetTokenT< l1t::CICADABxCollectiongtCICADAScoreToken_
 
std::string histFolder_
 
dqm::reco::MonitorElementhistoCaloLayer1CICADAScore
 
dqm::reco::MonitorElementhistoCaloMinusGt
 
dqm::reco::MonitorElementhistoCaloMinusSim
 
dqm::reco::MonitorElementhistoCaloMinusSimRegions
 
dqm::reco::MonitorElementhistoCaloRegions
 
dqm::reco::MonitorElementhistoGtCICADAScore
 
dqm::reco::MonitorElementhistoSimCICADAScore
 
dqm::reco::MonitorElementhistoSimRegions
 
dqm::reco::MonitorElementhistoSlot7MinusDaqBxid
 
edm::EDGetTokenT< l1t::CICADABxCollectionsimCICADAScoreToken_
 
edm::EDGetTokenT< L1CaloRegionCollectionsimRegionsToken_
 

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
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: DQM Analyzer for CaloLayer1 regions and CICADAScore

Implementation: This module uses emulator sequence for CaloLayer1.

Definition at line 45 of file L1TCaloLayer1Summary.h.

Constructor & Destructor Documentation

◆ L1TCaloLayer1Summary()

L1TCaloLayer1Summary::L1TCaloLayer1Summary ( const edm::ParameterSet iConfig)
explicit

Definition at line 3 of file L1TCaloLayer1Summary.cc.

5  consumes<l1t::CICADABxCollection>(iConfig.getParameter<edm::InputTag>("caloLayer1CICADAScore"))),
6  gtCICADAScoreToken_(consumes<l1t::CICADABxCollection>(iConfig.getParameter<edm::InputTag>("gtCICADAScore"))),
7  simCICADAScoreToken_(consumes<l1t::CICADABxCollection>(iConfig.getParameter<edm::InputTag>("simCICADAScore"))),
9  consumes<L1CaloRegionCollection>(iConfig.getParameter<edm::InputTag>("caloLayer1Regions"))),
10  simRegionsToken_(consumes<L1CaloRegionCollection>(iConfig.getParameter<edm::InputTag>("simRegions"))),
11  fedRawData_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("fedRawDataLabel"))),
12  histFolder_(iConfig.getParameter<std::string>("histFolder")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< FEDRawDataCollection > fedRawData_
edm::EDGetTokenT< L1CaloRegionCollection > simRegionsToken_
edm::EDGetTokenT< l1t::CICADABxCollection > gtCICADAScoreToken_
edm::EDGetTokenT< L1CaloRegionCollection > caloLayer1RegionsToken_
edm::EDGetTokenT< l1t::CICADABxCollection > caloLayer1CICADAScoreToken_
edm::EDGetTokenT< l1t::CICADABxCollection > simCICADAScoreToken_

Member Function Documentation

◆ analyze()

void L1TCaloLayer1Summary::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 15 of file L1TCaloLayer1Summary.cc.

References UCTDAQRawData::amcPayload(), UCTDAQRawData::BXID(), caloLayer1CICADAScoreToken_, L1TCaloLayer1Summary_cff::caloLayer1Regions, caloLayer1RegionsToken_, L1CaloRegion::et(), FEDRawDataCollection::FEDData(), l1t_dqm_sourceclient-live_cfg::fedRawData, fedRawData_, dqm::impl::MonitorElement::Fill(), L1CaloRegion::gctEta(), L1CaloRegion::gctPhi(), gtCICADAScoreToken_, histoCaloLayer1CICADAScore, histoCaloMinusGt, histoCaloMinusSim, histoCaloMinusSimRegions, histoCaloRegions, histoGtCICADAScore, histoSimCICADAScore, histoSimRegions, histoSlot7MinusDaqBxid, mps_fire::i, l1tPhase2CaloJetEmulator_cfi::iEta, iEvent, edm::HandleBase::isValid(), dqmiolumiharvest::j, dqmdumpme::k, FEDNumbering::MAXRCTFEDID, FEDNumbering::MINRCTFEDID, UCTDAQRawData::nAMCs(), simCICADAScoreToken_, L1TCaloLayer1Summary_cfi::simRegions, and simRegionsToken_.

15  {
16  edm::Handle<FEDRawDataCollection> fedRawDataCollection;
17  iEvent.getByToken(fedRawData_, fedRawDataCollection);
18  if (fedRawDataCollection.isValid()) {
19  for (int iFed = FEDNumbering::MINRCTFEDID + 4; iFed < FEDNumbering::MAXRCTFEDID; iFed += 2) {
20  const FEDRawData& fedRawData = fedRawDataCollection->FEDData(iFed);
21  if (fedRawData.size() == 0) {
22  continue;
23  }
24  const uint64_t* fedRawDataArray = (const uint64_t*)fedRawData.data();
25  UCTDAQRawData daqData(fedRawDataArray);
26 
27  if (daqData.nAMCs() == 7) {
28  UCTAMCRawData amcSlot7(daqData.amcPayload(3));
29  if (amcSlot7.amcNo() == 7) {
30  histoSlot7MinusDaqBxid->Fill(amcSlot7.BXID() - daqData.BXID());
31  }
32  }
33  }
34  }
35 
38  int nRegions = caloLayer1Regions.size();
39 
40  unsigned int maxEtaIdx = 0;
41  for (int iRegion = 0; iRegion < nRegions; iRegion++) {
42  if (maxEtaIdx < caloLayer1Regions[iRegion].gctEta()) {
43  maxEtaIdx = caloLayer1Regions[iRegion].gctEta();
44  }
45  }
46  int matrixSize = maxEtaIdx + 1;
47 
48  bool foundMatrix[2][matrixSize][matrixSize];
49  int etMatrix[2][matrixSize][matrixSize];
50  for (int i = 0; i < 2; i++) {
51  for (int j = 0; j < matrixSize; j++) {
52  for (int k = 0; k < matrixSize; k++) {
53  foundMatrix[i][j][k] = false;
54  etMatrix[i][j][k] = 0;
55  }
56  }
57  }
58 
59  for (int iRegion = 0; iRegion < nRegions; iRegion++) {
60  L1CaloRegion cRegion = caloLayer1Regions[iRegion];
61  L1CaloRegion sRegion = simRegions[iRegion];
62 
63  foundMatrix[0][cRegion.gctEta()][cRegion.gctPhi()] = true;
64  etMatrix[0][cRegion.gctEta()][cRegion.gctPhi()] = cRegion.et();
65  foundMatrix[1][sRegion.gctEta()][sRegion.gctPhi()] = true;
66  etMatrix[1][sRegion.gctEta()][sRegion.gctPhi()] = sRegion.et();
67  }
68  int iRegion = 0;
69  for (int iEta = 0; iEta < matrixSize; iEta++) {
70  for (int iPhi = 0; iPhi < matrixSize; iPhi++) {
71  if (foundMatrix[0][iEta][iPhi] && foundMatrix[1][iEta][iPhi]) {
72  histoCaloRegions->Fill(iRegion, etMatrix[0][iEta][iPhi]);
73  histoSimRegions->Fill(iRegion, etMatrix[1][iEta][iPhi]);
74  histoCaloMinusSimRegions->Fill(iRegion, etMatrix[0][iEta][iPhi] - etMatrix[1][iEta][iPhi]);
75  iRegion++;
76  }
77  }
78  }
79 
80  auto caloCICADAScores = iEvent.get(caloLayer1CICADAScoreToken_);
81  auto gtCICADAScores = iEvent.get(gtCICADAScoreToken_);
82  auto simCICADAScores = iEvent.get(simCICADAScoreToken_);
83 
84  if (caloCICADAScores.size() > 0) {
85  histoCaloLayer1CICADAScore->Fill(caloCICADAScores[0]);
86  if (gtCICADAScores.size() > 0) {
87  histoGtCICADAScore->Fill(gtCICADAScores.at(0, 0));
88  histoCaloMinusGt->Fill(caloCICADAScores[0] - gtCICADAScores.at(0, 0));
89  }
90  if (simCICADAScores.size() > 0) {
91  histoSimCICADAScore->Fill(simCICADAScores[0]);
92  histoCaloMinusSim->Fill(caloCICADAScores[0] - simCICADAScores[0]);
93  }
94  }
95 }
edm::EDGetTokenT< FEDRawDataCollection > fedRawData_
edm::EDGetTokenT< L1CaloRegionCollection > simRegionsToken_
dqm::reco::MonitorElement * histoGtCICADAScore
dqm::reco::MonitorElement * histoCaloMinusSim
edm::EDGetTokenT< l1t::CICADABxCollection > gtCICADAScoreToken_
void Fill(long long x)
edm::EDGetTokenT< L1CaloRegionCollection > caloLayer1RegionsToken_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< l1t::CICADABxCollection > caloLayer1CICADAScoreToken_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
dqm::reco::MonitorElement * histoSimCICADAScore
edm::EDGetTokenT< l1t::CICADABxCollection > simCICADAScoreToken_
dqm::reco::MonitorElement * histoCaloLayer1CICADAScore
unsigned gctEta() const
get GCT eta index
Definition: L1CaloRegion.h:153
unsigned long long uint64_t
Definition: Time.h:13
unsigned et() const
get Et
Definition: L1CaloRegion.h:90
dqm::reco::MonitorElement * histoCaloMinusSimRegions
dqm::reco::MonitorElement * histoCaloMinusGt
dqm::reco::MonitorElement * histoCaloRegions
bool isValid() const
Definition: HandleBase.h:70
dqm::reco::MonitorElement * histoSimRegions
unsigned gctPhi() const
get GCT phi index
Definition: L1CaloRegion.h:156
A calorimeter trigger region (sum of 4x4 trigger towers)
Definition: L1CaloRegion.h:21
std::vector< L1CaloRegion > L1CaloRegionCollection
dqm::reco::MonitorElement * histoSlot7MinusDaqBxid

◆ bookHistograms()

void L1TCaloLayer1Summary::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 97 of file L1TCaloLayer1Summary.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), histFolder_, histoCaloLayer1CICADAScore, histoCaloMinusGt, histoCaloMinusSim, histoCaloMinusSimRegions, histoCaloRegions, histoGtCICADAScore, histoSimCICADAScore, histoSimRegions, histoSlot7MinusDaqBxid, and dqm::implementation::NavigatorBase::setCurrentFolder().

97  {
99  histoSlot7MinusDaqBxid = ibooker.book1D("slot7BXID", "Slot 7- DAQ BXID", 50, -20, 20);
100 
101  ibooker.setCurrentFolder(histFolder_ + "/CICADAScore");
102  histoCaloLayer1CICADAScore = ibooker.book1D("caloLayer1CICADAScore", "CaloLayer1 CICADAScore", 50, 0, 200);
103  histoGtCICADAScore = ibooker.book1D("gtCICADAScore", "GT CICADAScore at BX0", 50, 0, 200);
104  histoCaloMinusGt = ibooker.book1D("caloMinusGtCICADAScore", "CaloLayer1 - GT CICADAScore at BX0", 50, -50, 50);
106  ibooker.book1D("simCaloLayer1CICADAScore", "simCaloLayer1 CICADAScore (input: DAQ regions)", 50, 0, 200);
107  histoCaloMinusSim = ibooker.book1D(
108  "caloMinusSimCICADAScore", "CaloLayer1 - simCaloLayer1 (input: DAQ regions) CICADAScore", 50, -50, 50);
109 
110  ibooker.setCurrentFolder(histFolder_ + "/Regions");
112  ibooker.book2D("caloMinusSumRegions",
113  "CaloLayer1 - simCaloLayer1 (input: DAQ trigger primatives) Regions;Region;ET Difference",
114  252,
115  -0.5,
116  252.5,
117  100,
118  -400,
119  400);
120  histoCaloRegions = ibooker.book2D("caloLayer1Regions", "CaloLayer1 Regions;Region;ET", 252, -0.5, 252.5, 100, 0, 800);
121  histoSimRegions = ibooker.book2D("simCaloLayer1Regions",
122  "simCaloLayer1 Regions (input: DAQ trigger primatives);Region;ET",
123  252,
124  -0.5,
125  252.5,
126  100,
127  0,
128  800);
129 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
dqm::reco::MonitorElement * histoGtCICADAScore
dqm::reco::MonitorElement * histoCaloMinusSim
dqm::reco::MonitorElement * histoSimCICADAScore
dqm::reco::MonitorElement * histoCaloLayer1CICADAScore
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:221
dqm::reco::MonitorElement * histoCaloMinusSimRegions
dqm::reco::MonitorElement * histoCaloMinusGt
dqm::reco::MonitorElement * histoCaloRegions
dqm::reco::MonitorElement * histoSimRegions
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
dqm::reco::MonitorElement * histoSlot7MinusDaqBxid

◆ fillDescriptions()

void L1TCaloLayer1Summary::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 132 of file L1TCaloLayer1Summary.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

132  {
133  // l1tCaloLayer1Summary
135  desc.add<edm::InputTag>("caloLayer1CICADAScore", edm::InputTag("caloLayer1Digis", "CICADAScore"));
136  desc.add<edm::InputTag>("gtCICADAScore", edm::InputTag("gtTestcrateStage2Digis", "CICADAScore"));
137  desc.add<edm::InputTag>("simCICADAScore", edm::InputTag("simCaloStage2Layer1Summary", "CICADAScore"));
138  desc.add<edm::InputTag>("caloLayer1Regions", edm::InputTag("caloLayer1Digis"));
139  desc.add<edm::InputTag>("simRegions", edm::InputTag("simCaloStage2Layer1Digis"));
140  desc.add<edm::InputTag>("fedRawDataLabel", edm::InputTag("rawDataCollector"));
141  desc.add<std::string>("histFolder", "L1T/L1TCaloLayer1Summary");
142  descriptions.add("l1tCaloLayer1Summary", desc);
143 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ caloLayer1CICADAScoreToken_

edm::EDGetTokenT<l1t::CICADABxCollection> L1TCaloLayer1Summary::caloLayer1CICADAScoreToken_
private

Definition at line 56 of file L1TCaloLayer1Summary.h.

Referenced by analyze().

◆ caloLayer1RegionsToken_

edm::EDGetTokenT<L1CaloRegionCollection> L1TCaloLayer1Summary::caloLayer1RegionsToken_
private

Definition at line 59 of file L1TCaloLayer1Summary.h.

Referenced by analyze().

◆ fedRawData_

edm::EDGetTokenT<FEDRawDataCollection> L1TCaloLayer1Summary::fedRawData_
private

Definition at line 61 of file L1TCaloLayer1Summary.h.

Referenced by analyze().

◆ gtCICADAScoreToken_

edm::EDGetTokenT<l1t::CICADABxCollection> L1TCaloLayer1Summary::gtCICADAScoreToken_
private

Definition at line 57 of file L1TCaloLayer1Summary.h.

Referenced by analyze().

◆ histFolder_

std::string L1TCaloLayer1Summary::histFolder_
private

Definition at line 73 of file L1TCaloLayer1Summary.h.

Referenced by bookHistograms().

◆ histoCaloLayer1CICADAScore

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoCaloLayer1CICADAScore
private

Definition at line 63 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoCaloMinusGt

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoCaloMinusGt
private

Definition at line 67 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoCaloMinusSim

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoCaloMinusSim
private

Definition at line 66 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoCaloMinusSimRegions

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoCaloMinusSimRegions
private

Definition at line 71 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoCaloRegions

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoCaloRegions
private

Definition at line 69 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoGtCICADAScore

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoGtCICADAScore
private

Definition at line 64 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoSimCICADAScore

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoSimCICADAScore
private

Definition at line 65 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoSimRegions

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoSimRegions
private

Definition at line 70 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ histoSlot7MinusDaqBxid

dqm::reco::MonitorElement* L1TCaloLayer1Summary::histoSlot7MinusDaqBxid
private

Definition at line 68 of file L1TCaloLayer1Summary.h.

Referenced by analyze(), and bookHistograms().

◆ simCICADAScoreToken_

edm::EDGetTokenT<l1t::CICADABxCollection> L1TCaloLayer1Summary::simCICADAScoreToken_
private

Definition at line 58 of file L1TCaloLayer1Summary.h.

Referenced by analyze().

◆ simRegionsToken_

edm::EDGetTokenT<L1CaloRegionCollection> L1TCaloLayer1Summary::simRegionsToken_
private

Definition at line 60 of file L1TCaloLayer1Summary.h.

Referenced by analyze().