29 JGeometry *jgeom = dapp->GetJGeometry(runnumber);
30 JCalibration *jcalib =
japp->GetJCalibration(runnumber);
31 map<string,string> installed;
32 if(jcalib->GetCalib(
"/DIRC/install_status", installed))
return;
33 if(atoi(installed[
"status"].data()) == 0)
return;
37 vector<double>DCML00_XYZ;
38 vector<double>DCML01_XYZ;
39 vector<double>DCML10_XYZ;
40 vector<double>DCML11_XYZ;
41 vector<double>WNGL00_XYZ;
42 vector<double>WNGL01_XYZ;
43 vector<double>WNGL10_XYZ;
44 vector<double>WNGL11_XYZ;
45 vector<double>OWDG_XYZ;
46 bool all_found =
true;
47 all_found &= jgeom->Get(
"//section/composition/posXYZ[@volume='DIRC']/@X_Y_Z", DIRC);
48 all_found &= jgeom->Get(
"//composition[@name='DIRC']/posXYZ[@volume='DRCC']/@X_Y_Z", DRCC);
49 all_found &= jgeom->Get(
"//composition[@name='DRCC']/posXYZ[@volume='DCML00']/@X_Y_Z/plane[@value='4']", DCML00_XYZ);
50 all_found &= jgeom->Get(
"//composition[@name='DRCC']/posXYZ[@volume='DCML01']/@X_Y_Z/plane[@value='3']", DCML01_XYZ);
51 all_found &= jgeom->Get(
"//composition[@name='DRCC']/posXYZ[@volume='DCML10']/@X_Y_Z/plane[@value='1']", DCML10_XYZ);
52 all_found &= jgeom->Get(
"//composition[@name='DRCC']/posXYZ[@volume='DCML11']/@X_Y_Z/plane[@value='2']", DCML11_XYZ);
53 all_found &= jgeom->Get(
"//composition[@name='DCML00']/posXYZ[@volume='WNGL']/@X_Y_Z", WNGL00_XYZ);
54 all_found &= jgeom->Get(
"//composition[@name='DCML01']/posXYZ[@volume='WNGL']/@X_Y_Z", WNGL01_XYZ);
55 all_found &= jgeom->Get(
"//composition[@name='DCML10']/posXYZ[@volume='WNGL']/@X_Y_Z", WNGL10_XYZ);
56 all_found &= jgeom->Get(
"//composition[@name='DCML11']/posXYZ[@volume='WNGL']/@X_Y_Z", WNGL11_XYZ);
57 all_found &= jgeom->Get(
"//trd[@name='OWDG']/@Xmp_Ymp_Z", OWDG_XYZ);
60 jerr <<
"Problem finding all DIRC geometry elements. Please make sure your HDDS is up to date!" << endl;
65 for(
int i=0; i<48; i++) {
68 for(
int j=0; j<4; j++) {
69 vector<double>locBar_XYZ;
70 jgeom->Get(Form(
"//box[@name='B%02d%c']/@X_Y_Z", i,
'A'+j), locBar_XYZ);
71 vector<double>locGlue_XYZ;
72 jgeom->Get(Form(
"//box[@name='G%02d%c']/@X_Y_Z", i,
'A'+j), locGlue_XYZ);
78 vector<double>DCBR_XYZ;
80 DIRC_BAR_END[i] = (DCML10_XYZ[0] - WNGL10_XYZ[0] + OWDG_XYZ[4]);
83 jgeom->Get(Form(
"//composition[@name='DCML10']/posXYZ[@volume='DCBR%02d']/@X_Y_Z", i), DCBR_XYZ);
87 DIRC_BAR_END[i] = (DCML11_XYZ[0] - WNGL11_XYZ[0] + OWDG_XYZ[4]);
90 jgeom->Get(Form(
"//composition[@name='DCML11']/posXYZ[@volume='DCBR%02d']/@X_Y_Z", i), DCBR_XYZ);
94 DIRC_BAR_END[i] = (DCML01_XYZ[0] + WNGL01_XYZ[0] - OWDG_XYZ[4]);
97 jgeom->Get(Form(
"//composition[@name='DCML01']/posXYZ[@volume='DCBR%02d']/@X_Y_Z", i), DCBR_XYZ);
101 DIRC_BAR_END[i] = (DCML00_XYZ[0] + WNGL00_XYZ[0] - OWDG_XYZ[4]);
104 jgeom->Get(Form(
"//composition[@name='DCML00']/posXYZ[@volume='DCBR%02d']/@X_Y_Z", i), DCBR_XYZ);
116 if(channel < MAX_BOX_CHANNEL)
156 return 8*pmt_row + pixel_row;
163 return 8*pmt_column + pixel_column;
181 for(
int i=0; i<48; i++) {
186 return static_cast<int>( locBar );
192 if(locBar < 0 || locBar > 47)
195 return static_cast<double>(
DIRC_BAR_Y[locBar] );
201 if(locBar < 0 || locBar > 47)
210 if(locBar < 0 || locBar > 47)
213 return static_cast<double>(
DIRC_BAR_L[locBar] );
int GetPixelID(int channel) const
int GetPmtRow(int channel) const
double GetBarY(int locBar) const
int GetPixelRow(int channel) const
int GetPixelY(int channel) const
int GetPixelColumn(int channel) const
int GetPmtColumn(int channel) const
int GetPmtPixelRow(int channel) const
double GetBarEnd(int locBar) const
double GetBarLength(int locBar) const
int GetPmtPixelColumn(int channel) const
int GetPmtID(int channel) const
int GetPixelX(int channel) const
void Initialize(int runnumber)
int GetBar(float y) const