You are here

6. Multivariate Analysis

Default triggered versus pT plot

Triggered versus pT plot with BOX option

Multiple Variables

The muon trigger should fire more likely for higher muon momenta - let's check that!

For that we need to draw two variables: how many were fired and ho many were not, against the momentum of the muon. We could put the fired / not fired on the y-axis, and the muon momentum on the x-axis. You can do that with TTree::Draw("yExpression:xExpression"). It should give you the top histogram above, where the y-axis has a value of 0 for not triggered muons and of 1 for triggered muons.

The default output puts one tiny dot at each point - which is fairly useless on our case. So specify as the third option to TTree::Draw() a different drawing option - we want "BOX" here, which should give the the second histogram with box sizes proportional to histogram bin entries.

This plot shows that for lower pT most muons are not triggered, while for higher pT most muons are triggered. The efficiency is thus rising with pT. We will study this in more detail in the following steps. Multivariate Analysis with TMVA

Now let's assume we want to see whether the muon trigger also depends on the muon X position, i.e. whether it fires more often for instance when the muon was created farther away from the beam pipe. This would mean that there is e.g. a linear correlation between the muon trigger and the position.

ROOT offers TMVA, a tool widely used in physics analyses for analyzing higher dimensional dependencies. We recommend that you put the following statements into a source file that you then run in ROOT

// Put into the file trigParam.C
// which #includes do you need?
#include ...
void trigParam() {
   // The location of the input data
   TFile* infile = TFile::Open("http://root.cern.ch/root/files/tutorials/mockupx.root");
   TTree* tree = 0;
   infile->GetObject("MyTree", tree);

   // The output file, it will hold the results of TMVA's work.
   TFile* outputFile = TFile::Open("mutrig.root", "RECREATE" );

   // Create a TMVA analysis
   TMVA::Factory *factory = new TMVA::Factory("MuonTrigger", outputFile,
      "!V:!Silent:Color:DrawProgressBar:Transformations=I;D;P;G,D:AnalysisType=Classification" );

   // Add a few variables to study - let's see which one TMVA finds relevant:
   factory->AddVariable( "muons.fPt", 'F' );
   factory->AddVariable( "muons.fE", 'F' );
   factory->AddVariable( "muons.fVertex.fX", 'F' );
   factory->AddVariable( "muons.fTriggered", 'F' );

   // Usually TMVA can predict whether an event belongs to "signal" or "background":
   // it determines that based on the valued of the parameters we selected above.
   // We don't really want to know that "signal" / "background" thing: we just "mis"-use
   // TMVA to analyze the parameter correlations. Nonetheless, let's just define signal
   // and background as triggered / not triggered. Both are in the same tree.
   // We distinguish them using TCut objects: selections as one would use in TTree::Draw(). 
   TCut signalCut("muons.fTriggered");
   TCut backgroundCut("!muons.fTriggered");
   factory->SetInputTrees(tree, signalCut, backgroundCut);

   // Now select which algorithm to run - it's not important here as long as it
   // determines the parameter correlations.
   factory->BookMethod( TMVA::Types::kFisher, "Fisher", "H:!V" );
   //  And start the correlation analysis:
   factory->TestAllMethods();
}

Parameter correlations

We want to know what muons.fTriggered depends on. A simple check is to look for correlations: variables that it depends on might be linearly correlated. TMVA tells us that the muon and the X position is completely uncorrelated. It also tells us that the muons' pT and energy are somewhat correlated. But what would be the best parameter to determine the muon trigger efficiency - what is most correlated with it?