A FLUKA simulation that records the energy deposited in a single layer of polysterene from an ion beam. HTCondor submission scripts are included.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
6.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. //////////////////////////////////////////////////////////
  2. // This class has been automatically generated on
  3. // Fri Mar 8 13:05:30 2019 by ROOT version 6.12/06
  4. // from TTree EVENTDAT/FLUKA Course Exercise DATE: 3/ 4/19, TIME: 11:54:46
  5. // found on file: jobs/runjob1001_eventdata.root
  6. //////////////////////////////////////////////////////////
  7. #ifndef eventdatroot_h
  8. #define eventdatroot_h
  9. #include <TROOT.h>
  10. #include <TChain.h>
  11. #include <TFile.h>
  12. #include <TH1.h>
  13. // Header file for the classes stored in the TTree if any.
  14. class eventdatroot {
  15. public :
  16. TTree *fChain; //!pointer to the analyzed TTree or TChain
  17. Int_t fCurrent; //!current Tree number in a TChain
  18. // Fixed size dimensions of array or collections stored in the TTree if any.
  19. // Declaration of leaf types
  20. Float_t DATA_ALL_PART[6];
  21. Float_t DATA_BEAMPART[6];
  22. Float_t DATA_ENERGY[6];
  23. Float_t DATA_id211[6];
  24. Int_t SEEDS[4];
  25. Float_t ENDIST[12];
  26. // List of branches
  27. TBranch *b_DATA; //!
  28. TBranch *b_seed; //!
  29. TBranch *b_endist; //!
  30. TH1F * h_endist_0;
  31. TH1F * h_endist_1;
  32. TH1F * h_endist_2;
  33. TH1F * h_endist_3;
  34. TH1F * h_endist_4;
  35. TH1F * h_endist_5;
  36. TH1F * h_endist_6;
  37. TH1F * h_endist_7;
  38. TH1F * h_endist_8;
  39. TH1F * h_endist_9;
  40. TH1F * h_endist_10;
  41. TH1F * h_endist_11;
  42. TH1F * h_ratio_e;
  43. TH1F * h_ratio_p;
  44. TH1F * h_sum_ep;
  45. TH1F * h_let_ep;
  46. TH1F * h_let_e;
  47. TH1F * h_let_p;
  48. TH1F * h_spratio;
  49. eventdatroot(TTree *tree=0);
  50. virtual ~eventdatroot();
  51. virtual Int_t Cut(Long64_t entry);
  52. virtual Int_t GetEntry(Long64_t entry);
  53. virtual Long64_t LoadTree(Long64_t entry);
  54. virtual void Init(TTree *tree);
  55. virtual void Loop(Float_t scale);
  56. virtual Bool_t Notify();
  57. virtual void Show(Long64_t entry = -1);
  58. virtual Int_t Closefile(TFile * file);
  59. };
  60. #endif
  61. #ifdef eventdatroot_cxx
  62. eventdatroot::eventdatroot(TTree *tree) : fChain(0)
  63. {
  64. // if parameter tree is not specified (or zero), connect the file
  65. // used to generate this class and read the Tree.
  66. // if (tree == 0) {
  67. // TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("jobs/runjob1001_eventdata.root");
  68. // if (!f || !f->IsOpen()) {
  69. // f = new TFile("jobs/runjob1001_eventdata.root");
  70. // }
  71. // f->GetObject("EVENTDAT",tree);
  72. // }
  73. // Init(tree);
  74. }
  75. eventdatroot::~eventdatroot()
  76. {
  77. if (!fChain) return;
  78. delete fChain->GetCurrentFile();
  79. }
  80. Int_t eventdatroot::GetEntry(Long64_t entry)
  81. {
  82. // Read contents of entry.
  83. if (!fChain) return 0;
  84. return fChain->GetEntry(entry);
  85. }
  86. Long64_t eventdatroot::LoadTree(Long64_t entry)
  87. {
  88. // Set the environment to read one entry
  89. if (!fChain) return -5;
  90. Long64_t centry = fChain->LoadTree(entry);
  91. if (centry < 0) return centry;
  92. if (fChain->GetTreeNumber() != fCurrent) {
  93. fCurrent = fChain->GetTreeNumber();
  94. Notify();
  95. }
  96. return centry;
  97. }
  98. void eventdatroot::Init(TTree *tree)
  99. {
  100. // The Init() function is called when the selector needs to initialize
  101. // a new tree or chain. Typically here the branch addresses and branch
  102. // pointers of the tree will be set.
  103. // It is normally not necessary to make changes to the generated
  104. // code, but the routine can be extended by the user if needed.
  105. // Init() will be called many times when running on PROOF
  106. // (once per file to be processed).
  107. // Set branch addresses and branch pointers
  108. if (!tree) return;
  109. fChain = tree;
  110. fCurrent = -1;
  111. fChain->SetMakeClass(1);
  112. fChain->SetBranchAddress("DATA", DATA_ALL_PART, &b_DATA);
  113. fChain->SetBranchAddress("SEEDS", SEEDS, &b_seed);
  114. fChain->SetBranchAddress("ENDIST", ENDIST, &b_endist);
  115. h_endist_0 = new TH1F("h_endist_0","edep by ionisation",400,0.0,0.1);
  116. h_endist_1 = new TH1F("h_endist_1","edep by pi0, e-, e+ and #gamma",400,0.0,0.06);
  117. h_endist_2 = new TH1F("h_endist_2","edep by nuclear recoils and heavy fragments",400,0.0,0.002);
  118. h_endist_3 = new TH1F("h_endist_3","edep by part. #lt threshold",200,0.0,0.002);
  119. h_endist_4 = new TH1F("h_endist_4","E leaving the system",200,0.0,1.1);
  120. h_endist_5 = new TH1F("h_endist_5","E carried by discarded particles",200,0.0,0.2);
  121. h_endist_6 = new TH1F("h_endist_6","resid, excit. E after evap.",200,0.0,0.2);
  122. h_endist_7 = new TH1F("h_endist_7","edep by low-energy neutrons",200,0.0,0.2);
  123. h_endist_8 = new TH1F("h_endist_8","E of part. #gt time limit",200,0.0,0.2);
  124. h_endist_9 = new TH1F("h_endist_9","E lost in endothermic nuclear reactions",200,0.0,0.2);
  125. h_endist_10 = new TH1F("h_endist_10","E lost in endothermic low-E n-reactions",200,0.0,0.2);
  126. h_endist_11 = new TH1F("h_endist_11","missing E",400,0.0,0.01);
  127. h_ratio_e = new TH1F("h_ratio_e","fraction of edep by pi0, e-, e+ and #gamma ",400,0.0,1.0);
  128. h_ratio_p = new TH1F("h_ratio_p","fraction of edep by ionisation",400,0.0,1.0);
  129. h_sum_ep = new TH1F("h_sum_ep","sum of edep by ion, pi0, e-, e+ and #gamma,",400,0.0,0.4);
  130. h_let_ep = new TH1F("h_let_ep","LET/Z^{2} (GeV/cm) by ion, pi0, e-, e+ and #gamma,",200,0.0,0.2);
  131. h_let_e = new TH1F("h_let_e","LET/Z^{2} (GeV/cm) by pi0, e-, e+ and #gamma,",200,0.0,0.1);
  132. h_let_p = new TH1F("h_let_p","LET/Z^{2} (GeV/cm) by ion",200,0.0,0.1);
  133. h_spratio = new TH1F("h_spratio","total LET/SP (MeV/cm/#rho)/SP(MeVcm2/g)",200,0.5,3.0);
  134. Notify();
  135. }
  136. Bool_t eventdatroot::Notify()
  137. {
  138. // The Notify() function is called when a new file is opened. This
  139. // can be either for a new TTree in a TChain or when when a new TTree
  140. // is started when using PROOF. It is normally not necessary to make changes
  141. // to the generated code, but the routine can be extended by the
  142. // user if needed. The return value is currently not used.
  143. return kTRUE;
  144. }
  145. void eventdatroot::Show(Long64_t entry)
  146. {
  147. // Print contents of entry.
  148. // If entry is not specified, print current entry
  149. if (!fChain) return;
  150. fChain->Show(entry);
  151. }
  152. Int_t eventdatroot::Cut(Long64_t entry)
  153. {
  154. // This function may be called from Loop.
  155. // returns 1 if entry is accepted.
  156. // returns -1 otherwise.
  157. return 1;
  158. }
  159. Int_t eventdatroot::Closefile(TFile * file)
  160. {
  161. file->cd();
  162. file->Write();
  163. file->Close();
  164. return 1;
  165. }
  166. #endif // #ifdef eventdatroot_cxx