14 #include <JANA/JApplication.h>
15 #include <JANA/JFactory.h>
47 gDirectory->mkdir(
"FDC_InternalAlignment");
48 gDirectory->cd(
"FDC_InternalAlignment");
49 for (
int i=1; i<=24;i++){
52 sprintf(thisName,
"Plane %.2i Wire Position Vs XY", i);
54 Hist3D[i-1]=
new TH3I(thisName, thisName, 100, -50., 50., 100, -50., 50., 100, -0.5, 0.5);
58 HistCurrentConstants =
new TProfile(
"CathodeAlignmentConstants",
"Constants Used for Cathode Alignment (In CCDB Order)", 450,0.5,450.5);
73 JCalibration * jcalib = eventLoop->GetJCalibration();
74 vector<map<string,double> >vals;
75 if (jcalib->Get(
"FDC/cathode_alignment",vals)==
false){
76 for(
unsigned int i=0; i<vals.size(); i++){
77 map<string,double> &row = vals[i];
79 HistCurrentConstants->Fill(i*4+1,row[
"dPhiU"]);
80 HistCurrentConstants->Fill(i*4+2,row[
"dU"]);
81 HistCurrentConstants->Fill(i*4+3,row[
"dPhiV"]);
82 HistCurrentConstants->Fill(i*4+4,row[
"dV"]);
86 if (jcalib->Get(
"FDC/strip_pitches_v2",vals)==
false){
87 for(
unsigned int i=0; i<vals.size(); i++){
88 map<string,double> &row = vals[i];
90 HistCurrentConstants->Fill(i*10+101,row[
"U_SP_1"]);
91 HistCurrentConstants->Fill(i*10+102,row[
"U_G_1"]);
92 HistCurrentConstants->Fill(i*10+103,row[
"U_SP_2"]);
93 HistCurrentConstants->Fill(i*10+104,row[
"U_G_2"]);
94 HistCurrentConstants->Fill(i*10+105,row[
"U_SP_3"]);
95 HistCurrentConstants->Fill(i*10+106,row[
"V_SP_1"]);
96 HistCurrentConstants->Fill(i*10+107,row[
"V_G_1"]);
97 HistCurrentConstants->Fill(i*10+108,row[
"V_SP_2"]);
98 HistCurrentConstants->Fill(i*10+109,row[
"V_G_2"]);
99 HistCurrentConstants->Fill(i*10+110,row[
"V_SP_3"]);
103 if (jcalib->Get(
"FDC/cell_offsets",vals)==
false){
104 for(
unsigned int i=0; i<vals.size(); i++){
105 map<string,double> &row = vals[i];
107 HistCurrentConstants->Fill(i*2+401,row[
"xshift"]);
108 HistCurrentConstants->Fill(i*2+402,row[
"yshift"]);
120 vector <const DFDCPseudo*> fdcPseudoVector;
121 loop->Get(fdcPseudoVector);
123 for (
unsigned int i = 0; i<fdcPseudoVector.size(); i++){
124 const DFDCPseudo* thisPseudo = fdcPseudoVector[i];
125 if (thisPseudo->
status != 6)
continue;
127 japp->RootWriteLock();
128 Hist3D[thisPseudo->
wire->
layer - 1]->Fill(thisPseudo->
w, thisPseudo->
s, thisPseudo->
w_c - thisPseudo->
w);
133 sprintf(thisName,
"Plane %.2i Wire t Vs Wire Number", thisPseudo->
wire->
layer);
137 96, 0.5, 96.5, 250, -50.0, 200.0);
139 sprintf(thisName,
"Plane %.2i Wire Position Vs XY", thisPseudo->
wire->
layer);
140 Fill2DProfile(
"FDC_InternalAlignment",
"Profile2D", thisName,
141 thisPseudo->
w, thisPseudo->
s, thisPseudo->
w_c - thisPseudo->
w,
143 100, -50.,50., 100,-50., 50.);
147 double sinphiumphiv =
sin(thisPseudo->
phi_u-thisPseudo->
phi_v);
148 double deltaX = HistCurrentConstants->GetBinContent((thisPseudo->
wire->
layer-1)*2+401);
149 double deltaU = HistCurrentConstants->GetBinContent((thisPseudo->
wire->
layer-1)*4+2);
150 double deltaV = HistCurrentConstants->GetBinContent((thisPseudo->
wire->
layer-1)*4+4);
151 double upred = ((thisPseudo->
w-deltaX)*sinphiumphiv + thisPseudo->
v*sinphiu)/sinphiv;
152 double vpred = -((thisPseudo->
w-deltaX)*sinphiumphiv-thisPseudo->
u*sinphiv)/sinphiu;
155 Fill2DHistogram(
"FDC_InternalAlignment",
"Cathode Projections", thisName,
156 thisPseudo->
u - deltaU, thisPseudo->
u - upred,
157 "u_res Vs. u;u_{local};u-upred",
158 192,-47.5,47.5,200, -0.2,0.2);
161 Fill2DHistogram(
"FDC_InternalAlignment",
"Cathode Projections", thisName,
162 thisPseudo->
v - deltaV, thisPseudo->
v - vpred,
163 "v_res Vs. v;v_{local};v-vpred",
164 192,-47.5,47.5,200, -0.2,0.2);
167 if((thisPseudo->
w-deltaX)<0.){
169 Fill2DHistogram(
"FDC_InternalAlignment",
"Cathode Projections Negative", thisName,
170 thisPseudo->
u - deltaU, thisPseudo->
u - upred,
171 "u_res Vs. u;u_{local};u-upred",
172 192,-47.5,47.5,200, -0.2,0.2);
175 Fill2DHistogram(
"FDC_InternalAlignment",
"Cathode Projections Negative", thisName,
176 thisPseudo->
v - deltaV, thisPseudo->
v - vpred,
177 "v_res Vs. v;v_{local};v-vpred",
178 192,-47.5,47.5,200, -0.2,0.2);
182 Fill2DHistogram(
"FDC_InternalAlignment",
"Cathode Projections Positive", thisName,
183 thisPseudo->
u - deltaU, thisPseudo->
u - upred,
184 "u_res Vs. u;u_{local};u-upred",
185 192,-47.5,47.5,200, -0.2,0.2);
188 Fill2DHistogram(
"FDC_InternalAlignment",
"Cathode Projections Positive", thisName,
189 thisPseudo->
v - deltaV, thisPseudo->
v - vpred,
190 "v_res Vs. v;v_{local};v-vpred",
191 192,-47.5,47.5,200, -0.2,0.2);
~JEventProcessor_FDC_InternalAlignment()
int status
status word for pseudopoint
sprintf(text,"Post KinFit Cut")
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
const DFDCWire * wire
DFDCWire for this wire.
class DFDCPseudo: definition for a reconstructed point in the FDC
double phi_v
rotation angles for cathode planes
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
jerror_t fini(void)
Called after last event of last event source has been processed.
double s
< wire position computed from cathode data, assuming the avalanche occurs at the wire ...
double time
time corresponding to this pseudopoint.
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
double v
centroid positions in the two cathode views
jerror_t init(void)
Called once at program start.
JEventProcessor_FDC_InternalAlignment()