Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Jet Flavour Tagging Howto | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Jet Flavour Tagging Howto with LCFIVertex | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | This is a detailed record on how the Marlin framework and included LCFI packages are used for jet flavour tagging. b-jet flavour tagging is part of our analysis of the feasibility of the ZZ fusion channel with CLIC ILD at 1.4 TeV. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | This is a detailed record on how the Marlin framework and included LCFIVertex packages are used for jet flavour tagging. b-jet flavour tagging is part of our analysis of the feasibility of the ZZ fusion channel with CLIC ILD at 1.4 TeV.
Note: this wiki refers to the LCFIVertex package, that can be found now on GitHub here![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jet Finder and Truth Tagging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | We use the LCFI![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | The LCFI package consists of a topological vertex finder ZVTOP, which reconstructs secondary interactions, and a multivariate classifier which combines several jet-related variables to tag bottom, charm, and light quark jets (see diagram). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Our steering file will contain the jet finder, flavour tagging and LCFI processors, and we will write new slcio files containing the added collections:
<group name="JetFinders"/> <group name="MyTrueAngularJetFlavourProcessorCollection"/> <processor name="IPRPCutProcessor"/> <processor name="MyPerEventIPFitterProcessor"/> <processor name="ZVRESRPCutProcessor"/> <processor name="MyZVTOP_ZVRES"/> <processor name="FTRPCutProcessor"/> <processor name="MyFlavourTagInputsProcessor"/> <processor name="MyLCIOOutputProcessor"/>The JetFinder processor reconstructs 2 and 4 jets events from the input collection (LooseSelectedPandoraPFANewPFOs was used). For the reconstructed 4 jets, MyTrueAngularJetFlavourProcessor determines MC Jet Flavour by angular matching of heavy quarks to jets, and also determines hadronic and partonic charge of the jet. The LCIOOutput processor creates new slcio files containing the new collections added by the above processors.
The LCFI processors have the following functions:
slcio files contain the collections: LooseSelectedPandoraPFANewPFOs, MCParticlesSkimmed, PandoraPFANewClusters, PandoraPFANewPFOs, PandoraPFANewReclusterMonitoring, ProngVertices, RecoMCTruthLink, SelectedLDCTracks, SelectedPandoraPFANewPFOs, TightSelectedPandoraPFANewPFOs and V0Vertices.
The processors listed above could be run in sequence, or split in several steps, invoking a LCIOOutput processor to write intermediate slcio outputs at every step. Here's a script for that, where the intermediate xml files are slight modifications of the files provided in LCFIVertex/steering examples. We found that the most time-consuming processor is ZVTOP_ZVRES with more than 10 s/event.
We found it easier to run processors 1 to 6 on batches of 10 input files, and save the outputs as /afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/ZVRES_out/runX_out.slcio . Then we ran processors 7 and 8 on these files to produce a new set ftiX_out.slcio . We used half of these files to train the neural net, but then again was easier to run flavour tagging (see below) on the individual ftiX_out.slcio files. We used the other half of the files files for the purity vs. efficiency plots (see below). These slcio output files were stored in /afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/ZVRES_out/ as well.
Troubleshooting: The b3_D0CutValue parameter of the IPRPCutProcessor was set to 5O instead of 50 , and was causing a crash. For the ZVRESRPCut processor, h1_MCPIDEnable had to be set to false . See also this post![]() Neural Network TrainingIn the previous step, we have extracted the discriminating parameters and truth-tagged the jets. Theslcio files created are stored in:
/afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/ZVRES_out/These files contain the collections Durham_4Jets, FlavourTagInputs and TrueJetFlavour_4Jets, which we will use now to train our neural nets. We use a customised version of the NeuralNetTrainer code included in the LCFI package. Separate nets were trained for 1, 2, or 3+ vertices to identify b-jets, c-jets, and c-jets with b background. Our steering file contains only:
<processor name="MyNeuralNetTrainer" type="GlasgowNeuralNetTrainer"/>This processor is a slightly modified version of the NeuralNetTrainer included in the LCFI package, where the polar angle cut was introduced as a steering parameter: // Theta cut parameters: _jetThetaAngleCut < theta < (180 - _jetThetaAngleCut) registerProcessorParameter( "JetThetaAngleCut" , "Cut on the jets theta angle" , _jetThetaAngleCut, (float)15.);such that we can pass a cut angle different of the 30º default: <!-- Jet theta angle cut (only the Glasgow NN trainer has this option) --> <parameter name="JetThetaAngleCut" type="float"> 24. </parameter>The neural nets are saved as XML files in gnets/ and will be used for flavour tagging (next step). No slcio output is written at this time. These neural networks can be downloaded from here: gnets.tgz
Flavour TaggingNow we are ready to employ the FlavourTag processor, which will do flavour tagging using the neural nets trained in the previous step. The inputslcio files contain the FlavourTagInputs and FTSelectedJets (or Durham_4Jets, not sure if there's a difference at this level) collections.
<processor name="MyFlavourTag"/> <processor name="MyLCIOOutputProcessor"/>The output slcio will contain a new collection FlavourTag (or FlavourTagGla in our customised configuration).
Purity and Efficiency StudiesTo determine the optimal cut for our b-tagging, a purity vs. efficiency study needs to be done. We use theMakePurityVsEfficiencyRootPlot.C macro provided by the LCFIVertex package.
First, we have to run:
<processor name="MyAIDAProcessor"/> <processor name="MyPlot"/> <processor name="MyLCFIAIDAPlotProcessor"/>We had to provide MyPlot with the actual names of our collections: <parameter name="TrueJetFlavourCollection" type="string">TrueJetFlavour_4Jets </parameter> <!--In fti-steer.xml this parameter is called "FlavourTagCollection", without the 's' --> <parameter name="FlavourTagCollections" type="string">FlavourTagGla </parameter>Note that LCFI must be compiled with ROOT if one wants .root output from PlotProcessor (instead of .txt). For this, we added FIND_PACKAGE( ROOT REQUIRED ) FOREACH( pkg ROOT ) IF( ${pkg}_FOUND ) INCLUDE_DIRECTORIES( ${${pkg}_INCLUDE_DIRS} ) ADD_DEFINITIONS( ${${pkg}_DEFINITIONS} ) ENDIF() ENDFOREACH()to the LCFIVertex/CMakeLists.txt file, sourced the root environment, then ran cmake and make install .
Once the AIDA Plots processors are run via Marlin , a text file PurityEfficiencyOutput.txt and a RAIDA root file are produced. We customised the MakePurityVsEfficiencyRootPlot.C macro and ran it to use the RAIDA file as input to produce the purity vs. efficiency plots:
root -l MakePurityVsEfficiencyRootPlotGla.CHere's a plot of our flavour tagging purity vs. efficiencies (using cca. 25k events): ![]() PurityEfficiencyOutput.txt . We used another Root macro to plot these values and determine the optimum b-cut.
For b-tagging, we've compared the plot produced by MakePurityVsEfficiencyRootPlotGla.C and graphs drawn with the data tabulated in PurityEfficiencyOutput.txt , for 1, 2, 3 (corresponding to distinct neural networks) or any number of vertices (which we don't know yet how to interpret):![]() PurityEfficiencyOutput.txt
Adding backgroundUp to now all that input slcio files contained was signal, so the 'background' in the plots above is not really background. To add background, we've downloaded 1.4!TeVeeqq files to:
/afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/qq/ILD/DST/00002091/000/We had to run processors 1-7 on these files to identify jets and calculate the discriminating parameters. For this, we used slightly modified versions of the scripts, which can be found here. The resulting outputs, containing approximately 25k events, are stored in /afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/ZVRES_out/ as well.
![]() Training the neural nets with eeqq background addedWe have trained another set of neural nets but adding this time eeqq background to the input. The resulting neural nets (25k signal + 25k background) are here: bnets.tgz.![]() Using an alternate Jet FinderThe whole sequence can be redone with and alternate jet finder. We used '!FastJet' and we replaced the Durham algorithm with KT. For this, we changedDurham_4Jets to Kt_4Jets and used
<processor name="MyFastJetProcessor4" type="FastJetProcessor"> <parameter name="algorithm" type="StringVec"> kt_algorithm 1.0 </parameter> <parameter name="clusteringMode" type="StringVec"> ExclusiveNJets 4 </parameter> <parameter name="jetOut" type="string" lcioOutType="ReconstructedParticle"> Kt_4Jets </parameter> <parameter name="recParticleIn" type="string" lcioInType="ReconstructedParticle"> LooseSelectedPandoraPFANewPFOs </parameter> <parameter name="recombinationScheme" type="string">E_scheme </parameter> <parameter name="recParticleOut" type="string" lcioOutType="ReconstructedParticle"> LooseSelectedPandoraPFOsInKt_4Jets </parameter> </processor>The relevant scripts and XML templates are here. The outputs are stored in /afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/ZVRES_out/ and have the prefix kt added the file name.
Using 4-Jet backgroundThis is done following the same procedure, but usingqqll 1.4TeV, CLIC_ILD DST-s (2645) and the script subqqll.sh and its dependencies, zvresQQllPBS.sh , and train_qnets.xml . The relevant files are:
/afs/phas.gla.ac.uk/data/ilc/datasets01/1.4tev/ZVRES_out/*qnets* . Purity vs. efficiency plot using qnets (1 vertex NN is gibberish): ![]() Useful Links
|