-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcode.cpp
More file actions
executable file
·65 lines (55 loc) · 1.61 KB
/
code.cpp
File metadata and controls
executable file
·65 lines (55 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*class that define the main method
*
* @author Leticia Freire
*/
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <locale>
//#include "dados.h"
#include "tracking.h"
using namespace std;
int main(){
/*including date*/
ofstream log("log.txt", ios_base::app | ios_base::out);
time_t t = time(0); // get time now
struct tm * now = localtime( & t );
log << (now->tm_year + 1900) << '-'
<< (now->tm_mon + 1) << '-'
<< now->tm_mday
<< endl;
/*adding the file names*/
vector<string> s;
s.push_back("events/0.json"); //s.push_back("events/1.json"); s.push_back("events/2.json");
// /*s.push_back("events/3.json"); s.push_back("events/4.json"); */ s.push_back("events/5.json");
for(int file = 0; file < s.size(); file++){
DataFile data;
cout << "Rodando codigo: prepareData()" << endl;
data.prepareData(s[file]);
cout << data.getNoHit() << endl;
cout << "testando os resultados" << endl;
data.prepareResults(s[file]);
// exit(0);
Tracking teste;
cout << "Rodando codigo: makeTracking()" << endl;
teste.makeTracking(data);
vector<TrackS> tracks = teste.getTracks();
cout << "Rodando codigo: compareTracks(tracks)" << endl;
data.compareGoodNewVersion(tracks);
// data.compareGood(tracks);
ofstream trackFile("tracks.txt");
for(int i = 0; i < tracks.size(); i++){
vector<PrPixelHit> hits = tracks[i].getHits();
trackFile << "(";
for(int j = 0; j < hits.size(); j++){
trackFile << hits[j].id() << ", ";
}
trackFile << ")" << endl;
}
}
//close the log file
log.close();
return 0;
}