// CPP includes #include #include #include #include #include #include #include #include #include // C includes #include #include #include #include // ROOT includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "TObjString.h" #include "TRandom3.h" #include "TObjArray.h" #include "TFrame.h" using namespace std; #ifdef __MAKECINT__ #pragma link C++ class vector+; #endif void run(){ TFile *f = TFile::Open("Results.root","READ"); f->ls(); TTree *t= (TTree*)f->Get("tvec"); vector > history_ps_x_all_part; vector > history_ps_y_all_part; vector *x = 0; vector *y = 0; TBranch *bx = 0; TBranch *by = 0; t->SetBranchAddress("x",&x,&bx); t->SetBranchAddress("y",&y,&by); for (Int_t i = 0; i < 1; i++) { Long64_t tentry = t->LoadTree(i); bx->GetEntry(tentry); history_ps_x_all_part.push_back(*x); by->GetEntry(tentry); history_ps_y_all_part.push_back(*y); } for (Int_t i = 0; i < 1; i++) { for (UInt_t j = 0; j ResetBranchAddresses(); } void run2(){ TFile *f = TFile::Open("Results.root","READ"); f->ls(); TTree *t= (TTree*)f->Get("tvec"); // Prepare matrixes to store the data read from the file containing the rsults. // The first matrix will contains, as first entry, all the x_positions of first particle followed, // as second entry, all the x_positions of the second particle followed and so on; // The second matrix will contains, as first entry,all the y_positions of first particle followed, // as second entry, all the y_positions of the second particle followed and so on; // The same for all othe matrixes down here. /*vector > history_ps_x_all_part; vector pos_x; vector *x; double sigma_x=2e-3; double distance = 0.05; int nEntries=t->GetEntries(); cout << t->GetEntries() << endl; for(int i=0;i<1;i++){ // Long64_t tentry = t->LoadTree(i); // TBranch *bvpx = 0; t->SetBranchAddress("x",&x); //bvpx->GetEntry(tentry); //t->GetEntry(i); cout << x->size()<size(); ++j) { cout <at(j)<at(j)); } history_ps_x_all_part.push_back(pos_x); t->ResetBranchAddresses(); } */ vector > history_ps_x_all_part; vector > history_ps_y_all_part; vector *x = 0; vector *y = 0; TBranch *bx = 0; TBranch *by = 0; t->SetBranchAddress("x",&x,&bx); t->SetBranchAddress("y",&y,&by); for (Int_t i = 0; i < 2; i++) { Long64_t tentry = t->LoadTree(i); bx->GetEntry(tentry); history_ps_x_all_part.push_back(*x); //by->GetEntry(tentry); } for (Int_t i = 0; i < 2; i++) { // for (UInt_t j = 0; j ResetBranchAddresses(); }