From a12dbbb9865546259ee4353f3f54fe7278ef044f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Brochet?= Date: Mon, 21 Sep 2015 16:03:06 +0200 Subject: [PATCH 1/2] Add very simple unit test to check that the framework is running --- test/BuildFile.xml | 4 ++++ test/TestDriver.cc | 3 +++ test/run_tests.sh | 7 +++++++ test/unit_tests_mc.py | 13 +++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 test/BuildFile.xml create mode 100644 test/TestDriver.cc create mode 100755 test/run_tests.sh create mode 100644 test/unit_tests_mc.py diff --git a/test/BuildFile.xml b/test/BuildFile.xml new file mode 100644 index 0000000..0a7a41f --- /dev/null +++ b/test/BuildFile.xml @@ -0,0 +1,4 @@ + + + + diff --git a/test/TestDriver.cc b/test/TestDriver.cc new file mode 100644 index 0000000..b2991bd --- /dev/null +++ b/test/TestDriver.cc @@ -0,0 +1,3 @@ +#include "FWCore/Utilities/interface/TestHelper.h" + +RUNTEST() diff --git a/test/run_tests.sh b/test/run_tests.sh new file mode 100755 index 0000000..38cd4c3 --- /dev/null +++ b/test/run_tests.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Pass in name and status +function die { echo $1: status $2 ; exit $2; } + +F1=${LOCAL_TEST_DIR}/unit_tests_mc.py +(cmsRun $F1 ) || die "Failure using $F1" $? diff --git a/test/unit_tests_mc.py b/test/unit_tests_mc.py new file mode 100644 index 0000000..ed18fbe --- /dev/null +++ b/test/unit_tests_mc.py @@ -0,0 +1,13 @@ + +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +from cp3_llbb.Framework import Framework + +process = Framework.create(False, eras.Run2_25ns, '74X_mcRun2_asymptotic_v2', redoJEC=True) + +process.source.fileNames = cms.untracked.vstring( + 'file:///afs/cern.ch/user/s/sbrochet/public/CP3/TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_Asympt25ns_MCRUN2_74_V9_reduced.root' + ) + +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10)) From 0b85fab59cfc2de28d34a9d0e099bae473228b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Brochet?= Date: Tue, 22 Sep 2015 10:09:04 +0200 Subject: [PATCH 2/2] Add data unit tests --- test/run_tests.sh | 3 +++ test/unit_tests_data.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/unit_tests_data.py diff --git a/test/run_tests.sh b/test/run_tests.sh index 38cd4c3..9f5fb55 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -5,3 +5,6 @@ function die { echo $1: status $2 ; exit $2; } F1=${LOCAL_TEST_DIR}/unit_tests_mc.py (cmsRun $F1 ) || die "Failure using $F1" $? + +F2=${LOCAL_TEST_DIR}/unit_tests_data.py +(cmsRun $F2 ) || die "Failure using $F2" $? diff --git a/test/unit_tests_data.py b/test/unit_tests_data.py new file mode 100644 index 0000000..f2119b6 --- /dev/null +++ b/test/unit_tests_data.py @@ -0,0 +1,13 @@ + +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras +from cp3_llbb.Framework import Framework + +process = Framework.create(True, eras.Run2_50ns, '74X_dataRun2_v2', redoJEC=True) + +process.source.fileNames = cms.untracked.vstring( + 'file:///afs/cern.ch/user/s/sbrochet/public/CP3/DoubleMuon-Run2015B-17Jul2015-v1-MiniAOD_reduced.root' + ) + +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10))