- #1
ChrisVer
Gold Member
- 3,378
- 465
I have one question (simple I hope).
In the TMVA factory one can set global weights by typing:
And use them afterwards by calling their names signalWeight, backgroundWeight.
If I want to use event-wise weights, the code below uses the factory->SetBackgroundWeightExpression etc:
I was wondering, later on how can I use those weights? Should I put this whole command in position where "signalWeight" should be used?
Thanks. (https://hep.pa.msu.edu/wiki/pub/AtlasSingleTop/AnalysisVersion1405006Check/TMVAnalysis_test3.C)
In the TMVA factory one can set global weights by typing:
C:
// global event weights (see below for setting event-wise weights)
Double_t signalWeight = 1.0;
Double_t backgroundWeight = 1.0;
And use them afterwards by calling their names signalWeight, backgroundWeight.
If I want to use event-wise weights, the code below uses the factory->SetBackgroundWeightExpression etc:
C:
factory->SetWeightExpression("EventWeight");
factory->SetSignalWeightExpression("EventWeight");
factory->SetBackgroundWeightExpression("EventWeight");
// This would set individual event weights (the variables defined in the
// expression need to exist in the original TTree)
// for signal : factory->SetSignalWeightExpression("weight1*weight2");
// for background: factory->SetBackgroundWeightExpression("weight1*weight2");
I was wondering, later on how can I use those weights? Should I put this whole command in position where "signalWeight" should be used?
Thanks. (https://hep.pa.msu.edu/wiki/pub/AtlasSingleTop/AnalysisVersion1405006Check/TMVAnalysis_test3.C)