7 #include "GaudiKernel/IToolSvc.h"
120 return StatusCode::SUCCESS;
126 const EventContext& ctx = Gaudi::Hive::currentContext();
133 int run = ctx.eventID().run_number();
134 uint64_t event = ctx.eventID().event_number();
163 return StatusCode::SUCCESS;
173 float energy = (0.3/41.)*Bdltot * 1000;
182 float Bend3_low[2] = {0.0079347, 0.021813};
183 float Bend3_high[4] = {0.437329, 0.0212849, 0.00000355516, -0.0000000147542};
189 if (
current <= 824.12) Bdl3 = Bend3_low[0] + Bend3_low[1]*
current;
198 float Bend4_low[2] = {0.00786406, 0.021814};
199 float Bend4_high[4] = {0.434258, 0.0212899, 0.00000356113, -0.0000000147379};
205 if (
current <= 824.12) Bdl4 = Bend4_low[0] + Bend4_low[1]*
current;
214 float coll3_opening = (fabs(coll3_down) + fabs(coll3_up))/2.0;
215 float coll9_opening = (fabs(coll9_down) + fabs(coll9_up))/2.0;
217 float errcoll = sqrt(coll3_opening*coll3_opening + coll9_opening*coll9_opening)*(1./27);
225 float err_abs = sqrt(fac*fac + 0.5*0.5);
236 float Bdl_tot = Bdl3 + Bdl4;
238 float errBdl3 = (
GetBdl3(currB3 + 0.1) -
GetBdl3(currB3 - 0.1))/2;
239 float errBdl4 = (
GetBdl4(currB4 + 0.1) -
GetBdl4(currB4 - 0.1))/2;
240 const float fac3 = errBdl3/Bdl3;
241 const float fac4 = errBdl4/Bdl4;
242 float errBdl = sqrt(fac3*fac3 + fac4*fac4)*Bdl_tot;
244 float resField = sqrt(0.0010*0.0010 + 0.0010*0.0010);
246 errBdl = sqrt(errBdl*errBdl + resField*resField + Bdl_tot*0.0003 * Bdl_tot*0.0003)/Bdl_tot*100;
257 float Bdl_B3 =
GetBdl3(currB3);
258 float Bdl_B4 =
GetBdl4(currB4);
260 float B2dl_B3 = (Bdl_B3 * Bdl_B3)*(1./(Lmag*9));
261 float B2dl_B4 = (Bdl_B4 * Bdl_B4)*(1./(Lmag*9));
262 float B2dl_tot = B2dl_B3 + B2dl_B4;
264 float B5suB34 = 0.19;
265 float B6suB34 = 0.22;
266 float B56lB34 = 0.25;
268 float B2dl_B5 = (B2dl_B3 + B2dl_B4)*B5suB34*B5suB34*B56lB34;
269 float B2dl_B6 = (B2dl_B3 + B2dl_B4)*B6suB34*B6suB34*B56lB34;
271 float loss = 0.00000127*
energy*
energy*(3*B2dl_tot/2 + B2dl_B5 + B2dl_B6);
279 float errloss = loss * 0.02;
287 return StatusCode::SUCCESS;
304 return StatusCode::SUCCESS;
315 if (((
run < 2101225) && (
run >= 2101022)) || ((
run < 2102165) && (
run >= 2102003)))
340 float coll_equip[24];
381 float quad_equip[22];
382 float trim_equip[10];
386 for (
int i=0;
i<nc_quad;
i++)
396 folder =
"/TILE/DCS/SYSTEM1/BEAM";
401 folder =
"/TILE/DCS/SYSTEM1/BEAM";
413 (*m_quad_file)[
i] = quad_file[
i];
414 (*m_quad_equip)[
i] = quad_equip[
i];
420 for (
int i=0;
i<nc_bend;
i++)
429 folder =
"/TILE/DCS/SYSTEM1/BEAM";
433 folder =
"/TILE/DCS/TILE_LV_62/BEAM";
441 if (StatusCode::SUCCESS!=
m_runpar->getVal(
folder,val2,bend_equip[
i])) {
445 (*m_bend_file)[
i] = bend_file[
i];
446 (*m_bend_equip)[
i] = bend_equip[
i];
466 for (
int i=0;
i<nc_trim;
i++)
475 folder =
"/TILE/DCS/SYSTEM1/BEAM";
479 folder =
"/TILE/DCS/TILE_LV_62/BEAM";
487 if (StatusCode::SUCCESS!=
m_runpar->getVal(
folder,val2,trim_equip[
i])) {
491 (*m_trim_file)[
i] = trim_file[
i];
492 (*m_trim_equip)[
i] = trim_equip[
i];
498 for (
int i=0;
i<nc_coll;
i++)
508 folder =
"/TILE/DCS/SYSTEM1/BEAM";
512 folder =
"/TILE/DCS/TILE_LV_62/BEAM";
520 if (StatusCode::SUCCESS!=
m_runpar->getVal(
folder,val2,coll_equip[
i])) {
524 (*m_coll_file)[
i] = coll_file[
i];
525 (*m_coll_equip)[
i] = coll_equip[
i];
529 for (
int i=0;
i<nc_quad;
i++)
533 for (
int i=0;
i<nc_bend;
i++)
537 for (
int i=0;
i<nc_trim;
i++)
541 for (
int i=0;
i<nc_coll;
i++)
552 for (
int i=0;
i<nc_quad;
i++)
556 for (
int i=0;
i<nc_bend;
i++)
560 for (
int i=0;
i<nc_trim;
i++)
564 for (
int i=0;
i<nc_coll;
i++)
583 for (
int i=0;
i<nc_bend;
i++)
590 folder =
"/TILE/DCS/SYSTEM1/BEAM";
594 folder =
"/TILE/DCS/TILE_LV_62/BEAM";
597 if (StatusCode::SUCCESS!=
m_runpar->getVal(
folder,val2,bend_equip[
i])) {
603 for (
int i=0;
i<nc_coll;
i++)
610 folder =
"/TILE/DCS/SYSTEM1/BEAM";
614 folder =
"/TILE/DCS/TILE_LV_62/BEAM";
617 if (StatusCode::SUCCESS!=
m_runpar->getVal(
folder,val2,coll_equip[
i])) {
641 m_B8_Bdl = 0.00530982*bend_equip[7] + 0.00000328502*bend_equip[7]*bend_equip[7] -
642 0.00000000532397*bend_equip[7]*bend_equip[7]*bend_equip[7]-
643 0.00000000000276483*bend_equip[7]*bend_equip[7]*bend_equip[7]*bend_equip[7]+
644 0.000000000000003368*bend_equip[7]*bend_equip[7]*bend_equip[7]*bend_equip[7]*bend_equip[7];
654 float coll12_opening = (fabs(coll_equip[11]) + fabs(coll_equip[23]))/2.0;