Skip to content

Commit

Permalink
Merge pull request #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 e7ddb1c + 1547ad6 commit 088700d
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 9 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 Calibration/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 Calibration/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);

@@ -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)
16 changes: 10 additions & 6 deletions Configuration/DataProcessing/python/Reco.py
Expand Up @@ -93,15 +93,18 @@ def alcaSkim(self, skims, **args):
"""

step = ""
if 'PromptCalibProd' in skims:
step = "ALCA:PromptCalibProd"
skims.remove('PromptCalibProd')
pclWflws = [x for x in skims if "PromptCalibProd" in x]
if len(pclWflws):
step = 'ALCA:'
for wfl in pclWflws:
step += wfl
skims.remove(wfl)

if len( skims ) > 0:
if step != "":
step += ","
step += "ALCAOUTPUT:"+('+'.join(skims))

options = Options()
options.__dict__.update(defaultOptions.__dict__)
options.scenario = self.cbSc
Expand All @@ -122,8 +125,9 @@ def alcaSkim(self, skims, **args):

# FIXME: dirty hack..any way around this?
# Tier0 needs the dataset used for ALCAHARVEST step to be a different data-tier
if 'PromptCalibProd' in step:
process.ALCARECOStreamPromptCalibProd.dataset.dataTier = cms.untracked.string('ALCAPROMPT')
for wfl in pclWflws:
methodToCall = getattr(process, 'ALCARECOStream'+wfl)
methodToCall.dataset.dataTier = cms.untracked.string('ALCAPROMPT')

return process

Expand Down
6 changes: 3 additions & 3 deletions Configuration/DataProcessing/test/run_CfgTest.sh
Expand Up @@ -36,9 +36,9 @@ runTest "${INPUT} --scenario=hcalnzs --reco --aod --alcareco --dqm --global-tag

INPUT=${LOCAL_TEST_DIR}/RunAlcaSkimming.py

runTest "${INPUT} --scenario pp --lfn=/store/whatever --global-tag GLOBALTAG::ALL --skims SiStripCalZeroBias+SiStripCalMinBias+TkAlMinBias+PromptCalibProd"
runTest "${INPUT} --scenario cosmics --lfn /store/whatever --global-tag GLOBALTAG::ALL --skims SiStripCalZeroBias+SiStripPCLHistos"
runTest "${INPUT} --scenario HeavyIons --lfn=/store/whatever --global-tag GLOBALTAG::ALL --skims SiStripCalZeroBias+SiStripCalMinBias+TkAlMinBiasHI+PromptCalibProd"
runTest "${INPUT} --scenario pp --lfn=/store/whatever --global-tag GLOBALTAG::ALL --skims SiStripCalZeroBias,SiStripCalMinBias,TkAlMinBias,PromptCalibProd"
runTest "${INPUT} --scenario cosmics --lfn /store/whatever --global-tag GLOBALTAG::ALL --skims SiStripCalZeroBias,SiStripPCLHistos"
runTest "${INPUT} --scenario HeavyIons --lfn=/store/whatever --global-tag GLOBALTAG::ALL --skims SiStripCalZeroBias,SiStripCalMinBias,TkAlMinBiasHI,PromptCalibProd"
runTest "${INPUT} --scenario AlCaLumiPixels --lfn /store/whatever --global-tag GLOBALTAG::ALL --skims LumiPixels"
#runTest "${INPUT} --scenario AlCaP0 --lfn /store/whatever --global-tag GLOBALTAG::ALL --skims EcalCalPi0Calib"
#runTest "${INPUT} --scenario AlCaPhiSymEcal --lfn /store/whatever --global-tag GLOBALTAG::ALL --skims EcalCalPhiSym"
Expand Down
1 change: 1 addition & 0 deletions Configuration/EventContent/python/AlCaRecoOutput_cff.py
Expand Up @@ -99,6 +99,7 @@
# stream for prompt-calibration @ Tier0
###############################################################
from Calibration.TkAlCaRecoProducers.ALCARECOPromptCalibProd_Output_cff import *
from Calibration.TkAlCaRecoProducers.ALCARECOPromptCalibProdSiStrip_Output_cff import *
from Calibration.TkAlCaRecoProducers.ALCARECOSiStripPCLHistos_Output_cff import *

# stream for the LumiPixels workflow
Expand Down
12 changes: 12 additions & 0 deletions Configuration/StandardSequences/python/AlCaRecoStreams_cff.py
Expand Up @@ -92,6 +92,7 @@
# stream for prompt-calibration @ Tier0
###############################################################
from Calibration.TkAlCaRecoProducers.ALCARECOPromptCalibProd_cff import *
from Calibration.TkAlCaRecoProducers.ALCARECOPromptCalibProdSiStrip_cff import *
from Calibration.TkAlCaRecoProducers.ALCARECOSiStripPCLHistos_cff import *


Expand Down Expand Up @@ -150,6 +151,7 @@
pathALCARECOMuAlGlobalCosmicsInCollisions = cms.Path(seqALCARECOMuAlGlobalCosmicsInCollisions*ALCARECOMuAlGlobalCosmicsInCollisionsDQM)
pathALCARECOMuAlGlobalCosmics = cms.Path(seqALCARECOMuAlGlobalCosmics*ALCARECOMuAlGlobalCosmicsDQM)
pathALCARECOPromptCalibProd = cms.Path(seqALCARECOPromptCalibProd)
pathALCARECOPromptCalibProdSiStrip = cms.Path(seqALCARECOPromptCalibProdSiStrip)
pathALCARECOSiStripPCLHistos = cms.Path(seqALCARECOSiStripPCLHistos)

# AlCaReco event content definitions:
Expand Down Expand Up @@ -466,6 +468,16 @@
dataTier = cms.untracked.string('ALCARECO')
)


ALCARECOStreamPromptCalibProdSiStrip = cms.FilteredStream(
responsible = 'Gianluca Cerminara',
name = 'PromptCalibProdSiStrip',
paths = (pathALCARECOPromptCalibProdSiStrip),
content = OutALCARECOPromptCalibProdSiStrip.outputCommands,
selectEvents = OutALCARECOPromptCalibProdSiStrip.SelectEvents,
dataTier = cms.untracked.string('ALCARECO')
)

ALCARECOStreamSiStripPCLHistos = cms.FilteredStream(
responsible = 'Gianluca Cerminara',
name = 'SiStripPCLHistos',
Expand Down

0 comments on commit 088700d

Please sign in to comment.