CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
MixingModule_Full2Fast Namespace Reference

Functions

def digitizersFull2Fast
 
def prepareDigiRecoMixing
 

Function Documentation

def MixingModule_Full2Fast.digitizersFull2Fast (   digitizers)

Definition at line 11 of file MixingModule_Full2Fast.py.

Referenced by prepareDigiRecoMixing().

11 
12 def digitizersFull2Fast(digitizers):
13 
14  # fastsim does not simulate castor
15  if hasattr(digitizers,"castor"):
16  delattr(digitizers,"castor")
17  else:
18  print "WARNING: digitizers has no attribute 'castor'"
19 
20  # fastsim does not digitize pixel and strip hits, it mixes tracks
21  if hasattr(digitizers,"pixel") and hasattr(digitizers,"strip"):
22  delattr(digitizers,"pixel")
23  delattr(digitizers,"strip")
24  import FastSimulation.Tracking.recoTrackAccumulator_cfi
25  digitizers.tracker = cms.PSet(FastSimulation.Tracking.recoTrackAccumulator_cfi.recoTrackAccumulator)
26  else:
27  print "WARNING: digitizers has no attribute 'pixel' and/or 'strip'"
28  print " : => not mixing tracks"
29 
30  # fastsim has its own names for simhit collections
31  for element in ["ecal","hcal"]:
32  if hasattr(digitizers,element):
33  getattr(digitizers,element).hitsProducer = "famosSimHits"
34  else:
35  print "WARNING: digitizers has no attribute '{0}'".format(element)
36 
37  # fastsim has different input for merged truth
38  if hasattr(digitizers,"mergedtruth"):
39  digitizers.mergedtruth.allowDifferentSimHitProcesses = True
40  digitizers.mergedtruth.simHitCollections = cms.PSet(
41  muon = cms.VInputTag( cms.InputTag('MuonSimHits','MuonDTHits'),
42  cms.InputTag('MuonSimHits','MuonCSCHits'),
43  cms.InputTag('MuonSimHits','MuonRPCHits') ),
44  trackerAndPixel = cms.VInputTag( cms.InputTag('famosSimHits','TrackerHits') )
45  )
46  digitizers.mergedtruth.simTrackCollection = cms.InputTag('famosSimHits')
47  digitizers.mergedtruth.simVertexCollection = cms.InputTag('famosSimHits')
48 
49  return digitizers
50 
def MixingModule_Full2Fast.prepareDigiRecoMixing (   process)

Definition at line 51 of file MixingModule_Full2Fast.py.

References digitizersFull2Fast().

51 
52 def prepareDigiRecoMixing(process):
53 
54  # switch to FastSim digitizers
55  process.mix.digitizers = digitizersFull2Fast(process.mix.digitizers)
56 
57  # switch to FastSim mixObjects
58  import FastSimulation.Configuration.mixObjects_cfi
59  process.mix.mixObjects = FastSimulation.Configuration.mixObjects_cfi.theMixObjects
60 
61  # fastsim does not simulate castor
62  # fastsim does not digitize pixel and strip hits
63  for element in ["simCastorDigis","simSiPixelDigis","simSiStripDigis"]:
64  if hasattr(process,element):
65  delattr(process,element)
66 
67  # get rid of some FullSim specific psets that work confusing when dumping FastSim cfgs
68  # (this is optional)
69  del process.theDigitizers
70  del process.theDigitizersValid
71  del process.trackingParticles
72  del process.stripDigitizer
73  del process.SiStripSimBlock
74  del process.castorDigitizer
75  del process.pixelDigitizer
76  del process.ecalDigitizer
77 
78  # get rid of FullSim specific services that work confusing when dumping FastSim cfgs
79  # (this is optional)
80  del process.siStripGainSimESProducer
81 
82  return process