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

NanoAOD update #21095

Merged
merged 81 commits into from Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
a7d14c6
add met unclustered uncertainty
gouskos Oct 2, 2017
cb9f8be
Merge tag 'CMSSW_9_4_0_pre2'
gpetruc Oct 3, 2017
e3a763a
Merge branch 'nano_94X' of github.com:cms-nanoAOD/cmssw
gpetruc Oct 4, 2017
4639b6a
first implementation of isolated tracks for nanoAOD
fgolf Sep 29, 2017
5837ea0
remove high purity requirement
fgolf Sep 29, 2017
8319f9c
change tabs to spaces; change int to bool where appropriate
fgolf Oct 4, 2017
7c35d56
improved size & doc report
gpetruc Oct 5, 2017
0bd3bb5
Added non-PF track, ecal and hcal isolation within a cone of 0.3
olaiya Oct 5, 2017
bb9a53a
set executable bit
gpetruc Oct 5, 2017
aa121ec
Merge pull request #37 from gpetruc/better_size_and_doc_report
gpetruc Oct 5, 2017
bcf76ce
Merge pull request #40 from arizzi/nano_94X_wTests
arizzi Oct 5, 2017
66c6391
For electrons with pt > 35.0 GeV store non-PF track, ecal and hcal is…
olaiya Oct 9, 2017
ce615a5
Merge pull request #38 from olaiya/cms-nanoAOD/master_moreElectronVars
gpetruc Oct 12, 2017
e45aa9c
Merge pull request #32 from fgolf/forNanoAOD_isoTracks
gpetruc Oct 12, 2017
28b98c7
Update met_cff.py
gouskos Oct 12, 2017
feba362
Merge pull request #31 from gouskos/cms-nanoAOD/nano_94X
gpetruc Oct 12, 2017
e854212
Merge branch 'nano_94X' of github.com:cms-nanoAOD/cmssw into merge_94X
gpetruc Oct 12, 2017
7466494
Merge remote-tracking branch 'my-cmssw/Comp2RefEqualH_for_TProfile' i…
gpetruc Oct 12, 2017
48a003a
support for merging flat tables
gpetruc Sep 22, 2017
35be574
DQM (to be continued)
gpetruc Sep 22, 2017
945ca51
Support for getting any value from FlatTable given row & column
gpetruc Sep 25, 2017
ba280e4
Change configuration syntax, support profile plots
gpetruc Sep 25, 2017
ed9165d
FlatTable::RowView (transient-only, for DQM)
gpetruc Sep 26, 2017
8172f72
more DQM stuff
gpetruc Sep 26, 2017
fc3a72e
improve DQM
gpetruc Sep 28, 2017
30fa9d1
Get DQM running on top of current master branch
gpetruc Oct 9, 2017
e6e66bb
Get NanoAOD DQM running with cmsDriver
gpetruc Oct 9, 2017
5abf173
add quality test (identity to reference)
gpetruc Oct 9, 2017
5225e72
run QTest in DQMOffline_SecondStep_cff
gpetruc Oct 9, 2017
e1b49ea
code-checks
gpetruc Oct 9, 2017
1e6f98c
fix DQM for eCorr and pt
gpetruc Oct 10, 2017
347716c
fix quotes in nanoDQM_cfi.py
gpetruc Oct 10, 2017
bda4452
prepareDQM: allow update-in-place with -u
gpetruc Oct 10, 2017
c674c1d
update DQM plots
gpetruc Oct 12, 2017
39c8317
Merged master from repository cms-nanoAOD with cms-merge-topic
fgolf Oct 12, 2017
40b7fc7
change from rho-central-neutral to rho-all for mini-iso for muons, el…
fgolf Oct 12, 2017
84220df
Merged master from repository cms-nanoAOD with cms-merge-topic
veelken Oct 17, 2017
99ee41c
replaced GenVisTau pdgId by charge and added mass
veelken Oct 17, 2017
9aa2f23
Merge pull request #47 from fgolf/nanoaod_rhoeffa_v2
gpetruc Oct 18, 2017
f47c5c4
Merge branch 'pre3' into cms-nanoAOD/master
arizzi Oct 25, 2017
13763c9
Merge pull request #50 from arizzi/nanoPre3
arizzi Oct 25, 2017
ce6c86e
Merge branch 'master' into DQM_and_qtests
arizzi Oct 25, 2017
128d0db
Merge pull request #43 from gpetruc/DQM_and_qtests
arizzi Oct 25, 2017
635417f
Merge branch 'master' of https://github.com/cms-nanoAOD/cmssw into fr…
veelken Oct 25, 2017
0f2841e
updated DQM plots for GenVisTau
veelken Oct 25, 2017
dd078f8
Re-adding jet changes on top of correct 940pre3 head
rappoccio Oct 25, 2017
c6eccc4
Restoring the b taggers
rappoccio Oct 25, 2017
40e9180
Adding 80x customization
rappoccio Oct 25, 2017
861d9bf
Merge pull request #49 from veelken/from-CMSSW_9_4_0_pre2
gpetruc Oct 25, 2017
96cca03
Fix DQM whitespace error from #49
gpetruc Oct 25, 2017
b66fbff
Adding customization
rappoccio Oct 25, 2017
c86b6ba
Adding N2 and N3, removing mpruned
rappoccio Oct 26, 2017
5746969
Renaming gen jet tables for AK8 and subjet AK8 correctly
rappoccio Oct 26, 2017
8076d2f
Fix N3 maximum in plot.
rappoccio Oct 27, 2017
1434654
use deterministic e/gamma smearing from https://github.com/cms-sw/cms…
gpetruc Oct 30, 2017
acde29c
Putting back isoTrack for 92x
rappoccio Oct 30, 2017
e1e21ad
add genpart mass and x1,x2
arizzi Oct 30, 2017
7cc7fcf
Merge pull request #53 from gpetruc/deterministic_egamma
gpetruc Oct 30, 2017
51c2acf
add gen particle mass in dqm
arizzi Oct 30, 2017
93b5885
reduce x1,x2 precision, fix codechecks
arizzi Oct 30, 2017
bc41c20
run QGL in 80X
arizzi Oct 30, 2017
488adca
Get some valid PDF weights on 80X MG5-MLM samples (work around differ…
gpetruc Oct 30, 2017
d77816f
Protection against zero-length collections in inspectNanoFile.py
gpetruc Oct 30, 2017
ec7093c
Merge pull request #56 from gpetruc/fixes_for_80X_tests
gpetruc Oct 30, 2017
11e4c3d
Merge pull request #54 from arizzi/genMassX1X2
arizzi Oct 31, 2017
d14734a
Merge pull request #55 from arizzi/qgl80x
arizzi Oct 31, 2017
c26f147
Merge branch 'master' into NanoAOD_940pre3
arizzi Oct 31, 2017
4d6172d
Merge branch 'master' into NanoAOD_940pre3
arizzi Oct 31, 2017
81b65a2
Merge pull request #52 from rappoccio/NanoAOD_940pre3
arizzi Oct 31, 2017
18b2b98
Add nTracker layers with measurement to muons
arizzi Oct 31, 2017
e0cea8a
PatAlgos LeptonUpdater: support for recomputing miniIsolation (needed…
gpetruc Oct 31, 2017
ba22349
Recompute miniIsolation for electrons and muons when running on 80X m…
gpetruc Oct 31, 2017
0330dab
Fix DQM from #52 (tool is picky about number formats and variable order)
gpetruc Oct 31, 2017
6322a9f
adapt relvals config to 940pre3
arizzi Oct 31, 2017
c86cc79
Merge pull request #59 from gpetruc/miniIso_80X
gpetruc Oct 31, 2017
1f28d85
add muon change to dqm
arizzi Oct 31, 2017
baa0bd1
Merge pull request #60 from arizzi/muonAndCMSDriver
arizzi Oct 31, 2017
8af4051
Add DQM to runTheMatrix NANOAOD default
arizzi Nov 2, 2017
74c9642
Merge branch 'master' into oct31st
arizzi Nov 2, 2017
9712582
Merge branch 'master' into oct31st
arizzi Nov 2, 2017
d960152
Add comments to explain logic to handle old 80X pdf weights in MLM sa…
gpetruc Nov 14, 2017
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: 6 additions & 6 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Expand Up @@ -478,7 +478,7 @@ def identitySim(wf):
#input for a NANOAOD from MINIAOD workflow
steps['ZEE_13_80XNanoAODINPUT']={'INPUT':InputInfo(dataSet='/RelValZEE_13/CMSSW_8_0_21-PU25ns_80X_mcRun2_asymptotic_2016_TrancheIV_v6_Tr4GT_v6-v1/MINIAODSIM',label='nanoaod80X',location='STD')}
steps['TTbar_13_92XNanoAODINPUT']={'INPUT':InputInfo(dataSet='/RelValTTbar_13/CMSSW_9_2_12-PU25ns_92X_upgrade2017_realistic_v11-v1/MINIAODSIM',label='nanoaod92X',location='STD')}
steps['TTbar_13_94XNanoAODINPUT']={'INPUT':InputInfo(dataSet='/RelValTTbar_13/CMSSW_9_4_0_pre1-PU25ns_93X_mc2017_realistic_v3-v1/MINIAODSIM',label='nanoaod94X',location='STD')}
steps['TTbar_13_94XNanoAODINPUT']={'INPUT':InputInfo(dataSet='/RelValTTbar_13/CMSSW_9_4_0_pre3-PU25ns_94X_mc2017_realistic_v4-v1/MINIAODSIM',label='nanoaod94X',location='STD')}

# 13 TeV recycle GEN-SIM input
steps['MinBias_13INPUT']={'INPUT':InputInfo(dataSet='/RelValMinBias_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')}
Expand Down Expand Up @@ -1978,12 +1978,12 @@ def gen2018HiMix(fragment,howMuch):
'--datatier' : 'MINIAODSIM',
'--eventcontent':'MINIAOD',},stepMiniAODMC])

