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

SiPixelPhase1 - Filter update #17761

Merged
merged 4 commits into from Mar 7, 2017
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
12 changes: 9 additions & 3 deletions DQM/SiPixelPhase1Clusters/interface/SiPixelPhase1Clusters.h
@@ -1,7 +1,7 @@
#ifndef SiPixelPhase1Clusters_h
#define SiPixelPhase1Clusters_h
#ifndef SiPixelPhase1Clusters_h
#define SiPixelPhase1Clusters_h
// -*- C++ -*-
//
//
// Package: SiPixelPhase1Clusters
// Class : SiPixelPhase1Clusters
//
Expand All @@ -28,6 +28,12 @@ class SiPixelPhase1Clusters : public SiPixelPhase1Base {
READOUT_CHARGE,
READOUT_NCLUSTERS
};
// Uncomment to add trigger event flag enumerators
// Make sure enum corresponds correctly with flags defined in _cfi.py file
// enum {
// FLAG_HLT,
// FLAG_L1,
// }

public:
explicit SiPixelPhase1Clusters(const edm::ParameterSet& conf);
Expand Down
11 changes: 9 additions & 2 deletions DQM/SiPixelPhase1Clusters/python/SiPixelPhase1Clusters_cfi.py
Expand Up @@ -6,7 +6,7 @@
title = "Cluster Charge",
range_min = 0, range_max = 200e3, range_nbins = 200,
xlabel = "Charge (electrons)",

specs = VPSet(
#StandardSpecification2DProfile,
StandardSpecificationPixelmapProfile,
Expand Down Expand Up @@ -219,11 +219,18 @@
SiPixelPhase1ClustersReadoutNClusters
)

## Uncomment to add trigger event flag settings
import DQM.SiPixelPhase1Common.TriggerEventFlag_cfi as triggerflag
SiPixelPhase1ClustersTriggers = cms.VPSet(
# triggerflag.genericTriggerEventFlag4HLTdb,
# triggerflag.genericTriggerEventFlag4L1bd,
)

SiPixelPhase1ClustersAnalyzer = cms.EDAnalyzer("SiPixelPhase1Clusters",
src = cms.InputTag("siPixelClusters"),
histograms = SiPixelPhase1ClustersConf,
geometry = SiPixelPhase1Geometry
geometry = SiPixelPhase1Geometry,
triggerflag = SiPixelPhase1ClustersTriggers,
)

