4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 kwargs.setdefault(
"pixelKeys", [])
8 kwargs.setdefault(
"stripKeys", [])
9 kwargs.setdefault(
"doDiffHistograms",
False)
10 kwargs.setdefault(
"matchByID",
False)
11 kwargs.setdefault(
"allowedRdoMisses", 0)
13 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
15 monitoringTool.HistPath =
"/"
17 if len(kwargs[
"pixelKeys"]) == 2
and kwargs[
"doDiffHistograms"]:
18 key0 = kwargs[
"pixelKeys"][0]
19 key1 = kwargs[
"pixelKeys"][1]
20 name = f
"{key0} - {key1}"
21 monitoringTool.defineHistogram(
"nmatched_pixel_clusters", path =
"FPGAOutputValidation", type =
"TH1I", title = f
"{name}: number of matched clusters", xbins = 100, xmin=0, xmax = 100)
22 monitoringTool.defineHistogram(
"diff_pixel_locx",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:locx;Local position x;", xbins = 200, xmin = -0.2, xmax = 0.2)
23 monitoringTool.defineHistogram(
"diff_pixel_locy",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:locy;Local position y;", xbins = 200, xmin = -0.2, xmax = 0.2)
24 monitoringTool.defineHistogram(
"diff_pixel_covxx",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:covxx;Local covariance xx;", xbins = 100, xmin = -0.1, xmax = 0.1)
25 monitoringTool.defineHistogram(
"diff_pixel_covyy",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:covyy;Local covariance yy;", xbins = 100, xmin = -0.1, xmax = 0.1)
26 monitoringTool.defineHistogram(
"diff_pixel_globalx",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:globalx;Global position x;", xbins = 200, xmin = -0.05, xmax = 0.05)
27 monitoringTool.defineHistogram(
"diff_pixel_globaly",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:globaly;Global position y;", xbins = 200, xmin = -0.05, xmax = 0.05)
28 monitoringTool.defineHistogram(
"diff_pixel_globalz",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:globalz;Global position z;", xbins = 200, xmin = -0.05, xmax = 0.05)
29 monitoringTool.defineHistogram(
"diff_pixel_omegax",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:omegax;Omega x;", xbins = 200, xmin = -1, xmax = 1)
30 monitoringTool.defineHistogram(
"diff_pixel_omegay",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:omegay;Omega y;", xbins = 200, xmin = -1, xmax = 1)
31 monitoringTool.defineHistogram(
"diff_pixel_channelsphi", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:channels in phi;Channels in #phi;", xbins = 10, xmin = -5, xmax = 5)
32 monitoringTool.defineHistogram(
"diff_pixel_channelseta", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:channels in eta;Channels in #eta;", xbins = 10, xmin = -5, xmax = 5)
33 monitoringTool.defineHistogram(
"diff_pixel_widtheta", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:width in eta;Channels in #phi;", xbins = 10, xmin = -5, xmax = 5)
34 monitoringTool.defineHistogram(
"diff_pixel_tot", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:tot;Total TOT;", xbins = 200, xmin = -1, xmax = 1)
36 if len(kwargs[
"stripKeys"]) == 2
and kwargs[
"doDiffHistograms"]:
37 key0 = kwargs[
"stripKeys"][0]
38 key1 = kwargs[
"stripKeys"][1]
39 name = f
"{key0} - {key1}"
40 monitoringTool.defineHistogram(
"nmatched_strip_clusters", path =
"FPGAOutputValidation", type =
"TH1I", title = f
"{name}: number of matched clusters", xbins = 100, xmin=0, xmax = 100)
41 monitoringTool.defineHistogram(
"diff_strip_locx",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:locx;Local position x;", xbins = 200, xmin = -0.2, xmax = 0.2)
42 monitoringTool.defineHistogram(
"diff_strip_covxx",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:covxx;Local covariance xx;", xbins = 100, xmin = -0.1, xmax = 0.1)
43 monitoringTool.defineHistogram(
"diff_strip_globalx",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:globalx;Global position x;", xbins = 200, xmin = -0.05, xmax = 0.05)
44 monitoringTool.defineHistogram(
"diff_strip_globaly",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:globaly;Global position y;", xbins = 200, xmin = -0.05, xmax = 0.05)
45 monitoringTool.defineHistogram(
"diff_strip_globalz",path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:globalz;Global position z;", xbins = 200, xmin = -0.05, xmax = 0.05)
46 monitoringTool.defineHistogram(
"diff_strip_channelsphi", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{name}:channels in phi;Channels in #phi;", xbins = 10, xmin = -5, xmax = 5)
48 for key
in kwargs[
"pixelKeys"]:
49 monitoringTool.defineHistogram(f
"{key}_LOCALPOSITION_X", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_LOCALPOSITION_X;Local position x;", xbins = 200, xmin = -40, xmax = 40)
50 monitoringTool.defineHistogram(f
"{key}_LOCALPOSITION_Y", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_LOCALPOSITION_Y;Local position y;", xbins = 200, xmin = -40, xmax = 40)
52 monitoringTool.defineHistogram(f
"{key}_LOCALCOVARIANCE_XX", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_LOCALCOVARIANCE_XX;Local covariance xx;", xbins = 100, xmin = 0, xmax = 1)
53 monitoringTool.defineHistogram(f
"{key}_LOCALCOVARIANCE_YY", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_LOCALCOVARIANCE_YY;Local covariance yy;", xbins = 100, xmin = 0, xmax = 1)
55 monitoringTool.defineHistogram(f
"{key}_GLOBALPOSITION_X", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_GLOBALPOSITION_X;Global position x [mm];", xbins = 200, xmin = -350, xmax = 350)
56 monitoringTool.defineHistogram(f
"{key}_GLOBALPOSITION_Y", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_GLOBALPOSITION_Y;Global position y [mm];", xbins = 200, xmin = -350, xmax = 350)
57 monitoringTool.defineHistogram(f
"{key}_GLOBALPOSITION_Z", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_GLOBALPOSITION_Z;Global position z [mm];", xbins = 200, xmin = -3000, xmax =3000)
59 monitoringTool.defineHistogram(f
"{key}_OMEGA_X", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_OMEGA_X;Omega X;", xbins = 100, xmin = 0, xmax = 1)
60 monitoringTool.defineHistogram(f
"{key}_OMEGA_Y", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_OMEGA_Y;Omega Y;", xbins = 100, xmin = 0, xmax = 1)
62 monitoringTool.defineHistogram(f
"{key}_CHANNELS_IN_PHI", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_CHANNELS_IN_PHI;Channels in #phi;", xbins = 100, xmin = 0, xmax = 100)
63 monitoringTool.defineHistogram(f
"{key}_CHANNELS_IN_ETA", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_CHANNELS_IN_ETA;Channels in #eta;", xbins = 100, xmin = 0, xmax = 100)
65 monitoringTool.defineHistogram(f
"{key}_WIDTH_IN_ETA", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_WIDTH_IN_ETA;Width in #eta;", xbins = 100, xmin = 0, xmax = 1)
67 monitoringTool.defineHistogram(f
"{key}_TOTAL_TOT", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_TOTAL_TOT;Total ToT;", xbins = 100, xmin = 0, xmax = 100)
69 for key
in kwargs[
"stripKeys"]:
70 monitoringTool.defineHistogram(f
"{key}_LOCALPOSITION_X", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_LOCALPOSITION_X;Local position x;", xbins = 200, xmin = -100, xmax = 100)
73 monitoringTool.defineHistogram(f
"{key}_LOCALCOVARIANCE_XX", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_LOCALCOVARIANCE_XX;Local covariance xx;", xbins = 100, xmin = 0, xmax = 1)
75 monitoringTool.defineHistogram(f
"{key}_GLOBALPOSITION_X", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_GLOBALPOSITION_X;Global position x [mm];", xbins = 200, xmin = -1024, xmax = 1024)
76 monitoringTool.defineHistogram(f
"{key}_GLOBALPOSITION_Y", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_GLOBALPOSITION_Y;Global position y [mm];", xbins = 200, xmin = -1024, xmax = 1024)
77 monitoringTool.defineHistogram(f
"{key}_GLOBALPOSITION_Z", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_GLOBALPOSITION_Z;Global position z [mm];", xbins = 200, xmin = -3000, xmax = 3000)
79 monitoringTool.defineHistogram(f
"{key}_CHANNELS_IN_PHI", path =
"FPGAOutputValidation", type =
"TH1F", title = f
"{key}_CHANNELS_IN_PHI;Channels in #phi;", xbins = 100, xmin = 0, xmax = 100)
81 from AthenaConfiguration.ComponentFactory
import CompFactory
82 FPGAOutputValidationAlg = CompFactory.FPGAOutputValidationAlg(
83 "FPGAOutputValidationAlg",
87 FPGAOutputValidationAlg.monitoringTool = monitoringTool
88 acc.addEventAlgo(FPGAOutputValidationAlg)
90 acc.addService(CompFactory.THistSvc(
91 Output=[
"FPGAOutputValidation DATAFILE='FPGAOutputValidation.root', OPT='RECREATE'"]