13.07.2015 Views

BASF2 tracking tutorial - Belle II Software Tutorial - HEPHY

BASF2 tracking tutorial - Belle II Software Tutorial - HEPHY

BASF2 tracking tutorial - Belle II Software Tutorial - HEPHY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong><strong>Belle</strong> <strong>II</strong> <strong>Software</strong> <strong>Tutorial</strong>Oksana Brovchenko (<strong>Belle</strong><strong>II</strong> Tracking group) | 21.11.2011IEKP, KITKIT – University of the State of Baden-Wuerttemberg andNational Laboratory of the Helmholtz Associationwww.kit.edu


Outline1 Introduction2 Requirements and basic hit classes3 How to execute <strong>tracking</strong> and fitting4 Output of the Fit5 SummaryIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 2/20


General remarksTracking package is heavily dependent on detector simulation input (e.g.changes in the hit classes may affect <strong>tracking</strong> results)Output format (Tracks) is not in a final shape yetGenFit itself (and its implementation) may also be improved in the future (butthis should not affect the general fitting procedure)Pattern recognition (different algorithms), vertexing and particle identificationthrough dE/dx are in developement but not yet included in the framework(one CDC pattern recognition module already available)Be aware thatthe <strong>tracking</strong> package is already useable, but is still under developementIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 3/20


GenFitDAFexperiment independent framework for track fitting(Nucl.Instrum.Meth.A620,Issue2-3,pp.518-525(2010))three modular componentsTrack Representation (describes propagation of particles through matter)we are currently using RKTrackRepReconstruction Hits (detector response)a RecoHit class has to provided by each <strong>tracking</strong> subdetectorFitting Algorithmsextended Kalman filter or Deterministic Annealing Filter (DAF)iterative Kalman filter with reweighted observationscalculates assignment probabilities of all competing hitscapable to fit tracks which are contaminated with noise hitsIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 4/20


General structureDetector SimulationTrackingDetector Hitsgaussian smearing and/orrealistic detector responseMCParticlesDetector HitsPattern RecognitionMCTrackFinderModuleRecoHits constructorcollects necessaryinformation and createstrack candidatesGenFitterModuleuses RecoHits and trackcandidates to create tracksIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 5/20


Hit classes3 <strong>tracking</strong> detectors: PXD, SVD, CDCSensitive DetectorSimHitsDigitizerCDCHitsRecoHitConstructorexecutedwithin GenFitterRecoHitsSensitive DetectorPXD/SVDSimHitsDigitizerTrueHitsDigitsRecoHitConstructorexecutedwithin GenFitterClusterizerClustersRecoHitsIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 6/20


Necessary modulesCreate geometrybe sure to have the <strong>tracking</strong> detectors you want to use included in the simulatedgeometryexample how to create only the inner detector part:geometry = register module(’Geometry’)geometry.param(’Components’,[”MagneticField”,”Beampipe”,”PXD”,”SVD”,”CDC”])Shoot particles and perform geant4 simulationat the moment fitting does not work very well for low momentum (curling) tracksshoot particles with ≈ p > 0.4 GeV to get a reasonable fitting efficiencypGun = register module(’ParticleGun’)pGun.param(’momentumGeneration’,’uniform’)pGun.param(’momentumParams’: [0.4,1.5])Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 7/20


MCTrackFinderModulemctrackfinder = register module(’MCTrackFinder’)Collects hits created by primary MCParticlesFills GFTrackCand (Track Candidate class needed for the fitting) with allnecessary initial informationCreates a GFTrackCand collectionYou can select which hits to use:mctrackfinder.param(’UseCDCHits’,1)mctrackfinder.param(’UseSVDHits’,1)mctrackfinder.param(’UsePXDHits’,1)If you want to perform fitting studies with ’imperfect’ start parameters, youcan use the smearing option:mctrackfinder.param(’Smearing’,0.1)Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 9/20


GenFitterModulegenfitter = register module(’GenFitter’)Uses GenFit (external software) to fit the tracksNeeds a GFTrackCand collection as inputSelect if you are using tracks from MCTrackFinder or from patternrecognitiongenfitter.param(’mcTracks’,1)Select a filter (0: Kalman, 1:DAF)genfitter.param(’FilterId’,0)For Kalman, select number of iterationsFor DAF, select a probability cutgenfitter.param(’NIterations’,2)genfitter.param(’ProbCut’,0.001)Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 10/20


