FairRoot/PandaRoot
anamaterial.C
Go to the documentation of this file.
1 // root macro to analyze the material budget in the MVD
2 {
3  int nEvents = 1000;
4  bool verbose = false;
5  // ----- Load libraries ------------------------------------------------
6  gROOT->ProcessLine(".x ../Libs.C");
7  // ----- Timer --------------------------------------------------------
8  TStopwatch timer;
9  timer.Start();
10  // ------------------------------------------------------------------------
11 
12  PndFileNameCreator namecreator("/home/ralfk/MVD/mvdmacros/data/mvdevalg4.root");
13  std::string inFile = namecreator.GetSimFileName(false);
14 
15  TFile* f = new TFile(inFile.c_str()); // the sim file you want to analyse
16  TTree *t=(TTree *) f->Get("pndsim") ;
17 
18 // TClonesArray* point_array=new TClonesArray("PndSdsMCPoint");
19 // t->SetBranchAddress("MVDPoint",&mc_array);//Branch names
20 
21  TClonesArray* mc_array=new TClonesArray("PndMCTrack");
22  t->SetBranchAddress("MCTrack",&mc_array);//Branch names
23 
24  TGeoManager *geoMan = (TGeoManager*) gDirectory->Get("FAIRGeom");
25 
26 
27  for(Int_t event=0;event<nEvents && event<mc_array.GetEntriesFast();event++)
28  {
29 
30 
31 
32  }
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43  // ----- Finish -------------------------------------------------------
44  timer.Stop();
45  Double_t rtime = timer.RealTime();
46  Double_t ctime = timer.CpuTime();
47  cout << endl << endl;
48  cout << "Macro finished succesfully." << endl;
49  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
50  cout << endl;
51  // ------------------------------------------------------------------------
52 }
#define verbose
TGeoManager * geoMan
TClonesArray * mc_array
Definition: anaLmdCluster.C:25
std::string GetSimFileName(std::string addon="", bool cut=false)
TString inFile
Definition: hit_dirc.C:8
A simple class which adds the corresponding file extensions to a given base class.
Double_t
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
TFile * f
Definition: bump_analys.C:12
PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
Double_t ctime
Definition: hit_dirc.C:114
TTree * t
Definition: bump_analys.C:13
Double_t rtime
Definition: hit_dirc.C:113