Skip to content

Commit

Permalink
Merge pull request #19992 from davidcarbonis/phase1pixelValidation_93…
Browse files Browse the repository at this point in the history
…0_fixes_v2

PixelPhase Validation bin reduction and protection against memory leak.
  • Loading branch information
cmsbuild committed Aug 10, 2017
2 parents 9a5c50e + 8af2a3d commit 1551b75
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 95 deletions.
17 changes: 10 additions & 7 deletions Validation/SiPixelPhase1DigisV/python/SiPixelPhase1DigisV_cfi.py
Expand Up @@ -11,12 +11,13 @@
range_nbins = 300,
topFolderName = "PixelPhase1V/Digis",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save()
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

SiPixelPhase1DigisNdigis = DefaultHistoDigiCluster.clone(
SiPixelPhase1DigisNdigis = DefaultHisto.clone(
name = "digis", # 'Count of' added automatically
title = "Digis",
xlabel = "Number of Digis",
Expand Down Expand Up @@ -46,8 +47,9 @@
range_nbins = 200,
topFolderName = "PixelPhase1V/Digis",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save()
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -60,8 +62,9 @@
range_nbins = 300,
topFolderName = "PixelPhase1V/Digis",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save()
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand Down
3 changes: 0 additions & 3 deletions Validation/SiPixelPhase1HitsV/interface/SiPixelPhase1HitsV.h
Expand Up @@ -20,10 +20,7 @@ namespace reco {

class SiPixelPhase1HitsV : public SiPixelPhase1Base {
enum {
TOF_ETA,
TOF_PHI,
TOF_R,
TOF_Z,
ELOSS,
ENTRY_EXIT_X,
ENTRY_EXIT_Y,
Expand Down
61 changes: 14 additions & 47 deletions Validation/SiPixelPhase1HitsV/python/SiPixelPhase1HitsV_cfi.py
Expand Up @@ -2,46 +2,13 @@
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQM.SiPixelPhase1Common.HistogramManager_cfi import *

SiPixelPhase1HitsTofEta = DefaultHisto.clone(
name = "tof_eta",
title = "Time of flight vs #eta",
range_min = -4.0, range_max = 4.0, range_nbins = 5000,
range_y_min = -100, range_y_max = 100, range_y_nbins = 200,
xlabel = "#eta", ylabel = "Time of flight",
topFolderName = "PixelPhase1V/Hits",
dimensions = 2,
specs = VPSet(
Specification().groupBy("").save(),
)
)

SiPixelPhase1HitsTofPhi = SiPixelPhase1HitsTofEta.clone(
name = "tof_phi",
title = "Time of flight vs #phi",
range_min = -3.5, range_max = 3.5, range_nbins = 5000,
xlabel = "#phi",
dimensions = 2,
specs = VPSet(
Specification().groupBy("").save(),
)
)

SiPixelPhase1HitsTofR = SiPixelPhase1HitsTofEta.clone(
SiPixelPhase1HitsTofR = DefaultHisto.clone(
name = "tof_r",
title = "Time of flight vs r",
range_min = 0, range_max = 60, range_nbins = 5000,
xlabel = "r",
dimensions = 2,
specs = VPSet(
Specification().groupBy("").save(),
)
)

SiPixelPhase1HitsTofZ = SiPixelPhase1HitsTofEta.clone(
name = "tof_z",
title = "Time of flight vs z",
range_min = -60, range_max = 60, range_nbins = 5000,
xlabel = "z",
range_min = 0, range_max = 60, range_nbins = 2500,
range_y_min = 0.0, range_y_max = 100.0, range_y_nbins = 100,
xlabel = "r", ylabel = "Time of flight",
topFolderName = "PixelPhase1V/Hits",
dimensions = 2,
specs = VPSet(
Specification().groupBy("").save(),
Expand All @@ -56,8 +23,9 @@
dimensions = 1,
topFolderName = "PixelPhase1V/Hits",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -69,8 +37,9 @@
dimensions = 1,
topFolderName = "PixelPhase1V/Hits",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -96,8 +65,9 @@
dimensions = 1,
topFolderName = "PixelPhase1V/Hits",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand Down Expand Up @@ -141,10 +111,7 @@
)

SiPixelPhase1HitsConf = cms.VPSet(
SiPixelPhase1HitsTofEta,
SiPixelPhase1HitsTofPhi,
SiPixelPhase1HitsTofR,
SiPixelPhase1HitsTofZ,
SiPixelPhase1HitsEnergyLoss,
SiPixelPhase1HitsEntryExitX,
SiPixelPhase1HitsEntryExitY,
Expand Down
30 changes: 4 additions & 26 deletions Validation/SiPixelPhase1HitsV/src/SiPixelPhase1HitsV.cc
Expand Up @@ -9,6 +9,7 @@

#include "Validation/SiPixelPhase1HitsV/interface/SiPixelPhase1HitsV.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/GeometryVector/interface/LocalPoint.h"
Expand Down Expand Up @@ -66,10 +67,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
GlobalPoint gpos=det->toGlobal(it->localPosition());

float tof = it->timeOfFlight();
float globalEta = gpos.eta();
float globalPhi = gpos.phi();
float globalR = gpos.mag();
float globalZ = gpos.z();

float energyLoss = it->energyLoss();

Expand All @@ -83,10 +81,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
float localPhi = it->localPosition().phi();
float localEta = it->localPosition().eta();

histo[TOF_ETA].fill(globalEta, tof, id, &iEvent);
histo[TOF_PHI].fill(globalPhi, tof, id, &iEvent);
histo[TOF_R].fill(globalR, tof, id, &iEvent);
histo[TOF_Z].fill(globalZ, tof, id, &iEvent);
histo[ELOSS].fill(energyLoss, id, &iEvent);
histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
Expand All @@ -104,10 +99,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
GlobalPoint gpos=det->toGlobal(it->localPosition());

float tof = it->timeOfFlight();
float globalEta = gpos.eta();
float globalPhi = gpos.phi();
float globalR = gpos.mag();
float globalZ = gpos.z();

float energyLoss = it->energyLoss();

Expand All @@ -121,10 +113,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
float localPhi = it->localPosition().phi();
float localEta = it->localPosition().eta();

histo[TOF_ETA].fill(globalEta, tof, id, &iEvent);
histo[TOF_PHI].fill(globalPhi, tof, id, &iEvent);
histo[TOF_R].fill(globalR, tof, id, &iEvent);
histo[TOF_Z].fill(globalZ, tof, id, &iEvent);
histo[ELOSS].fill(energyLoss, id, &iEvent);
histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
Expand All @@ -143,10 +132,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
GlobalPoint gpos=det->toGlobal(it->localPosition());

float tof = it->timeOfFlight();
float globalEta = gpos.eta();
float globalPhi = gpos.phi();
float globalR = gpos.mag();
float globalZ = gpos.z();

float energyLoss = it->energyLoss();

Expand All @@ -160,10 +146,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
float localPhi = it->localPosition().phi();
float localEta = it->localPosition().eta();

histo[TOF_ETA].fill(globalEta, tof, id, &iEvent);
histo[TOF_PHI].fill(globalPhi, tof, id, &iEvent);
histo[TOF_R].fill(globalR, tof, id, &iEvent);
histo[TOF_Z].fill(globalZ, tof, id, &iEvent);
histo[ELOSS].fill(energyLoss, id, &iEvent);
histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
Expand All @@ -182,10 +165,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
GlobalPoint gpos=det->toGlobal(it->localPosition());

float tof = it->timeOfFlight();
float globalEta = gpos.eta();
float globalPhi = gpos.phi();
float globalR = gpos.mag();
float globalZ = gpos.z();

float energyLoss = it->energyLoss();

Expand All @@ -199,10 +179,7 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup
float localPhi = it->localPosition().phi();
float localEta = it->localPosition().eta();

histo[TOF_ETA].fill(globalEta, tof, id, &iEvent);
histo[TOF_PHI].fill(globalPhi, tof, id, &iEvent);
histo[TOF_R].fill(globalR, tof, id, &iEvent);
histo[TOF_Z].fill(globalZ, tof, id, &iEvent);
histo[ELOSS].fill(energyLoss, id, &iEvent);
histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
Expand All @@ -225,9 +202,10 @@ void SiPixelPhase1HitsV::analyze(const edm::Event& iEvent, const edm::EventSetup

edm::Handle<reco::TrackToTrackingParticleAssociator> theHitsAssociator;
iEvent.getByToken(trackAssociatorByHitsToken_,theHitsAssociator);
if ( theHitsAssociator.isValid() ) {
associatorByHits = theHitsAssociator.product();
if ( ! theHitsAssociator.isValid() ) {
throw cms::Exception ("NO VALID HIT ASSOCIATOR");
}
associatorByHits = theHitsAssociator.product();

if ( TPCollectionH.isValid() && trackCollectionH.isValid() ) {
reco::RecoToSimCollection p = associatorByHits->associateRecoToSim(trackCollectionH,TPCollectionH);
Expand Down
Expand Up @@ -14,6 +14,7 @@
Specification().groupBy("PXForward").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -29,6 +30,7 @@
Specification().groupBy("PXForward").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -43,6 +45,7 @@
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -58,8 +61,7 @@
Specification().groupBy("PXForward").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -80,8 +82,9 @@
specs = VPSet(
Specification().groupBy("PXBarrel").save(),
Specification().groupBy("PXForward").save(),
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -102,6 +105,7 @@
Specification().groupBy("").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -121,8 +125,7 @@
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
StandardSpecification2DProfile,
)
)

Expand Down
Expand Up @@ -9,8 +9,9 @@
xlabel = "Charge size (in ke)",
topFolderName = "PixelPhase1V/Clusters",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -21,8 +22,9 @@
xlabel = "Cluster size (in pixels)",
topFolderName = "PixelPhase1V/Clusters",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand All @@ -33,8 +35,9 @@
xlabel = "Cluster size (in pixels)",
topFolderName = "PixelPhase1V/Clusters",
specs = VPSet(
Specification().groupBy("PXBarrel/PXLayer/PXModuleName").save(),
Specification().groupBy("PXForward/PXDisk/PXModuleName").save(),
Specification().groupBy("PXBarrel/PXLayer").save(),
Specification().groupBy("PXForward/PXDisk").save(),
StandardSpecification2DProfile,
)
)

Expand Down

0 comments on commit 1551b75

Please sign in to comment.