stepNanoAODDefaults = { '-s': 'NANO,DQM:@nanoAODDQM', '-n': 1000 }
stepNanoAODData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @arizzi - my old and perhaps outdated/wrong understanding is that DQM can only be run in one step of a workflow for some technical reason. [dating from the miniAOD dqm saga]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the point... you mean "running in the same cmsRun" ? Perhaps for miniaod it was related to validation of the lossy compression?

stepNanoAODMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ])
stepNanoEDMData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD,DQM' ,'--datatier': 'NANOEDMAOD,DQMIO' }, stepNanoAODDefaults ])
stepNanoEDMMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOEDMAODSIM,DQMIO' }, stepNanoAODDefaults ])

stepNanoAODDefaults = { '-s': 'NANO', '-n': 1000 }
stepNanoAODData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD' ,'--datatier': 'NANOAOD' }, stepNanoAODDefaults ])
stepNanoAODMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM','--datatier': 'NANOAODSIM' }, stepNanoAODDefaults ])
stepNanoEDMData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD' ,'--datatier': 'NANOEDMAOD' }, stepNanoAODDefaults ])
stepNanoEDMMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM','--datatier': 'NANOEDMAODSIM' }, stepNanoAODDefaults ])

steps['NANOAOD2016'] = merge([{'--conditions': 'auto:run2_data_relval', '--era': 'Run2_2016'}, stepNanoAODData ])
steps['NANOAOD2017'] = merge([{'--conditions': 'auto:run2_data_relval', '--era': 'Run2_2017'}, stepNanoAODData ])
Expand Down
3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/DQMOfflineMC_cff.py
Expand Up @@ -28,3 +28,6 @@
label = 'TrackerCollisionSelectedTrackMonMB' + str(tracks)
locals()[label].doEffFromHitPatternVsBX = False

