Skip to content
Snippets Groups Projects
Commit 415ca0a8 authored by Michiel Jan Veen's avatar Michiel Jan Veen
Browse files

Small fixes, adding stds to NSWValAlg

parent 7824abeb
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,6 @@
#include "EDM_object.h"
using namespace std;
EDM_object::EDM_object () {
m_stationName = nullptr;
m_stationEta = nullptr;
......@@ -96,7 +94,7 @@ bool EDM_object::update_match(int index, int ch_candidate) {
void EDM_object::init_matching () {
if (empty()) { return; }
m_matchedchannel = new vector<int>(this->size());
m_matchedchannel = new std::vector<int>(this->size());
for ( uint i = 0; i < this->size(); ++i) { m_matchedchannel->at(i) = -10; }
}
......@@ -116,8 +114,8 @@ void EDM_object::update_efficiency ( int maximum_difference ) {
m_mismatches += (n_obj - nMatches);
}
void EDM_object::printEfficiency(ofstream& file) {
file << "\nMatching " << m_name << " to " << m_matchedwith << " for " << m_detector << endl;
file << "Total: " << m_total << ", number of mismatches: " << m_mismatches <<endl;
file << "Efficiency: " << (m_total - m_mismatches) / (double)m_total * 100. << "%" << endl;
void EDM_object::printEfficiency(std::ofstream& file) {
file << "\nMatching " << m_name << " to " << m_matchedwith << " for " << m_detector << std::endl;
file << "Total: " << m_total << ", number of mismatches: " << m_mismatches << std::endl;
file << "Efficiency: " << (m_total - m_mismatches) / (double)m_total * 100. << "%" << std::endl;
}
......@@ -20,7 +20,7 @@ public:
// Efficiency
void update_efficiency ( int maximum_difference );
void printEfficiency (ofstream& file);
void printEfficiency (std::ofstream& file);
// setters
void setName (TString name) { m_name = name; }
......@@ -43,7 +43,7 @@ public:
EDM_object ();
~EDM_object () { clearVars(); }
std::vector<string> *m_stationName;
std::vector<std::string> *m_stationName;
std::vector<int> *m_stationEta;
std::vector<int> *m_stationPhi;
std::vector<int> *m_multiplet;
......
......@@ -344,11 +344,11 @@ StatusCode NSWPRDValAlg::NSWMatchingAlg () {
}
// Prepare the output file
ofstream efficiencies;
std::ofstream efficiencies;
efficiencies.open("NSWMatchingAlg_efficiencies.txt");
efficiencies << "NSW Matching algorithm, efficiencies of conversion from and to various EDM objects" << endl;
efficiencies << "Settings:\n" << m_doNSWMatchingMuon << endl;
efficiencies << " 'Maximum Strip Distance':" << m_maxStripDiff << endl;
efficiencies << "NSW Matching algorithm, efficiencies of conversion from and to various EDM objects" << std::endl;
efficiencies << "Settings:\n" << m_doNSWMatchingMuon << std::endl;
efficiencies << " 'Maximum Strip Distance':" << m_maxStripDiff << std::endl;
efficiencies.close();
// sTGC matching
......@@ -399,7 +399,7 @@ StatusCode NSWPRDValAlg::NSWMatchingAlg (EDM_object data0, EDM_object data1) {
data1.setMatchedwith(data0.getName());
// Prepare Muon only check
vector<int>* TruthParticle_Pdg;
std::vector<int>* TruthParticle_Pdg;
if ( m_doNSWMatchingMuon ) { m_tree->SetBranchAddress("TruthParticle_Pdg", &TruthParticle_Pdg); }
Long64_t nEntries = m_tree->GetEntriesFast();
......@@ -460,8 +460,8 @@ StatusCode NSWPRDValAlg::NSWMatchingAlg (EDM_object data0, EDM_object data1) {
}
// Write result to file
ofstream efficiencies;
efficiencies.open("NSWMatchingAlg_efficiencies.txt", ofstream::app);
std::ofstream efficiencies;
efficiencies.open("NSWMatchingAlg_efficiencies.txt", std::ofstream::app);
data0.printEfficiency(efficiencies);
data1.printEfficiency(efficiencies);
efficiencies.close();
......
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