5    gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
 
    6    gSystem->Load(
"libHypGe");
 
   15         TString Filename = 
"$SIMDATADIR/Neutron/"+Filename_ext;
 
   18         TFile* InputFile = 
new TFile(Filename);
 
   19         TFile* OutputFile = 
new TFile(outfile,
"RECREATE");
 
   22   TTree *
b=(TTree *) InputFile->Get(
"pndsim") ;
 
   23   TClonesArray* 
hit_bar=
new TClonesArray(
"PndHypGePoint");
 
   24   b->SetBranchAddress(
"HypGePoint",&hit_bar);
 
   25   TClonesArray* 
mc_bar=
new TClonesArray(
"PndMCTrack");
 
   26   b->SetBranchAddress(
"MCTrack",&mc_bar);
 
   30         TH1D* hNHits = 
new TH1D(
"hNHits",
"Polar angle of primary neutrons interacting with the crystals",180, 90,180);
 
   31         hNHits->SetXTitle(
"#Theta [#circ]");
 
   32         hNHits->SetYTitle(
"Counts / 0.5 #circ");
 
   34         TH1D* hNHits_p = 
new TH1D(
"hNHits_p",
"Direction of polar momentum of primary neutrons interacting with the crystals",180, 90,180);
 
   35         hNHits_p->SetXTitle(
"#Theta [#circ]");
 
   36         hNHits_p->SetYTitle(
"Counts / 0.5 #circ");
 
   38         TH1D* hNAll = 
new TH1D(
"hNAll",
"All Neutrons",180, 90,180);
 
   39         hNAll->SetXTitle(
"#Theta [#circ]");
 
   40         hNAll->SetYTitle(
"Counts / 0.5 #circ");
 
   42         TH1D* hNMom = 
new TH1D(
"hNMom",
"E_{kin} of neutrons",1000, 0,0.5);
 
   43         hNMom->SetXTitle(
"E_{kin} of neutrons [GeV]");
 
   44         hNMom->SetYTitle(
"Counts / 0.5 MeV");
 
   46         TH1D* hCrystalHit = 
new TH1D(
"hCrystalHit",
"Hits per Crystal",1700,1,1700);
 
   47         hCrystalHit->SetXTitle(
"Crystal number");
 
   48         hCrystalHit->SetYTitle(
"Counts per crystal");
 
   50         TH1D* hNeutronEnergyDeposit = 
new TH1D(
"hNeutronEnergyDeposit",
"Energy deposited by Neutrons per Hit",500,0,0.005);
 
   51         hNeutronEnergyDeposit->SetXTitle(
"Energy [GeV]");
 
   52         hNeutronEnergyDeposit->SetYTitle(
"Counts / 10 keV");
 
   54         Int_t *ActualTrackID ;
 
   55         Int_t 
nEvents = b->GetEntriesFast();
 
   56         cout<< 
"Number of Simulated Events: "<<nEvents<<endl;
 
   66                 if (!((k*100)% nEvents))        
 
   68                         cout << 
"Event number :\t" << k << endl;
 
   75                 for (Int_t 
i=0; 
i<hit_bar->GetEntriesFast(); 
i++)
 
   90                                 cout << 
"Event :\t" << k <<
"\tHit : \t" << 
i << 
"\tDetector :\t" << DetID << 
"\tTrackID :\t"<< TrackID<<
"\tMother :\t"<< mcgam->
GetMotherID()<<endl;
 
   96                                 NHit.SetX(hitgam->
GetX());
 
   97                                 NHit.SetY(hitgam->
GetY());
 
   98                                 NHit.SetZ(hitgam->
GetZ()+55);
 
   99                                 hNHits->Fill(180/
TMath::Pi()*NHit.Theta());                             
 
  103                                 NHit_p.SetX(hitgam->
GetPx());
 
  104                                 NHit_p.SetY(hitgam->
GetPy());
 
  105                                 NHit_p.SetZ(hitgam->
GetPz());
 
  106                                 hNHits_p->Fill(180/
TMath::Pi()*NHit_p.Theta());         
 
  109                                 hNMom->Fill(1./2.* NMom.Mag2()/0.939);                          
 
  120                 cout << 
"mcbar length :\t" <<mc_bar->GetEntriesFast() << endl;
 
  121                 for (Int_t 
m = 0; 
m<mc_bar->GetEntriesFast();
m++)
 
  128                                 cout << 
"event :\t"<<k<<
"\tmcpdg :\t" << mcgam->
GetPdgCode() << 
"\tmcmotherid :\t"<< mcgam->
GetMotherID() <<endl;
 
  130                                 hNAll->Fill(180/
TMath::Pi()*NAllMom.Theta());           
 
  146         hCrystalHit->Write();
 
  147         hNeutronEnergyDeposit->Write();
 
  163         cout << endl << endl;
 
  164         cout << 
"Macro finished succesfully." << endl;
 
  166         cout << 
"Real time " << rtime << 
" s, CPU time " << ctime << 
" s" << endl;
 
  169         cout << 
"Hits\t" << Hits << endl;
 
TVector3 GetMomentum() const 
int AllNeutronAnalysis_job_edit(TString Filename_ext)
Int_t GetMotherID() const 
Int_t GetDetectorID() const 
Double_t GetEnergyLoss() const 
Double_t GetpdgCode() const