Skip to content
Snippets Groups Projects
Commit 466f3e21 authored by Martin Beyer's avatar Martin Beyer
Browse files

apply chang-format

parent 1a13be8d
No related branches found
No related tags found
1 merge request!1512TrdPid Interpolate error spam fix #3067
Pipeline #26105 passed
...@@ -98,8 +98,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData() ...@@ -98,8 +98,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData()
if (fMCinput) { /// mc pid method if (fMCinput) { /// mc pid method
if (fMomDep) { if (fMomDep) {
std::vector<TString> histnames {"MC_electron_p_eloss", "MC_pion_p_eloss", "MC_kaon_p_eloss", "MC_proton_p_eloss", std::vector<TString> histnames{"MC_electron_p_eloss", "MC_pion_p_eloss", "MC_kaon_p_eloss", "MC_proton_p_eloss",
"MC_muon_p_eloss"}; "MC_muon_p_eloss"};
inArr = new TObjArray(histnames.size()); inArr = new TObjArray(histnames.size());
for (size_t i = 0; i < histnames.size(); i++) { for (size_t i = 0; i < histnames.size(); i++) {
h[i] = histFile->Get<TH2F>(histnames[i]); h[i] = histFile->Get<TH2F>(histnames[i]);
...@@ -124,8 +124,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData() ...@@ -124,8 +124,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData()
} }
} }
if (!fMomDep) { if (!fMomDep) {
std::vector<TString> histnames {"MC_electron_eloss", "MC_pion_eloss", "MC_kaon_eloss", "MC_proton_eloss", std::vector<TString> histnames{"MC_electron_eloss", "MC_pion_eloss", "MC_kaon_eloss", "MC_proton_eloss",
"MC_muon_eloss"}; "MC_muon_eloss"};
inArr = new TObjArray(histnames.size()); inArr = new TObjArray(histnames.size());
for (size_t i = 0; i < histnames.size(); i++) { for (size_t i = 0; i < histnames.size(); i++) {
h[i] = histFile->Get<TH1F>(histnames[i]); h[i] = histFile->Get<TH1F>(histnames[i]);
...@@ -146,8 +146,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData() ...@@ -146,8 +146,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData()
} }
else { /// data driven method else { /// data driven method
if (fMomDep) { if (fMomDep) {
std::vector<TString> histnames {"ELE_electron_p_eloss", "PIO_pion_p_eloss", "ELE_kaon_p_eloss", std::vector<TString> histnames{"ELE_electron_p_eloss", "PIO_pion_p_eloss", "ELE_kaon_p_eloss",
"ELE_proton_p_eloss", "ELE_muon_p_eloss"}; "ELE_proton_p_eloss", "ELE_muon_p_eloss"};
inArr = new TObjArray(histnames.size()); inArr = new TObjArray(histnames.size());
for (size_t i = 0; i < histnames.size(); i++) { for (size_t i = 0; i < histnames.size(); i++) {
h[i] = histFile->Get<TH2F>(histnames[i]); h[i] = histFile->Get<TH2F>(histnames[i]);
...@@ -173,8 +173,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData() ...@@ -173,8 +173,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData()
} }
} }
if (!fMomDep) { if (!fMomDep) {
std::vector<TString> histnames {"ELE_electron_eloss", "PIO_pion_eloss", "ELE_kaon_eloss", "ELE_proton_eloss", std::vector<TString> histnames{"ELE_electron_eloss", "PIO_pion_eloss", "ELE_kaon_eloss", "ELE_proton_eloss",
"ELE_muon_eloss"}; "ELE_muon_eloss"};
inArr = new TObjArray(histnames.size()); inArr = new TObjArray(histnames.size());
for (size_t i = 0; i < histnames.size(); i++) { for (size_t i = 0; i < histnames.size(); i++) {
h[i] = histFile->Get<TH1F>(histnames[i]); h[i] = histFile->Get<TH1F>(histnames[i]);
...@@ -203,7 +203,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData() ...@@ -203,7 +203,8 @@ Bool_t CbmTrdSetTracksPidLike::ReadData()
LOG_IF(info, hist->GetEntries() < 1000) << "Input histogram is almost empty for" << name.Data(); LOG_IF(info, hist->GetEntries() < 1000) << "Input histogram is almost empty for" << name.Data();
// check particles // check particles
if (name.Contains("electron")) particle = CbmTrdSetTracksPidLike::kElectron; if (name.Contains("electron"))
particle = CbmTrdSetTracksPidLike::kElectron;
else if (name.Contains("pion")) else if (name.Contains("pion"))
particle = CbmTrdSetTracksPidLike::kPion; particle = CbmTrdSetTracksPidLike::kPion;
else if (name.Contains("kaon")) else if (name.Contains("kaon"))
...@@ -312,7 +313,8 @@ void CbmTrdSetTracksPidLike::Exec(Option_t*) ...@@ -312,7 +313,8 @@ void CbmTrdSetTracksPidLike::Exec(Option_t*)
} }
/// only trd tracks with mimimum 1 reconstructed point /// only trd tracks with mimimum 1 reconstructed point
if (pTrack->GetNofHits() < 1) continue; if (pTrack->GetNofHits() < 1)
continue;
else else
fNofTracks++; fNofTracks++;
...@@ -390,17 +392,25 @@ Double_t CbmTrdSetTracksPidLike::GetProbability(Int_t k, Double_t mom, Double_t ...@@ -390,17 +392,25 @@ Double_t CbmTrdSetTracksPidLike::GetProbability(Int_t k, Double_t mom, Double_t
// //
/// check for undefined dedx (dedx = -1. is sometimes passed in) /// check for undefined dedx (dedx = -1. is sometimes passed in)
if (dedx < 0.) { return -999.; } if (dedx < 0.) {
return -999.;
}
/// useless protection /// useless protection
if (k < 0 || k > fgkNParts) { return -999.; } if (k < 0 || k > fgkNParts) {
return -999.;
}
/// histogram has TRD momentum at inner point vs. dedx sinal [keV] /// histogram has TRD momentum at inner point vs. dedx sinal [keV]
TH1* hist = (TH1*) fHistdEdx->At(k); TH1* hist = (TH1*) fHistdEdx->At(k);
if (!hist) { return -999.; } if (!hist) {
return -999.;
}
/// check for entries/ non-empty histograms /// check for entries/ non-empty histograms
if (hist->GetEntries() < 1000.) { return -999.; } if (hist->GetEntries() < 1000.) {
return -999.;
}
Int_t ndim = hist->GetDimension(); Int_t ndim = hist->GetDimension();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment