Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TkDQM: fix reset counter logic in SiPixelDigiSource #32875

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 56 additions & 41 deletions DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,59 @@
#include "Geometry/CommonTopologies/interface/PixelTopology.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "DQM/SiPixelMonitorDigi/interface/SiPixelDigiModule.h"
#include <DQMServices/Core/interface/DQMOneEDAnalyzer.h>
#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
#include <cstdint>

class SiPixelDigiSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<bool>> {
struct SiPixelDigiCounter {
int nBPIXDigis = 0;
int nFPIXDigis = 0;
int nDigisPerFed[40];
int NzeroROCs[2];
int NloEffROCs[2];

bool ROCMapToReset = false;

bool DoZeroRocsBMO1 = false;
bool DoZeroRocsBMO2 = false;
bool DoZeroRocsBMO3 = false;

bool DoZeroRocsBMI1 = false;
bool DoZeroRocsBMI2 = false;
bool DoZeroRocsBMI3 = false;

bool DoZeroRocsBPO1 = false;
bool DoZeroRocsBPO2 = false;
bool DoZeroRocsBPO3 = false;

bool DoZeroRocsBPI1 = false;
bool DoZeroRocsBPI2 = false;
bool DoZeroRocsBPI3 = false;

bool DoZeroRocsFPO1 = false;
bool DoZeroRocsFPO2 = false;

bool DoZeroRocsFMO1 = false;
bool DoZeroRocsFMO2 = false;

bool DoZeroRocsFPI1 = false;
bool DoZeroRocsFPI2 = false;

bool DoZeroRocsFMI1 = false;
bool DoZeroRocsFMI2 = false;
SiPixelDigiCounter() {
//all initialization which was done in BeginRun
nBPIXDigis = 0;
nFPIXDigis = 0;
for (int i = 0; i != 40; i++)
nDigisPerFed[i] = 0;
for (int i = 0; i < 2; i++)
NzeroROCs[i] = 0;
for (int i = 0; i < 2; i++)
NloEffROCs[i] = 0;
};
};

class SiPixelDigiSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<SiPixelDigiCounter>> {
public:
explicit SiPixelDigiSource(const edm::ParameterSet& conf);
~SiPixelDigiSource() override;
Expand All @@ -39,14 +88,14 @@ class SiPixelDigiSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<bool
void analyze(const edm::Event&, const edm::EventSetup&) override;
void dqmBeginRun(const edm::Run&, edm::EventSetup const&) override;
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
std::shared_ptr<bool> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi,
const edm::EventSetup& iSetup) const override;
std::shared_ptr<SiPixelDigiCounter> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi,
const edm::EventSetup& iSetup) const override;
void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;

virtual void buildStructure(edm::EventSetup const&);
virtual void bookMEs(DQMStore::IBooker&, const edm::EventSetup& iSetup);

virtual void CountZeroROCsInSubstructure(bool, bool&, SiPixelDigiModule*);
virtual void CountZeroROCsInSubstructure(bool, bool&, SiPixelDigiModule*, SiPixelDigiCounter*);

std::string topFolderName_;

Expand Down Expand Up @@ -117,8 +166,7 @@ class SiPixelDigiSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<bool
int nL4M3;
int nL4M4;
int nBigEvents;
int nBPIXDigis;
int nFPIXDigis;

MonitorElement* bigEventRate;
MonitorElement* pixEvtsPerBX;
MonitorElement* pixEventRate;
Expand Down Expand Up @@ -174,40 +222,8 @@ class SiPixelDigiSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<bool
std::vector<MonitorElement*> meNDigisCHANEndcapDps_;
std::vector<MonitorElement*> meNDigisCHANEndcapDms_;

int NzeroROCs[2];
int NloEffROCs[2];

bool ROCMapToReset;
//the following long list of bools is to patch the ZeroOccupancy ROC filling in a way that a substructure (like BPix/BmO/Layer1) is counted only once as it should be (in the past for each module in the substructure the same number of ZeroOccupancy rocs was added)

bool DoZeroRocsBMO1;
bool DoZeroRocsBMO2;
bool DoZeroRocsBMO3;

bool DoZeroRocsBMI1;
bool DoZeroRocsBMI2;
bool DoZeroRocsBMI3;

bool DoZeroRocsBPO1;
bool DoZeroRocsBPO2;
bool DoZeroRocsBPO3;

bool DoZeroRocsBPI1;
bool DoZeroRocsBPI2;
bool DoZeroRocsBPI3;

bool DoZeroRocsFPO1;
bool DoZeroRocsFPO2;

bool DoZeroRocsFMO1;
bool DoZeroRocsFMO2;

bool DoZeroRocsFPI1;
bool DoZeroRocsFPI2;

bool DoZeroRocsFMI1;
bool DoZeroRocsFMI2;

int bigEventSize;
bool isUpgrade;
bool firstRun;
Expand All @@ -217,13 +233,12 @@ class SiPixelDigiSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<bool
int I_fedId[1856];
int I_linkId1[1856];
int I_linkId2[1856];
int nDigisPerFed[40];

int nDigisPerChan[1152];
int nDigisPerDisk[6];
int numberOfDigis[336];
int nDigisA;
int nDigisB;

//define Token(-s)
edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> srcToken_;
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoToken_;
Expand Down
Loading