/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/analyse/Iro/read_ntuples.C File Reference

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include "TChain.h"
#include "TProfile.h"
#include "TFile.h"
#include "TTree.h"
#include "TString.h"

Include dependency graph for read_ntuples.C:

Go to the source code of this file.

Functions

void read_ntuples ()


Function Documentation

void read_ntuples (  ) 

Definition at line 12 of file read_ntuples.C.

00012                    {
00013   gStyle->SetOptStat(0);
00014 
00015   TFile *f1=new TFile("DSTPionsAllEM.root","READ");
00016   TTree *t1 = (TTree*)(f1->Get("Pions"));
00017 
00018   int num_entries=t1->GetEntries();
00019   cout << "entries " << num_entries << endl;
00020   double energy; double Nhtot; double Nhtot1; double Nhtot2; double Nhtot3; float ShCont1; double NbHitsRear; double NbHitsBoard; double Zstart;
00021   t1 -> SetBranchAddress("Ebeam",&energy);
00022   t1 -> SetBranchAddress("Nhtot",&Nhtot);
00023   t1 -> SetBranchAddress("Nhtot1",&Nhtot1);
00024   t1 -> SetBranchAddress("Nhtot2",&Nhtot2);
00025   t1 -> SetBranchAddress("Nhtot3",&Nhtot3);
00026   t1 -> SetBranchAddress("ShCont1",&ShCont1);
00027   t1 -> SetBranchAddress("NbHitsRear",&NbHitsRear);
00028   t1 -> SetBranchAddress("NbHitsBoard",&NbHitsBoard);
00029   t1 -> SetBranchAddress("Zstart",&Zstart);
00030 
00031   vector<double> energies;
00032   double energy_step=0;
00033 
00034   for ( int ient = 0; ient < num_entries; ient++ ) {
00035     t1->GetEntry(ient);
00036 
00037     if (energy!=energy_step) energies.push_back(energy);
00038     energy_step=energy;
00039 
00040   }
00041 
00042   int size_energies=energies.size();
00043   cout << "Nb of different energies " << size_energies << endl;
00044 
00045 }


Generated on Mon Jan 7 13:16:58 2013 for MicromegasFramework by  doxygen 1.4.7