Skip to content

Commit

Permalink
New geometry2 (#133)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mnieslony authored and brichards64 committed Aug 12, 2019
1 parent 7e637b9 commit e9db587
Show file tree
Hide file tree
Showing 11 changed files with 621 additions and 745 deletions.
251 changes: 142 additions & 109 deletions UserTools/EventDisplay/EventDisplay.cpp

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions UserTools/EventDisplay/EventDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class EventDisplay: public Tool {
TBox *box_mrd_top = nullptr;
double tank_height;
double tank_radius;
static const int max_num_lappds = 200; //one is allowed to dream, right?
int max_num_lappds = 200; //one is allowed to dream, right?
double detector_version;
std::string detector_config;
bool draw_ring_temp;
Expand All @@ -116,8 +116,8 @@ class EventDisplay: public Tool {
int n_mrd_pmts;
int n_veto_pmts;
int n_lappds;
std::vector<int> active_lappds;
int act_lappds[max_num_lappds]={0};
std::map<int,int> active_lappds_user; // WCSim LAPPD IDs read from config file
std::map<int,int> active_lappds; // converted to detectorkey
double max_y;
double min_y;

Expand All @@ -143,18 +143,18 @@ class EventDisplay: public Tool {
double tank_center_y;
double tank_center_z;

std::map<unsigned long,int> detectorkey_to_lappdid;
std::map<int,unsigned long> lappdid_to_detectorkey;
std::map<unsigned long,int> channelkey_to_pmtid;
std::map<int,unsigned long> pmt_tubeid_to_channelkey;
std::map<unsigned long,int> channelkey_to_mrdpmtid;
std::map<unsigned long,int> channelkey_to_faccpmtid;
static const unsigned long n_channels_per_lappd = 60;

double charge[200];
double time[200];
double charge_lappd[max_num_lappds];
std::vector<std::vector<Position>> hits_LAPPDs;
std::vector<std::vector<double>> time_lappd;
std::map<unsigned long,double> charge;
std::map<unsigned long,double> time;
std::map<unsigned long,double> charge_lappd;
std::map<unsigned long,std::vector<Position>> hits_LAPPDs;
std::map<unsigned long,std::vector<double>> time_lappd;
std::vector<double> mrddigittimesthisevent;
std::vector<int> mrddigitpmtsthisevent;
std::vector<double> mrddigitchargesthisevent;
Expand Down Expand Up @@ -200,11 +200,14 @@ class EventDisplay: public Tool {
int current_n_polylines = 0;

//histograms
std::vector<unsigned long> lappd_detkeys;
std::vector<unsigned long> pmt_detkeys;
std::vector<unsigned long> hitpmt_detkeys;
TH1F *time_PMTs = nullptr;
TH1F *time_LAPPDs[max_num_lappds];
std::map<int,TH1F*> time_LAPPDs; //the keys for the LAPPD histogram maps are the indices of the lappd_detkeys vector
TH1F *charge_PMTs = nullptr;
TH2F *charge_time_PMTs = nullptr;
TH1F *charge_LAPPDs[max_num_lappds];
std::map<int,TH1F*> charge_LAPPDs;

//legends
TLegend *leg_charge = nullptr;
Expand Down
Binary file removed UserTools/TankCalibrationDiffuser/.DS_Store
Binary file not shown.
32 changes: 23 additions & 9 deletions UserTools/TankCalibrationDiffuser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,30 @@ The TankCalibrationDiffuser tool needs access to the hit information within ANNI
The following variables can be configured for the TankCalibrationDiffuser tool:

```
OutputFile /ANNIECode/ToolAnalysis/histogrammed_pmt_charge.root #Output root file for the current calibration run
StabilityFile /ANNIECode/ToolAnalysis/stability_pmtcharge.root #Output root file that displays the stability over multiple runs
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)
DiffuserX 0. #x-position of the diffuser ball
DiffuserY 0. #y-position of the diffuser ball
DiffuserZ 0. #z-position of the diffuser ball
ToleranceCharge 0.5 #tolerance of fit single p.e. value for being classified as a bad PMT
ToleranceTime 0.5 #tolerance of mean time value [ns] for being classified as a bad PMT
TApplication 0 #0/1, depending on whether plots should be shown interactively or not
# TankCalibrationDiffuser Config File
OutputFile SimulationCalibrationTest #Output root prefix name for the current run
DiffuserX 0. #x-position of the diffuser ball
DiffuserY 0. #y-position of the diffuser ball
DiffuserZ 0. #z-position of the diffuser ball
ToleranceCharge 0.5 #tolerance of fit single p.e. value for being classified as a bad PMT
ToleranceTime 0.5 #tolerance of mean time value [ns] for being classified as a bad PMT
FitMethod Gaus2Exp #fit function for charge, options: Gaus2Exp (2 times gaus + exp), Gaus2 (2 times gaus), Gaus (single gaus)
TApplication 0 #0/1, depending on whether plots should be shown interactively or not
verbose 1 #verbosity of the application
```

## OutputFiles

The tool produces two output files:
* 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
* 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)
* PMT Detkey
* Fitted charge - mean
* Fitted charge - sigma
* Fitted time - mean
* Fitted time - sigma
* Time deviation (observed / expected hit time)
* The last line of the .txt-file contains the average fit information averaged over all PMTs (assigned to detectorkey 10000)
Loading

0 comments on commit e9db587

Please sign in to comment.