FairRoot/PandaRoot
Functions | Variables
hit_analys.C File Reference

Go to the source code of this file.

Functions

gROOT LoadMacro ("$VMCWORKDIR/gconfig/basiclibs.C")
 
 rootlogon ()
 
 basiclibs ()
 
t SetBranchAddress ("EmcHit",&hit_array)
 
 for (Int_t j=0;j< t->GetEntriesFast();j++)
 
h1 Draw ()
 
c1 Update ()
 

Variables

TFile * f = new TFile("hit_emc.root")
 
TTree * t =(TTree *) f->Get("pndsim")
 
TClonesArray * hit_array =new TClonesArray("PndEmcHit")
 
double hit_theta
 
double point_theta
 
TH1F * h1 = new TH1F("h1","Theta",100,-0.1,0.1)
 
TCanvas * c1 = new TCanvas("c1", "", 100, 100, 800, 800)
 

Function Documentation

basiclibs ( )
h1 Draw ( )

Definition at line 64 of file NHitsPerEvent.C.

64  {
65 
66  std::cout << "mvdHitArray: " << mvdHitArray->GetEntries() << " projectedHitArray " << mvdProjectedArray->GetEntries() << std::endl;
67 
68 // gHitPoints->Clear();
71  //if (gHitPoints->GetN() != x.size()) gHitPoints->Expand(x.size());
72 
73  std::cout << "NHits: " << gHitPoints->GetN() << std::endl;
74  gHitPoints->Draw("apl");
75  gProjections->Draw("pl");
76 }
void ExtractData(TClonesArray *array, TGraph *g)
Definition: NHitsPerEvent.C:78
TGraph * gHitPoints
Definition: NHitsPerEvent.C:15
TClonesArray * mvdHitArray
Definition: NHitsPerEvent.C:12
TClonesArray * mvdProjectedArray
Definition: NHitsPerEvent.C:13
TGraph * gProjections
Definition: NHitsPerEvent.C:16
for ( Int_t  j = 0; j< t->GetEntriesFast(); j++)

Definition at line 20 of file hit_analys.C.

References PndEmcHit::GetPointList(), hit(), and i.

21  {
22  t->GetEntry(j);
23  for (Int_t i=0; i<hit_array->GetEntriesFast(); i++)
24  {
26  TVector3 hit_pos(hit->GetX(),hit->GetY(),hit->GetZ());
27  hit_theta=hit_pos.Theta();
28 
29  std::vector<PndEmcPoint*> pointList=hit->GetPointList();
30  if (pointList.size()!=0)
31  {
32  TVector3 point_pos(pointList[0]->GetX(),pointList[0]->GetY(),pointList[0]->GetZ());
33  point_theta=point_pos.Theta();
34  h1->Fill(hit_theta-point_theta);
35  }
36  }
37  }
Int_t i
Definition: run_full.C:25
double point_theta
Definition: hit_analys.C:16
TH1F * h1
Definition: hit_analys.C:18
TClonesArray * hit_array
Definition: hit_analys.C:12
std::vector< PndEmcPoint * > & GetPointList()
Definition: PndEmcHit.h:68
TTree * t
Definition: hit_analys.C:10
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:26
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
double hit_theta
Definition: hit_analys.C:16
gROOT LoadMacro ( "$VMCWORKDIR/gconfig/basiclibs.C )
rootlogon ( )

Definition at line 1 of file outdated/mpiTools/macros/emc/rootlogon.C.

2 {
3  gSystem->AddIncludePath("-I$VMCWORKDIR/emc");
4  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcDigi");
5  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcMC");
6  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcTools");
7  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcReco");
8  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcData");
9  gSystem->AddIncludePath("-I$VMCWORKDIR/pnddata");
10  gSystem->AddIncludePath("-I$VMCWORKDIR/base");
11  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
12  basiclibs();
13 
14  gSystem->Load("libDpmEvtGen.so");
15  gSystem->Load("libGeoBase");
16  gSystem->Load("libParBase");
17  gSystem->Load("libBase");
18  gSystem->Load("libTrkBase");
19  gSystem->Load("libPndData");
20  gSystem->Load("libField");
21  gSystem->Load("libPassive");
22  gSystem->Load("libGen");
23  gSystem->Load("libPGen");
24  gSystem->Load("libEmc");
25 
26  delete gRandom;
27  gRandom=new TRandom3(0);
28 }
basiclibs()
t SetBranchAddress ( "EmcHit"  ,
hit_array 
)
c1 Update ( )

Variable Documentation

TCanvas* c1 = new TCanvas("c1", "", 100, 100, 800, 800)

Definition at line 39 of file hit_analys.C.

TFile* f = new TFile("hit_emc.root")

Definition at line 9 of file hit_analys.C.

TH1F* h1 = new TH1F("h1","Theta",100,-0.1,0.1)

Definition at line 18 of file hit_analys.C.

TClonesArray* hit_array =new TClonesArray("PndEmcHit")

Definition at line 12 of file hit_analys.C.

double hit_theta

Definition at line 16 of file hit_analys.C.

double point_theta

Definition at line 16 of file hit_analys.C.

TTree* t =(TTree *) f->Get("pndsim")

Definition at line 10 of file hit_analys.C.