Skip to content

Commit

Permalink
Merge pull request cms-sw#3135 from cerminar/pclForCosmics_from700
Browse files Browse the repository at this point in the history
Pcl for cosmics: specialize PromptCalibProd streams for running only cosmic friendly workflows
  • Loading branch information
davidlange6 committed Apr 2, 2014
2 parents 2ecd6e1 + de27023 commit 0d9fe55
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 0 deletions.
@@ -0,0 +1,17 @@
import FWCore.ParameterSet.Config as cms




OutALCARECOPromptCalibProdSiStrip_noDrop = cms.PSet(
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstring('pathALCARECOPromptCalibProdSiStrip')
),
outputCommands = cms.untracked.vstring(
'keep *_MEtoEDMConvertSiStrip_*_*')
)

import copy

OutALCARECOPromptCalibProdSiStrip=copy.deepcopy(OutALCARECOPromptCalibProdSiStrip_noDrop)
OutALCARECOPromptCalibProdSiStrip.outputCommands.insert(0, "drop *")
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms


seqALCARECOPromptCalibProdSiStrip = cms.Sequence()


6 changes: 6 additions & 0 deletions TkAlCaRecoProducers/test/BuildFile.xml
@@ -0,0 +1,6 @@
<use name="DQMServices/Core"/>
<use name="FWCore/Framework"/>
<use name="boost"/>
<library file="DQMRootFileReader.cc" name="CalibrationTkAlCaRecoProducersDQMRootFileReader">
<flags EDM_PLUGIN="1"/>
</library>
99 changes: 99 additions & 0 deletions TkAlCaRecoProducers/test/DQMRootFileReader.cc
@@ -0,0 +1,99 @@
// -*- C++ -*-
//
// Class: DQMRootFileReader
//
/**\class DQMRootFileReader
Description: Simple example showing how to read MonitorElements from a DQM plain ROOT file
Implementation:
<Notes on implementation>
*/
//
//
//


// system include files
#include <string>
#include <vector>
#include <iostream>

// user include files
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"


using std::cout;
using std::endl;

//
// class declaration
//
class DQMRootFileReader : public edm::EDAnalyzer {
public:
explicit DQMRootFileReader( const edm::ParameterSet& );
~DQMRootFileReader();

virtual void analyze( const edm::Event&, const edm::EventSetup& );

virtual void endJob(void);

private:
// ----------member data ---------------------------

// back-end interface
DQMStore * dbe;
std::string filename;
};

//
// constructors and destructor
//
DQMRootFileReader::DQMRootFileReader(const edm::ParameterSet& iConfig ) {
// get hold of back-end interface
dbe = edm::Service<DQMStore>().operator->();

filename = iConfig.getUntrackedParameter<std::string>("RootFileName", "test_playback.root");
}



DQMRootFileReader::~DQMRootFileReader() {
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)

}


void DQMRootFileReader::endJob(void)
{
cout << "Dumping DQMStore dir structure:" << endl;
dbe->showDirStructure();
// dbe->save("test.root");
}


//
// member functions
//

// ------------ method called to produce the data ------------
void DQMRootFileReader::analyze(const edm::Event& iEvent,
const edm::EventSetup& iSetup )
{
// NOTE: this is here just because we need it after the beginRun of MEtoEDMCoverter which calls a Reset on all MEs.
dbe->open(filename, false, "","",DQMStore::OpenRunDirs::StripRunDirs);
dbe->showDirStructure();

}

// define this as a plug-in
DEFINE_FWK_MODULE(DQMRootFileReader);

62 changes: 62 additions & 0 deletions TkAlCaRecoProducers/test/convertSiStripRootDQMFileToEDM_cfg.py
@@ -0,0 +1,62 @@
import FWCore.ParameterSet.Config as cms

""" This python cfg converts a plain DQM root file in a EDM file that can be used to run the SiStrip bad channel calibration as done @ Tier0"""



process = cms.Process("CONV")

#process.load("DQMServices.Core.test.MessageLogger_cfi")
process.load('Configuration.EventContent.EventContent_cff')
process.load("DQMServices.Core.DQM_cfg")
#process.DQMStore.collateHistograms = cms.untracked.bool(True)



process.fileReader = cms.EDAnalyzer("DQMRootFileReader",
RootFileName = cms.untracked.string
('/build/cerminar/debugpcl/CMSSW_5_3_16/src/Calibration/TkAlCaRecoProducers/test/DQM_V0001_R000160819__StreamExpress__Run2011A-Express-v1__DQM.root')
)

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)


runNumber = int(process.fileReader.RootFileName.value().split('/')[-1].split('_')[2].lstrip("R"))
print "Run number extracted from file name:",runNumber

process.source = cms.Source("EmptySource",
firstRun = cms.untracked.uint32(runNumber),
)




process.ALCARECOStreamSiStripPCLHistos = cms.OutputModule("PoolOutputModule",
outputCommands = cms.untracked.vstring('drop *',
'keep *_MEtoEDMConvertSiStrip_*_*'),
fileName = cms.untracked.string('SiStripPCLHistos.root'),
dataset = cms.untracked.PSet(
filterName = cms.untracked.string(''),
dataTier = cms.untracked.string('ALCARECO')
),
eventAutoFlushCompressedSize = cms.untracked.int32(5242880)
)

process.MEtoEDMConvertSiStrip = cms.EDProducer("MEtoEDMConverter",
deleteAfterCopy = cms.untracked.bool(False),
Verbosity = cms.untracked.int32(0),
Frequency = cms.untracked.int32(50),
Name = cms.untracked.string('MEtoEDMConverter'),
MEPathToSave = cms.untracked.string('AlCaReco/SiStrip')
)



process.path = cms.Path(process.fileReader)
process.ALCARECOStreamSiStripPCLHistosOutPath = cms.EndPath(process.ALCARECOStreamSiStripPCLHistos)
process.endjob_step = cms.EndPath(process.MEtoEDMConvertSiStrip)


process.schedule = cms.Schedule(process.path, process.endjob_step, process.ALCARECOStreamSiStripPCLHistosOutPath)

0 comments on commit 0d9fe55

Please sign in to comment.