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

Fixes for800 #13142

Merged
merged 6 commits into from
Feb 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 23 additions & 5 deletions DQM/DTMonitorClient/src/DTOccupancyTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,21 @@ string DTOccupancyTest::getMEName(string histoTag, const DTChamberId& chId) {
}


int DTOccupancyTest::getIntegral(TH2F *histo, int firstBinX, int lastBinX, int firstBinY, int lastBinY, bool doall) {

int sum = 0;
for (Int_t i = firstBinX; i < lastBinX+1; i++) {
for (Int_t j = firstBinY; j < lastBinY+1; j++) {

if (histo->GetBinContent(i,j) >0){
if (!doall) return 1;
sum += histo->GetBinContent(i,j);
}
}
}

return sum;
}


// Run a test on the occupancy of the chamber
Expand All @@ -273,17 +288,20 @@ string DTOccupancyTest::getMEName(string histoTag, const DTChamberId& chId) {
// 2 -> dead layer
// 3 -> dead SL
// 4 -> dead chamber


int DTOccupancyTest::runOccupancyTest(TH2F *histo, const DTChamberId& chId,
float& chamberPercentage) {
int nBinsX = histo->GetNbinsX();
int nBinsY = histo->GetNbinsY();

// Reset the error flags
bool failSL = false;
bool failLayer = false;
bool failCells = false;

// Check that the chamber has digis
if(histo->Integral() == 0) {
if (getIntegral(histo,1,nBinsX,1,nBinsY,false) == 0) {
chamberPercentage = 0;
return 4;
}
Expand Down Expand Up @@ -331,8 +349,8 @@ int DTOccupancyTest::runOccupancyTest(TH2F *histo, const DTChamberId& chId,
// check the SL occupancy
int binYlow = ((slay-1)*4)+1;
int binYhigh = binYlow+3;
double slInteg = histo->Integral(1,nBinsX,binYlow,binYhigh);
if(slInteg == 0) {

if(getIntegral(histo,1,nBinsX,binYlow,binYhigh,false) == 0) {
chamberPercentage = 1.-1./(float)nSL;
return 3;
}
Expand All @@ -342,7 +360,7 @@ int DTOccupancyTest::runOccupancyTest(TH2F *histo, const DTChamberId& chId,

int binY = binYlow+(lay-1);

double layerInteg = histo->Integral(1,nBinsX,binY,binY);
double layerInteg = getIntegral(histo,1,nBinsX,binY,binY,true);
squaredLayerOccupSum += layerInteg*layerInteg;
totalChamberOccupp+= layerInteg;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

squaredLayerOccupSum and totalChamberOccupp are apparently not used.


Expand Down Expand Up @@ -433,7 +451,7 @@ int DTOccupancyTest::runOccupancyTest(TH2F *histo, const DTChamberId& chId,
int binY = binYlow+(lay-1);

// compute the integral of the layer occupancy
double layerInteg = histo->Integral(1,nBinsX,binY,binY);
double layerInteg = getIntegral(histo,1,nBinsX,binY,binY,true);

LogTrace("DTDQM|DTMonitorClient|DTOccupancyTest") << " layer: " << layID << " integral: " << layerInteg << endl;

Expand Down
2 changes: 2 additions & 0 deletions DQM/DTMonitorClient/src/DTOccupancyTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class DTOccupancyTest: public DQMEDHarvester{
/// Get the ME name
std::string getMEName(std::string histoTag, const DTChamberId& chId);

int getIntegral(TH2F *histo, int, int, int, int, bool);

// Run the test on the occupancy histos
int runOccupancyTest(TH2F *histo, const DTChamberId& chId, float& chamberPercentage);

Expand Down