Newer
Older
FairShipTools / updatedNuNtuples / checkGeo.py
#import sys
#sys.path.append('..')
from ROOT import *
from lookAtGeo import *

fileNameGeo = "geofile_full.10.0.Genie-TGeant4_n691.root"#"../data/neutrino681/ship.10.0.Genie-TGeant4.root"
oldGeo = True

if oldGeo:
    volName = None
    RPCname = "volScintLayer_"
    passiveName = "volLayer_" 
    HPTname1 = "volDriftLayer"
    HPTname2 = "_1"
    passiveRange = range(0,12)
    passiveRange.reverse()
    RPCrange = range(0,11)
else:
    volName = "volArm2MS"
    RPCname = "volPpc_"
    passiveName = "volIron_" 
    HPTname1 = "volHPT_"
    HPTname2 = ""
    passiveRange = range(12,25)
    RPCrange = range(11,22)
    

'''myNodes_name = ["volLayer_%s"%i for i in xrange(0,12)]
myNodes_name += ["lidT1lisci_1","lidT1I_1","lidT1O_1"]
myNodes_name += ["volScintLayer_%s"%i for i in xrange(0,11)]
myNodes_name += ["lidT6lisci_1","lidT6I_1","lidT6O_1"]
myNodes_name += ["volDriftLayer%s_1"%i for i in xrange(1,6)]
myNodes_name += ["Tr%s_%s"%(i,i) for i in xrange(1,5)]
myNodes_name += ["Veto_5"]
'''

myNodes_name = ["%s%s"%(passiveName,i) for i in passiveRange]#xrange(0,12)]
myNodes_name += ["lidT1lisci_1","lidT1I_1","lidT1O_1"]
myNodes_name += ["%s%s"%(RPCname,i) for i in RPCrange]
myNodes_name += ["lidT6lisci_1","lidT6I_1","lidT6O_1"]
myNodes_name += ["%s%s%s"%(HPTname1,i,HPTname2) for i in xrange(1,6)]
myNodes_name += ["Tr%s_%s"%(i,i) for i in xrange(1,5)]
myNodes_name += ["Veto_5"]

myGeoEl = findPositionGeoElement(fileNameGeo, myNodes_name,volName)
#lastPassiveEl = [myGeoEl["volLayer_0"]['z']-myGeoEl["volLayer_0"]['dimZ'],myGeoEl["volLayer_0"]['z']+myGeoEl["volLayer_0"]['dimZ']]
lastPassiveEl = [myGeoEl["%s%s"%(passiveName,passiveRange[-1])]['z']-myGeoEl["%s%s"%(passiveName,passiveRange[-1])]['dimZ'],myGeoEl["%s%s"%(passiveName,passiveRange[-1])]['z']+myGeoEl["%s%s"%(passiveName,passiveRange[-1])]['dimZ']]

geo = loadGeometry(fileNameGeo)
ship_geo = geo['ShipGeo']

entranceWindows = [ [myGeoEl["lidT1O_1"]['z']-myGeoEl["lidT1O_1"]['dimZ'],myGeoEl["lidT1O_1"]['z']+myGeoEl["lidT1O_1"]['dimZ']],
                    [myGeoEl["lidT1I_1"]['z']-myGeoEl["lidT1I_1"]['dimZ'],myGeoEl["lidT1I_1"]['z']+myGeoEl["lidT1I_1"]['dimZ']]
                  ]                   
volume = [myGeoEl["lidT1O_1"]['z']-myGeoEl["lidT6O_1"]['dimZ'],myGeoEl["lidT6O_1"]['z']-myGeoEl["lidT6O_1"]['dimZ']]#[myGeoEl["lidT1lisci_1"]['z']+myGeoEl["lidT1lisci_1"]['dimZ'],4100]

scintTankW = [myGeoEl["lidT1lisci_1"]['z']-myGeoEl["lidT1lisci_1"]['dimZ'],myGeoEl["lidT1lisci_1"]['z']+myGeoEl["lidT1lisci_1"]['dimZ']]
scintTankV = [myGeoEl["lidT1lisci_1"]['z']-myGeoEl["lidT1lisci_1"]['dimZ'],myGeoEl["lidT1lisci_1"]['z']+myGeoEl["lidT1lisci_1"]['dimZ']]

#OPERA = [myGeoEl["volLayer_11"]['z']-myGeoEl["volLayer_11"]['dimZ'],myGeoEl["volLayer_0"]['z']+myGeoEl["volLayer_0"]['dimZ']]
OPERA = [myGeoEl["%s%s"%(passiveName,passiveRange[0])]['z']-myGeoEl["%s%s"%(passiveName,passiveRange[0])]['dimZ'],myGeoEl["%s%s"%(passiveName,passiveRange[-1])]['z']+myGeoEl["%s%s"%(passiveName,passiveRange[-1])]['dimZ']]
OPERA_wrong = [-2705.3,-2625.3]
Tracking = [myGeoEl["Tr1_1"]['z']-myGeoEl["Tr1_1"]['dimZ'],myGeoEl["Tr4_4"]['z']+myGeoEl["Tr4_4"]['dimZ']]
vetoWall = [[volume[0],Tracking[0]]]

print "Geometry Parameters:"
print "last passive (interactionElement == 0): ",lastPassiveEl
print "entrance windows (interactionElement == 1): ", entranceWindows
print "volume (interactionElement ==2): ", volume
print "scintTankW: ", scintTankW
print "scintTankV: ", scintTankV
print "OPERA-system: ",OPERA
print "OPERA_wrong: ", OPERA_wrong
print "Tracking: ", Tracking
print "vetoWall: ",vetoWall