41 cout <<
" lmd radiation dose studies based on energy deposit in sensors " << endl;
42 TCanvas* canvas =
new TCanvas(
"canvas",
"canvas", 600, 600);
47 tMC.Add(
"./Lumi_MC_0.root");
50 TClonesArray* true_tracks =
new TClonesArray(
"PndMCTrack");
51 tMC.SetBranchAddress(
"MCTrack", &true_tracks);
53 TClonesArray* true_points =
new TClonesArray(
"PndSdsMCPoint");
54 tMC.SetBranchAddress(
"LMDPoint", &true_points);
60 TH1F* hist_eloss_total =
new TH1F(
"hist_eloss_total",
"energy deposit in 50#mum x 2cm x2cm sensors", 200, 0, 60);
61 TH1F* hist_eloss =
new TH1F(
"hist_eloss",
"energy deposit scaled to 1#mum", 200, 0, 1200);
62 hist_eloss_total->SetXTitle(
"E_{dep} [keV]");
63 hist_eloss->SetXTitle(
"E_{dep} [eV]");
65 TH2* plane3_hits =
new TH2F(
"plane3_hits",
"hits on plane 3", 200, -10, 10, 200, -10, 10);
66 plane3_hits->SetXTitle(
"X [cm]");
67 plane3_hits->SetYTitle(
"Y [cm]");
68 plane3_hits->SetZTitle(
"# hits");
70 plane3_Edep->SetNameTitle(
"plane3_Edep",
"E dep on plane 3");
71 plane3_Edep->SetZTitle(
"E_{dep} [J]");
73 plane3_rate->SetNameTitle(
"plane3_rate",
"rate on plane 3");
74 plane3_rate->SetZTitle(
"rate [kHz]");
76 plane3_rad->SetNameTitle(
"plane3_rad",
"IEL dose on plane 3");
77 plane3_rad->SetZTitle(
"IEL dose [Gy/a]");
81 int nEvents_counted(0);
84 cout <<
" reading " << nEvents <<
" Events " << endl;
85 for (Int_t j = 0; j <
nEvents ; j++) {
90 int nHits = true_points->GetEntriesFast();
92 for (Int_t iHit = 0; iHit <
nHits; iHit++) {
96 hist_eloss_total->Fill(mcpoint->GetEnergyLoss()*1.e6);
97 hist_eloss->Fill(mcpoint->GetEnergyLoss()*1.e9/50.);
100 int ihalf, iplane, imodule, iside, idie, isensor;
101 lmddim.
Get_sensor_by_id(sensID, ihalf, iplane, imodule, iside, idie, isensor);
107 if (iplane == 3 && iside == 0){
108 plane3_hits->Fill(hit_pos_lmd.X(), hit_pos_lmd.Y());
109 plane3_rate->Fill(hit_pos_lmd.X(), hit_pos_lmd.Y());
110 plane3_Edep->Fill(hit_pos_lmd.X(), hit_pos_lmd.Y(), mcpoint->GetEnergyLoss()*1.e9*1.602e-19);
111 plane3_rad->Fill(hit_pos_lmd.X(), hit_pos_lmd.Y(), mcpoint->GetEnergyLoss()*1.e9*1.602e-19);
134 double sig_total = 124.63e-27;
137 double lumi_ref = 1e32;
139 double rate_total = sig_total * lumi_ref;
140 cout <<
"\n The total rate at 1.5 GeV/c and " << lumi_ref <<
" mean luminosity to normalize to is " << rate_total <<
" Hz" << endl;
142 double tsim = nEvents_counted / rate_total;
143 cout << nEvents_counted <<
" events correspond to a real time of " << tsim <<
" s " << endl;
144 plane3_rate->Scale(1./tsim*1e-3);
146 cout <<
" total rate of " << nhitstotal <<
" hits is " << nhitstotal/tsim*1e-6 <<
"MHz" << endl;
147 plane3_rad->Scale(1./tsim*60.*60.*24.*365.*0.5/(2.33e-3*(2*2*50.e-4)));
149 plane3_Edep->Draw(
"colz");
152 plane3_hits->Draw(
"colz");
153 canvas->Print(
"MC_hit_distr_1_5_plane_3_side_0.pdf");
154 canvas->Print(
"MC_hit_distr_1_5_plane_3_side_0.root");
156 canvas->Print(
"MC_IEL_distrib_1_5.pdf");
157 canvas->Print(
"MC_IEL_distrib_1_5.root");
159 plane3_rate->Draw(
"colz");
160 cout <<
" max rate is " << plane3_rate->GetBinContent(plane3_rate->GetMaximumBin()) <<
" kHz" << endl;
161 canvas->Print(
"MC_hit_rate_1_5_plane_3_side_0.pdf");
162 canvas->Print(
"MC_hit_rate_1_5_plane_3_side_0.root");
164 plane3_rad->Draw(
"colz");
165 cout <<
" max dose is " << plane3_rad->GetBinContent(plane3_rad->GetMaximumBin()) <<
" Gy" << endl;
166 canvas->Print(
"MC_IEL_dose_1_5_plane_3_side_0.pdf");
167 canvas->Print(
"MC_IEL_does_1_5_plane_3_side_0.root");
TH2Poly * Get_histogram_Plane(int iplane, int iside, bool aligned=true, bool lmd_frame=true, bool pixel_subdivision=false)
TVector3 hit_pos(hit->GetX(), hit->GetY(), hit->GetZ())
TVector3 Transform_global_to_lmd_local(const TVector3 &point, bool isvector=false, bool aligned=true)
void DrawProgressBar(int len, double percent)
Int_t GetSensorID() const
void Get_sensor_by_id(const int sensor_id, int &ihalf, int &iplane, int &imodule, int &iside, int &idie, int &isensor)
TVector3 GetPosition() const
static PndLmdDim & Get_instance()