Skip to content

Commit

Permalink
clean up fitcentroid code
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesJieranShen committed Dec 9, 2024
1 parent 01fad48 commit 6d26a33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
8 changes: 4 additions & 4 deletions test/full/fitcentroid/cylinder/cylinder.geo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ invisible: 1,

{
name: "GEO",
index: "water",
index: "detector",
valid_begin: [0, 0],
valid_end: [0, 0],
mother: "world",
Expand All @@ -27,10 +27,10 @@ color: [0.4, 0.4, 0.6, 0.1],
// use an inner volume to speed up simulation.
{
name: "GEO",
index: "water_inner",
index: "detector_inner",
valid_begin: [0, 0],
valid_end: [0, 0],
mother: "water",
mother: "detector",
type: "tube",
r_max: 2500.0,
size_z: 2500.0,
Expand All @@ -45,7 +45,7 @@ name: "GEO",
index: "pmts",
valid_begin: [0, 0],
valid_end: [0, 0],
mother: "water",
mother: "detector",
type: "pmtarray",
pmt_model: "r1408",
pmt_detector_type: "idpmt",
Expand Down
26 changes: 0 additions & 26 deletions test/full/fitcentroid/fitcentroid.C
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
// void make_plots(TFile *event_file, TTree *T, TFile *out_file)
// {
// TH1F *hCenterRes = new TH1F("hCenterRes", "20 keVee electrons at the center;Reconstructed X (mm);Events per bin",
// 40, -800, 800); TProfile *hReconVsRadius = new TProfile("hReconVsRadius", "20 keVee electrons (error bars are
// RMS);(Radius/437 mm)**3;Reconstructed X - True X (mm)", 5, 0, 1, "s"); TProfile *hReconVsEnergy = new
// TProfile("hReconVsEnergy", "Electrons at center (error bars are RMS);Kinetic energy (keVee);Reconstructed X (mm)",
// 5, 20, 100,"s");
//
// T->Draw("ev.centroid.pos.fX>>hCenterRes","mc.particle.ke < 0.0205 && mc.particle.pos.fX < 0.05","goff");
// T->Draw("ev.centroid.pos.fX-mc.particle.pos.fX:(mc.particle.pos.Mag()/437)>>hReconVsRadius","mc.particle.ke <
// 0.0205 && mc.particle.pos.fX > 0.05","goff prof");
// T->Draw("ev.centroid.pos.fX:mc.particle.ke*1000>>hReconVsEnergy","mc.particle.ke > 0.0205 && mc.particle.pos.fX <
// 0.05","goff prof");
//
// hCenterRes->Fit("gaus");
// hReconVsRadius->SetMinimum(-200);
// hReconVsRadius->SetMaximum(200);
// hReconVsEnergy->SetMinimum(-200);
// hReconVsEnergy->SetMaximum(200);
//
// out_file->cd();
// hCenterRes->Write();
// hReconVsRadius->Write();
// hReconVsEnergy->Write();
// }

void fitcentroid(std::string event_filename, std::string out_filename) {
TFile *event_file = new TFile(event_filename.c_str(), "READ");
TTree *T = (TTree *)event_file->Get("T");
Expand Down

0 comments on commit 6d26a33

Please sign in to comment.