from PhysicsTools.NanoAOD.nanoDQM_cff import nanoDQMMC
DQMOfflineNanoAOD.replace(nanoDQM, nanoDQMMC)
#PostDQMOfflineNanoAOD.replace(nanoDQM, nanoDQMMC)
3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py
Expand Up @@ -18,6 +18,7 @@
from DQMOffline.Hcal.HcalDQMOfflinePostProcessor_cff import *
from DQMOffline.L1Trigger.L1TriggerDqmOffline_cff import *
from DQM.HcalTasks.OfflineHarvestingSequence_pp import *
from PhysicsTools.NanoAOD.nanoDQM_cff import *

DQMOffline_SecondStep_PreDPG = cms.Sequence( dqmDcsInfoClient *
ecal_dqm_client_offline *
Expand Down Expand Up @@ -140,3 +141,5 @@
DQMHarvestBTag = cms.Sequence( bTagCollectorSequenceDATA )

DQMHarvestMiniAOD = cms.Sequence( dataCertificationJetMETSequence * muonQualityTests_miniAOD)
DQMHarvestNanoAOD = cms.Sequence( nanoHarvest )

6 changes: 6 additions & 0 deletions DQMOffline/Configuration/python/DQMOffline_cff.py
Expand Up @@ -176,3 +176,9 @@
phase2_hcal.toReplaceWith( PostDQMOfflineMiniAOD, PostDQMOfflineMiniAOD.copyAndExclude([
pfMetDQMAnalyzerMiniAOD, pfPuppiMetDQMAnalyzerMiniAOD # No hcalnoise yet
]))


from PhysicsTools.NanoAOD.nanoDQM_cff import nanoDQM
DQMOfflineNanoAOD = cms.Sequence(nanoDQM)
#PostDQMOfflineNanoAOD = cms.Sequence(nanoDQM)

3 changes: 3 additions & 0 deletions DQMOffline/Configuration/python/autoDQM.py
Expand Up @@ -47,6 +47,9 @@
'miniAODDQM': ['DQMOfflineMiniAOD',
'PostDQMOfflineMiniAOD',
'DQMHarvestMiniAOD'],
'nanoAODDQM': ['DQMOfflineNanoAOD',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure this sequence is covered by at least one run the matrix workflow.

There is a change to relval steps, but that change only changes the dataset...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added for all relval involving NANOAOD

'PostDQMOffline',
'DQMHarvestNanoAOD'],
'standardDQM': ['DQMOffline',
'PostDQMOffline',
'dqmHarvesting'],
Expand Down
20 changes: 19 additions & 1 deletion DataFormats/NanoAOD/interface/FlatTable.h
Expand Up @@ -69,6 +69,22 @@ class FlatTable {
return * beginData<T>(column);
}

double getAnyValue(unsigned int row, unsigned int column) const ;

class RowView {
public:
RowView() {}
RowView(const FlatTable & table, unsigned int row) : table_(&table), row_(row) {}
double getAnyValue(unsigned int column) const { return table_->getAnyValue(row_, column); }
double getAnyValue(const std::string & column) const { return table_->getAnyValue(row_, table_->columnIndex(column)); }
const FlatTable & table() const { return *table_; }
unsigned int row() const { return row_; }
private:
const FlatTable * table_;
unsigned int row_;
};
RowView row(unsigned int row) const { return RowView(*this, row); }

template<typename T, typename C = std::vector<T>>
void addColumn(const std::string & name, const C & values, const std::string & docString, ColumnType type = defaultColumnType<T>(),int mantissaBits=-1) {
if (columnIndex(name) != -1) throw cms::Exception("LogicError", "Duplicated column: "+name);
Expand All @@ -94,7 +110,9 @@ class FlatTable {
vec.push_back( value );
}
}


void addExtension(const FlatTable & extension) ;

template<typename T> static ColumnType defaultColumnType() { throw cms::Exception("unsupported type"); }

// this below needs to be public for ROOT, but it is to be considered private otherwise
Expand Down
29 changes: 29 additions & 0 deletions DataFormats/NanoAOD/src/FlatTable.cc
Expand Up @@ -6,3 +6,32 @@ int nanoaod::FlatTable::columnIndex(const std::string & name) const {
}
return -1;
}

