Skip to content

Commit

Permalink
Merge pull request cms-sw#8993 from mtosi/from-CMSSW_7_5_0_pre3_fixSt…
Browse files Browse the repository at this point in the history
…ripDQMatHLT

fix strip DQM @HLT
  • Loading branch information
cmsbuild authored and wmtan committed May 30, 2015
2 parents 570e9e9 + f6ddf5c commit 8ba636a
Show file tree
Hide file tree
Showing 110 changed files with 1,605 additions and 1,021 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
SpyReorderedDigisTag = cms.InputTag('SiStripSpyDigiConverter','Reordered'),
SpyVirginRawDigisTag = cms.InputTag('SiStripSpyDigiConverter','VirginRaw'),
SpySource = cms.SecSource(
"PoolSource",
"MixingSource",
fileNames = cms.untracked.vstring(
'SpyFileNameWhichNeedsToBeSet SiStripSpyEventMatcher.SpySource.fileNames'
)
),
sequential = cms.bool.untracked(True),
),
CounterDiffMaxAllowed = cms.uint32(100)
)
Expand Down
16 changes: 5 additions & 11 deletions DQM/SiStripMonitorHardware/src/SiStripSpyEventMatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Sources/interface/VectorInputSource.h"
#include "FWCore/Sources/interface/VectorInputSourceDescription.h"
#include "FWCore/Sources/interface/VectorInputSourceFactory.h"
#include "FWCore/Framework/interface/InputSourceDescription.h"
#include "FWCore/Framework/src/SignallingProductRegistry.h"
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
#include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
Expand Down Expand Up @@ -65,30 +65,24 @@ namespace sistrip {
productRegistry_->setFrozen();

eventPrincipal_.reset(new edm::EventPrincipal(source_->productRegistry(),
source_->branchIDListHelper(),
source_->thinnedAssociationsHelper(),
std::make_shared<edm::BranchIDListHelper>(),
std::make_shared<edm::ThinnedAssociationsHelper>(),
*processConfiguration_,
nullptr));
}

std::unique_ptr<SpyEventMatcher::Source> SpyEventMatcher::constructSource(const edm::ParameterSet& sourceConfig)
{
const edm::VectorInputSourceFactory* sourceFactory = edm::VectorInputSourceFactory::get();
edm::InputSourceDescription description(edm::ModuleDescription(),
*productRegistry_,
std::make_shared<edm::BranchIDListHelper>(),
std::make_shared<edm::ThinnedAssociationsHelper>(),
std::make_shared<edm::ActivityRegistry>(),
-1, -1, -1,
edm::PreallocationConfiguration());
edm::VectorInputSourceDescription description(*productRegistry_, edm::PreallocationConfiguration());
return sourceFactory->makeVectorInputSource(sourceConfig, description);
}

void SpyEventMatcher::initialize()
{
size_t fileNameHash = 0U;
//add spy events to the map until there are none left
source_->loopSequential(*eventPrincipal_,fileNameHash,std::numeric_limits<size_t>::max(),boost::bind(&SpyEventMatcher::addNextEventToMap,this,_1));
source_->loopOverEvents(*eventPrincipal_,fileNameHash,std::numeric_limits<size_t>::max(),boost::bind(&SpyEventMatcher::addNextEventToMap,this,_1));
//debug
std::ostringstream ss;
ss << "Events with possible matches (eventID,apvAddress): ";
Expand Down
70 changes: 70 additions & 0 deletions DQMOffline/Trigger/python/SiStrip_OfflineMonitoring_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,74 @@
errorReplyDcs = cms.bool( True ),
)

hltESPPixelCPETemplateReco = cms.ESProducer( "PixelCPETemplateRecoESProducer",
DoCosmics = cms.bool( False ),
LoadTemplatesFromDB = cms.bool( True ),
ComponentName = cms.string( "hltESPPixelCPETemplateReco" ),
Alpha2Order = cms.bool( True ),
ClusterProbComputationFlag = cms.int32( 0 ),
speed = cms.int32( -2 ),
UseClusterSplitter = cms.bool( False )
)

