This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
from pprint import pprint | |
import numpy as np | |
np.random.seed(12345) | |
import matplotlib.pyplot as plt | |
Appointment = namedtuple("Appointment", "scheduled late_by emergency") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
random.seed(12345) | |
class Dice(object): | |
def __init__(self, sides=6): | |
print "creating a dice with %i sides."%sides | |
self.sides = sides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All sorts of stuff for setting up the Forward tracking | |
# itneresting stuff towards the bottom | |
FstForward = PrForwardTracking("FstForward") | |
FstForward.InputName = self.getProp("RootInTES") + "Track/VeloUTFst" | |
FstForward.OutputName = self.getProp("RootInTES") + "Track/Forward" | |
FstForward.addTool(PrForwardTool) | |
FstForward.PrForwardTool.AddUTHitsToolName = "" | |
# Now with the momentum estimate FstForward.PrForwardTool.UseMomentumEstimate = True | |
# MinPt determines the size of the search window, set # this to the lowest pT you want to be able to find |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
Infos = namedtuple('Infos', ["bias"," threshold", "alignment"]) | |
# information about runs 1234 and 1235 | |
run_info = {1234: Infos(12.3, 2., 42.), | |
1235: Infos(12.2, 2.1, 42.3)} | |
# retrieve it | |
print run_info[1234] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://github.com/scikit-learn/scikit-learn.git | |
$ git remote add pprett https://github.com/pprett/scikit-learn.git | |
$ git remote add ndawe https://github.com/ndawe/scikit-learn.git | |
$ git fetch | |
$ git checkout -b weighted_scores ndawe/weighted_scores | |
$ git rebase master | |
$ git checkout master | |
$ git merge weighted_scores | |
$ git checkout -b gbrt-sample-weight pprett/gbrt-sample-weight | |
$ git rebase master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SetupProject DaVinci v35r1 | |
# ipython -i dst-explore.py <inputDST> | |
import sys | |
import GaudiPython as GP | |
from GaudiConf import IOHelper | |
from Configurables import LHCbApp, ApplicationMgr, DataOnDemandSvc | |
from Configurables import SimConf, DigiConf, DecodeRawEvent | |
from Configurables import CondDB, DstConf, PhysConf | |
from Configurables import LoKiSvc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cluster2mc_particles(cluster, event): | |
links = event['/Event/Link/Raw/VP/Clusters'] | |
refs = links.linkReference() | |
mc_particles = event['MC/Particles'] | |
next_idx = -1 | |
particles = [] | |
for channel, key in links.keyIndex(): | |
if channel == cluster.channelID().channelID(): | |
mc_key = refs[key].objectKey() | |
particles.append(mc_particles.object(mc_key)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nodes(evt, node=None): | |
nodenames = [] | |
if node is None: | |
root = evt.retrieveObject('') | |
node = root.registry() | |
if node.object(): | |
nodenames.append(node.identifier()) | |
for l in evt.leaves(node): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer