-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update Pixel DQM modules prohibiting concurrent lumis #32805
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -101,23 +101,74 @@ SiPixelDigiSource::~SiPixelDigiSource() { | |||
LogInfo("PixelDQM") << "SiPixelDigiSource::~SiPixelDigiSource: Destructor" << endl; | ||||
} | ||||
|
||||
void SiPixelDigiSource::dqmBeginLuminosityBlock(const edm::LuminosityBlock& lb, edm::EventSetup const&) { | ||||
std::shared_ptr<bool> SiPixelDigiSource::globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, | ||||
const edm::EventSetup& iSetup) const { | ||||
unsigned int currentLS = lumi.id().luminosityBlock(); | ||||
bool resetCounters = (currentLS % 10 == 0) ? true : false; | ||||
return std::make_shared<bool>(resetCounters); | ||||
} | ||||
|
||||
void SiPixelDigiSource::globalEndLuminosityBlock(const edm::LuminosityBlock& lb, edm::EventSetup const&) { | ||||
int thisls = lb.id().luminosityBlock(); | ||||
const bool resetCounters = luminosityBlockCache(lb.index()); | ||||
|
||||
float averageBPIXFed = float(nBPIXDigis) / 32.; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For future memory and readability 32 and 8 can be made named constants. |
||||
float averageFPIXFed = float(nFPIXDigis) / 8.; | ||||
|
||||
if (averageDigiOccupancy) { | ||||
for (int i = 0; i != 40; i++) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This 40 can be taken from here
|
||||
float averageOcc = 0.; | ||||
if (i < 32) { | ||||
if (averageBPIXFed > 0.) | ||||
averageOcc = nDigisPerFed[i] / averageBPIXFed; | ||||
} else { | ||||
if (averageFPIXFed > 0.) | ||||
averageOcc = nDigisPerFed[i] / averageFPIXFed; | ||||
} | ||||
if (!modOn) { | ||||
averageDigiOccupancy->Fill( | ||||
i, | ||||
nDigisPerFed[i]); //In offline we fill all digis and normalise at the end of the run for thread safe behaviour. | ||||
avgfedDigiOccvsLumi->setBinContent(thisls, i + 1, nDigisPerFed[i]); //Same plot vs lumi section | ||||
} | ||||
if (modOn) { | ||||
if (thisls % 10 == 0) | ||||
averageDigiOccupancy->Fill( | ||||
i, | ||||
averageOcc); // "modOn" basically mean Online DQM, in this case fill histos with actual value of digi fraction per fed for each ten lumisections | ||||
if (avgfedDigiOccvsLumi && thisls % 5 == 0) | ||||
avgfedDigiOccvsLumi->setBinContent( | ||||
int(thisls / 5), | ||||
i + 1, | ||||
averageOcc); //fill with the mean over 5 lumisections, previous code was filling this histo only with last event of each 10th lumisection | ||||
} | ||||
} | ||||
|
||||
if (modOn && thisls % 10 == 0 && averageDigiOccupancy) { | ||||
if (modOn && thisls % 10 == 0) { | ||||
avgBarrelFedOccvsLumi->setBinContent( | ||||
int(thisls / 10), averageBPIXFed); //<NDigis> vs lumisection for barrel, filled every 10 lumi sections | ||||
avgEndcapFedOccvsLumi->setBinContent( | ||||
int(thisls / 10), averageFPIXFed); //<NDigis> vs lumisection for endcap, filled every 10 lumi sections | ||||
} | ||||
} | ||||
|
||||
//reset counters | ||||
|
||||
if (modOn && resetCounters && averageDigiOccupancy) { | ||||
nBPIXDigis = 0; | ||||
nFPIXDigis = 0; | ||||
for (int i = 0; i != 40; i++) | ||||
nDigisPerFed[i] = 0; | ||||
} | ||||
|
||||
if (!modOn && averageDigiOccupancy) { | ||||
nBPIXDigis = 0; | ||||
nFPIXDigis = 0; | ||||
for (int i = 0; i != 40; i++) | ||||
nDigisPerFed[i] = 0; | ||||
} | ||||
|
||||
if (modOn && thisls % 10 == 0) { | ||||
if (modOn && resetCounters) { | ||||
ROCMapToReset = true; //the ROC map is reset each 10 lumisections | ||||
|
||||
for (int i = 0; i < 2; i++) | ||||
|
@@ -160,50 +211,6 @@ void SiPixelDigiSource::dqmBeginLuminosityBlock(const edm::LuminosityBlock& lb, | |||
} | ||||
} | ||||
|
||||
void SiPixelDigiSource::dqmEndLuminosityBlock(const edm::LuminosityBlock& lb, edm::EventSetup const&) { | ||||
int thisls = lb.id().luminosityBlock(); | ||||
|
||||
float averageBPIXFed = float(nBPIXDigis) / 32.; | ||||
float averageFPIXFed = float(nFPIXDigis) / 8.; | ||||
|
||||
if (averageDigiOccupancy) { | ||||
for (int i = 0; i != 40; i++) { | ||||
float averageOcc = 0.; | ||||
if (i < 32) { | ||||
if (averageBPIXFed > 0.) | ||||
averageOcc = nDigisPerFed[i] / averageBPIXFed; | ||||
} else { | ||||
if (averageFPIXFed > 0.) | ||||
averageOcc = nDigisPerFed[i] / averageFPIXFed; | ||||
} | ||||
if (!modOn) { | ||||
averageDigiOccupancy->Fill( | ||||
i, | ||||
nDigisPerFed[i]); //In offline we fill all digis and normalise at the end of the run for thread safe behaviour. | ||||
avgfedDigiOccvsLumi->setBinContent(thisls, i + 1, nDigisPerFed[i]); //Same plot vs lumi section | ||||
} | ||||
if (modOn) { | ||||
if (thisls % 10 == 0) | ||||
averageDigiOccupancy->Fill( | ||||
i, | ||||
averageOcc); // "modOn" basically mean Online DQM, in this case fill histos with actual value of digi fraction per fed for each ten lumisections | ||||
if (avgfedDigiOccvsLumi && thisls % 5 == 0) | ||||
avgfedDigiOccvsLumi->setBinContent( | ||||
int(thisls / 5), | ||||
i + 1, | ||||
averageOcc); //fill with the mean over 5 lumisections, previous code was filling this histo only with last event of each 10th lumisection | ||||
} | ||||
} | ||||
|
||||
if (modOn && thisls % 10 == 0) { | ||||
avgBarrelFedOccvsLumi->setBinContent( | ||||
int(thisls / 10), averageBPIXFed); //<NDigis> vs lumisection for barrel, filled every 10 lumi sections | ||||
avgEndcapFedOccvsLumi->setBinContent( | ||||
int(thisls / 10), averageFPIXFed); //<NDigis> vs lumisection for endcap, filled every 10 lumi sections | ||||
} | ||||
} | ||||
} | ||||
|
||||
void SiPixelDigiSource::dqmBeginRun(const edm::Run& r, const edm::EventSetup& iSetup) { | ||||
LogInfo("PixelDQM") << " SiPixelDigiSource::beginJob - Initialisation ... " << std::endl; | ||||
LogInfo("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/" << layOn << "/" << phiOn << std::endl; | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being picky here, I think
<>
are reserved to system includes andcmssw
includes should use""