hltESPPixelCPEGeneric = cms.ESProducer( "PixelCPEGenericESProducer",
EdgeClusterErrorX = cms.double( 50.0 ),
DoCosmics = cms.bool( False ),
LoadTemplatesFromDB = cms.bool( True ),
UseErrorsFromTemplates = cms.bool( True ),
eff_charge_cut_highX = cms.double( 1.0 ),
TruncatePixelCharge = cms.bool( True ),
size_cutY = cms.double( 3.0 ),
size_cutX = cms.double( 3.0 ),
inflate_all_errors_no_trk_angle = cms.bool( False ),
IrradiationBiasCorrection = cms.bool( False ),
TanLorentzAnglePerTesla = cms.double( 0.106 ),
inflate_errors = cms.bool( False ),
eff_charge_cut_lowX = cms.double( 0.0 ),
eff_charge_cut_highY = cms.double( 1.0 ),
ClusterProbComputationFlag = cms.int32( 0 ),
EdgeClusterErrorY = cms.double( 85.0 ),
ComponentName = cms.string( "hltESPPixelCPEGeneric" ),
eff_charge_cut_lowY = cms.double( 0.0 ),
PixelErrorParametrization = cms.string( "NOTcmsim" ),
Alpha2Order = cms.bool( True )
)

hltESPTTRHBuilderAngleAndTemplate = cms.ESProducer( "TkTransientTrackingRecHitBuilderESProducer",
StripCPE = cms.string( "hltESPStripCPEfromTrackAngle" ),
Matcher = cms.string( "StandardMatcher" ),
ComputeCoarseLocalPositionFromDisk = cms.bool( False ),
PixelCPE = cms.string( "hltESPPixelCPETemplateReco" ),
ComponentName = cms.string( "hltESPTTRHBuilderAngleAndTemplate" )
)

hltESPTTRHBWithTrackAngle = cms.ESProducer( "TkTransientTrackingRecHitBuilderESProducer",
StripCPE = cms.string( "hltESPStripCPEfromTrackAngle" ),
Matcher = cms.string( "StandardMatcher" ),
ComputeCoarseLocalPositionFromDisk = cms.bool( False ),
PixelCPE = cms.string( "hltESPPixelCPEGeneric" ),
ComponentName = cms.string( "hltESPTTRHBWithTrackAngle" )
)

hltESPStripCPEfromTrackAngle = cms.ESProducer( "StripCPEESProducer",
ComponentType = cms.string( "StripCPEfromTrackAngle" ),
ComponentName = cms.string( "hltESPStripCPEfromTrackAngle" ),
parameters = cms.PSet(
mLC_P2 = cms.double( 0.3 ),
mLC_P1 = cms.double( 0.618 ),
mLC_P0 = cms.double( -0.326 ),
useLegacyError = cms.bool( True ),
mTEC_P1 = cms.double( 0.471 ),
mTEC_P0 = cms.double( -1.885 ),
mTOB_P0 = cms.double( -1.026 ),
mTOB_P1 = cms.double( 0.253 ),
mTIB_P0 = cms.double( -0.742 ),
mTIB_P1 = cms.double( 0.202 ),
mTID_P0 = cms.double( -1.427 ),
mTID_P1 = cms.double( 0.433 )
)
)

from RecoTracker.TrackProducer.TrackRefitter_cfi import *
hltTrackRefitterForSiStripMonitorTrack = TrackRefitter.clone()
hltTrackRefitterForSiStripMonitorTrack.beamSpot = cms.InputTag("hltOnlineBeamSpot")
Expand All @@ -53,6 +121,8 @@
hltTrackRefitterForSiStripMonitorTrack.useHitsSplitting = cms.bool(False)
#hltTrackRefitterForSiStripMonitorTrack.src = cms.InputTag("hltIter4Merged") # scenario 0
hltTrackRefitterForSiStripMonitorTrack.src = cms.InputTag("hltIter2Merged") # scenario 1
#hltTrackRefitterForSiStripMonitorTrack.TTRHBuilder = cms.string('hltESPTTRHBuilderAngleAndTemplate')
hltTrackRefitterForSiStripMonitorTrack.TTRHBuilder = cms.string('hltESPTTRHBWithTrackAngle')

