Skip to content
Snippets Groups Projects
Commit d9a38be8 authored by Carlos Andres Pinzon Osorio's avatar Carlos Andres Pinzon Osorio
Browse files

Upload New File

parent 52fb05a6
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
Carlos Andres Pinzon Osorio
Maestria en Ingenieria Fisica
UAN
Bogota-Colombia
%% Cell type:markdown id: tags:
# Proyecto ciencia de datos
Conversion de archivo con extension .CSV a .ROOT
%% Cell type:code id: tags:
``` c++
%jsroot on
```
%% Cell type:code id: tags:
``` c++
#include "Riostream.h"
#include "TString.h"
#include "TFile.h"
#include "TTree.h"
#include "TSystem.h"
#include <stdio.h>
#include <stdlib.h>
```
%% Cell type:code id: tags:
``` c++
TString dir = gSystem->UnixPathName(__FILE__);
dir.ReplaceAll("analisiss.C","");
dir.ReplaceAll("/./","/");
```
%% Cell type:code id: tags:
``` c++
TFile *f = new TFile("analisiss.root","RECREATE");
```
%% Cell type:code id: tags:
``` c++
TTree *tree = new TTree("ntuple","data from csv file");
// The file inside has ----> type, Channel, NJets, MET, Mll, LepDeltaPhi, METLLDeltaPhi, SumLepPt, BTags, weight
tree->ReadFile("analisiss.csv", "individuo/C:origen/C:peso/C:tamano/C",';');
f->Write();
```
%% Output
input_line_41:2:9: error: redefinition of 'tree'
TTree *tree = new TTree("ntuple","data from csv file");
^
input_line_32:2:9: note: previous definition is here
TTree *tree = new TTree("Data","data from csv file");
^
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