Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
bf00c2c
added beam offset analysis
raffaelladevita Oct 16, 2023
7668543
used moment at R1
raffaelladevita Oct 16, 2023
cf00117
saving new offset histograms to the histogram file
raffaelladevita Oct 17, 2023
f0bb2b2
improving offset fit and reverting to use track vertex variables
raffaelladevita Oct 20, 2023
2cd262a
added theta threshold function with offset
raffaelladevita Oct 20, 2023
21db196
changing function names to be sector dependent
raffaelladevita Oct 30, 2023
d35c8c5
restore time residual plots, update to skimming script
raffaelladevita Dec 8, 2023
2b9341e
restore time residual plots, attempt2
raffaelladevita Dec 8, 2023
7d628e1
restoring writing of time residuals to file
raffaelladevita Dec 11, 2023
b8a43eb
reading time histograms when reanalyzing or refitting
raffaelladevita Dec 13, 2023
3ad3db0
restoring vertex constraint
raffaelladevita Dec 18, 2023
90540c2
set a 10 count threshold on the scattering chamber exit window peak f…
raffaelladevita Dec 20, 2023
4176492
improved vertex fit for new cryotarget
raffaelladevita Feb 9, 2024
9c561b0
added time residuals calibration plots, switched to newer coatjava ve…
raffaelladevita Feb 12, 2024
9f5dcee
modified reading and writing of histogram file to save fitted functions
raffaelladevita Feb 13, 2024
7599aea
added fit of integrated vertex distribution, setting of residual stat…
raffaelladevita Feb 16, 2024
fdaadb9
renamed histograms
raffaelladevita Feb 16, 2024
9ae06af
disabled jminuit log during histogram fitting
raffaelladevita Feb 16, 2024
09c0ab9
added checks on histograms fit convergence and code cleanups
raffaelladevita Feb 17, 2024
bea1709
restored log file
raffaelladevita Feb 17, 2024
ad30c3d
now selecting status=0 hits, added wire plots
raffaelladevita Feb 19, 2024
4b61569
r1 translations are now global, changing theta to traj point
raffaelladevita Feb 26, 2024
03553c2
bug fix
raffaelladevita Feb 26, 2024
21f7e84
added option to initialize misalignment fit from CCDB table (-init), …
raffaelladevita Feb 27, 2024
2e807e6
added command-line options to choose frame and global/loval R1 transl…
raffaelladevita Feb 27, 2024
0d57efb
cleanup
raffaelladevita Feb 27, 2024
c6a9071
increased R3 residual error by x2 and added alpha plots
raffaelladevita Feb 27, 2024
ad416c2
changed alpha to reducedalpha
raffaelladevita Feb 27, 2024
bf68daf
fix to global transformation handling and more time plots
raffaelladevita Feb 29, 2024
dde4810
more plots and improved fitting
raffaelladevita Mar 2, 2024
7420fa8
improved DC skimming scripts
raffaelladevita Mar 8, 2024
3335dc9
restoring time residual bins for angular bins
raffaelladevita Mar 8, 2024
724bb1d
Merge branch 'dcDev7' of github.com:JeffersonLab/clas12alignment into…
raffaelladevita Mar 8, 2024
b66da57
adding doca cuts
raffaelladevita Mar 22, 2024
a30c954
improving hit selection
raffaelladevita Mar 22, 2024
68c3301
added alpha cuts on hits and double gaussian fit of residuals
raffaelladevita Mar 22, 2024
cecd83e
Merge branch 'dcDev7' of github.com:JeffersonLab/clas12alignment into…
raffaelladevita Mar 22, 2024
a7d313a
improving hit selection again
raffaelladevita Mar 22, 2024
967a918
redo failed fits
raffaelladevita Mar 25, 2024
d8bbd43
Merge branch 'dcDev7' of github.com:JeffersonLab/clas12alignment into…
raffaelladevita Mar 25, 2024
56796a1
added command line options to turn hit cuts on/off
raffaelladevita Mar 26, 2024
29114c4
Merge branch 'dcDev7' of github.com:JeffersonLab/clas12alignment into…
raffaelladevita Mar 26, 2024
8ae55e9
fix setting of doca cuts and added more logging
raffaelladevita Mar 27, 2024
dea57ba
added command line option to set the ecal cut, plotting pulls instead…
raffaelladevita Apr 9, 2024
6066359
added vertex fit for Spring18
raffaelladevita Apr 12, 2024
3377be7
fixing the target length in the RG-A Spring18 fits
raffaelladevita Apr 15, 2024
fee2a99
changing moller cone distance to FTon
raffaelladevita Apr 18, 2024
55a4883
added angular plot of time residuals
raffaelladevita May 3, 2024
dace5bb
do not refit time residual if fit is stored
raffaelladevita May 16, 2024
1f97e24
creating timeValues array even if tres is false
raffaelladevita May 17, 2024
d92163f
version bump
raffaelladevita May 31, 2024
54d5b5b
added time residuals for left right hits
raffaelladevita Jun 17, 2024
3c0035a
making LR time residual plots layer dependent
raffaelladevita Jun 18, 2024
2212d5d
saving LR time residuals to the histogram file
raffaelladevita Jun 18, 2024
f50d04a
saving LR time residuals to the histogram file
raffaelladevita Jun 18, 2024
66625bb
added region-by-region before/after plots
raffaelladevita Jun 20, 2024
b27a189
file name now shown in the jframe title and code cleanups
raffaelladevita Jul 15, 2024
77ca9df
more vertex plots in kinematics.groovy
raffaelladevita Jul 26, 2024
6d3698e
added RG-K vertex fit function, excluding measurements with failed fi…
raffaelladevita Aug 23, 2024
34877bd
now really switching -fit parser options to use inputlist
raffaelladevita Aug 27, 2024
7a1e6e6
merged master
raffaelladevita Aug 27, 2024
129551f
updated .gitignore with dc specific files
raffaelladevita Aug 27, 2024
b5bd993
plot only non empty graphs when running only with r0
raffaelladevita Aug 29, 2024
dd7c746
fixed issue with skim script
raffaelladevita Sep 6, 2024
217299e
added vertex fitting function for RG-E
raffaelladevita Dec 6, 2024
6454cfe
Merge branch 'master' into dcDev8
raffaelladevita Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,9 @@ public static void main(String[] args){
parser.getOptionParser("-process").addOption("-time" , "0", "make time residual histograms (1=true, 0=false)");
parser.getOptionParser("-process").addOption("-residuals", "2", "fit residuals with double gaussian (2), single gaussian (1), or use mean (0)");
parser.getOptionParser("-process").addOption("-vertfit" , "5", "fit vertex plots with:\n" +
"\t\t- RG-E layout (10), dual target, \n" +
"\t\t- RG-A Spring18 layout (9)\n" +
"\t\t- RG-K layout (8), new cryotarget, \n" +
"\t\t- RG-D layout (7), new cryotarget, \n" +
"\t\t- RG-C layout (6),\n" +
"\t\t- 4 gaussians (5),\n" +
Expand Down Expand Up @@ -1176,6 +1179,9 @@ public static void main(String[] args){
parser.getOptionParser("-analyze").addOption("-shifts" , "0", "use event-by-event subtraction for unit shifts (1=on, 0=off)");
parser.getOptionParser("-analyze").addOption("-residuals", "2", "fit residuals (2), use mean (1), or use existing fit available (0)");
parser.getOptionParser("-analyze").addOption("-vertfit" , "5", "fit vertex plots with:\n" +
"\t\t- RG-E layout (10), dual target, \n" +
"\t\t- RG-A Spring18 layout (9)\n" +
"\t\t- RG-K layout (8), new cryotarget, \n" +
"\t\t- RG-D layout (7), new cryotarget,\n" +
"\t\t- RG-C layout (6),\n" +
"\t\t- 4 gaussians (5),\n" +
Expand Down Expand Up @@ -1207,6 +1213,9 @@ public static void main(String[] args){
parser.getOptionParser("-fit").addOption("-shifts" , "0", "use event-by-event subtraction for unit shifts (1=on, 0=off)");
parser.getOptionParser("-fit").addOption("-sector" , "1", "sector-dependent derivatives (1) or average (0)");
parser.getOptionParser("-fit").addOption("-vertfit" , "5", "fit vertex plots with:\n" +
"\t\t- RG-E layout (10), dual target, \n" +
"\t\t- RG-A Spring18 layout (9)\n" +
"\t\t- RG-K layout (8), new cryotarget, \n" +
"\t\t- RG-D layout (7), new cryotarget, \n" +
"\t\t- RG-C layout (6),\n" +
"\t\t- 4 gaussians (5),\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public class Constants {
public static int NPARS = 18;

// size of unit shift (cm for ri_xyz, deg for ri_cxyz
// public static double[] UNITSHIFT = { 0.1, 0.8, 0.2, 0.2, 0.2, 0.4,
// 0.05, 0.4, 0.1, 0.2, 0.1, 0.2,
// 0.1, 0.8, 0.2, 0.2, 0.1, 0.4};
// public static double[] UNITSHIFT = { 0.05, 0.4, 0.1, 0.1, 0.1, 0.1,
// 0.025, 0.2, 0.05, 0.05, 0.05, 0.05,
// 0.05, 0.4, 0.1, 0.05, 0.05, 0.05};
public static double[] UNITSHIFT = { 0.1, 0.8, 0.2, 0.2, 0.2, 0.2,
0.1, 0.8, 0.2, 0.2, 0.2, 0.2,
0.1, 0.8, 0.2, 0.2, 0.2, 0.2};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,9 @@ private static boolean fitVertex(int mode, H1F histo) {
case 9:
Histo.fitRGKVertex(histo);
break;
case 10:
Histo.fitRGEVertex(histo);
break;
default:
if(histo.getFunction()!=null) {
if(histo.getFunction().getChiSquare()>0)
Expand Down Expand Up @@ -1431,7 +1434,6 @@ public static void fitRGDVertex(H1F histo) {
}

/**
<<<<<<< HEAD
* 3-peaks vertex fitting function
* Peaks correspond to: target windows and scattering chamber exit window
* Initialized according to:
Expand Down Expand Up @@ -1495,8 +1497,6 @@ public static void fitRGKVertex(H1F histo) {
}

/**
=======
>>>>>>> master
* 4-peaks vertex fitting function
* Peaks correspond to: target windows and scattering chamber exit window
* Initialized according to:
Expand Down Expand Up @@ -1552,6 +1552,75 @@ public static void fitRGAS18Vertex(H1F histo) {
// if(f1_vtx.getParameter(6)<f1_vtx.getParameter(0)/4) f1_vtx.setParameter(6, 0);
}


/**
* 5-peaks vertex fitting function
* Peaks correspond to: target windows and scattering chamber exit window
* Initialized according to:
* - chosen target length (TARGETLENGTH),
* - target exit window position (TARGETPOS)
* - distance between target exit window and insulation foil (WINDOWDIST)
* - distance between the scattering chamber exit window and the target center (SCEXIT)
* Includes wide Gaussians to account for target residual gas and the air
* outside the scattering chamber
* @param histo
*/
public static void fitRGEVertex(H1F histo) {
int nbin = histo.getData().length;
double dx = histo.getDataX(1)-histo.getDataX(0);
//find downstream window
int ibin0 = Histo.getMaximumBinBetween(histo, histo.getDataX(0), (Constants.TARGETPOS+Constants.SCEXIT)/2);
//check if the found maximum is the first or second peak, ibin is tentative upstream window
int ibin1 = Math.max(0, ibin0 - (int)(Constants.TARGETLENGTH/dx));
int ibin2 = Math.min(nbin-1, ibin0 + (int)(Constants.TARGETLENGTH/dx));
if(histo.getBinContent(ibin1)<histo.getBinContent(ibin2)) {
ibin1 = ibin0;
ibin0 = ibin2;
}
int ibinsc = Histo.getMaximumBinBetween(histo, (Constants.SCEXIT+Constants.TARGETCENTER)*0.8, (Constants.SCEXIT+Constants.TARGETCENTER)*1.2);

double mean = histo.getDataX(ibin0);
double amp = histo.getBinContent(ibin0);
double sigma = 0.5;
double sc = histo.getBinContent(ibinsc);
double air = histo.getBinContent(ibinsc + ((int) (sigma*6/dx)));
double scw = Constants.SCEXIT;
if(sc>10) scw = histo.getDataX(ibinsc)-mean+Constants.TARGETLENGTH/2;
double bg = histo.getBinContent((ibin1+ibin0)/2);
String function = "[ampU]*gaus(x,[exw]-[tl],[sigma])+"
+ "[ampD]*gaus(x,[exw],[sigma])+"
+ "[ampw]*gaus(x,[exw]+[wd],[sigma])+"
+ "[ampw]*gaus(x,[exw]+[wd]*2,[sigma])/3+"
+ "[bg]*gaus(x,[exw]-[tl]/2,[tl]*0.6)+"
+ "[sc]*gaus(x,[exw]+[scw]-[tl]/2,[sigma])+"
+ "[air]*gaus(x,[exw]+[scw]-[tl]/2+[adelta],[asigma])";
F1D f1_vtx = new F1D("f"+histo.getName(), function, -10, 10);
f1_vtx.setLineColor(2);
f1_vtx.setLineWidth(2);
f1_vtx.setOptStat("111111111111111");
f1_vtx.setParameter(0, amp);
f1_vtx.setParameter(1, mean);
f1_vtx.setParameter(2, Constants.TARGETLENGTH);
f1_vtx.setParLimits(2, Constants.TARGETLENGTH*0.9, Constants.TARGETLENGTH*1.1);
f1_vtx.setParameter(3, sigma);
f1_vtx.setParameter(4, amp);
f1_vtx.setParameter(5, amp);
f1_vtx.setParameter(6, Constants.WINDOWDIST);
f1_vtx.setParLimits(6, Constants.WINDOWDIST*0.9, Constants.WINDOWDIST*1.1);
f1_vtx.setParameter(7, bg);
f1_vtx.setParameter(8, sc);
f1_vtx.setParameter(9, scw);
f1_vtx.setParLimits(9, (Constants.SCEXIT)*0.7, (Constants.SCEXIT)*1.3);
f1_vtx.setParameter(10, air);
f1_vtx.setParameter(11, sigma*3);
f1_vtx.setParLimits(11, 0, sigma*8);
f1_vtx.setParameter(12, sigma*8);
f1_vtx.setRange(mean-Constants.TARGETLENGTH*2.0,Constants.SCEXIT+Constants.TARGETLENGTH*0.6);
// histo.setFunction(f1_vtx);
DataFitter.fit(f1_vtx, histo, "Q"); //No options uses error for sigma
// if(f1_vtx.getParameter(6)<f1_vtx.getParameter(0)/4) f1_vtx.setParameter(6, 0);
}

//This was a previous version of fitting the z vertex peaks
public static void fitVertex(H1F histo) {
double mean = histo.getDataX(histo.getMaximumBin());
Expand Down
Loading