SiPixelPhase1ClustersHarvester = cms.EDAnalyzer("SiPixelPhase1Harvester",
Expand Down
10 changes: 6 additions & 4 deletions DQM/SiPixelPhase1Clusters/src/SiPixelPhase1Clusters.cc
Expand Up @@ -19,7 +19,7 @@


SiPixelPhase1Clusters::SiPixelPhase1Clusters(const edm::ParameterSet& iConfig) :
SiPixelPhase1Base(iConfig)
SiPixelPhase1Base(iConfig)
{
srcToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("src"));
}
Expand All @@ -29,12 +29,12 @@ void SiPixelPhase1Clusters::analyze(const edm::Event& iEvent, const edm::EventSe
iEvent.getByToken(srcToken_, input);
if (!input.isValid()) return;

bool hasClusters=false;
bool hasClusters=false;

edm::ESHandle<TrackerGeometry> tracker;
iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
assert(tracker.isValid());

edmNew::DetSetVector<SiPixelCluster>::const_iterator it;
for (it = input->begin(); it != input->end(); ++it) {
auto id = DetId(it->detId());
Expand All @@ -44,6 +44,9 @@ void SiPixelPhase1Clusters::analyze(const edm::Event& iEvent, const edm::EventSe

for(SiPixelCluster const& cluster : *it) {
int row = cluster.x()-0.5, col = cluster.y()-0.5;
//// Uncomment to activate trigger filtering if statement
//// Any logical operation between trigger should be handled manually here
// if( checktrigger(iEvent,iSetup,FLAG_HLT) )
histo[READOUT_CHARGE].fill(double(cluster.charge()), id, &iEvent, col, row);
histo[CHARGE].fill(double(cluster.charge()), id, &iEvent, col, row);
histo[SIZE ].fill(double(cluster.size() ), id, &iEvent, col, row);
Expand Down Expand Up @@ -77,4 +80,3 @@ void SiPixelPhase1Clusters::analyze(const edm::Event& iEvent, const edm::EventSe
}

DEFINE_FWK_MODULE(SiPixelPhase1Clusters);

1 change: 1 addition & 0 deletions DQM/SiPixelPhase1Common/BuildFile.xml
Expand Up @@ -8,6 +8,7 @@
<use name="Alignment/TrackerAlignment"/>
<use name="CondFormats/GeometryObjects"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="CommonTools/TriggerUtils"/>

<export>
<lib name="1"/>
Expand Down
30 changes: 18 additions & 12 deletions DQM/SiPixelPhase1Common/interface/SiPixelPhase1Base.h
@@ -1,6 +1,6 @@
#ifndef SiPixel_DefaultTemplates_h
#define SiPixel_DefaultTemplates_h
//
//
// This defines two classes, one that has to be extended to make a new plugin,
// and one that can be used as-is for the Harvesting.
//
Expand All @@ -15,6 +15,7 @@
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"

#include "DQM/SiPixelPhase1Common/interface/HistogramManager.h"

Expand All @@ -40,29 +41,34 @@ class HistogramManagerHolder {
// use it but if you just need some normal HistogramManager this should be perfect.
class SiPixelPhase1Base : public DQMEDAnalyzer, public HistogramManagerHolder {
public:
SiPixelPhase1Base(const edm::ParameterSet& iConfig)
: DQMEDAnalyzer(), HistogramManagerHolder(iConfig) {};
SiPixelPhase1Base(const edm::ParameterSet& iConfig);

// You should analyze something, and call histoman.fill(...).
//void analyze(edm::Event const& e, edm::EventSetup const& eSetup);
// You should analyze something, and call histoman.fill(...). Setting to pure virtual function
void analyze(edm::Event const& e, edm::EventSetup const& eSetup) = 0;

// This booking is usually fine.
void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& iSetup) {
for (HistogramManager& histoman : histo)
histoman.book(iBooker, iSetup);
};
// Also used to store the required triggers
void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& iSetup);

virtual ~SiPixelPhase1Base() {};

protected:
// Returns a value of whether the trigger stored at position "trgidx" is properly fired.
bool checktrigger( const edm::Event& iEvent, const edm::EventSetup& iSetup, const unsigned trgidx ) const;

private:
// Storing the trigger objects per plugin instance
std::vector<std::unique_ptr<GenericTriggerEventFlag>> triggerlist;
};

// This wraps the Histogram Managers into a DQMEDHarvester. It
// This wraps the Histogram Managers into a DQMEDHarvester. It
// provides sane default implementations, so most plugins don't care about this.
// However, you have to instantiate one with the same config as your Analyzer
// However, you have to instantiate one with the same config as your Analyzer
// to get the Harvesting done.
// For custom harvesting, you have to derive from this.
class SiPixelPhase1Harvester : public DQMEDHarvester, public HistogramManagerHolder {
public:
SiPixelPhase1Harvester(const edm::ParameterSet& iConfig)
SiPixelPhase1Harvester(const edm::ParameterSet& iConfig)
: DQMEDHarvester(), HistogramManagerHolder(iConfig) {};

void dqmEndLuminosityBlock(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter, edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& eSetup) ;
Expand Down
57 changes: 33 additions & 24 deletions DQM/SiPixelPhase1Common/python/HistogramManager_cfi.py
Expand Up @@ -37,9 +37,9 @@
PerLayer2D = cms.PSet(enabled = cms.bool(True)) # 2D maps/profiles of layers
PerLayer1D = cms.PSet(enabled = cms.bool(True)) # normal histos per layer
PerReadout = cms.PSet(enabled = cms.bool(True)) # "Readout view", also for initial timing
OverlayCurvesForTiming= cms.PSet(enabled = cms.bool(True)) #switch to overlay digi/clusters curves for timing scan
OverlayCurvesForTiming= cms.PSet(enabled = cms.bool(True)) #switch to overlay digi/clusters curves for timing scan

# Default histogram configuration. This is _not_ used automatically, but you
# Default histogram configuration. This is _not_ used automatically, but you
# can import and pass this (or clones of it) in the plugin config.
DefaultHisto = cms.PSet(
# Setting this to False hides all plots of this HistogramManager. It does not even record any data.
Expand All @@ -52,7 +52,7 @@
# If False, no histograms are booked for DetIds where any column is undefined.
# since or-columns are not supported any longer, this has to be False, otherwise
# you will see a PXBarrel_UNDEFINED with endcap modules and the other way round.
# It could still be useful for debugging, to see if there is more UNDEFINED
# It could still be useful for debugging, to see if there is more UNDEFINED
# than expected.
bookUndefined = cms.bool(False),

Expand All @@ -66,18 +66,18 @@
ylabel = cms.string("count"),
dimensions = cms.int32(1),
range_min = cms.double(0),
range_max = cms.double(100),
range_max = cms.double(100),
range_nbins = cms.int32(100),
range_y_min = cms.double(0),
range_y_max = cms.double(100),
range_y_max = cms.double(100),
range_y_nbins = cms.int32(100),

# This structure is output by the SpecficationBuilder.
specs = cms.VPSet()
# cms.PSet(spec =
# cms.PSet(spec =
# cms.VPset(
# cms.PSet(
# type = GROUPBY,
# type = GROUPBY,
# stage = FIRST,
# columns = cms.vstring("P1PXBBarrel|P1PXECEndcap", "DetId"),
# arg = cms.string("")
Expand Down Expand Up @@ -105,7 +105,7 @@
DefaultHistoReadout=DefaultHisto.clone()
DefaultHistoReadout.topFolderName= cms.string("PixelPhase1/FED/Readout")

# Commonly used specifications.
# Commonly used specifications.
StandardSpecifications1D = [
# The column names are either defined in the GeometryInterface.cc or read from TrackerTopology.
# Endcap names side by side. The "/" separates columns and also defines how the output folders are nested.
Expand All @@ -115,7 +115,7 @@
.save()
.reduce("MEAN")
.groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
.save(),
.save(),
Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade")
.save()
.reduce("MEAN")
Expand All @@ -139,33 +139,33 @@
.reduce("MEAN")
.groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
.save(),
Specification().groupBy("PXBarrel/PXLayer")
Specification().groupBy("PXBarrel/PXLayer")
.save(),
Specification().groupBy("PXForward/PXDisk")
Specification().groupBy("PXForward/PXDisk")
.save()


]

StandardSpecificationTrend = [
Specification().groupBy("PXBarrel/Lumisection")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXBarrel", "EXTEND_X")
.save(),
Specification().groupBy("PXForward/Lumisection")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXForward", "EXTEND_X")
.save()
]

StandardSpecificationTrend2D = [
Specification().groupBy("PXBarrel/PXLayer/Lumisection")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXBarrel/PXLayer", "EXTEND_X")
.groupBy("PXBarrel", "EXTEND_Y")
.save(),
Specification().groupBy("PXForward/PXDisk/Lumisection")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXForward/PXDisk","EXTEND_X")
.groupBy("PXForward", "EXTEND_Y")
.save()
Expand Down Expand Up @@ -234,7 +234,7 @@

# the same for NDigis and friends. Needed due to technical limitations...
StandardSpecifications1D_Num = [
Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/DetId/Event")
Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/DetId/Event")
.reduce("COUNT") # per-event counting
.groupBy("PXBarrel/Shell/PXLayer/SignedLadder").save()
.reduce("MEAN")
Expand All @@ -244,7 +244,7 @@
.reduce("COUNT")
.groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName")
.save(),
Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/DetId/Event")
Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/DetId/Event")
.reduce("COUNT") # per-event counting
.groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade").save()
.reduce("MEAN")
Expand All @@ -270,11 +270,11 @@
.groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
.save(),
Specification().groupBy("PXBarrel/PXLayer/Event") #this will produce inclusive counts per Layer/Disk
.reduce("COUNT")
.reduce("COUNT")
.groupBy("PXBarrel/PXLayer")
.save(),
Specification().groupBy("PXForward/PXDisk/Event")
.reduce("COUNT")
.reduce("COUNT")
.groupBy("PXForward/PXDisk/")
.save()
]
Expand All @@ -288,15 +288,19 @@
Specification().groupBy("PXForward/Event")
.reduce("COUNT")
.groupBy("PXForward")
.save()
.save(),
Specification().groupBy("PXAll/Event")
.reduce("COUNT")
.groupBy("PXAll")
.save(),
]

StandardSpecificationTrend_Num = [

Specification().groupBy("PXBarrel/PXLayer/Event")
.reduce("COUNT")
.groupBy("PXBarrel/PXLayer/Lumisection")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXBarrel/PXLayer","EXTEND_X")
.groupBy("PXBarrel", "EXTEND_Y")
.save(),
Expand All @@ -309,7 +313,7 @@
Specification().groupBy("PXForward/PXDisk/Event")
.reduce("COUNT")
.groupBy("PXForward/PXDisk/Lumisection")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXForward/PXDisk","EXTEND_X")
.groupBy("PXForward", "EXTEND_Y")
.save(),
Expand All @@ -319,6 +323,12 @@
.reduce("MEAN")
.groupBy("PXForward", "EXTEND_X")
.save(),
Specification().groupBy("PXAll/Event")
.reduce("COUNT")
.groupBy("PXAll/Lumisection")
.reduce("MEAN")
.groupBy("PXAll", "EXTEND_X")
.save(),
]


Expand All @@ -327,7 +337,7 @@
.groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule" + "/DetId/Event")
.reduce("COUNT")
.groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
.reduce("MEAN")
.reduce("MEAN")
.groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
.groupBy("PXBarrel/PXLayer", "EXTEND_Y")
.save(),
Expand All @@ -351,4 +361,3 @@ def VPSet(*args):
e = list(a)
l = l+e
return cms.VPSet(l)

24 changes: 24 additions & 0 deletions DQM/SiPixelPhase1Common/python/TriggerEventFlag_cfi.py
@@ -0,0 +1,24 @@
import FWCore.ParameterSet.Config as cms

genericTriggerEventFlag4HLTdb = cms.PSet(
andOr = cms.bool( False ),
dbLabel = cms.string("SiStripDQMTrigger"), # ("TrackerDQMTrigger"),
andOrHlt = cms.bool(True), # True:=OR; False:=AND
hltInputTag = cms.InputTag( "TriggerResults::HLT" ),
hltPaths = cms.vstring("HLT_ZeroBias_v*","HLT_HIZeroBias_v*","HLT_PAL1MinimumBiasHF_OR_SinglePixelTrack_*"),
hltDBKey = cms.string("SiStrip_HLT"),
errorReplyHlt = cms.bool( False ),
verbosityLevel = cms.uint32(1)
)

genericTriggerEventFlag4L1bd = cms.PSet(
andOr = cms.bool( False ),
dbLabel = cms.string("SiStripDQMTrigger"), # ("TrackerDQMTrigger"),
l1Algorithms = cms.vstring(""), # cms.vstring( 'L1Tech_BPTX_plus_AND_minus.v0', 'L1_ZeroBias' )
andOrL1 = cms.bool( True ),
# errorReplyL1 = cms.bool( True ),
errorReplyL1 = cms.bool( False ),
l1DBKey = cms.string("SiStrip_L1"),
l1BeforeMask = cms.bool( True ), # specifies, if the L1 algorithm decision should be read as before (true) or after (false) masking is applied.
verbosityLevel = cms.uint32(1)
)