ATLAS Offline Software
JetStandardHistoSpecs.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon import SystemOfUnits
4 from JetMonitoring.JetMonitoringConfig import HistoSpec, VarSpec, ConfigDict, ToolSpec
5 
6 # ***********************************************
7 # ***********************************************
8 # The list of "jet variable"" which are not simple float. Or aliases to simple float.
9 # A VarSpec specify :
10 # 1) the name of a jet attribute
11 # 2) its type
12 # 3) optional and only if type is vector<X>, the index of the element of the vector to be plotted
13 # (simple float can be generated on-the-fly just by their name. they don't need spec)
14 
15 knownVar = dict(
16  mass = VarSpec('m:GeV', 'float'),
17  JVF = VarSpec('JVF', 'vecfloat'),
18  EPS = VarSpec('EnergyPerSampling', 'vecfloat'),
19 
20  # this variable has an index specified. It will thus has only 1 value per jet : the JVF at pos 0
21  JVF0 = VarSpec('JVF', 'vecfloat', 0),
22 )
23 
24 # Explicitly declare variables which have underlying type vector<int> (otherwise the system would automatically configure them as vector<float>)
25 knownVar['NumTrkPt1000[0]'] = VarSpec('NumTrkPt1000[0]', 'vecint', )
26 knownVar['NumTrkPt500[0]'] = VarSpec('NumTrkPt500[0]', 'vecint', )
27 knownVar['numConstituents'] = VarSpec('numConstituents', 'int', )
28 
29 knownEventVar = dict(
30  # These always are of type 'float'
31  avgMu = ToolSpec('EventHistoVarTool', 'avgMu', Attribute='averageInteractionsPerCrossing'),
32  actMu = ToolSpec('EventHistoVarTool', 'actMu', Attribute='actualInteractionsPerCrossing'),
33  njets = ToolSpec('NumJetVarTool', 'njets', ),
34  njetsPt20 = ToolSpec('NumJetVarTool', 'njetsPt20', PtCut=20.),
35  njetsPt50 = ToolSpec('NumJetVarTool', 'njetsPt50', PtCut=50.),
36  njetsEt20 = ToolSpec('NumJetVarTool', 'njetsEt20', EtCut=20.),
37  njetsEt50 = ToolSpec('NumJetVarTool', 'njetsEt50', EtCut=50.),
38  njetsEt20Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt20Eta0_32', EtCut=20., EtaMin=0., EtaMax=3.2),
39  njetsEt30Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt30Eta0_32', EtCut=30., EtaMin=0., EtaMax=3.2),
40  njetsEt40Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt40Eta0_32', EtCut=40., EtaMin=0., EtaMax=3.2),
41  njetsEt50Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt50Eta0_32', EtCut=50., EtaMin=0., EtaMax=3.2),
42  njetsEt70Eta0_24 = ToolSpec('NumJetVarTool', 'njetsEt70Eta0_24', EtCut=70., EtaMin=0., EtaMax=2.4),
43  njetsEt60Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt60Eta0_32', EtCut=60., EtaMin=0., EtaMax=3.2),
44  njetsEt80Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt80Eta0_32', EtCut=80., EtaMin=0., EtaMax=3.2),
45  njetsEt100Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt100Eta0_32', EtCut=100., EtaMin=0., EtaMax=3.2),
46  njetsEt260Eta32_49 = ToolSpec('NumJetVarTool', 'njetsEt260Eta32_49', EtCut=260., EtaMin=3.2, EtaMax=4.9),
47  njetsEt200Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt200Eta0_32', EtCut=200., EtaMin=0., EtaMax=3.2),
48  njetsEt330Eta0_32 = ToolSpec('NumJetVarTool', 'njetsEt330Eta0_32', EtCut=330., EtaMin=0., EtaMax=3.2),
49  njetsPt20Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt20Eta0_32', PtCut=20., EtaMin=0., EtaMax=3.2),
50  njetsPt30Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt30Eta0_32', PtCut=30., EtaMin=0., EtaMax=3.2),
51  njetsPt40Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt40Eta0_32', PtCut=40., EtaMin=0., EtaMax=3.2),
52  njetsPt50Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt50Eta0_32', PtCut=50., EtaMin=0., EtaMax=3.2),
53  njetsPt70Eta0_24 = ToolSpec('NumJetVarTool', 'njetsPt70Eta0_24', PtCut=70., EtaMin=0., EtaMax=2.4),
54  njetsPt60Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt60Eta0_32', PtCut=60., EtaMin=0., EtaMax=3.2),
55  njetsPt80Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt80Eta0_32', PtCut=80., EtaMin=0., EtaMax=3.2),
56  njetsPt100Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt100Eta0_32', PtCut=100., EtaMin=0., EtaMax=3.2),
57  njetsPt260Eta32_49 = ToolSpec('NumJetVarTool', 'njetsPt260Eta32_49', PtCut=260., EtaMin=3.2, EtaMax=4.9),
58  njetsPt200Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt200Eta0_32', PtCut=200., EtaMin=0., EtaMax=3.2),
59  njetsPt330Eta0_32 = ToolSpec('NumJetVarTool', 'njetsPt330Eta0_32', PtCut=330., EtaMin=0., EtaMax=3.2),
60  njetsPt200 = ToolSpec('NumJetVarTool', 'njetsPt200', PtCut=200.),
61 
62 )
63 
64 # ***************************************
65 # The list of standard jet histograms.
66 # This is a list of specification, each describing how to histogram a jet variable into 1D or 2D histos.
67 # A specification is a specialized dictionnary (a HistoSpec, see JetMonitoringConfig.py)
68 # The format is :
69 # HistoSpec( name , bins , optional_arguments... )
70 # where 'name' is a string and 'bins' is a tuple as in (nbin,xmin,xmax) or (nbinx,xmin,xmax,nbiny,ymin,ymax)
71 # See various commented examples below for optional arguments.
72 
73 _knownHistos = [
74  # Simple form : histogram of variable 'eta' (the name of spec is the same as the name of variable)
75  # As in TH1 ctor, ';' in the title is interpreted as in "Main Title;Title xAxis;Title yAxis"
76  HistoSpec( 'eta', (50,-5,5) , title='#eta;#eta;Entries'),
77  HistoSpec( 'rapidity', (50,-5,5) , title='rapidity;y;Entries'), # Test non-EDM variable
78  HistoSpec( 'phi', (50,-3.3,3.3) , title='#phi;#phi;Entries'),
79  # Same but we indicate that the variable is to be plotted in GeV by appending ':GeV'
80  HistoSpec( 'pt:GeV', (200,0,800) , title='p_{T};p_{T} [GeV];'),
81  HistoSpec( 'm:GeV', (100,0,300) , title='mass;mass [GeV];'),
82  HistoSpec( 'e:GeV', (200,0,800) , title='E;E [GeV];'),
83  HistoSpec( 'et:GeV', (200,0,800), title='E_{T};E_{T} [GeV],'),
84 
85  # We want an other pT histo, with different bins.
86  # We add a new spec with a new name and we indicate the actual variable with the argument xvar
87  HistoSpec( 'highpt', (390,200.,8000) , title='p_{T};p_{T} [GeV];', xvar='pt:GeV'),
88 
89  HistoSpec( 'avgMu', (100, 0., 200.) , title='Ave. Interactions per Crossing; Ave. mu' , xvar='avgMu'),
90  #EventHistoSpec( 'njets', (30,0,30), title='Jet Multiplicity;Njets;Entries' ),
91  #HistoSpec( 'njets', (30,0,30), title='Jet Multiplicity;Njets;Entries' , xvar='njets'),
92  # When the jet variable is not a simple float, use the xvar argument to refer to a detailed variable spec in 'knownVar'
93  HistoSpec( 'JVF', (100,0,1.2) , title='Jet Vtx Frac;JVF;Entries', xvar='JVF'),
94  # if the var name contains '[N]' the system will assume the variable is a vector<float> and setup tools accordingly (so we don't need to specify 'xvar')
95  HistoSpec( 'JVF[0]', (100,0,1.2) , title='JVF for vtx 0;JVF[0];Entries', ),
96  HistoSpec( 'JVF[1]', (100,0,1.2) , title='JVF for vtx 1;JVF[1];Entries', ),
97 
98 
99  # full list
100  HistoSpec('ptN', (250, 0.0, 5000.0), title='Jet Pt;Pt [GeV];', xvar='pt:GeV'),
101 
102  HistoSpec('EMFrac', (50, -0.1, 1.4), title='EM Fraction;EM Fraction;Entries', ),
103  HistoSpec('LArQuality', (50, -0.4, 1.2), title='LAr quality;Energy;Entries', ),
104  HistoSpec('HECQuality', (50, -0.1, 1.4), title='HEC Quality;HEC Quality;Entries', ),
105  HistoSpec('HECFrac', (50, -0.1, 1.4), title='HEC Fraction;HEC Fraction;Entries', ),
106  HistoSpec('AverageLArQF', (100, 0, 65535), title='Average LAr QF;AverageLArQF;Entries', ),
107  HistoSpec('FracSamplingMaxIndex', (24, 0, 24), title='FracSamplingMaxIndex; FracSamplingMaxIndex;Entries', xvar=VarSpec('FracSamplingMaxIndex','int')),
108  HistoSpec('FracSamplingMax', (50, -0.1, 1.2), title='FracSamplingMax; FracSamplingMax;Entries', ),
109  HistoSpec('Timing', (40, -20, 20), title='Jet Time info;Time;', ),
110  HistoSpec('LooseBad', (10, 0, 2), title='Jet Cleaning LooseBad;', ),
111 
112 
113  HistoSpec('LeadingClusterSecondLambda', (100, 0.0, 10000.0), title='LeadingClusterSecondLambda; LeadingClusterSecondLambda;', ),
114  HistoSpec('LeadingClusterSecondR', (100, 0.0, 100000.0), title='LeadingClusterSecondR; LeadingClusterSecondR;', ),
115  HistoSpec('OotFracClusters5', (50, -0.1, 1.2), title='OotFracClusters5; OotFracClusters5;', ),
116  HistoSpec('OotFracClusters10', (50, -0.1, 1.2), title='OotFracClusters10; OotFracClusters10;', ),
117 
118  HistoSpec('Jvt', (70, -0.2, 1.2), title='Jet JVT;JVT;Entries', ),
119  HistoSpec('JVFCorr', (120, -1.2, 1.2), title='Jet JVT; JVFCorr;Entries', ),
120  HistoSpec('JvtRpt', (75, 0, 1.5), title='Jet JVT Rpt; JVTRpt;Entries', ),
121  HistoSpec('EM3Frac', (50,-0.1,1.0), title='EM3 fraction;EM3 fraction;Entries'),
122  HistoSpec('Tile0Frac', (50,-0.1,1.0), title='Tile0 fraction;Tile0 fraction;Entries'),
123 
124 
125  HistoSpec('GhostMuonSegmentCount', (60, 0, 60), title='Number of associated muon segments;Number;', xvar=VarSpec('GhostMuonSegmentCount','int')),
126  HistoSpec('GhostTruthCount', (60, 0, 60), title='Number of associate truth part;Number;', xvar=VarSpec('GhostTruthCount','int')),
127  HistoSpec('GhostTrackCount', (60, 0, 60), title='Number of associate tracks;Number;', xvar=VarSpec('GhostTrackCount','int')),
128  HistoSpec('GhostTruthAssociationFraction', (50, 0, 1.0), title='Fraction of associated truth particles from a matched truth jet jet;GhostTruthAssociationFraction;', ),
129 
130  HistoSpec('Width', (50, 0, 1.0), title='Jet Width;Width;', ),
131  HistoSpec('Width15', (50, 0, 1.5), title='Jet Width;Width;', xvar='Width'),
132  HistoSpec('Mu12', (100, 0, 1.0), title='Mu12;Mu12;', ),
133 
134  HistoSpec('NumTrkPt500[0]', (100, 0, 100), title='Number of tracks from PV0 above 0.5 GeV:N_{tracks}(p_{T}>0.5 GeV);NumTrkPt500;Entries', ),
135  HistoSpec('NumTrkPt1000[0]', (100, 0, 100), title='Number of all tracks above 1 GeV:N_{tracks}(p_{T}>1 GeV);NumTrkPt1000;Entries', ),
136  HistoSpec('SumPtTrkPt500[0]:GeV', (100, 0, 200), title='Sum Pt of all tracks above 0.5 GeV:SumPtTrk(p_{T}>0.5 GeV);SumPtTrkPt500 [GeV];Entries', ),
137  HistoSpec('SumPtChargedPFOPt500[0]:GeV', (100, 0, 200), title='Sum Pt of all charged PFO above 0.5 GeV:SumPtChargedPFO(p_{T}>0.5 GeV);SumPtChargedPFOPt500 [GeV];Entries', ),
138  HistoSpec('fCharged', (100, 0, 2), title='Normalised sum Pt of all charged PFO above 0.5 GeV:fCharged(p_{T}>0.5 GeV);fCharged;Entries', ),
139 
140  HistoSpec('FoxWolfram4', (100, -1, 1), title='FoxWolfram0;FoxWolfram4;', ),
141  HistoSpec('FoxWolfram0', (100, -1, 1), title='FoxWolfram0;FoxWolfram0;', ),
142  HistoSpec('FoxWolfram1', (100, -1, 1), title='FoxWolfram0;FoxWolfram1;', ),
143  HistoSpec('FoxWolfram2', (100, -1, 1), title='FoxWolfram0;FoxWolfram2;', ),
144  HistoSpec('FoxWolfram3', (100, -1, 1), title='FoxWolfram0;FoxWolfram3;', ),
145 
146  HistoSpec('ZCut12', (100, 0, 1.0), title='ZCut12;ZCut12;', ),
147  HistoSpec('ZCut23', (100, 0, 1.0), title='ZCut23;ZCut23;', ),
148  HistoSpec('ZCut34', (100, 0, 1.0), title='ZCut34;ZCut34;', ),
149 
150  HistoSpec('KtDR', (100, 0, 10), title='KtDR;KtDR;', ),
151 
152  HistoSpec('Split12', (100, 0, 5000), title='Split12;Split12;', ),
153  HistoSpec('Split23', (100, 0, 5000), title='Split23;Split23;', ),
154  HistoSpec('Split34', (100, 0, 5000), title='Split34;Split34;', ),
155 
156  HistoSpec('D2', (100, -1, 1), title='D2;D2;', ),
157  HistoSpec('D2_Beta2', (100, -1, 1), title='D2_Beta2;D2_Beta2;', ),
158 
159  HistoSpec('ThrustMaj', (100, -1, 2), title='ThrustMaj;ThrustMaj;', ),
160  HistoSpec('ThrustMin', (100, -1, 2), title='ThrustMin;ThrustMin;', ),
161 
162  HistoSpec('ECF2', (100, 0, 10000), title='ECF2;ECF2;', ),
163  HistoSpec('ECF3', (100, 0, 10000), title='ECF3;ECF3;', ),
164  HistoSpec('ECF1', (100, 0, 10000), title='ECF1;ECF1;', ),
165  HistoSpec('ECF1_Beta2', (100, -1, 1), title='ECF1_Beta2;ECF1_Beta2;', ),
166  HistoSpec('ECF3_Beta2', (100, -1, 1), title='ECF3_Beta2;ECF3_Beta2;', ),
167  HistoSpec('ECF2_Beta2', (100, -1, 1), title='ECF2_Beta2;ECF2_Beta2;', ),
168 
169  HistoSpec('DipExcl12', (100, -1, 2), title='DipExcl12;DipExcl12;', ),
170  HistoSpec('Dip12', (100, -1, 2), title='Dip12;Dip12;', ),
171  HistoSpec('Dip23', (100, -1, 2), title='Dip23;Dip23;', ),
172  HistoSpec('Dip13', (100, -1, 2), title='Dip13;Dip13;', ),
173 
174  HistoSpec('C1_Beta2', (100, -1, 1), title='C1;C1;', xvar='C1'),
175  HistoSpec('C2_Beta2', (100, -1, 1), title='C2_Beta2;C2_Beta2;', ),
176  HistoSpec('C2', (100, -1, 1), title='C2;C2;', ),
177  HistoSpec('C1', (100, -1, 1), title='C1;C1;', ),
178 
179  HistoSpec('NegativeE:GeV', (80, -10, 0), title='Negative E in Jet;Energy;', ),
180  HistoSpec('N90Constituents', (100, 0, 100), title='N90Constituents; N90Constituents;', ),
181  HistoSpec('nconstit', (100,0, 200), title='Num. of Consituents; Nconstituents;'),
182 
183  HistoSpec('BchCorrDotx', (50, 0, 1), title='BchCorrDotx:BchCorrDotx;', ),
184  HistoSpec('BchCorrCell', (50, 0, 1), title='BchCorrCell:BchCorrCell;', ),
185 
186 
187  HistoSpec('TrackWidthPt1000[0]', (75, 0.0, 1.5), title='Width from tracks from PV0 above 1 GeV:Track Width(p_{T}>1 GeV);', ),
188 
189 
190  HistoSpec('Volatility', (100, -100, 100), title='Volatility;Volatility;', ),
191  HistoSpec('PlanarFlow', (100, -1, 1.1), title='PlanarFlow;PlanarFlow;', ),
192  HistoSpec('CentroidR', (100, 0, 7500), title='CentroidR; CentroidR;', ),
193  HistoSpec('Sphericity', (100, 0, 1), title='Sphericity;Sphericity;', ),
194  HistoSpec('Aplanarity', (100, 0, 1), title='Aplanarity;Aplanarity;', ),
195  HistoSpec('Angularity', (100, -0.1, 0.1), title='Angularity;Angularity;', ),
196 
197 
198 
199  HistoSpec('Tau1', (100, 0, 1.0), title='Tau1;Tau1;', ),
200  HistoSpec('Tau2', (100, 0, 1.0), title='Tau2;Tau2;', ),
201  HistoSpec('Tau3', (100, 0, 1.0), title='Tau3;Tau3;', ),
202  HistoSpec('Tau21', (100, 0, 1.0), title='Tau21;Tau21;', ),
203  HistoSpec('Tau32', (100, 0, 1.0), title='Tau32;Tau32;', ),
204  HistoSpec('Tau1_wta', (100, 0, 1.0), title='Tau1_wta;Tau1_wta;', ),
205  HistoSpec('Tau3_wta', (100, 0, 1.0), title='Tau3_wta;Tau3_wta;', ),
206  HistoSpec('Tau2_wta', (100, 0, 1.0), title='Tau2_wta;Tau2_wta;', ),
207  HistoSpec('Tau21_wta', (100, 0, 1.0), title='Tau21_wta;Tau21_wta;', ),
208  HistoSpec('Tau32_wta', (100, 0, 1.0), title='Tau32_wta;Tau32_wta;', ),
209 
210  HistoSpec('Charge', (100, -2, 2), title='Charge;Charge;', ),
211 
212  HistoSpec('DetectorEta', (100,-5,5), title='DetectorEta;Detector #eta;Entries' ),
213  HistoSpec('ActiveArea', (80,0,0.8), title='ActiveArea;Active Area;Entries' ),
214  HistoSpec('ActiveArea15', (80, 0, 1.5), title='Active Area;Active Area;Entries', xvar='ActiveArea'),
215 
216  HistoSpec('PullPhi', (100, -6.3, 6.3), title='PullPhi;PullPhi;', ),
217  HistoSpec('PullMag', (100, 0, 100), title='PullMag;PullMag;', ),
218  HistoSpec('Pull_C10', (100, -1, 1), title='Pull_C10;Pull_C10;', ),
219  HistoSpec('Pull_C11', (100, -1, 1), title='Pull_C11;Pull_C11;', ),
220  HistoSpec('Pull_C01', (100, -1, 1), title='Pull_C01;Pull_C01;', ),
221  HistoSpec('Pull_C00', (100, -1, 1), title='Pull_C00;Pull_C00;', ),
222 
223  HistoSpec('ShowerDeconstructionW', (100, -100, 100), title='ShowerDeconstructionW;ShowerDeconstructionW;', ),
224  HistoSpec('ShowerDeconstructionTop', (100, -100, 100), title='ShowerDeconstructionTop;ShowerDeconstructionTop;', ),
225 
226 
227  HistoSpec( 'JetConstitScaleMomentum_eta', (50,-5,5) , title='ConstitScale #eta;ConstitScale #eta;Entries'),
228  HistoSpec( 'JetConstitScaleMomentum_phi', (50,-3.3,3.3) , title='ConstitScale #phi;ConstitScale #phi;Entries'),
229  HistoSpec( 'JetConstitScaleMomentum_pt:GeV', (200,0,800) , title='ConstitScale p_{T};ConstitScale p_{T} [GeV];Entries'),
230  HistoSpec( 'JetConstitScaleMomentum_m:GeV', (100,0,300) , title='ConstitScale mass;ConstitScale mass [GeV];Entries'),
231 
232  HistoSpec( 'JetEMScaleMomentum_eta', (50,-5,5) , title='EMScale #eta;EMScale #eta;Entries'),
233  HistoSpec( 'JetEMScaleMomentum_phi', (50,-3.3,3.3) , title='EMScale #phi;EMScale #phi;Entries'),
234  HistoSpec( 'JetEMScaleMomentum_pt:GeV', (200,0,800) , title='EMScale p_{T};EMScale p_{T} [GeV];Entries'),
235  HistoSpec( 'JetEMScaleMomentum_m:GeV', (100,0,300) , title='EMScale mass;EMScale mass [GeV];Entries'),
236 
237  HistoSpec( 'JetPileupScaleMomentum_eta', (50,-5,5) , title='PileupScale #eta;PileupScale #eta;Entries'),
238  HistoSpec( 'JetPileupScaleMomentum_phi', (50,-3.3,3.3) , title='PileupScale #phi;PileupScale #phi;Entries'),
239  HistoSpec( 'JetPileupScaleMomentum_pt:GeV', (200,0,800) , title='PileupScale p_{T};PileupScale p_{T} [GeV];Entries'),
240  HistoSpec( 'JetPileupScaleMomentum_m:GeV', (100,0,300) , title='PileupScale mass;PileupScale mass [GeV];Entries'),
241 
242  HistoSpec( 'JetEtaJESScaleMomentum_eta', (50,-5,5) , title='EtaJESScale #eta;EtaJESScale #eta;Entries'),
243  HistoSpec( 'JetEtaJESScaleMomentum_phi', (50,-3.3,3.3) , title='EtaJESScale #phi;EtaJESScale #phi;Entries'),
244  HistoSpec( 'JetEtaJESScaleMomentum_pt:GeV', (200,0,800) , title='EtaJESScale p_{T};EtaJESScale p_{T} [GeV];Entries'),
245  HistoSpec( 'JetEtaJESScaleMomentum_m:GeV', (100,0,300) , title='EtaJESScale mass;EtaJESScale mass [GeV];Entries'),
246  # ---------------------
247  # 2D histogram (x and y vars are separated by ';' )
248  HistoSpec( 'pt:GeV;m:GeV', (100,0,1000, 100,0,300) , title='mass vs p_{T};p_{T};mass [GeV];'),
249 
250 ]
251 
252 
253 # ---------------------
254 # Below we add specifications for custom monitoring tools used to create histograms not drawable from simple attribute/variables.
255 # We rely on the generic 'ToolSpec' dictionnary.
256 # Format is: ToolSpec('ToolClassName', 'toolName', defineHistoFunc=aFunction , ...properties...) where
257 # - defineHistoFunc is mandatory. It must be a function with signature similar as HistoSpec.defineHisto
258 # and dedicated to define histograms as in standard monitoring configuration.
259 # - properties are properties of the 'ToolClassName'. They will be transfered to the c++
260 # instance. If a property is itself a tool, it can be specified as a ToolSpec.
261 #
262 
263 # -- JetHistoLeadingJetsRelations specification
264 # The python helper defining the histograms using the monitoring framework :
265 def defineHistoForLeadingJets(conf, parentAlg, monhelper, path):
266 
267  # helpfor that generates the monitoring group#
268  group = monhelper.addGroup(parentAlg, conf.Group, f'Jets/{parentAlg.JetContainerName}')
269  path = 'standardHistos'
270  group.defineHistogram('dEta;leadJetsDEta', path=path, xbins=100, xmin=-5, xmax=5)
271  group.defineHistogram('dPhi;leadJetsDPhi', path=path, xbins=100, xmin=-3, xmax=3)
272  group.defineHistogram('dR;leadJetsDR', path=path, xbins=100, xmin=0, xmax=10)
273 
274 
275 # Add the specifications
276 _knownHistos += [
277  ToolSpec('JetHistoLeadingJetsRelations', 'leadingJetsRel', defineHistoFunc=defineHistoForLeadingJets, Group='LeadingJetGroup',)
278 ]
279 
280 
281 
282 
283 # -- JetHistoResponseAndEff specification
284 # this tools allows to plot a fixed set of efficiency and response histos vs truth (or any other reference container).
285 # The python helper defining the histograms using the monitoring framework :
286 def defineHistoForRespAndEff(conf, parentAlg, monhelper , path):
287  # create a monitoring group with the histo path starting from the parentAlg
288  group = monhelper.addGroup(parentAlg, conf.Group, f'Jets/{parentAlg.JetContainerName}')
289  path = 'standardHistos'
290  # define the histogram
291  group.defineHistogram('passDr1,refPt;efficiencyR1',title='Passing deltaR<0.1', type="TEfficiency", path=path, xbins=100 , xmin=0, xmax=4000. ,)
292  group.defineHistogram('passDr2,refPt;efficiencyR2',title='Passing deltaR<0.2', type="TEfficiency", path=path, xbins=100 , xmin=0, xmax=4000. ,)
293  group.defineHistogram('passDr3,refPt;efficiencyR3',title='Passing deltaR<0.3', type="TEfficiency", path=path, xbins=100 , xmin=0, xmax=4000. ,)
294  group.defineHistogram('relDiff',title='pT relative Diff', type="TH1F", path=path, xbins=100 , xmin=-2, xmax=2. ,)
295  group.defineHistogram('refEta,relDiff',title='pT relative Diff vs Eta', type="TH2F", path=path, xbins=60 , xmin=-5, xmax=5., ybins=60 , ymin=-2, ymax=2. ,)
296  group.defineHistogram('refPt,relDiff',title='pT relative Diff vs pT', type="TH2F", path=path, xbins=60 , xmin=0, xmax=5000., ybins=60 , ymin=-2, ymax=2. ,)
297 
298 _knownHistos += [
299  ToolSpec('JetHistoResponseAndEff', 'respVsAntiKt4Truth', defineHistoFunc=defineHistoForRespAndEff, Group='AntiK4TruthRespGroup', RefContainerName="AntiKt4TruthJets", EnergyScale=1./SystemOfUnits.GeV),
300  ToolSpec('JetHistoResponseAndEff', 'respVsAntiKt10TruthTrim', defineHistoFunc=defineHistoForRespAndEff, Group='AntiK10TruthTrimRespGroup', RefContainerName="AntiKt10TruthTrimmedPtFrac5SmallR20Jets", EnergyScale=1./SystemOfUnits.GeV),
301 ]
302 # purely for convenience we add a map of JetContainer name -> JetHistoResponseAndEff spec
303 responseAndEffSpecMap = dict(
304  AntiKt4TruthJets = 'respVsAntiKt4Truth',
305  AntiKt10TruthTrimmedPtFrac5SmallR20Jets = 'respVsAntiKt10TruthTrim',
306  )
307 
308 
309 
310 
311 # --
312 knownHistos = ConfigDict( )
313 # convert the list into a dictionnary indexed by spec name
314 for h in _knownHistos:
315  knownHistos[h.name] = h
316 
317 
318 
319 
320 
321 # **********************************************************
322 # commented out example of a defineHistoFunc suitable for custom tool specifications
323 # def defineHistoForHistoPtTool(conf, parentAlg, monhelper , path):
324 # group = monhelper.addGroup(parentAlg, conf.Group, parentAlg.JetContainerName+'/')
325 
326 # group.defineHistogram('jetPt', path='TestPtTool', xbins=100, xmin=0, xmax=160)
327 
328 
329 # ***************************************
330 # The list of known JetSelectorTool
331 #from JetSelectorTools.JetSelectorToolsConf import JetCleaningTool
332 knownSelector = dict(
333  LooseBad = ToolSpec('JetCleaningTool' , "LooseBadJets" , CutLevel = "LooseBad")
334 )
335