1 import ROOT,os,sys,getopt
11 """ More description here"""
44 self.__productVertex.clear()
45 self.__productMoment.clear()
46 self.__productCharge.clear()
47 self.__productInfo.clear()
59 print type(self).__name__,
" : "
60 print "\tdecay vertex: ",
" ".join(
"{:10.4f}".format(self.
__HNLdecayCoord(ii))
for ii
in range(0,3)),
61 print "\n\tdecay products (trID, pdg, charge, momentum):"
64 print "\t",
" ".join(
"{:10.4f}".format(self.
__productMoment[tid](ii))
for ii
in range(0,3))
135 if (
not ok ) :
return False
140 if (
not ok ) :
break
173 vec3 = ROOT.TVector3(xy[0],xy[1],z)
187 x=self.__tree.MCTrack[trID]
190 if (
not b) :
return 0
192 vec3 = ROOT.TVector3(x.GetPx(),x.GetPy(),x.GetPz())
194 vec3 = ROOT.TVector3(x.GetStartX(),x.GetStartY(),x.GetStartZ())
199 mid = x.GetMotherId()
200 if(mid>=0) : self.
__productInfo[trID][
'mpdg'] = self.__tree.MCTrack[mid].GetPdgCode()
203 print "additional MC track for trID", trID
220 print "sTree.MCTrack", self.__tree.MCTrack,
"size:", len(self.__tree.MCTrack)
224 for x
in self.__tree.MCTrack:
227 mid = x.GetMotherId()
232 if self.
__debug>0:
print "HNL\t\t", tid,
"\t", x.GetStartX(), x.GetStartY(), x.GetStartZ(),
"\t\t", x.GetPx(), x.GetPy(), x.GetPz()
234 self.__decayProdTrID.append(tid)
235 vec3 = ROOT.TVector3(x.GetPx(),x.GetPy(),x.GetPz())
237 vec3 = ROOT.TVector3(x.GetStartX(),x.GetStartY(),x.GetStartZ())
242 self.
__productInfo[tid][
'mpdg'] = self.__tree.MCTrack[mid].GetPdgCode()
243 if( self.
__debug>0 ):
print x.GetPdgCode(),
"\t\t", tid,
"\t", x.GetStartX(), x.GetStartY(), x.GetStartZ(),
"\t\t", x.GetPx(), x.GetPy(), x.GetPz()
245 self.
__HNLdecayCoord = ROOT.TVector3(x.GetStartX(), x.GetStartY(), x.GetStartZ())
247 if self.__HNLdecayCoord.Z()!=x.GetStartZ():
248 self.__HNLdecayCoord.SetXYZ(0,0,-8899)
def setAccPlaneZ
set z of the last full acceptance plane (to be used in checkEllipticAcc), depends on RecoSettings...
__HNLdecayCoord
HNL decay vertex coordinates (TVector3).
def readEvent
reads HNL decay products from MCTrack collection (two at the moment!).
__productCharge
Charge of several stored products (not only HNL daughter) as {MCTrID : value}.
__decayProdTrID
MCTrID (index of the track in MCtrack list) for HNL daughter products.
def getCharge
returns charge of a particle with the given trID (index in MCTrack collection).
def getTrIDs
returns list of all MCtrIDs read by readEvent and readTrack - not only HNL decay products.
__zAcc
z of the last full acceptance plane (to be used in checkEllipticAcc), must be set later...
def getHNLdecayTrIDs
returns list of MCtrIDs (index in MCTrack collection) fot HNL decay products.
__productInfo
Basic information on the particle (pdg, mother pdg,...
def getMomentum
returns momentum (TVector3) for a particle with the given trID (index in MCTrack collection).
def getTrackPropagation
for Tracker Performance studies.
def checkEllipticAcc
checks if HNL decay vertex (and both HNL daughter tracks, if tight cut) are in elliptic acceptance at...
def __clean
clears all dictionaries and lists.
__productMoment
Momentum of several stored products (not only HNL daughter) as {MCTrID : TVector3}.
def getHNLdecayVertex
returns HNL decay vertex coordinates (TVector3 __HNLdecayCoord).
def getEventWeight
returns event weight.
def PrintHNL
prints HNL decay products
def readTrack
reads one additional track with trID from MCTrack collection.
__debug
debug level [0,3].
def checkVertexUpDown
for Tracker Performance studies.
__tree
root tree to be read.
For a single event stores HNL, its decay products and several other tracks (if requested) from ShipMC...
__productVertex
Production vertices of several stored products (not only HNL daughter) as {MCTrID : TVector3}...