Skip to content

Commit 182848e

Browse files
author
Max Zhao
committed
Fixes for comments from mmusich
1 parent 3d7afba commit 182848e

File tree

2 files changed

+26
-31
lines changed

2 files changed

+26
-31
lines changed

DQM/L1TMonitor/interface/L1TCaloLayer1Summary.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
4141
#include "EventFilter/L1TXRawToDigi/interface/UCTDAQRawData.h"
4242
#include "EventFilter/L1TXRawToDigi/interface/UCTAMCRawData.h"
43+
#include "DataFormats/FEDRawData/interface/FEDNumbering.h"
4344

4445
class L1TCaloLayer1Summary : public DQMEDAnalyzer {
4546
public:

DQM/L1TMonitor/src/L1TCaloLayer1Summary.cc

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void L1TCaloLayer1Summary::analyze(const edm::Event& iEvent, const edm::EventSet
1616
edm::Handle<FEDRawDataCollection> fedRawDataCollection;
1717
iEvent.getByToken(fedRawData_, fedRawDataCollection);
1818
if (fedRawDataCollection.isValid()) {
19-
for (int iFed = 1354; iFed < 1360; iFed += 2) {
19+
for (int iFed = FEDNumbering::MINRCTFEDID + 4; iFed < FEDNumbering::MAXRCTFEDID; iFed += 2) {
2020
const FEDRawData& fedRawData = fedRawDataCollection->FEDData(iFed);
2121
if (fedRawData.size() == 0) {
2222
continue;
@@ -26,9 +26,7 @@ void L1TCaloLayer1Summary::analyze(const edm::Event& iEvent, const edm::EventSet
2626

2727
if (daqData.nAMCs() == 7) {
2828
UCTAMCRawData amcSlot7(daqData.amcPayload(3));
29-
if (amcSlot7.amcNo() != 7) {
30-
std::cout << "Wrong AMC No: " << amcSlot7.amcNo() << std::endl;
31-
} else {
29+
if (amcSlot7.amcNo() == 7) {
3230
histoSlot7MinusDaqBxid->Fill(amcSlot7.BXID() - daqData.BXID());
3331
}
3432
}
@@ -37,11 +35,18 @@ void L1TCaloLayer1Summary::analyze(const edm::Event& iEvent, const edm::EventSet
3735

3836
L1CaloRegionCollection caloLayer1Regions = iEvent.get(caloLayer1RegionsToken_);
3937
L1CaloRegionCollection simRegions = iEvent.get(simRegionsToken_);
38+
int nRegions = caloLayer1Regions.size();
4039

41-
bool foundMatrix[2][18][18] = {};
42-
int etMatrix[2][18][18] = {};
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;
4347

44-
int nRegions = caloLayer1Regions.size();
48+
bool foundMatrix[2][matrixSize][matrixSize] = {};
49+
int etMatrix[2][matrixSize][matrixSize] = {};
4550
for (int iRegion = 0; iRegion < nRegions; iRegion++) {
4651
L1CaloRegion cRegion = caloLayer1Regions[iRegion];
4752
L1CaloRegion sRegion = simRegions[iRegion];
@@ -52,8 +57,8 @@ void L1TCaloLayer1Summary::analyze(const edm::Event& iEvent, const edm::EventSet
5257
etMatrix[1][sRegion.gctEta()][sRegion.gctPhi()] = sRegion.et();
5358
}
5459
int iRegion = 0;
55-
for (int iEta = 0; iEta < 18; iEta++) {
56-
for (int iPhi = 0; iPhi < 18; iPhi++) {
60+
for (int iEta = 0; iEta < matrixSize; iEta++) {
61+
for (int iPhi = 0; iPhi < matrixSize; iPhi++) {
5762
if (foundMatrix[0][iEta][iPhi] && foundMatrix[1][iEta][iPhi]) {
5863
histoCaloRegions->Fill(iRegion, etMatrix[0][iEta][iPhi]);
5964
histoSimRegions->Fill(iRegion, etMatrix[1][iEta][iPhi]);
@@ -69,19 +74,9 @@ void L1TCaloLayer1Summary::analyze(const edm::Event& iEvent, const edm::EventSet
6974

7075
histoSimCICADAScore->Fill(simCICADAScore);
7176
histoCaloMinusSim->Fill(caloCICADAScore - simCICADAScore);
72-
73-
uint32_t bx0Idx;
74-
if (gtCICADAScores.size() == 30) {
75-
bx0Idx = 12;
76-
} else if (gtCICADAScores.size() == 5) {
77-
bx0Idx = 2;
78-
} else {
79-
bx0Idx = 2;
80-
}
81-
8277
histoCaloLayer1CICADAScore->Fill(caloCICADAScore);
83-
histoGtCICADAScore->Fill(gtCICADAScores[bx0Idx]);
84-
histoCaloMinusGt->Fill(gtCICADAScores[bx0Idx] - caloCICADAScore);
78+
histoGtCICADAScore->Fill(gtCICADAScores.at(0, 0));
79+
histoCaloMinusGt->Fill(gtCICADAScores.at(0, 0) - caloCICADAScore);
8580
}
8681

8782
void L1TCaloLayer1Summary::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&, edm::EventSetup const&) {
@@ -105,17 +100,16 @@ void L1TCaloLayer1Summary::bookHistograms(DQMStore::IBooker& ibooker, edm::Run c
105100

106101
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
107102
void L1TCaloLayer1Summary::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
108-
//The following says we do not know what parameters are allowed so do no validation
109-
// Please change this to state exactly what you do use, even if it is no parameters
103+
// l1tCaloLayer1Summary
110104
edm::ParameterSetDescription desc;
111-
desc.setUnknown();
112-
descriptions.addDefault(desc);
113-
114-
//Specify that only 'tracks' is allowed
115-
//To use, remove the default given above and uncomment below
116-
//edm::ParameterSetDescription desc;
117-
//desc.addUntracked<edm::InputTag>("tracks", edm::InputTag("ctfWithMaterialTracks"));
118-
//descriptions.addWithDefaultLabel(desc);
105+
desc.add<edm::InputTag>("caloLayer1CICADAScore", edm::InputTag("caloLayer1Digis", "CICADAScore"));
106+
desc.add<edm::InputTag>("gtCICADAScore", edm::InputTag("gtTestcrateStage2Digis", "CICADAScore"));
107+
desc.add<edm::InputTag>("simCICADAScore", edm::InputTag("simCaloStage2Layer1Summary", "CICADAScore"));
108+
desc.add<edm::InputTag>("caloLayer1Regions", edm::InputTag("caloLayer1Digis"));
109+
desc.add<edm::InputTag>("simRegions", edm::InputTag("simCaloStage2Layer1Digis"));
110+
desc.add<edm::InputTag>("fedRawDataLabel", edm::InputTag("rawDataCollector"));
111+
desc.add<std::string>("histFolder", "L1T/L1TCaloLayer1Summary");
112+
descriptions.add("l1tCaloLayer1Summary", desc);
119113
}
120114

121115
//define this as a plug-in

0 commit comments

Comments
 (0)