diff --git a/ntuple_nuVeto_small.py b/ntuple_nuVeto_small.py index 51f6645..82d86d2 100644 --- a/ntuple_nuVeto_small.py +++ b/ntuple_nuVeto_small.py @@ -299,6 +299,7 @@ import offlineForBarbara as offline offline.loadNodes(fGeo) offline.ShipGeo = r['ShipGeo'] +offline.initBField() # Handle geometry # Names of useful geometry nodes diff --git a/offlineForBarbara.py b/offlineForBarbara.py index d332e0a..71ce6d4 100644 --- a/offlineForBarbara.py +++ b/offlineForBarbara.py @@ -2,9 +2,24 @@ import tools import shipunit as u from ShipGeoConfig import ConfigRegistry +import shipDet_conf + +__run = ROOT.FairRunSim() + from operator import mul, add -dy = 10. +import sys +sys.path.append('KaterinaLight/') +from StrawHits import StrawHits +## Use it like: +# f = TFile(fileName) +# t = f.Get("cbmsim") +# sh = offline.StrawHits(t, offline.shipDet_conf.configure(offline.__run, r['ShipGeo']), r['ShipGeo'].straw.resol, 0, None, r['ShipGeo']) +# t.GetEntry(58) +# sh.readEvent() +# sh.FitTracks() + +#dy = 10. # init geometry and mag. field #ShipGeo = ConfigRegistry.loadpy("$FAIRSHIP/geometry/geometry_config.py", Yheight = dy ) @@ -98,14 +113,14 @@ return 1 if "bar" in nuName: reduction = 0.5 - flux = 6.98e+11 * 2.e+20 / 5.e+13 + flux = 1.#6.98e+11 * 2.e+20 / 5.e+13 else: reduction = 1. - flux = 1.09e+12 * 2.e+20/ 5.e+13 + flux = 1.#1.09e+12 * 2.e+20/ 5.e+13 crossSec = 6.7e-39*E * reduction NA = 6.022e+23 binN = h_GioHans.GetXaxis().FindBin(E) - return crossSec * flux * h_GioHans.GetBinContent(binN) * w * NA / entries + return crossSec * flux * h_GioHans.GetBinContent(binN) * w * NA #/ entries def findWeight(sampleType, NC, E, MCTrack, entries, nuName, ON): @@ -434,4 +449,9 @@ hasEcalAndMuons(tree, particle) goodBehavedTracks(tree, particle) chi2Ndf(tree, particle) - vertexInfo(tree, particle) \ No newline at end of file + vertexInfo(tree, particle) + +def initBField(): + bfield = ROOT.genfit.BellField(ShipGeo.Bfield.max, ShipGeo.Bfield.z, 2, ShipGeo.Yheight/2.) + fM = ROOT.genfit.FieldManager.getInstance() + fM.init(bfield)