void nanoaod::FlatTable::addExtension(const nanoaod::FlatTable & other) {
if (extension() || !other.extension() || name() != other.name() || size() != other.size()) throw cms::Exception("LogicError", "Mismatch in adding extension");
for (unsigned int i = 0, n = other.nColumns(); i < n; ++i) {
switch(other.columnType(i)) {
case FloatColumn:
addColumn<float>(other.columnName(i), other.columnData<float>(i), other.columnDoc(i), other.columnType(i));
break;
case IntColumn:
addColumn<int>(other.columnName(i), other.columnData<int>(i), other.columnDoc(i), other.columnType(i));
break;
case BoolColumn: // as UInt8
case UInt8Column:
addColumn<uint8_t>(other.columnName(i), other.columnData<uint8_t>(i), other.columnDoc(i), other.columnType(i));
break;
}
}
}

double nanoaod::FlatTable::getAnyValue(unsigned int row, unsigned int column) const {
if (column >= nColumns()) throw cms::Exception("LogicError","Invalid column");
switch(columnType(column)) {
case FloatColumn: return *(beginData<float>(column)+row);
case IntColumn: return *(beginData<int>(column)+row);
case BoolColumn: return *(beginData<uint8_t>(column)+row);
case UInt8Column: return *(beginData<uint8_t>(column)+row);
}
throw cms::Exception("LogicError", "Unsupported type");
}
1 change: 1 addition & 0 deletions DataFormats/NanoAOD/src/classes.h
Expand Up @@ -9,6 +9,7 @@ namespace DataFormats_NanoAOD {
struct dictionary {
nanoaod::FlatTable table;
edm::Wrapper<nanoaod::FlatTable> w_table;
nanoaod::FlatTable::RowView table_cursor;
edm::Wrapper<nanoaod::MergeableCounterTable> w_mtable;
edm::Wrapper<nanoaod::UniqueString> w_ustr;
};
Expand Down
1 change: 1 addition & 0 deletions DataFormats/NanoAOD/src/classes_def.xml
Expand Up @@ -6,6 +6,7 @@
<class name="nanoaod::FlatTable" ClassVersion="3">
<version ClassVersion="3" checksum="2443023556"/>
</class>
<class name="nanoaod::FlatTable::RowView" transient="true" />
<class name="edm::Wrapper<nanoaod::FlatTable>" />

<class name="nanoaod::MergeableCounterTable::FloatColumn" ClassVersion="3">
Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/NanoAOD/plugins/BuildFile.xml
Expand Up @@ -13,7 +13,7 @@
<use name="RecoVertex/VertexPrimitives"/>
<use name="DataFormats/L1TGlobal"/>
<use name="IOPool/Provenance"/>

<use name="DQMServices/Core"/>
<library file="*.cc" name="PhysicsToolsNanoAODPlugins">
<flags EDM_PLUGIN="1"/>
</library>
27 changes: 24 additions & 3 deletions PhysicsTools/NanoAOD/plugins/GenWeightsTableProducer.cc
Expand Up @@ -227,10 +227,11 @@ class GenWeightsTableProducer : public edm::global::EDProducer<edm::StreamCache<
std::vector<ScaleVarWeight> scaleVariationIDs;
std::vector<PDFSetWeights> pdfSetWeightIDs;

std::regex weightgroup("<weightgroup\\s+combine=\"(.*)\"\\s+name=\"(.*)\"\\s*>");
std::regex weightgroup("<weightgroup\\s+combine=\"(.*)\"\\s+(?:name|type)=\"(.*)\"\\s*>");
std::regex endweightgroup("</weightgroup>");
std::regex scalew("<weight\\s+id=\"(\\d+)\">\\s*(muR=(\\S+)\\s+muF=(\\S+)(\\s+.*)?)</weight>");
std::regex scalew("<weight\\s+id=\"(\\d+)\">\\s*(mu[rR]=(\\S+)\\s+mu[Ff]=(\\S+)(\\s+.*)?)</weight>");
std::regex pdfw("<weight\\s+id=\"(\\d+)\">\\s*PDF set\\s*=\\s*(\\d+)\\s*</weight>");
std::regex pdfwOld("<weight\\s+id=\"(\\d+)\">\\s*Member \\s*(\\d+)\\s*</weight>");
std::smatch groups;
for (auto iter=lheInfo->headers_begin(), end = lheInfo->headers_end(); iter != end; ++iter) {
if (iter->tag() != "initrwgt") {
Expand All @@ -243,7 +244,7 @@ class GenWeightsTableProducer : public edm::global::EDProducer<edm::StreamCache<
if (lheDebug) std::cout << lines[iLine];
if (std::regex_search(lines[iLine], groups, weightgroup)) {
if (lheDebug) std::cout << ">>> Looks like the beginning of a weight group for " << groups.str(2) << std::endl;
if (groups.str(2) == "scale_variation") {
if (groups.str(2) == "scale_variation" || groups.str(2) == "Central scale variation") {
for ( ++iLine; iLine < nLines; ++iLine) {
if (lheDebug) std::cout << " " << lines[iLine];
if (std::regex_search(lines[iLine], groups, scalew)) {
Expand Down Expand Up @@ -276,6 +277,26 @@ class GenWeightsTableProducer : public edm::global::EDProducer<edm::StreamCache<
break;
}
}
} else if (groups.str(2) == "NNPDF30_lo_as_0130.LHgrid") { // some old 80X samples have PDF names in the header instead of using "PDF_variation" (e.g. MLM LO samples)
for ( ++iLine; iLine < nLines; ++iLine) { // we explicitly catch this one, and set the LHA ID by hand
if (lheDebug) std::cout << " " << lines[iLine];
if (std::regex_search(lines[iLine], groups, pdfwOld)) {
unsigned int lhaID = std::stoi(groups.str(2))+262000; // ids in LHE are 0 ... N, to be mapped to the LHAPDF ids 262000 ... 262000 + N
// 262000 is NNPDF30_lo_as_0130, as per https://lhapdf.hepforge.org/pdfsets.html
if (lheDebug) std::cout << " >>> PDF weight " << groups.str(1) << " for " << groups.str(2) << " = " << lhaID << std::endl;
if (lhaID == 262000) continue; // skip the central value weight as we have it already as nominal weight, only record the uncertainty weights
if (pdfSetWeightIDs.empty() || ! pdfSetWeightIDs.back().maybe_add(groups.str(1),lhaID)) {
pdfSetWeightIDs.emplace_back(groups.str(1),lhaID);
}
} else if (std::regex_search(lines[iLine], endweightgroup)) {
if (lheDebug) std::cout << ">>> Looks like the end of a weight group" << std::endl;
break;
} else if (std::regex_search(lines[iLine], weightgroup)) {
if (lheDebug) std::cout << ">>> Looks like the beginning of a new weight group, I will assume I missed the end of the group." << std::endl;
--iLine; // rewind by one, and go back to the outer loop
break;
}
}
} else {
for ( ++iLine; iLine < nLines; ++iLine) {
if (lheDebug) std::cout << " " << lines[iLine];
Expand Down