I am a newbie to TMVA and using it for separating the signal from the background. I want to use the μ-transformed BDT output in the fit. In μ-transformation (probability integral transformation), where the signal shape is linear between 0 and 1, the background shape is exponential. Compared with the usual
Rarity transformation, the distribution is total reverse as of μ-transformation. I have referred to the TMVA guide but didn’t get the proper information on implementing it.
I don’t know it is available in the package like other transformation types like normalisation, decorrelation, PCS and Gaussianisation.
Kindly shares some suggestions, references, or code to reproduce the result.
Thanks in advance
I am not sure I have understood well your question. You would like to apply the transformation on the output value you are getting from BDT, but it is not clear to me how this transformation differs from the rarity that TMVA implements (see pages 29 and 30 of the TMVA Users Guide). If you want to have it uniformly distributed for the signal, is it not enough that you swap in the input definition the labels for signal and background ?
Otherwise TMVA returns also the density distribution and you can compute your integral transformations
@moneta Thank you for your reply.
Yes, I want to have a uniform distribution for the signal and background distribution as exponential. This type of transformation is described as μ-transform, and it is given as reference on page 30 of the TMVA guide.
Could you please share with me the source code of rarity transformation? That would be very helpful.
The rarity is computed in MethodBase::GetRarity(), see ROOT: TMVA::MethodBase Class Reference and it is computed integrating the histogram representing the background (or signal ) PDF. It uses internally the class
TMVA::PDF, which is a wrapper of an histogram obtained with the output variable distribution.
To get the PDF distributions and the rarity you should use the method option
Thank you for the information. I will try to work on it.
Could you please clarify?
To evaluate the rarity function using the signal PDF instead of the background PDF.
TMVA::Reader::GetRarity() only has this available for background PDF as given in the example snippet,
> TH1F *rarityHistFi = new TH1F( "MVA_Fisher_Rarity", "MVA_Fisher_Rarity", 50, 0, 1 );
rarityHistFi->Fill( TMVA::Reader->GetRarity( "Fisher method" ) );
TMVA::MethodBase::GetRarity(), I have an option to specify the PDF to be a signal.
So I can replace the TMVA::Reader with TMVA::MethodBase like
TMVA::MethodBase * pdf = TMVA::MethodBase *>(TMVA::Reader::FindMVA("Fisher"));
rarityHistFi->Fill( TMVA::MethodBase->GetRarity( pdf , TMVA::Types::kSignal ) );
This is correct, by passing
kSignal in GetRarity() you should be able to have the integral transformation you want