CMS 3D CMS Logo

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

Functions

def customiseMTVForBPix123Holes
 

Function Documentation

def customiseMTVForBPix123Holes.customiseMTVForBPix123Holes (   process)

Definition at line 9 of file customiseMTVForBPix123Holes.py.

References clone(), print(), and python.rootplot.root2matplotlib.replace().

9 
10 def customiseMTVForBPix123Holes(process):
11  from Validation.RecoTrack.cutsRecoTracks_cfi import cutsRecoTracks as _cutsRecoTracks
12  import math
13  _minPhi = process.trackValidatorTrackingOnly.histoProducerAlgoBlock.minPhi.value()
14  _maxPhi = process.trackValidatorTrackingOnly.histoProducerAlgoBlock.maxPhi.value()
15  _nPhi = process.trackValidatorTrackingOnly.histoProducerAlgoBlock.nintPhi.value()
16  _binPhi = (_maxPhi - _minPhi) / _nPhi
17  process.generalTracksL1L2 = _cutsRecoTracks.clone(
18  minLayer = 0,
19  quality = [],
20  minRapidity = -1.0, # also eta < -1 is affected, but let's start with this
21  minPhi=_minPhi+_binPhi*14, maxPhi=_minPhi+_binPhi*19) # ~0.7 .. ~0.2
22  process.generalTracksL2L3 = process.generalTracksL1L2.clone(
23  minRapidity = -0.9, maxRapidity = 2,
24  minPhi=_minPhi+_binPhi*33, maxPhi=_minPhi+_binPhi + 2*math.pi) # ~2.6 .. ~3.3
25 
26  print("L1L2 %f %f" % (process.generalTracksL1L2.minPhi.value(), process.generalTracksL1L2.maxPhi.value()))
27  print("L2L3 %f %f" % (process.generalTracksL2L3.minPhi.value(), process.generalTracksL2L3.maxPhi.value()))
28 
29  from CommonTools.RecoAlgos.trackingParticleRefSelector_cfi import trackingParticleRefSelector as _trackingParticleRefSelector
30  process.trackingParticlesL1L2 = _trackingParticleRefSelector.clone(
31  signalOnly = False,
32  chargedOnly = False,
33  tip = 1e5,
34  lip = 1e5,
35  minRapidity = process.generalTracksL1L2.minRapidity.value(),
36  maxRapidity = process.generalTracksL1L2.maxRapidity.value(),
37  ptMin = 0,
38  minPhi = process.generalTracksL1L2.minPhi.value(),
39  maxPhi = process.generalTracksL1L2.maxPhi.value(),
40  )
41  process.trackingParticlesL2L3 = process.trackingParticlesL1L2.clone(
42  minRapidity = process.generalTracksL2L3.minRapidity.value(),
43  maxRapidity = process.generalTracksL2L3.maxRapidity.value(),
44  minPhi = process.generalTracksL2L3.minPhi.value(),
45  maxPhi = process.generalTracksL2L3.maxPhi.value(),
46  )
47  process.tracksPreValidationTrackingOnly += (
48  process.trackingParticlesL1L2 +
49  process.trackingParticlesL2L3 +
50  process.generalTracksL1L2 +
51  process.generalTracksL2L3
52  )
53 
54  process.trackValidatorTrackingOnlyL1L2 = process.trackValidatorTrackingOnly.clone(
55  dirName = process.trackValidatorTrackingOnly.dirName.value().replace("Track/", "TrackL1L2/"),
56  label_tp_effic = "trackingParticlesL1L2",
57  label_tp_effic_refvector = True,
58  label = ["generalTracksL1L2"],
59  )
60  process.trackValidatorTrackingOnlyL2L3 = process.trackValidatorTrackingOnlyL1L2.clone(
61  dirName = process.trackValidatorTrackingOnlyL1L2.dirName.value().replace("L1L2", "L2L3"),
62  label_tp_effic = "trackingParticlesL2L3",
63  label = ["generalTracksL2L3"],
64  )
65  process.trackValidatorsTrackingOnly += (
66  process.trackValidatorTrackingOnlyL1L2 +
67  process.trackValidatorTrackingOnlyL2L3
68  )
69  for trkColl in process.trackValidatorTrackingOnly.label:
70  if "ByAlgoMask" in trkColl: continue
71  if "Pt09" in trkColl and not trkColl in ["generalTracksPt09", "cutsRecoTracksPt09Hp"]: continue
72  if trkColl != "generalTracks":
73  selL1L2 = getattr(process, trkColl).clone(src="generalTracksL1L2")
74  selL2L3 = getattr(process, trkColl).clone(src="generalTracksL2L3")
75  if "Pt09" in trkColl:
76  selL1L2Name = trkColl.replace("Pt09", "Pt09L1L2")
77  selL2L3Name = trkColl.replace("Pt09", "Pt09L2L3")
78  else:
79  selL1L2Name = trkColl.replace("cutsRecoTracks", "cutsRecoTracksL1L2")
80  selL2L3Name = trkColl.replace("cutsRecoTracks", "cutsRecoTracksL2L3")
81  setattr(process, selL1L2Name, selL1L2)
82  setattr(process, selL2L3Name, selL2L3)
83  process.tracksPreValidationTrackingOnly += (selL1L2+selL2L3)
84  process.trackValidatorTrackingOnlyL1L2.label.append(selL1L2Name)
85  process.trackValidatorTrackingOnlyL2L3.label.append(selL2L3Name)
86 
87  for midfix in ["Building", "Seeding"]:
88  label = "trackValidator%sTrackingOnly" % midfix
89  mtv = getattr(process, label)
90  mtvL1L2 = mtv.clone(
91  dirName = mtv.dirName.value()[:-1] + "L1L2/",
92  label_tp_effic = "trackingParticlesL1L2",
93  label_tp_effic_refvector = True,
94  label = [],
95  mvaLabels = cms.PSet(),
96  doMVAPlots = False,
97  )
98  mtvL2L3 = mtvL1L2.clone(
99  dirName = mtvL1L2.dirName.value().replace("L1L2", "L2L3"),
100  label_tp_effic = "trackingParticlesL2L3",
101  )
102  setattr(process, label+"L1L2", mtvL1L2)
103  setattr(process, label+"L2L3", mtvL2L3)
104  process.trackValidatorsTrackingOnly += (
105  mtvL1L2 +
106  mtvL2L3
107  )
108  for trkColl in mtv.label:
109  selL1L2 = process.generalTracksL1L2.clone(src=trkColl)
110  selL2L3 = process.generalTracksL2L3.clone(src=trkColl)
111  selL1L2Name = trkColl+"L1L2"
112  selL2L3Name = trkColl+"L2L3"
113  setattr(process, selL1L2Name, selL1L2)
114  setattr(process, selL2L3Name, selL2L3)
115  process.tracksPreValidationTrackingOnly += (selL1L2+selL2L3)
116 
117  mtvL1L2.label.append(selL1L2Name)
118  mtvL2L3.label.append(selL2L3Name)
119 
120  return process
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135