import DQM.SiStripMonitorTrack.SiStripMonitorTrack_cfi
HLTSiStripMonitorTrack = DQM.SiStripMonitorTrack.SiStripMonitorTrack_cfi.SiStripMonitorTrack.clone()
Expand Down
4 changes: 0 additions & 4 deletions FWCore/Framework/interface/InputSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ namespace edm {
/// Accessor for Process Configuration
ProcessConfiguration const& processConfiguration() const {return moduleDescription().processConfiguration();}

/// Accessor for primary input source flag
bool primary() const {return primary_;}

/// Accessor for global process identifier
std::string const& processGUID() const {return processGUID_;}

Expand Down Expand Up @@ -441,7 +438,6 @@ namespace edm {
std::unique_ptr<ProcessHistoryRegistry> processHistoryRegistry_;
std::shared_ptr<BranchIDListHelper> branchIDListHelper_;
std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper_;
bool const primary_;
std::string processGUID_;
Timestamp time_;
mutable bool newRun_;
Expand Down
10 changes: 3 additions & 7 deletions FWCore/Framework/src/InputSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ namespace edm {
processHistoryRegistry_(new ProcessHistoryRegistry),
branchIDListHelper_(desc.branchIDListHelper_),
thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_),
primary_(pset.getParameter<std::string>("@module_label") == std::string("@main_input")),
processGUID_(primary_ ? createGlobalIdentifier() : std::string()),
processGUID_(createGlobalIdentifier()),
time_(),
newRun_(true),
newLumi_(true),
Expand All @@ -84,12 +83,9 @@ namespace edm {
}
if (maxSecondsUntilRampdown_ > 0) {
processingStart_ = std::chrono::steady_clock::now();
}

// Secondary input sources currently do not have a product registry.
if(primary_) {
assert(desc.productRegistry_ != 0);
}

assert(desc.productRegistry_ != 0);
std::string const defaultMode("RunsLumisAndEvents");
std::string const runMode("Runs");
std::string const runLumiMode("RunsAndLumis");
Expand Down
4 changes: 2 additions & 2 deletions FWCore/ParameterSet/python/Types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ def testFileInPath(self):
f = FileInPath("FWCore/ParameterSet/python/Types.py")
self.assertEqual(f.configValue(), "'FWCore/ParameterSet/python/Types.py'")
def testSecSource(self):
s1 = SecSource("PoolSource", fileNames = vstring("foo.root"))
s1 = SecSource("MixingSource", fileNames = vstring("foo.root"))
self.assertEqual(s1.type_(), "PoolSource")
self.assertEqual(s1.configValue(),
"""PoolSource { """+"""
Expand All @@ -1395,7 +1395,7 @@ def testSecSource(self):
}
""")
s1=SecSource("PoolSource",type=int32(1))
s1=SecSource("MixingSource",type=int32(1))
self.assertEqual(s1.type.value(),1)
def testEventID(self):
eid = EventID(2, 0, 3)
Expand Down
2 changes: 1 addition & 1 deletion FWCore/ParameterSet/test/complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
)

process.mix = cms.EDProducer("MixingModule",
input = cms.SecSource("PoolSource",
input = cms.SecSource("MixingSource",
fileNames = cms.untracked.vstring("file:pileup.root")
),
mixtype = cms.string("fixed"),
Expand Down
2 changes: 1 addition & 1 deletion FWCore/PythonParameterSet/test/makepset_t.cppunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void testmakepset::secsourceAux() {
" fileName = cms.string('file:CumHits.root')\n"
")\n"
"process.mix = cms.EDFilter('MixingModule',\n"
" input = cms.SecSource('PoolSource',\n"
" input = cms.SecSource('MixingSource',\n"
" fileNames = cms.untracked.vstring('file:pileup.root')\n"
" ),\n"
" max_bunch = cms.int32(3),\n"
Expand Down
83 changes: 30 additions & 53 deletions FWCore/Sources/interface/VectorInputSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ VectorInputSource: Abstract interface for vector input sources.
----------------------------------------------------------------------*/

#include "DataFormats/Common/interface/SecondaryEventIDAndFileInfo.h"
#include "FWCore/Framework/interface/InputSource.h"
#include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h"
#include "DataFormats/Provenance/interface/ProductRegistry.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include <memory>
#include <string>
Expand All @@ -18,84 +20,59 @@ namespace CLHEP {

namespace edm {
class EventPrincipal;
struct InputSourceDescription;
class LuminosityBlockID;
struct VectorInputSourceDescription;
class EventID;
class ParameterSet;
class VectorInputSource : public InputSource {
class VectorInputSource {
public:
explicit VectorInputSource(ParameterSet const& pset, InputSourceDescription const& desc);
explicit VectorInputSource(ParameterSet const& pset, VectorInputSourceDescription const& desc);
virtual ~VectorInputSource();

template<typename T>
size_t loopRandom(EventPrincipal& cache, size_t& fileNameHash, size_t number, T eventOperator, CLHEP::HepRandomEngine*);
template<typename T>
size_t loopSequential(EventPrincipal& cache, size_t& fileNameHash, size_t number, T eventOperator);
template<typename T>
size_t loopRandomWithID(EventPrincipal& cache, size_t& fileNameHash, LuminosityBlockID const& id, size_t number, T eventOperator, CLHEP::HepRandomEngine*);
template<typename T>
size_t loopSequentialWithID(EventPrincipal& cache, size_t& fileNameHash, LuminosityBlockID const& id, size_t number, T eventOperator);
size_t loopOverEvents(EventPrincipal& cache, size_t& fileNameHash, size_t number, T eventOperator, CLHEP::HepRandomEngine* = nullptr, EventID const* id = nullptr);

template<typename T, typename Iterator>
size_t loopSpecified(EventPrincipal& cache, size_t& fileNameHash, Iterator const& begin, Iterator const& end, T eventOperator);

void dropUnwantedBranches(std::vector<std::string> const& wantedBranches);
//
/// Called at beginning of job
void doBeginJob();

/// Called at end of job
void doEndJob();

std::shared_ptr<ProductRegistry const> productRegistry() const {return productRegistry_;}
ProductRegistry& productRegistryUpdate() const {return *productRegistry_;}
ProcessHistoryRegistry const& processHistoryRegistry() const {return *processHistoryRegistry_;}
ProcessHistoryRegistry& processHistoryRegistryForUpdate() {return *processHistoryRegistry_;}

private:

void clearEventPrincipal(EventPrincipal& cache);
virtual void readOneRandom(EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*) = 0;
virtual bool readOneRandomWithID(EventPrincipal& cache, size_t& fileNameHash, LuminosityBlockID const& id, CLHEP::HepRandomEngine*) = 0;
virtual bool readOneSequential(EventPrincipal& cache, size_t& fileNameHash) = 0;
virtual bool readOneSequentialWithID(EventPrincipal& cache, size_t& fileNameHash, LuminosityBlockID const& id) = 0;

private:
virtual bool readOneEvent(EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine*, EventID const* id) = 0;
virtual void readOneSpecified(EventPrincipal& cache, size_t& fileNameHash, SecondaryEventIDAndFileInfo const& event) = 0;
void readOneSpecified(EventPrincipal& cache, size_t& fileNameHash, EventID const& event) {
SecondaryEventIDAndFileInfo info(event, fileNameHash);
readOneSpecified(cache, fileNameHash, info);
}

virtual void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches) = 0;
};

template<typename T>
size_t VectorInputSource::loopRandom(EventPrincipal& cache, size_t& fileNameHash, size_t number, T eventOperator, CLHEP::HepRandomEngine* engine) {
size_t i = 0U;
for(; i < number; ++i) {
clearEventPrincipal(cache);
readOneRandom(cache, fileNameHash, engine);
eventOperator(cache, fileNameHash);
}
return i;
}

template<typename T>
size_t VectorInputSource::loopSequential(EventPrincipal& cache, size_t& fileNameHash, size_t number, T eventOperator) {
size_t i = 0U;
for(; i < number; ++i) {
clearEventPrincipal(cache);
bool found = readOneSequential(cache, fileNameHash);
if(!found) break;
eventOperator(cache, fileNameHash);
}
return i;
}
virtual void beginJob() = 0;
virtual void endJob() = 0;

template<typename T>
size_t VectorInputSource::loopRandomWithID(EventPrincipal& cache, size_t& fileNameHash, LuminosityBlockID const& id, size_t number, T eventOperator, CLHEP::HepRandomEngine* engine) {
size_t i = 0U;
for(; i < number; ++i) {
clearEventPrincipal(cache);
bool found = readOneRandomWithID(cache, fileNameHash, id, engine);
if(!found) break;
eventOperator(cache, fileNameHash);
}
return i;
}
std::shared_ptr<ProductRegistry> productRegistry_;
std::unique_ptr<ProcessHistoryRegistry> processHistoryRegistry_;
};

template<typename T>
size_t VectorInputSource::loopSequentialWithID(EventPrincipal& cache, size_t& fileNameHash, LuminosityBlockID const& id, size_t number, T eventOperator) {
size_t VectorInputSource::loopOverEvents(EventPrincipal& cache, size_t& fileNameHash, size_t number, T eventOperator, CLHEP::HepRandomEngine* engine, EventID const* id) {
size_t i = 0U;
for(; i < number; ++i) {
clearEventPrincipal(cache);
bool found = readOneSequentialWithID(cache, fileNameHash, id);
bool found = readOneEvent(cache, fileNameHash, engine, id);
if(!found) break;
eventOperator(cache, fileNameHash);
}
Expand Down
30 changes: 30 additions & 0 deletions FWCore/Sources/interface/VectorInputSourceDescription.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef FWCore_Framework_InputSourceDescription_h
#define FWCore_Framework_InputSourceDescription_h

/*----------------------------------------------------------------------
VectorInputSourceDescription : the stuff that is needed to configure
a VectorinputSource that does not come in through the ParameterSet
----------------------------------------------------------------------*/

#include "FWCore/Framework/src/PreallocationConfiguration.h"

namespace edm {
class PreallocationConfiguration;
class ProductRegistry;

struct VectorInputSourceDescription {
VectorInputSourceDescription() :
productRegistry_(nullptr) {
}

VectorInputSourceDescription(ProductRegistry& preg, PreallocationConfiguration const& allocations) :
productRegistry_(&preg), allocations_(&allocations) {
}

ProductRegistry* productRegistry_;
PreallocationConfiguration const* allocations_;
};
}

#endif
6 changes: 3 additions & 3 deletions FWCore/Sources/interface/VectorInputSourceFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <string>

namespace edm {
struct InputSourceDescription;
struct VectorInputSourceDescription;
class ParameterSet;

typedef VectorInputSource* (ISVecFunc)(ParameterSet const&, InputSourceDescription const&);
typedef VectorInputSource* (ISVecFunc)(ParameterSet const&, VectorInputSourceDescription const&);
typedef edmplugin::PluginFactory<ISVecFunc> VectorInputSourcePluginFactory;

class VectorInputSourceFactory {
Expand All @@ -22,7 +22,7 @@ namespace edm {

std::unique_ptr<VectorInputSource>
makeVectorInputSource(ParameterSet const&,
InputSourceDescription const&) const;
VectorInputSourceDescription const&) const;

private:
VectorInputSourceFactory();
Expand Down

0 comments on commit 8ba636a

Please sign in to comment.