FairRoot/PandaRoot
Functions | Variables
anaLmdSim.C File Reference
#include "TCanvas.h"

Go to the source code of this file.

Functions

gROOT LoadMacro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
 rootlogon ()
 
gSystem Load ("libLmd")
 
timer Start ()
 
tree SetBranchAddress ("LMDPoint",&point)
 
h1 SetFillColor (kBlue)
 
h2 SetTitle ("the MC point; #X cm;#Y cm;# Z cm")
 
h2 SetFillColor (kRed)
 
h3 SetTitle ("the EnergyLoss: #X keV;")
 
 for (int i=0;i< nEvents &&i< tree->GetEntriesFast();i++)
 
h1 DrawCopy ()
 

Variables

TStopwatch timer
 
Int_t nEvents = 1e5
 
TFile * MCPoint = new TFile("/private/huagen/simdata/Lmd_DPM_elastic_6.2_1.9mrad_5M_1.root","READ")
 
TTree * tree = (TTree*)MCPoint->Get("pndsim")
 
TClonesArray * point = new TClonesArray("PndSdsMCPoint")
 
TH2F * h1 = new TH2F("c1","Point on X versus Y",100, -10, 10, 100, -10, 10)
 
TH3F * h2 = new TH3F("c2","Point on X,Y and Z", 100, -10, 10, 100, -10, 10, 100, 1070,1150)
 
TH1F * h3 = new TH1F("c3","Energy Loss", 1000, 0, 1000)
 
double X =0
 
double Y =0
 
double Z =0
 
double eloss
 
TCanvas * c = new TCanvas("c2")
 

Function Documentation

h1 DrawCopy ( )
for ( )

Definition at line 36 of file anaLmdSim.C.

References PndSdsMCPoint::GetPosition(), PndSdsMCPoint::GetPositionOut(), i, Y, and Z.

36  {
37  tree->GetEntry(i);
38  for(int j=0;j<point->GetEntriesFast();j++){
39  PndSdsMCPoint* MyPoint = (PndSdsMCPoint*)point->At(j);
40  X = (MyPoint->GetPosition().X()+MyPoint->GetPositionOut().X())/2.;
41  Y = (MyPoint->GetPosition().Y()+MyPoint->GetPositionOut().Y())/2;
42  Z = (MyPoint->GetPosition().Z()+MyPoint->GetPositionOut().Z())/2;
43  eloss = MyPoint->GetEnergyLoss()*1000000;
44  // cout<<"the eloss is:"<<eloss<<endl;
45  h1->Fill(X,Y);
46  h1->SetFillColor(kBlue);
47  h2->Fill(X,Y,Z);
48  h2->SetFillColor(kRed);
49  h3->Fill(eloss);
50  }
51  }
Int_t i
Definition: run_full.C:25
TTree * tree
Definition: plot_dirc.C:12
double eloss
Definition: anaLmdSim.C:34
TVector3 GetPositionOut() const
Definition: PndSdsMCPoint.h:91
double Y
Definition: anaLmdDigi.C:68
TH1F * h3
TVector3 GetPosition() const
Definition: PndSdsMCPoint.h:90
double X
Definition: anaLmdDigi.C:68
double Z
Definition: anaLmdDigi.C:68
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
gSystem Load ( "libLmd"  )
gROOT LoadMacro ( "$VMCWORKDIR/gconfig/rootlogon.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()
tree SetBranchAddress ( "LMDPoint"  ,
point 
)
h1 SetFillColor ( kBlue  )
h2 SetFillColor ( kRed  )
h2 SetTitle ( "the MC point; #X cm;#Y cm;# Z cm )
h3 SetTitle ( "the EnergyLoss: #X keV;"  )
timer Start ( )

Variable Documentation

c = new TCanvas("c2")

Definition at line 52 of file anaLmdSim.C.

double eloss
TH2F* h1 = new TH2F("c1","Point on X versus Y",100, -10, 10, 100, -10, 10)

Definition at line 24 of file anaLmdSim.C.

TH3F* h2 = new TH3F("c2","Point on X,Y and Z", 100, -10, 10, 100, -10, 10, 100, 1070,1150)

Definition at line 26 of file anaLmdSim.C.

TH1F* h3 = new TH1F("c3","Energy Loss", 1000, 0, 1000)

Definition at line 29 of file anaLmdSim.C.

TFile* MCPoint = new TFile("/private/huagen/simdata/Lmd_DPM_elastic_6.2_1.9mrad_5M_1.root","READ")

Definition at line 18 of file anaLmdSim.C.

Int_t nEvents = 1e5

Definition at line 16 of file anaLmdSim.C.

TClonesArray* point = new TClonesArray("PndSdsMCPoint")

Definition at line 21 of file anaLmdSim.C.

TStopwatch timer

Definition at line 13 of file anaLmdSim.C.

TTree* tree = (TTree*)MCPoint->Get("pndsim")

Definition at line 19 of file anaLmdSim.C.

double X =0

Definition at line 33 of file anaLmdSim.C.

double Y =0

Definition at line 33 of file anaLmdSim.C.

double Z =0

Definition at line 33 of file anaLmdSim.C.