Skip to content

Commit

Permalink
Updated the MC setup for PbPb 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Govinda Stahl Leiton committed Apr 21, 2019
1 parent 65289e9 commit fe9e10a
Show file tree
Hide file tree
Showing 22 changed files with 595 additions and 861 deletions.
25 changes: 13 additions & 12 deletions VertexCompositeAnalyzer/plugins/PATCompositeTreeProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class PATCompositeTreeProducer : public edm::EDAnalyzer {
int Ntrkoffline;
int Npixel;
short nPV;
ushort candSize;
uint candSize;
bool trigHLT[MAXTRG];
bool evtSel[MAXSEL];
float HFsumETPlus;
Expand Down Expand Up @@ -282,7 +282,7 @@ class PATCompositeTreeProducer : public edm::EDAnalyzer {
// gen info
std::vector<reco::GenParticleRef> genVec_;
float weight_gen;
ushort candSize_gen;
uint candSize_gen;
float pt_gen[MAXCAN];
float eta_gen[MAXCAN];
float y_gen[MAXCAN];
Expand Down Expand Up @@ -454,17 +454,17 @@ PATCompositeTreeProducer::fillRECO(const edm::Event& iEvent, const edm::EventSet
iEvent.getByToken(tok_offlineBS_, beamspot);
edm::Handle<reco::VertexCollection> vertices;
iEvent.getByToken(tok_offlinePV_, vertices);
if(!vertices.isValid()) { throw cms::Exception("PATCompositeAnalyzer") << "Primary vertices collection not found!" << std::endl; }
if(!vertices.isValid()) throw cms::Exception("PATCompositeAnalyzer") << "Primary vertices collection not found!" << std::endl;

edm::Handle<pat::CompositeCandidateCollection> v0candidates;
iEvent.getByToken(patCompositeCandidateCollection_Token_, v0candidates);
if(!v0candidates.isValid()) { throw cms::Exception("PATCompositeAnalyzer") << "V0 candidate collection not found!" << std::endl; }
if(!v0candidates.isValid()) throw cms::Exception("PATCompositeAnalyzer") << "V0 candidate collection not found!" << std::endl;

edm::Handle<MVACollection> mvavalues;
if(useAnyMVA_)
{
iEvent.getByToken(MVAValues_Token_, mvavalues);
if(!mvavalues.isValid()) { throw cms::Exception("PATCompositeAnalyzer") << "MVA collection not found!" << std::endl; }
if(!mvavalues.isValid()) throw cms::Exception("PATCompositeAnalyzer") << "MVA collection not found!" << std::endl;
assert( (*mvavalues).size() == v0candidates->size() );
}

Expand Down Expand Up @@ -590,7 +590,8 @@ PATCompositeTreeProducer::fillRECO(const edm::Event& iEvent, const edm::EventSet

//RECO Candidate info
candSize = v0candidates->size();
for(ushort it=0; it<candSize; ++it)
if(candSize>MAXCAN) throw cms::Exception("PATCompositeAnalyzer") << "Number of candidates (" << candSize << ") exceeds limit!" << std::endl;
for(uint it=0; it<candSize; ++it)
{
const auto& trk = (*v0candidates)[it];

Expand Down Expand Up @@ -642,7 +643,7 @@ PATCompositeTreeProducer::fillRECO(const edm::Event& iEvent, const edm::EventSet
dlos2D[it] = dl2D[it]/dl2Derror;

const ushort& nDau = trk.numberOfDaughters();
if(nDau!=NDAU_) { throw cms::Exception("PATCompositeAnalyzer") << "Expected " << NDAU_ << " daughters but V0 candidate has " << nDau << " daughters!" << std::endl; }
if(nDau!=NDAU_) throw cms::Exception("PATCompositeAnalyzer") << "Expected " << NDAU_ << " daughters but V0 candidate has " << nDau << " daughters!" << std::endl;

//Gen match
if(doGenMatching_)
Expand Down Expand Up @@ -1006,7 +1007,7 @@ PATCompositeTreeProducer::fillGEN(const edm::Event& iEvent, const edm::EventSetu

edm::Handle<reco::GenParticleCollection> genpars;
iEvent.getByToken(tok_genParticle_, genpars);
if(!genpars.isValid()) { throw cms::Exception("PATCompositeAnalyzer") << "Gen matching cannot be done without Gen collection!" << std::endl; }
if(!genpars.isValid()) throw cms::Exception("PATCompositeAnalyzer") << "Gen matching cannot be done without Gen collection!" << std::endl;

candSize_gen = 0;
for(uint idx=0; idx<genpars->size(); ++idx)
Expand Down Expand Up @@ -1058,8 +1059,8 @@ PATCompositeTreeProducer::beginJob()
{
throw cms::Exception("PATCompositeAnalyzer") << "Want threeProngDecay but PID daughter vector size is: " << NDAU_ << " !" << std::endl;
}
if(!doRecoNtuple_ && !doGenNtuple_) { throw cms::Exception("PATCompositeAnalyzer") << "No output for either RECO or GEN!! Fix config!!" << std::endl; }
if(twoLayerDecay_ && doMuon_) { throw cms::Exception("PATCompositeAnalyzer") << "Muons cannot be coming from two layer decay!! Fix config!!" << std::endl; }
if(!doRecoNtuple_ && !doGenNtuple_) throw cms::Exception("PATCompositeAnalyzer") << "No output for either RECO or GEN!! Fix config!!" << std::endl;
if(twoLayerDecay_ && doMuon_) throw cms::Exception("PATCompositeAnalyzer") << "Muons cannot be coming from two layer decay!! Fix config!!" << std::endl;

if(saveHistogram_) initHistogram();
if(saveTree_) initTree();
Expand Down Expand Up @@ -1124,7 +1125,7 @@ PATCompositeTreeProducer::initTree()
PATCompositeNtuple->Branch("bestvtxX",&bestvx,"bestvtxX/F");
PATCompositeNtuple->Branch("bestvtxY",&bestvy,"bestvtxY/F");
PATCompositeNtuple->Branch("bestvtxZ",&bestvz,"bestvtxZ/F");
PATCompositeNtuple->Branch("candSize",&candSize,"candSize/s");
PATCompositeNtuple->Branch("candSize",&candSize,"candSize/i");
if(isCentrality_)
{
PATCompositeNtuple->Branch("centrality",&centrality,"centrality/S");
Expand Down Expand Up @@ -1277,7 +1278,7 @@ PATCompositeTreeProducer::initTree()
if(doGenNtuple_)
{
PATCompositeNtuple->Branch("weight_gen",&weight_gen,"weight_gen/F");
PATCompositeNtuple->Branch("candSize_gen",&candSize_gen,"candSize_gen/s");
PATCompositeNtuple->Branch("candSize_gen",&candSize_gen,"candSize_gen/i");
PATCompositeNtuple->Branch("pT_gen",pt_gen,"pT_gen[candSize_gen]/F");
PATCompositeNtuple->Branch("eta_gen",eta_gen,"eta_gen[candSize_gen]/F");
PATCompositeNtuple->Branch("y_gen",y_gen,"y_gen[candSize_gen]/F");
Expand Down
6 changes: 5 additions & 1 deletion VertexCompositeAnalyzer/python/dimuanalyzer_tree_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@
'HLT_HIL1DoubleMuOpen_Centrality_50_100_v', # Peripheral dimuons
'HLT_HIL3Mu2p5NHitQ10_L2Mu2_M7toinf_v', # Bottomonia
'HLT_HIL1DoubleMu10_v', # Z bosons
'HLT_HIUPC_DoubleMu0_NotMBHF2AND_v', # UPC dimuons
# Single muon triggers
'HLT_HIL1MuOpen_Centrality_80_100_v', # Peripheral muons
'HLT_HIL3Mu12_v', # Electroweak bosons
'HLT_HIUPC_SingleMuOpen_NotMBHF2AND_v', # UPC muons
),
triggerFilterNames = cms.untracked.vstring(
'hltL1fL1sL1DoubleMuOpenOSCentrality40100L1Filtered0',
'hltL1fL1sL1DoubleMuOpenCentrality50100L1Filtered0',
'hltL3f0L3Mu2p5NHitQ10L2Mu2FilteredM7toinf',
'hltL1fL1sL1DoubleMu10L1Filtered0',
'hltL1sDoubleMu0NotMBHF2AND',
'hltL1fL1sL1MuOpenCentrality80100L1Filtered0',
'hltL3fL1sL1SingleMu*OpenL1f*L2f0L3Filtered12'
'hltL3fL1sL1SingleMu*OpenL1f*L2f0L3Filtered12',
'hltL1sSingleMuOpenNotMBHF2AND',
),

#Filter info
Expand Down
12 changes: 0 additions & 12 deletions VertexCompositeProducer/python/collisionEventSelection_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,11 @@
# Cluster-shape filter re-run offline from ClusterCompatibility object
from VertexCompositeAnalysis.VertexCompositeProducer.clusterCompatibilityFilter_cfi import *

collisionEventSelection = cms.Sequence(
hfCoincFilter3Th3 *
primaryVertexFilter *
siPixelRecHits *
hltPixelClusterShapeFilter)

collisionEventSelectionAOD = cms.Sequence(
hfCoincFilter3Th3 *
primaryVertexFilter *
clusterCompatibilityFilter)

collisionEventSelectionV2 = cms.Sequence(
hfCoincFilter2Th4 *
primaryVertexFilter *
siPixelRecHits *
hltPixelClusterShapeFilter)

collisionEventSelectionAODv2 = cms.Sequence(
hfCoincFilter2Th4 *
primaryVertexFilter *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
muonRecoAlgorithm = cms.InputTag('patMuonsWithTrigger'),

# Muon selection
muonSelection = cms.string(""),
muonSelection = cms.string("isGlobalMuon || muonID('TMOneStationTight')"),
tkdXYCut = cms.double(99999.), #|dXY| <
tkdZCut = cms.double(99999.), #|dZ| <

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
# 'keep *_particleFlow_*_*',
# mc (if present)
# 'keep *_*GenJet*_*_*',
'keep recoGenParticles_genParticles_*_*',
'keep *_genMuons_*_*',
'keep recoGenParticles_genMuons_*_*',
'keep *_generator_*_*',
# 'keep *SimVertex*_*_*_*',
# missing ET
Expand Down
57 changes: 0 additions & 57 deletions VertexCompositeProducer/test/D0producer.py

This file was deleted.

57 changes: 0 additions & 57 deletions VertexCompositeProducer/test/JPsiproducer.py

This file was deleted.

Loading

0 comments on commit fe9e10a

Please sign in to comment.