Further important remarks and hintsGeometry conversionGenFit uses currently TGeo geometry ⇒ Geant4 geometry from the simulationis convertedthere is sometimes no corresponding TGeo volume for a geant4 volumewithin the <strong>tracking</strong> detectors it is only the case for PXD gluecomment out lines 6 and 13 in the pxd/data/PXD-Components.xmlMagnetic fieldto switch between constant B field and a radial field map, editsimulation/data/MagneticField.xmlto use a constant B field with boundaries, edit the calculate method ingeometry/bfieldmap/src/BFieldComponentConstant.ccexample:if (point.Perp()


Further important remarks and hints (2)Newest GenFit versionto use the newest GenFit version in your own framework versiongo to your externals folderexecute svn update in folders genfit/genfit and genfit/RKTrackRepexecute make genfit.clean genfit in your externals folderWhen using CDCTracking (additionally to MCTracking), be careful with thecollection namesTo check if all necessary collections are there and what their names are,include the PrintCollectionsModule in your pathprintcol = register module(’PrintCollections’)To find out more about module parameters (of any module), type basf2 -mIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 13/20


Output of GenFitterModuleAt the moment: two collections with similar informationGFTracks collection’native’ GenFit outputcontains all fit informationallows extrapolation of the trackhas several useful functions-> useful in a ’successor’ module if you want to get a particular information fromthe trackTracks collectioncustom class to store the track variables in a way more suitable for furtherreconstruction and analysiscontains helix parametrisation of the track and will in the future contain furtherinformation like e.g. dE/dxis still in a preliminary shape-> useful if you just directly want to know the initial momentum and the status ofthe track fitTo write out both collections:output = register module(’SimpleOutput’)Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 14/20


Steering filesNow it is time to try it outcheck out the <strong>tracking</strong> package: addpkg <strong>tracking</strong>recompile: sconsTake a look at <strong>tracking</strong>/examples/MCFitting.pyexecute it: basf2 MCFitting.pyTake a look at <strong>tracking</strong>/examples/CDCPatternRecoFitting.pyexecute it: basf2 CDCPatternRecoFitting.pyEdit some parameters in the steering files to see the effect (pGun settings,used subdetectors, GenFit parameters)If you want: take a look at the resulting root files with TBrowserIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 15/20


GFTrack classaccess the original GFTrackCandget ID of the MCParticle: gfTrack→getCand().getMcTrackId();get PDG hypothesis used in the fit: gfTrack→getCand().getPdgCode();access the original Track Representation to extrapolate the trackbe careful, sometimes the extrapolate method may fail or produce unreasonable resultsgfTrack→getCardinalRep()→extrapolateToPoint(point, poca, dirInPoca);gfTrack→getCardinalRep()→extrapolateToLine(point1, point2, poca, dirInPoca,poca onwire);get track position and momentum in a defined detector planegfTrack→getPosMomCov(plane,resultPosition,resultMomentum,resultCovariance);Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 16/20


Track classget ID of the MCParticle and fit statustrack→getMCId();track→getFitFailed();track→getPValue();get helix parameters according to perigee parametrisationtrack→getD0();track→getPhi();track→getOmega();track→getZ0();track→getCotTheta();calculate initial momentum from helix parameters (s. Backup slides)Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 17/20


Your own <strong>tracking</strong> analysis moduleDownload MyTrackingAnalysisModule.cc and MyTrackingAnalysisModule.hfrom the indico pageCreate a folder myTrackingAnalysis in <strong>tracking</strong>/modules with correspondingsrc and include directories and put these files in thereRecompile with sconsRegister the new module in your steering filemy<strong>tracking</strong> = register module(’MyTrackingAnalysis’)Add the module to the path and execute your steering fileIf you are using PatternReco tracks, take care of setting correct collectionnamesmy<strong>tracking</strong>.param(’GFTracksColName’, ’GFTracks PatternReco’)my<strong>tracking</strong>.param(’TracksColName’, ’Tracks PatternReco’)Take a closer look at MyTrackingAnalysisModule.ccIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 18/20


Concluding remarksTo see what performance you can expect from the <strong>tracking</strong>, check <strong>tracking</strong>slides from B2GM, coming Computing WS or Tracking meetingsIn case of technical problems or feature requestscheck the doxygen documentationadd the feature request to redminewrite to belle2 <strong>tracking</strong>@bpost.kek.jpIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 19/20


SummaryTracking package is already useable within basf2, but is still underdevelopementMonteCarlo based <strong>tracking</strong> including all 3 subdetectors is available with twooutput track classes’Realistic’ <strong>tracking</strong> within the CDC possible with the CDCTrackingModuleand follows the same scheme as MonteCarlo based <strong>tracking</strong>More contributions to ’realistic’ <strong>tracking</strong> expected in the near future- (A more elaborate CDCDigitizer)- (SVDDigitizer and SVDClusterizer)HoughFinder for the CDCSVD only track finderVertexing with MartinRaveParticle Identification through dE/dxAlternative track propagation for Genfit...Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 20/20


Thank youIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 21/20


BACKUPIntroduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 22/20


Perigee helix parametrisationHelix parametersd0: signed distance from poca/pegiree to the origin in the xy plane. Negativeif the projection of the momentum on this distance points to the origin.φ 0 : track direction angle at the perigee in the xy plane ([-pi; pi])ω: signed curvature (q/R)z0: distance from poca/perigee to the origin along the z axiscot θ: cotangent of polar angle (dz/ds)Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 23/20


Perigee helix parametrisationInitial momentum:⎛ ⎞ ⎛ ⎞px⎝py⎠ = 1 cos(φ 0 )⎝sin(φ 0 ) ⎠|ω · α|pzcot θα = 1/(1.5 · 0.00299792458)Introduction Requirements and basic hit classes How to execute <strong>tracking</strong> and fitting Output of the Fit SummaryOksana Brovchenko – <strong>BASF2</strong> <strong>tracking</strong> <strong>tutorial</strong> 21.11.2011 24/20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!