236 algo, rParam, btagDiscriminators, btagInfos, patJets, labelName, btagPrefix, postfix):
241 discriminators = set(btagDiscriminators)
242 present_meta = discriminators.intersection(set(supportedMetaDiscr.keys()))
243 discriminators -= present_meta
244 for meta_tagger
in present_meta:
245 for src
in supportedMetaDiscr[meta_tagger]:
246 discriminators.add(src)
247 btagDiscriminators =
list(discriminators)
251 requiredTagInfos =
list(btagInfos)
252 for btagDiscr
in btagDiscriminators :
253 for tagInfoList
in supportedBtagDiscr[btagDiscr] :
254 for requiredTagInfo
in tagInfoList :
255 tagInfoCovered =
False 256 for tagInfo
in requiredTagInfos :
257 if requiredTagInfo == tagInfo :
258 tagInfoCovered =
True 260 if not tagInfoCovered :
261 requiredTagInfos.append(requiredTagInfo)
263 if hasattr( process,
'candidateJetProbabilityComputer' ) ==
False :
265 process.load(
"RecoBTag.ImpactParameter.impactParameter_cff")
266 task.add(process.impactParameterTask)
267 process.load(
"RecoBTag.SecondaryVertex.secondaryVertex_cff")
268 task.add(process.secondaryVertexTask)
269 process.load(
"RecoBTag.SoftLepton.softLepton_cff")
270 task.add(process.softLeptonTask)
271 process.load(
"RecoBTag.Combined.combinedMVA_cff")
272 task.add(process.combinedMVATask)
273 process.load(
"RecoBTag.CTagging.cTagging_cff")
274 task.add(process.cTaggingTask)
276 process.load(
"RecoBTag.ImpactParameter.impactParameter_EventSetup_cff")
277 process.load(
"RecoBTag.SecondaryVertex.secondaryVertex_EventSetup_cff")
278 process.load(
"RecoBTag.SoftLepton.softLepton_EventSetup_cff")
279 process.load(
"RecoBTag.Combined.combinedMVA_EventSetup_cff")
280 process.load(
"RecoBTag.CTagging.cTagging_EventSetup_cff")
282 import RecoJets.JetProducers.caTopTaggers_cff
as toptag
286 sys.stderr.write(
"-------------------------------------------------------------------\n")
287 sys.stderr.write(
" Warning: For a complete switch to the legacy tight b-tag track\n")
288 sys.stderr.write(
" selection, please also enable the \'runIVF\' switch.\n")
289 sys.stderr.write(
"-------------------------------------------------------------------\n")
291 sys.stderr.write(
"-------------------------------------------------------------------\n")
292 sys.stderr.write(
" Warning: With the tight b-tag track selection enabled, it is\n")
293 sys.stderr.write(
" advisable to set \'btagPrefix\' to a non-empty string to\n")
294 sys.stderr.write(
" avoid unintentional modifications to the default\n")
295 sys.stderr.write(
" b tagging setup that might be loaded in the same job.\n")
296 sys.stderr.write(
"-------------------------------------------------------------------\n")
300 svSourceCvsL = copy.deepcopy(svSource)
301 svSourceCvsL.setModuleLabel(svSource.getModuleLabel()+
'CvsL')
304 runIVFforCTagOnly =
False 305 ivfcTagInfos = [
'pfInclusiveSecondaryVertexFinderCvsLTagInfos',
'pfInclusiveSecondaryVertexFinderNegativeCvsLTagInfos']
307 if pvSource.getModuleLabel() ==
'offlineSlimmedPrimaryVertices' and any(i
in requiredTagInfos
for i
in ivfcTagInfos)
and not runIVF:
308 runIVFforCTagOnly =
True 310 sys.stderr.write(
"-------------------------------------------------------------------\n")
311 sys.stderr.write(
" Info: To run c tagging on MiniAOD, c-tag-specific IVF secondary\n")
312 sys.stderr.write(
" vertices will be remade.\n")
313 sys.stderr.write(
"-------------------------------------------------------------------\n")
315 if runIVF
and btagPrefix !=
'':
316 if runIVFforCTagOnly:
317 svSourceCvsL.setModuleLabel(btagPrefix+svSourceCvsL.getModuleLabel())
319 svSource.setModuleLabel(btagPrefix+svSource.getModuleLabel())
320 svSourceCvsL.setModuleLabel(btagPrefix+svSourceCvsL.getModuleLabel())
326 runNegativeVertexing =
False 327 runNegativeCvsLVertexing =
False 328 for btagInfo
in requiredTagInfos:
329 if btagInfo ==
'pfInclusiveSecondaryVertexFinderNegativeTagInfos' or btagInfo ==
'pfNegativeDeepFlavourTagInfos':
330 runNegativeVertexing =
True 331 if btagInfo ==
'pfInclusiveSecondaryVertexFinderNegativeCvsLTagInfos':
332 runNegativeCvsLVertexing =
True 334 if runNegativeVertexing
or runNegativeCvsLVertexing:
335 import RecoVertex.AdaptiveVertexFinder.inclusiveNegativeVertexing_cff
as NegVertex
337 if runNegativeVertexing:
339 NegVertex.inclusiveCandidateNegativeVertexFinder.clone(primaryVertices = pvSource,tracks=pfCandidates),
342 NegVertex.candidateNegativeVertexMerger.clone(secondaryVertices = cms.InputTag(btagPrefix+
'inclusiveCandidateNegativeVertexFinder'+labelName+postfix)),
345 NegVertex.candidateNegativeVertexArbitrator.clone( secondaryVertices = cms.InputTag(btagPrefix+
'candidateNegativeVertexMerger'+labelName+postfix)
346 ,primaryVertices = pvSource
347 ,tracks=pfCandidates),
349 addToProcessAndTask(btagPrefix+
'inclusiveCandidateNegativeSecondaryVertices'+labelName+postfix,
350 NegVertex.inclusiveCandidateNegativeSecondaryVertices.clone(secondaryVertices = cms.InputTag(btagPrefix+
'candidateNegativeVertexArbitrator'+labelName+postfix)),
353 if runNegativeCvsLVertexing:
354 addToProcessAndTask(btagPrefix+
'inclusiveCandidateNegativeVertexFinderCvsL'+labelName+postfix,
355 NegVertex.inclusiveCandidateNegativeVertexFinderCvsL.clone(primaryVertices = pvSource,tracks=pfCandidates),
358 NegVertex.candidateNegativeVertexMergerCvsL.clone(secondaryVertices = cms.InputTag(btagPrefix+
'inclusiveCandidateNegativeVertexFinderCvsL'+labelName+postfix)),
361 NegVertex.candidateNegativeVertexArbitratorCvsL.clone( secondaryVertices = cms.InputTag(btagPrefix+
'candidateNegativeVertexMergerCvsL'+labelName+postfix)
362 ,primaryVertices = pvSource
363 ,tracks=pfCandidates),
365 addToProcessAndTask(btagPrefix+
'inclusiveCandidateNegativeSecondaryVerticesCvsL'+labelName+postfix,
366 NegVertex.inclusiveCandidateNegativeSecondaryVerticesCvsL.clone(secondaryVertices = cms.InputTag(btagPrefix+
'candidateNegativeVertexArbitratorCvsL'+labelName+postfix)),
370 acceptedTagInfos =
list()
371 for btagInfo
in requiredTagInfos:
372 if hasattr(btag,btagInfo):
373 if btagInfo ==
'pfImpactParameterTagInfos':
375 btag.pfImpactParameterTagInfos.clone(jets = jetSource,primaryVertex=pvSource,candidates=pfCandidates),
378 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
379 _btagInfo.explicitJTA = cms.bool(explicitJTA)
381 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
382 _btagInfo.minimumNumberOfPixelHits = cms.int32(2)
383 _btagInfo.minimumNumberOfHits = cms.int32(8)
384 if btagInfo ==
'pfImpactParameterAK8TagInfos':
386 btag.pfImpactParameterAK8TagInfos.clone(jets = jetSource,primaryVertex=pvSource,candidates=pfCandidates),
389 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
390 _btagInfo.explicitJTA = cms.bool(explicitJTA)
392 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
393 _btagInfo.minimumNumberOfPixelHits = cms.int32(2)
394 _btagInfo.minimumNumberOfHits = cms.int32(8)
395 if btagInfo ==
'pfImpactParameterCA15TagInfos':
397 btag.pfImpactParameterCA15TagInfos.clone(jets = jetSource,primaryVertex=pvSource,candidates=pfCandidates),
400 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
401 _btagInfo.explicitJTA = cms.bool(explicitJTA)
403 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
404 _btagInfo.minimumNumberOfPixelHits = cms.int32(2)
405 _btagInfo.minimumNumberOfHits = cms.int32(8)
406 if btagInfo ==
'pfSecondaryVertexTagInfos':
408 btag.pfSecondaryVertexTagInfos.clone(
409 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix)),
412 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
413 _btagInfo.trackSelection.pixelHitsMin = cms.uint32(2)
414 _btagInfo.trackSelection.totalHitsMin = cms.uint32(8)
415 if btagInfo ==
'pfDeepCSVTagInfos':
417 btag.pfDeepCSVTagInfos.clone(
418 svTagInfos = cms.InputTag(btagPrefix+
'pfInclusiveSecondaryVertexFinderTagInfos'+labelName+postfix)),
420 if svClustering
or fatJets != cms.InputTag(
''):
421 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
422 if btagInfo ==
'pfDeepCSVNegativeTagInfos':
424 btag.pfDeepCSVNegativeTagInfos.clone(
425 svTagInfos = cms.InputTag(btagPrefix+
'pfInclusiveSecondaryVertexFinderNegativeTagInfos'+labelName+postfix)),
427 if svClustering
or fatJets != cms.InputTag(
''):
428 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
429 if btagInfo ==
'pfDeepCSVPositiveTagInfos':
431 btag.pfDeepCSVPositiveTagInfos.clone(
432 svTagInfos = cms.InputTag(btagPrefix+
'pfInclusiveSecondaryVertexFinderTagInfos'+labelName+postfix)),
434 if svClustering
or fatJets != cms.InputTag(
''):
435 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
436 if btagInfo ==
'pfDeepCMVATagInfos':
438 btag.pfDeepCMVATagInfos.clone(
439 deepNNTagInfos = cms.InputTag(btagPrefix+
'pfDeepCSVTagInfos'+labelName+postfix),
440 ipInfoSrc = cms.InputTag(btagPrefix+
"pfImpactParameterTagInfos"+labelName+postfix),
441 muInfoSrc = cms.InputTag(btagPrefix+
"softPFMuonsTagInfos"+labelName+postfix),
442 elInfoSrc = cms.InputTag(btagPrefix+
"softPFElectronsTagInfos"+labelName+postfix)),
444 if svClustering
or fatJets != cms.InputTag(
''):
445 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
446 if btagInfo ==
'pfDeepCMVANegativeTagInfos':
448 btag.pfDeepCMVATagInfos.clone(
449 deepNNTagInfos = cms.InputTag(btagPrefix+
'pfDeepCSVTagInfos'+labelName+postfix),
450 ipInfoSrc = cms.InputTag(btagPrefix+
"pfImpactParameterTagInfos"+labelName+postfix),
451 muInfoSrc = cms.InputTag(btagPrefix+
"softPFMuonsTagInfos"+labelName+postfix),
452 elInfoSrc = cms.InputTag(btagPrefix+
"softPFElectronsTagInfos"+labelName+postfix)),
454 if svClustering
or fatJets != cms.InputTag(
''):
455 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
456 if btagInfo ==
'pfDeepCMVAPositiveTagInfos':
458 btag.pfDeepCMVATagInfos.clone(
459 deepNNTagInfos = cms.InputTag(btagPrefix+
'pfDeepCSVTagInfos'+labelName+postfix),
460 ipInfoSrc = cms.InputTag(btagPrefix+
"pfImpactParameterTagInfos"+labelName+postfix),
461 muInfoSrc = cms.InputTag(btagPrefix+
"softPFMuonsTagInfos"+labelName+postfix),
462 elInfoSrc = cms.InputTag(btagPrefix+
"softPFElectronsTagInfos"+labelName+postfix)),
464 if svClustering
or fatJets != cms.InputTag(
''):
465 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
466 if btagInfo ==
'pfInclusiveSecondaryVertexFinderTagInfos':
468 btag.pfInclusiveSecondaryVertexFinderTagInfos.clone(
469 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix),
470 extSVCollection=svSource),
472 if svClustering
or fatJets != cms.InputTag(
''):
473 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
474 if btagInfo ==
'pfInclusiveSecondaryVertexFinderAK8TagInfos':
476 btag.pfInclusiveSecondaryVertexFinderAK8TagInfos.clone(
477 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterAK8TagInfos'+labelName+postfix),
478 extSVCollection=svSource),
480 if svClustering
or fatJets != cms.InputTag(
''):
481 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
482 if btagInfo ==
'pfBoostedDoubleSVAK8TagInfos':
484 btag.pfBoostedDoubleSVAK8TagInfos.clone(
485 svTagInfos = cms.InputTag(btagPrefix+
'pfInclusiveSecondaryVertexFinderAK8TagInfos'+labelName+postfix)),
487 if btagInfo ==
'pfInclusiveSecondaryVertexFinderCA15TagInfos':
489 btag.pfInclusiveSecondaryVertexFinderCA15TagInfos.clone(
490 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterCA15TagInfos'+labelName+postfix),
491 extSVCollection=svSource),
493 if svClustering
or fatJets != cms.InputTag(
''):
494 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
495 if btagInfo ==
'pfBoostedDoubleSVCA15TagInfos':
497 btag.pfBoostedDoubleSVCA15TagInfos.clone(
498 svTagInfos = cms.InputTag(btagPrefix+
'pfInclusiveSecondaryVertexFinderCA15TagInfos'+labelName+postfix)),
500 if btagInfo ==
'pfInclusiveSecondaryVertexFinderCvsLTagInfos':
502 btag.pfInclusiveSecondaryVertexFinderCvsLTagInfos.clone(
503 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix),
504 extSVCollection=svSourceCvsL),
506 if svClustering
or fatJets != cms.InputTag(
''):
507 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
508 if btagInfo ==
'pfInclusiveSecondaryVertexFinderNegativeCvsLTagInfos':
510 btag.pfInclusiveSecondaryVertexFinderNegativeCvsLTagInfos.clone(
511 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix),
512 extSVCollection = btagPrefix+
'inclusiveCandidateNegativeSecondaryVerticesCvsL'+labelName+postfix),
514 if svClustering
or fatJets != cms.InputTag(
''):
515 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
516 if btagInfo ==
'pfGhostTrackVertexTagInfos':
518 btag.pfGhostTrackVertexTagInfos.clone(
519 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix)),
521 if btagInfo ==
'pfSecondaryVertexNegativeTagInfos':
523 btag.pfSecondaryVertexNegativeTagInfos.clone(
524 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix)),
527 _btagInfo = getattr(process, btagPrefix+btagInfo+labelName+postfix)
528 _btagInfo.trackSelection.pixelHitsMin = cms.uint32(2)
529 _btagInfo.trackSelection.totalHitsMin = cms.uint32(8)
530 if btagInfo ==
'pfInclusiveSecondaryVertexFinderNegativeTagInfos':
532 btag.pfInclusiveSecondaryVertexFinderNegativeTagInfos.clone(
533 trackIPTagInfos = cms.InputTag(btagPrefix+
'pfImpactParameterTagInfos'+labelName+postfix),
534 extSVCollection=cms.InputTag(btagPrefix+
'inclusiveCandidateNegativeSecondaryVertices'+labelName+postfix)),
536 if svClustering
or fatJets != cms.InputTag(
''):
537 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
538 if btagInfo ==
'impactParameterTagInfos':
540 btag.impactParameterTagInfos.clone(
541 jetTracks = cms.InputTag(
'jetTracksAssociatorAtVertex'+labelName+postfix),
542 primaryVertex=pvSource),
544 if btagInfo ==
'secondaryVertexTagInfos':
546 btag.secondaryVertexTagInfos.clone(
547 trackIPTagInfos = cms.InputTag(btagPrefix+
'impactParameterTagInfos'+labelName+postfix)),
549 if btagInfo ==
'inclusiveSecondaryVertexFinderTagInfos':
551 btag.inclusiveSecondaryVertexFinderTagInfos.clone(
552 trackIPTagInfos = cms.InputTag(btagPrefix+
'impactParameterTagInfos'+labelName+postfix)),
554 if svClustering
or fatJets != cms.InputTag(
''):
555 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
556 if btagInfo ==
'inclusiveSecondaryVertexFinderFilteredTagInfos':
558 btag.inclusiveSecondaryVertexFinderFilteredTagInfos.clone(
559 trackIPTagInfos = cms.InputTag(btagPrefix+
'impactParameterTagInfos'+labelName+postfix)),
561 if svClustering
or fatJets != cms.InputTag(
''):
562 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
563 if btagInfo ==
'secondaryVertexNegativeTagInfos':
565 btag.secondaryVertexNegativeTagInfos.clone(
566 trackIPTagInfos = cms.InputTag(btagPrefix+
'impactParameterTagInfos'+labelName+postfix)),
568 if btagInfo ==
'inclusiveSecondaryVertexFinderNegativeTagInfos':
570 btag.inclusiveSecondaryVertexFinderNegativeTagInfos.clone(
571 trackIPTagInfos = cms.InputTag(btagPrefix+
'impactParameterTagInfos'+labelName+postfix)),
573 if svClustering
or fatJets != cms.InputTag(
''):
574 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
575 if btagInfo ==
'inclusiveSecondaryVertexFinderFilteredNegativeTagInfos':
577 btag.inclusiveSecondaryVertexFinderFilteredNegativeTagInfos.clone(
578 trackIPTagInfos = cms.InputTag(btagPrefix+
'impactParameterTagInfos'+labelName+postfix)),
580 if svClustering
or fatJets != cms.InputTag(
''):
581 setupSVClustering(getattr(process, btagPrefix+btagInfo+labelName+postfix), svClustering, algo, rParam, fatJets, groomedFatJets)
582 if btagInfo ==
'softMuonTagInfos':
584 btag.softMuonTagInfos.clone(jets = jetSource, primaryVertex=pvSource),
586 if btagInfo ==
'softPFMuonsTagInfos':
588 btag.softPFMuonsTagInfos.clone(jets = jetSource, primaryVertex=pvSource, muons=muSource),
590 if btagInfo ==
'softPFElectronsTagInfos':
592 btag.softPFElectronsTagInfos.clone(jets = jetSource, primaryVertex=pvSource, electrons=elSource),
595 if 'DeepFlavourTagInfos' in btagInfo:
597 if btagInfo ==
'pfNegativeDeepFlavourTagInfos':
598 deep_csv_tag_infos =
'pfDeepCSVNegativeTagInfos' 599 svUsed = cms.InputTag(btagPrefix+
'inclusiveCandidateNegativeSecondaryVertices'+labelName+postfix)
602 deep_csv_tag_infos =
'pfDeepCSVTagInfos' 606 if not (
'limmed' in jetSource.value()):
607 puppi_value_map = cms.InputTag(
"puppi")
608 vertex_associator = cms.InputTag(
"primaryVertexAssociation",
"original")
610 puppi_value_map = cms.InputTag(
"")
611 vertex_associator = cms.InputTag(
"")
613 btag.pfDeepFlavourTagInfos.clone(
616 secondary_vertices=svUsed,
617 shallow_tag_infos = cms.InputTag(btagPrefix+deep_csv_tag_infos+labelName+postfix),
618 puppi_value_map = puppi_value_map,
619 vertex_associator = vertex_associator,
623 if btagInfo ==
'pfDeepDoubleBTagInfos':
625 btag.pfDeepDoubleBTagInfos.clone(
628 secondary_vertices=svSource,
629 shallow_tag_infos = cms.InputTag(btagPrefix+
'pfBoostedDoubleSVAK8TagInfos'+labelName+postfix),
633 acceptedTagInfos.append(btagInfo)
634 elif hasattr(toptag, btagInfo) :
635 acceptedTagInfos.append(btagInfo)
637 print ' --> %s ignored, since not available via RecoBTag.Configuration.RecoBTag_cff!'%(btagInfo)
639 acceptedBtagDiscriminators =
list()
640 for discriminator_name
in btagDiscriminators :
641 btagDiscr = discriminator_name.split(
':')[0]
643 if hasattr(btag,btagDiscr):
644 newDiscr = btagPrefix+btagDiscr+labelName+postfix
645 if hasattr(process, newDiscr):
647 elif hasattr(getattr(btag, btagDiscr),
'tagInfos'):
650 getattr(btag, btagDiscr).
clone(
651 tagInfos = cms.VInputTag(
652 *[ cms.InputTag(btagPrefix+x+labelName+postfix) \
653 for x
in supportedBtagDiscr[discriminator_name][0] ]
659 elif hasattr(getattr(btag, btagDiscr),
'src'):
662 getattr(btag, btagDiscr).
clone(
663 src = cms.InputTag(btagPrefix+supportedBtagDiscr[discriminator_name][0][0]+labelName+postfix)
669 raise ValueError(
'I do not know how to update %s it does not have neither "tagInfos" nor "src" attributes' % btagDiscr)
670 acceptedBtagDiscriminators.append(discriminator_name)
672 print ' --> %s ignored, since not available via RecoBTag.Configuration.RecoBTag_cff!'%(btagDiscr)
674 for meta_tagger
in present_meta:
675 btagDiscr = meta_tagger.split(
':')[0]
677 if hasattr(btag,btagDiscr):
678 newDiscr = btagPrefix+btagDiscr+labelName+postfix
679 if hasattr(process, newDiscr):
684 getattr(btag, btagDiscr).
clone(),
688 for dependency
in supportedMetaDiscr[meta_tagger]:
689 if ':' in dependency:
690 new_dep = btagPrefix+dependency.split(
':')[0]+labelName+postfix+
':'+dependency.split(
':')[1]
692 new_dep = btagPrefix+dependency+labelName+postfix
693 replace = MassSearchReplaceAnyInputTagVisitor(dependency, new_dep)
694 replace.doIt(getattr(process, newDiscr), newDiscr)
695 acceptedBtagDiscriminators.append(meta_tagger)
697 print ' --> %s ignored, since not available via RecoBTag.Configuration.RecoBTag_cff!'%(btagDiscr)
700 patJets.tagInfoSources = cms.VInputTag( *[ cms.InputTag(btagPrefix+x+labelName+postfix)
for x
in acceptedTagInfos ] )
701 patJets.discriminatorSources = cms.VInputTag(*[
702 cms.InputTag(btagPrefix+x+labelName+postfix) \
703 if ':' not in x
else \
704 cms.InputTag(btagPrefix+x.split(
':')[0]+labelName+postfix+
':'+x.split(
':')[1]) \
705 for x
in acceptedBtagDiscriminators
707 if len(acceptedBtagDiscriminators) > 0 :
708 patJets.addBTagInfo =
True 711 if not tightBTagNTkHits:
712 if pvSource.getModuleLabel() ==
'offlineSlimmedPrimaryVertices':
717 ivfbTagInfos = [
'pfInclusiveSecondaryVertexFinderTagInfos',
'pfInclusiveSecondaryVertexFinderAK8TagInfos',
'pfInclusiveSecondaryVertexFinderCA15TagInfos']
718 if any(i
in acceptedTagInfos
for i
in ivfbTagInfos)
and not runIVFforCTagOnly:
719 if not hasattr( process, btagPrefix+
'inclusiveCandidateVertexFinder' ):
720 loadWithPrefix(process,
'RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff', btagPrefix, task.label())
722 if hasattr( process, btagPrefix+
'inclusiveCandidateVertexFinder' ):
723 _temp = getattr(process, btagPrefix+
'inclusiveCandidateVertexFinder')
724 _temp.minHits = cms.uint32(8)
726 if pvSource.getModuleLabel() ==
'offlineSlimmedPrimaryVertices':
727 if hasattr( process, btagPrefix+
'inclusiveCandidateVertexFinder' ):
728 _temp = getattr(process, btagPrefix+
'inclusiveCandidateVertexFinder')
729 _temp.primaryVertices = pvSource
730 _temp.tracks = pfCandidates
731 if hasattr( process, btagPrefix+
'candidateVertexArbitrator' ):
732 _temp = getattr(process, btagPrefix+
'candidateVertexArbitrator')
733 _temp.primaryVertices = pvSource
734 _temp.tracks = pfCandidates
735 if hasattr( process, btagPrefix+
'inclusiveCandidateSecondaryVertices' )
and not hasattr( process, svSource.getModuleLabel() ):
737 getattr(process, btagPrefix+
'inclusiveCandidateSecondaryVertices').
clone(),
739 if any(i
in acceptedTagInfos
for i
in ivfcTagInfos):
740 if not hasattr( process, btagPrefix+
'inclusiveCandidateVertexFinderCvsL' ):
741 loadWithPrefix(process,
'RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff', btagPrefix, task.label())
743 if hasattr( process, btagPrefix+
'inclusiveCandidateVertexFinderCvsL' ):
744 _temp = getattr(process, btagPrefix+
'inclusiveCandidateVertexFinderCvsL')
745 _temp.minHits = cms.uint32(8)
747 if pvSource.getModuleLabel() ==
'offlineSlimmedPrimaryVertices':
748 if hasattr( process, btagPrefix+
'inclusiveCandidateVertexFinderCvsL' ):
749 _temp = getattr(process, btagPrefix+
'inclusiveCandidateVertexFinderCvsL')
750 _temp.primaryVertices = pvSource
751 _temp.tracks = pfCandidates
752 if hasattr( process, btagPrefix+
'candidateVertexArbitratorCvsL' ):
753 _temp = getattr(process, btagPrefix+
'candidateVertexArbitratorCvsL')
754 _temp.primaryVertices = pvSource
755 _temp.tracks = pfCandidates
756 if hasattr( process, btagPrefix+
'inclusiveCandidateSecondaryVerticesCvsL' )
and not hasattr( process, svSourceCvsL.getModuleLabel() ):
758 getattr(process, btagPrefix+
'inclusiveCandidateSecondaryVerticesCvsL').
clone(),
760 if 'inclusiveSecondaryVertexFinderTagInfos' in acceptedTagInfos:
761 if not hasattr( process,
'inclusiveVertexing' ):
762 process.load(
'RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff' )
763 task.add(process.inclusiveVertexingTask)
764 task.add(process.inclusiveCandidateVertexingTask)
765 task.add(process.inclusiveCandidateVertexingCvsLTask)
766 if 'inclusiveSecondaryVertexFinderFilteredTagInfos' in acceptedTagInfos:
767 if not hasattr( process,
'inclusiveVertexing' ):
768 process.load(
'RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff' )
769 task.add(process.inclusiveVertexingTask)
770 task.add(process.inclusiveCandidateVertexingTask)
771 task.add(process.inclusiveCandidateVertexingCvsLTask)
772 if 'inclusiveSecondaryVertexFinderFilteredTagInfos' in acceptedTagInfos:
773 if not hasattr( process,
'inclusiveSecondaryVerticesFiltered' ):
774 process.load(
'RecoBTag.SecondaryVertex.inclusiveSecondaryVerticesFiltered_cfi' )
775 task.add(process.inclusiveSecondaryVerticesFiltered)
776 task.add(process.bVertexFilter)
777 if not hasattr( process,
'bToCharmDecayVertexMerged' ):
778 process.load(
'RecoBTag.SecondaryVertex.bToCharmDecayVertexMerger_cfi' )
779 task.add(process.bToCharmDecayVertexMerged)
780 if 'caTopTagInfos' in acceptedTagInfos :
781 patJets.addTagInfos =
True 782 if not hasattr( process,
'caTopTagInfos' )
and not hasattr( process,
'caTopTagInfosAK8' ):
783 process.load(
'RecoJets.JetProducers.caTopTaggers_cff' )
784 task.add(process.caTopTaggersTask)
bool any(const std::vector< T > &v, const T &what)
def addToProcessAndTask(label, module, process, task)
def loadWithPrefix(process, moduleName, prefix='', loadedProducersAndFilters=None)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def getPatAlgosToolsTask(process)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run