Skip to content

Commit e9db587

Browse files
mnieslonybrichards64
authored andcommitted
New geometry2 (#133)
* fix channelkey bug for EventDisplay & TankCalibrationDiffuser tools, additional time plots for TankCalibrationDiffuser tool * Delete .DS_Store * Update README.md Extend the description in the TankCalibrationDiffuser README file
1 parent 7e637b9 commit e9db587

11 files changed

+621
-745
lines changed

UserTools/EventDisplay/EventDisplay.cpp

+142-109
Large diffs are not rendered by default.

UserTools/EventDisplay/EventDisplay.h

+14-11
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class EventDisplay: public Tool {
104104
TBox *box_mrd_top = nullptr;
105105
double tank_height;
106106
double tank_radius;
107-
static const int max_num_lappds = 200; //one is allowed to dream, right?
107+
int max_num_lappds = 200; //one is allowed to dream, right?
108108
double detector_version;
109109
std::string detector_config;
110110
bool draw_ring_temp;
@@ -116,8 +116,8 @@ class EventDisplay: public Tool {
116116
int n_mrd_pmts;
117117
int n_veto_pmts;
118118
int n_lappds;
119-
std::vector<int> active_lappds;
120-
int act_lappds[max_num_lappds]={0};
119+
std::map<int,int> active_lappds_user; // WCSim LAPPD IDs read from config file
120+
std::map<int,int> active_lappds; // converted to detectorkey
121121
double max_y;
122122
double min_y;
123123

@@ -143,18 +143,18 @@ class EventDisplay: public Tool {
143143
double tank_center_y;
144144
double tank_center_z;
145145

146-
std::map<unsigned long,int> detectorkey_to_lappdid;
146+
std::map<int,unsigned long> lappdid_to_detectorkey;
147147
std::map<unsigned long,int> channelkey_to_pmtid;
148148
std::map<int,unsigned long> pmt_tubeid_to_channelkey;
149149
std::map<unsigned long,int> channelkey_to_mrdpmtid;
150150
std::map<unsigned long,int> channelkey_to_faccpmtid;
151151
static const unsigned long n_channels_per_lappd = 60;
152152

153-
double charge[200];
154-
double time[200];
155-
double charge_lappd[max_num_lappds];
156-
std::vector<std::vector<Position>> hits_LAPPDs;
157-
std::vector<std::vector<double>> time_lappd;
153+
std::map<unsigned long,double> charge;
154+
std::map<unsigned long,double> time;
155+
std::map<unsigned long,double> charge_lappd;
156+
std::map<unsigned long,std::vector<Position>> hits_LAPPDs;
157+
std::map<unsigned long,std::vector<double>> time_lappd;
158158
std::vector<double> mrddigittimesthisevent;
159159
std::vector<int> mrddigitpmtsthisevent;
160160
std::vector<double> mrddigitchargesthisevent;
@@ -200,11 +200,14 @@ class EventDisplay: public Tool {
200200
int current_n_polylines = 0;
201201

202202
//histograms
203+
std::vector<unsigned long> lappd_detkeys;
204+
std::vector<unsigned long> pmt_detkeys;
205+
std::vector<unsigned long> hitpmt_detkeys;
203206
TH1F *time_PMTs = nullptr;
204-
TH1F *time_LAPPDs[max_num_lappds];
207+
std::map<int,TH1F*> time_LAPPDs; //the keys for the LAPPD histogram maps are the indices of the lappd_detkeys vector
205208
TH1F *charge_PMTs = nullptr;
206209
TH2F *charge_time_PMTs = nullptr;
207-
TH1F *charge_LAPPDs[max_num_lappds];
210+
std::map<int,TH1F*> charge_LAPPDs;
208211

209212
//legends
210213
TLegend *leg_charge = nullptr;
-6 KB
Binary file not shown.

UserTools/TankCalibrationDiffuser/README.md

+23-9
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,30 @@ The TankCalibrationDiffuser tool needs access to the hit information within ANNI
1414
The following variables can be configured for the TankCalibrationDiffuser tool:
1515

1616
```
17-
OutputFile /ANNIECode/ToolAnalysis/histogrammed_pmt_charge.root #Output root file for the current calibration run
18-
StabilityFile /ANNIECode/ToolAnalysis/stability_pmtcharge.root #Output root file that displays the stability over multiple runs
19-
GeometryFile configfiles/TankCalibrationDiffuser/geofile_128PMTs.txt #Geometry file specifying the different radii of the PMTs (taken from file geofile.txt in WCSim installation directory for the respective installation)
20-
DiffuserX 0. #x-position of the diffuser ball
21-
DiffuserY 0. #y-position of the diffuser ball
22-
DiffuserZ 0. #z-position of the diffuser ball
23-
ToleranceCharge 0.5 #tolerance of fit single p.e. value for being classified as a bad PMT
24-
ToleranceTime 0.5 #tolerance of mean time value [ns] for being classified as a bad PMT
25-
TApplication 0 #0/1, depending on whether plots should be shown interactively or not
17+
# TankCalibrationDiffuser Config File
18+
19+
OutputFile SimulationCalibrationTest #Output root prefix name for the current run
20+
DiffuserX 0. #x-position of the diffuser ball
21+
DiffuserY 0. #y-position of the diffuser ball
22+
DiffuserZ 0. #z-position of the diffuser ball
23+
ToleranceCharge 0.5 #tolerance of fit single p.e. value for being classified as a bad PMT
24+
ToleranceTime 0.5 #tolerance of mean time value [ns] for being classified as a bad PMT
25+
FitMethod Gaus2Exp #fit function for charge, options: Gaus2Exp (2 times gaus + exp), Gaus2 (2 times gaus), Gaus (single gaus)
26+
TApplication 0 #0/1, depending on whether plots should be shown interactively or not
2627
2728
verbose 1 #verbosity of the application
2829
2930
```
31+
32+
## OutputFiles
33+
34+
The tool produces two output files:
35+
* a root file `<OutputFile>_PMTStability_Run<RunNumber>.root` which contains the charge & time histograms for all the PMTs and overview plots of the fitted charge and time distributions
36+
* a txt file `<OutputFile>_Run<RunNumber>_pmts_laser_calibration.txt`, which contains a PMT-by-PMT summary of the calibration run information. The columns are (from left to right)
37+
* PMT Detkey
38+
* Fitted charge - mean
39+
* Fitted charge - sigma
40+
* Fitted time - mean
41+
* Fitted time - sigma
42+
* Time deviation (observed / expected hit time)
43+
* The last line of the .txt-file contains the average fit information averaged over all PMTs (assigned to detectorkey 10000)

0 commit comments

Comments
 (0)