示例#1
0
    def apply_function(self):

        weight_scale = self.params.weight_scale.m_as('dimensionless')
        livetime_s = self.params.livetime.m_as('sec')
        scale = weight_scale * livetime_s

        for container in self.data:
            vectorizer.scale(scale,
                             container['weights'],
                             out=container['weights'])
示例#2
0
 def compute_function(self):
     for container in self.data:
         vectorizer.assign(vals=container["weights"],
                           out=container["manual_variance"])
         vectorizer.scale(
             vals=container["manual_variance"],
             scale=self.variance_scale,
             out=container["manual_variance"],
         )
         if self.divide_n:
             vectorizer.scale(
                 vals=container["manual_variance"],
                 scale=self.expected_total_mc /
                 self.total_mc[container.name],
                 out=container["manual_variance"],
             )
         if self.variance_floor is not None:
             apply_floor(self.variance_floor,
                         out=container["manual_variance"])
示例#3
0
 def apply_function(self):
     scale = self.params.atm_muon_scale.m_as('dimensionless')
     for container in self.data:
         vectorizer.scale(scale,
                          container['count'],
                          out=container['weights'])
示例#4
0
 def apply_function(self):
     # reset weights
     for container in self.data:
         vectorizer.scale(1.,
                          container['initial_weights'],
                          out=container['weights'])