CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
dataLoader.DataLoader Class Reference
Inheritance diagram for dataLoader.DataLoader:

Public Member Functions

def __init__
 
def print_data
 

Public Attributes

 abseta_test_points
 
 DISCR_MAX
 
 DISCR_MIN
 
 discr_test_points
 
 discrs
 
 entries
 
 ETA_MAX
 
 ETA_MIN
 
 eta_test_points
 
 etas
 
 flavs
 
 meas_type
 
 ops
 
 PT_MAX
 
 PT_MIN
 
 pt_test_points
 
 pts
 
 syss
 

Detailed Description

Definition at line 6 of file dataLoader.py.

Constructor & Destructor Documentation

def dataLoader.DataLoader.__init__ (   self,
  csv_data,
  measurement_type 
)

Definition at line 7 of file dataLoader.py.

7 
8  def __init__(self, csv_data, measurement_type):
9  self.meas_type = measurement_type
10 
11  # list of entries
12  ens = []
13  for l in csv_data:
14  if not l.strip():
15  continue # skip empty lines
16  try:
17  e = ROOT.BTagEntry(l)
18  if e.params.measurementType == measurement_type:
19  ens.append(e)
20  except TypeError:
21  raise RuntimeError("Error: can not interpret line: " + l)
22  self.entries = ens
23 
24  self.ETA_MIN = -2.4
25  self.ETA_MAX = 2.4
26  self.PT_MIN = min(e.params.ptMin for e in ens)
27  self.PT_MAX = max(e.params.ptMax for e in ens)
28  self.DISCR_MIN = min(e.params.discrMin for e in ens)
29  self.DISCR_MAX = max(e.params.discrMax for e in ens)
30 
31  # sets of fixed data
32  self.ops = set(e.params.operatingPoint for e in ens)
33  self.flavs = set(e.params.jetFlavor for e in ens)
34  self.syss = set(e.params.sysType for e in ens)
35  self.etas = set((e.params.etaMin, e.params.etaMax) for e in ens)
36  self.pts = set((e.params.ptMin, e.params.ptMax) for e in ens)
37  self.discrs = set((e.params.discrMin, e.params.discrMax) for e in ens)
38 
39  # test points for variable data (using bound +- epsilon)
40  eps = 1e-4
41  eta_test_points = list(itertools.ifilter(
42  lambda x: self.ETA_MIN < x < self.ETA_MAX,
43  itertools.chain(
44  (a + eps for a, _ in self.etas),
45  (a - eps for a, _ in self.etas),
46  (b + eps for _, b in self.etas),
47  (b - eps for _, b in self.etas),
48  (self.ETA_MIN + eps, self.ETA_MAX - eps),
49  )
50  ))
51  abseta_test_points = list(itertools.ifilter(
52  lambda x: 0. < x < self.ETA_MAX,
53  itertools.chain(
54  (a + eps for a, _ in self.etas),
55  (a - eps for a, _ in self.etas),
56  (b + eps for _, b in self.etas),
57  (b - eps for _, b in self.etas),
58  (eps, self.ETA_MAX - eps),
59  )
60  ))
61  pt_test_points = list(itertools.ifilter(
62  lambda x: self.PT_MIN < x < self.PT_MAX,
63  itertools.chain(
64  (a + eps for a, _ in self.pts),
65  (a - eps for a, _ in self.pts),
66  (b + eps for _, b in self.pts),
67  (b - eps for _, b in self.pts),
68  (self.PT_MIN + eps, self.PT_MAX - eps),
69  )
70  ))
71  discr_test_points = list(itertools.ifilter(
72  lambda x: self.DISCR_MIN < x < self.DISCR_MAX,
73  itertools.chain(
74  (a + eps for a, _ in self.discrs),
75  (a - eps for a, _ in self.discrs),
76  (b + eps for _, b in self.discrs),
77  (b - eps for _, b in self.discrs),
78  (self.DISCR_MIN + eps, self.DISCR_MAX - eps),
79  )
80  ))
81  # use sets
82  self.eta_test_points = set(round(f, 5) for f in eta_test_points)
83  self.abseta_test_points = set(round(f, 5) for f in abseta_test_points)
84  self.pt_test_points = set(round(f, 5) for f in pt_test_points)
85  self.discr_test_points = set(round(f, 5) for f in discr_test_points)
T min(T a, T b)
Definition: MathUtil.h:58
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

Member Function Documentation

def dataLoader.DataLoader.print_data (   self)

Definition at line 86 of file dataLoader.py.

References dataLoader.DataLoader.DISCR_MAX, dataLoader.DataLoader.DISCR_MIN, dataLoader.DataLoader.discr_test_points, dataLoader.DataLoader.discrs, dataLoader.DataLoader.ETA_MAX, dataLoader.DataLoader.ETA_MIN, dataLoader.DataLoader.eta_test_points, dataLoader.DataLoader.etas, dataLoader.DataLoader.flavs, dataLoader.DataLoader.ops, dataLoader.DataLoader.PT_MAX, dataLoader.DataLoader.PT_MIN, dataLoader.DataLoader.pt_test_points, dataLoader.DataLoader.pts, and dataLoader.DataLoader.syss.

86 
87  def print_data(self):
88  print "\nFound operating points (need at least 0, 1, 2):"
89  print self.ops
90 
91  print "\nFound jet flavors (need 0, 1, 2):"
92  print self.flavs
93 
94  print "\nFound sys types (need at least 'central', 'up', 'down'; " \
95  "also 'up_SYS'/'down_SYS' compatibility is checked):"
96  print self.syss
97 
98  print "\nFound eta ranges: (need everything covered from %g or 0. " \
99  "up to %g):" % (self.ETA_MIN, self.ETA_MAX)
100  print self.etas
101 
102  print "\nFound pt ranges: (need everything covered from %g " \
103  "to %g):" % (self.PT_MIN, self.PT_MAX)
104  print self.pts
105 
106  print "\nFound discr ranges: (only needed for operatingPoint==3, " \
107  "covered from %g to %g):" % (self.DISCR_MIN, self.DISCR_MAX)
108  print self.discrs
109 
110  print "\nTest points for eta (bounds +- epsilon):"
111  print self.eta_test_points
112 
113  print "\nTest points for pt (bounds +- epsilon):"
114  print self.pt_test_points
115 
116  print "\nTest points for discr (bounds +- epsilon):"
117  print self.discr_test_points
118  print ""
119 

Member Data Documentation

dataLoader.DataLoader.abseta_test_points

Definition at line 82 of file dataLoader.py.

dataLoader.DataLoader.DISCR_MAX

Definition at line 28 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.DISCR_MIN

Definition at line 27 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.discr_test_points

Definition at line 84 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.discrs

Definition at line 36 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.entries

Definition at line 21 of file dataLoader.py.

dataLoader.DataLoader.ETA_MAX

Definition at line 24 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.ETA_MIN

Definition at line 23 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.eta_test_points

Definition at line 81 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.etas

Definition at line 34 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.flavs

Definition at line 32 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.meas_type

Definition at line 8 of file dataLoader.py.

dataLoader.DataLoader.ops

Definition at line 31 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.PT_MAX

Definition at line 26 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.PT_MIN

Definition at line 25 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.pt_test_points

Definition at line 83 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.pts

Definition at line 35 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().

dataLoader.DataLoader.syss

Definition at line 33 of file dataLoader.py.

Referenced by dataLoader.DataLoader.print_data().