ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaMonitorAnalysisAlgorithm.cxx
Go to the documentation of this file.
1
2
5
6
7
8TrigEgammaMonitorAnalysisAlgorithm::TrigEgammaMonitorAnalysisAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ):
9 TrigEgammaMonitorBaseAlgorithm( name, pSvcLocator )
10
11{}
12
15
16
18{
19 ATH_MSG_INFO("TrigEgammaMonitorAnalysisAlgorithm::initialize()...");
21
22 return StatusCode::SUCCESS;
23}
24
25
26// *********************************************************************************
27
28
29
30void TrigEgammaMonitorAnalysisAlgorithm::fillLabel( const ToolHandle<GenericMonitoringTool>& groupHandle,
31 const std::string &histname,
32 const std::string &label ) const
33{
34 auto mon = Monitored::Scalar<std::string>( histname, label );
35 fill( groupHandle, mon );
36}
37
38
39
40// *********************************************************************************
41
43 const std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >>& pairObjs,
44 const TrigInfo& info, const bool onlyHLT ) const
45{
46
47 std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >> pair_vec;
48 std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >> pair_iso_vec;
49
50 std::vector<asg::AcceptData> accept_vec;
51 std::vector<asg::AcceptData> accept_iso_vec;
52
53 std::vector<asg::AcceptData> emu_accept_vec;
54 std::vector<asg::AcceptData> emu_accept_iso_vec;
55
56 ATH_MSG_DEBUG("Inside fillEfficiencies: pairObject which is passed to function is: " << pairObjs.size());
57
58 for( auto pairObj : pairObjs ){
59
60 ATH_MSG_DEBUG("Print decision = " << pairObj.second);
61 if(pairObj.first->type()==xAOD::Type::Electron){
62 auto passBits=tdt()->isPassedBits(info.trigger);
63 if(!((passBits & TrigDefs::L1_isPassedAfterVeto) && ((passBits & TrigDefs::EF_prescaled)==0))){
64 ATH_MSG_DEBUG("Prescaled trigger: " << info.trigger << " Skipping to normalize efficiencies");
65 continue;
66 }
67 const xAOD::Electron* el = static_cast<const xAOD::Electron *> (pairObj.first);
68 float et = getEt(el)/Gaudi::Units::GeV;
69 if(et < info.etthr-5.0) continue;
70
71 }else if(pairObj.first->type()==xAOD::Type::Photon){
72 ATH_MSG_DEBUG("FILL EFFICIENCY IS LOOKING AT PHOTONS");
73 float et = getCluster_et(pairObj.first)/Gaudi::Units::GeV;
74 ATH_MSG_DEBUG("raw cluster et (MeV?) = " << getCluster_et(pairObj.first));
75 ATH_MSG_DEBUG("et: " << et);
76 ATH_MSG_DEBUG("info.etthr: " << info.etthr);
77 if(et < info.etthr-5.0) continue;
78
79 // Applying FixedCutLoose isolation on the offline photon as recommended in the twiki:
80 // https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/IsolationSelectionTool#Photons
81 bool pass_CaloIso = getIsolation_topoetcone20(pairObj.first)/getCluster_et(pairObj.first) < 0.065;
82 bool pass_trkIso = getIsolation_ptcone20(pairObj.first)/getCluster_et(pairObj.first) < 0.05;
83
84 ATH_MSG_DEBUG(" pass_CaloIso :" << pass_CaloIso );
85 ATH_MSG_DEBUG(" pass_trkIso :" << pass_trkIso );
86
87 if (!pass_CaloIso || !pass_trkIso){
88 ATH_MSG_DEBUG("Did not passed FixedCutLoose offline isolationFixedCutLoose offline isolation");
89 continue; // pass FixedCutLoose offline isolation
90
91 }
92 } // Offline photon
93
94
95 // Good pair to be measure
96 if(m_doEmulation){ // Emulation
97 bool valid=false;
98 auto acceptData = m_emulatorTool->emulate( pairObj.second, info.trigger , valid);
99 // skip this probe since the emulation is not possible. Avoid diff denominators between emulation and efficiecy
100 if(!valid) {
101 ATH_MSG_DEBUG("Emulation fail. Skip this probe...");
102 continue;
103 }
104 emu_accept_vec.push_back( acceptData );
105 static const SG::Decorator<bool> IsolatedDec("Isolated");
106 if( IsolatedDec(*pairObj.first) ){
107 emu_accept_iso_vec.push_back(acceptData);
108 }
109 }
110
111 // Good pair to be measure
112 { // Efficiency
113 pair_vec.push_back(pairObj);
114 auto acceptData = setAccept( pairObj.second, info, onlyHLT );
115 accept_vec.push_back(acceptData);
116 static const SG::Decorator<bool> IsolatedDec("Isolated");
117 if( IsolatedDec(*pairObj.first) ){
118 pair_iso_vec.push_back(pairObj);
119 accept_iso_vec.push_back(acceptData);
120 }
121 }
122
123
124 }
125
126 std::string dirname= "Efficiency";
127 std::string l2step = "FastElectron";
128 if( info.signature == "Electron" or info.signature == "e" ){
129 l2step = "FastElectron";
130 }else if( info.signature == "Photon" or info.signature == "g" ){
131 l2step = "FastPhoton";
132 }
133 fillEfficiency(ctx, "L1Calo" , "L1Calo" , info.pidname, info, pair_vec , accept_vec, dirname);
134 fillEfficiency(ctx, "FastCalo" , "L2Calo" , info.pidname, info, pair_vec , accept_vec, dirname);
135 fillEfficiency(ctx, l2step , "L2" , info.pidname, info, pair_vec , accept_vec, dirname);
136 fillEfficiency(ctx, "PrecisionCalo" , "EFCalo" , info.pidname, info, pair_vec , accept_vec, dirname);
137 fillEfficiency(ctx, "HLT" , "HLT" , info.pidname, info, pair_vec , accept_vec, dirname);
138
139 ATH_MSG_DEBUG("THE SIZE OF PAIR_VEC IS: " << pair_vec.size());
140 ATH_MSG_DEBUG("THE SIZE OF accept_VEC IS: " << accept_vec.size());
141 ATH_MSG_DEBUG("INFO.PIDNAME: " << info.pidname);
142
143
144 if( m_detailedHists ){
145 for( const auto& pid : m_isemname ){
146 fillEfficiency(ctx, "HLT_" + pid, "HLT", pid, info, pair_vec , accept_vec, dirname);
147 fillEfficiency(ctx, "HLT_" + pid + "Iso", "HLT", pid, info, pair_iso_vec, accept_iso_vec, dirname );
148 }
149 for( const auto& pid : m_lhname ){
150 fillEfficiency(ctx, "HLT_" + pid, "HLT", pid, info, pair_vec, accept_vec, dirname );
151 fillEfficiency(ctx, "HLT_" + pid + "Iso", "HLT", pid, info, pair_iso_vec, accept_iso_vec, dirname );
152 }
153 }
154
155 // Fill emulator efficiency plots
156 if ( m_doEmulation ){
157 dirname= "Emulation";
158 fillEfficiency(ctx, "L1Calo" , "L1Calo" , info.pidname, info, pair_vec , emu_accept_vec, dirname);
159 fillEfficiency(ctx, "FastCalo" , "L2Calo" , info.pidname, info, pair_vec , emu_accept_vec, dirname);
160 fillEfficiency(ctx, l2step , "L2" , info.pidname, info, pair_vec , emu_accept_vec, dirname);
161 fillEfficiency(ctx, "PrecisionCalo" , "EFCalo" , info.pidname, info, pair_vec , emu_accept_vec, dirname);
162 fillEfficiency(ctx, "HLT" , "HLT" , info.pidname, info, pair_vec , emu_accept_vec, dirname);
163 }
164
165 // Fill Inefficiencies
166 fillInefficiency( info.pidname, info, pair_vec , accept_vec);
167
168}
169
170// *********************************************************************************
171
172
174 const std::string &subgroup,
175 const std::string &level,
176 const std::string &pidword,
177 const TrigInfo& info,
178 const std::vector< std::pair< const xAOD::Egamma *,
179 const TrigCompositeUtils::Decision* >>& pairObjs,
180 const std::vector< asg::AcceptData >& acceptObjs ,
181 const std::string& dirname ) const
182{
183 const float etthr = info.etthr;
184 const std::string trigger = info.trigger;
185 auto monGroup = getGroup( trigger + "_"+dirname+"_" + subgroup );
186
187 std::vector<float> et_vec, highet_vec, pt_vec, eta_vec, phi_vec, avgmu_vec, npvtx_vec,et_slice0_vec,et_slice1_vec,et_slice2_vec,et_slice3_vec, ptvarcone20rel_vec, ptvarcone30rel_vec, z0_vec, d0_vec;
188 std::vector<float> match_et_vec, match_highet_vec, match_pt_vec, match_eta_vec, match_phi_vec, match_avgmu_vec, match_npvtx_vec, match_ptvarcone20rel_vec, match_ptvarcone30rel_vec, match_z0_vec, match_d0_vec;
189 std::vector<bool> et_passed_vec, et_failed_vec, highet_passed_vec, highet_failed_vec, pt_passed_vec, eta_passed_vec, eta_failed_vec, phi_passed_vec, avgmu_passed_vec, npvtx_passed_vec;
190 std::vector<bool> ptvarcone20rel_passed_vec, ptvarcone30rel_passed_vec, z0_passed_vec, d0_passed_vec;
191 std::vector<bool> et_slice0_passed_vec,et_slice1_passed_vec,et_slice2_passed_vec,et_slice3_passed_vec;
192
193 auto et_col = Monitored::Collection( "et" , et_vec );
194 auto highet_col = Monitored::Collection( "highet" , highet_vec );
195 auto pt_col = Monitored::Collection( "pt" , pt_vec );
196 auto eta_col = Monitored::Collection( "eta" , eta_vec );
197 auto phi_col = Monitored::Collection( "phi" , phi_vec );
198 auto avgmu_col = Monitored::Collection( "avgmu" , avgmu_vec );
199 auto npvtx_col = Monitored::Collection( "npvtx" , npvtx_vec );
200 auto ptvarcone20rel_col = Monitored::Collection( "ptvarcone20rel" , ptvarcone20rel_vec );
201 auto ptvarcone30rel_col = Monitored::Collection( "ptvarcone30rel" , ptvarcone30rel_vec );
202
203 auto z0_col = Monitored::Collection( "z0" , z0_vec );
204 auto d0_col = Monitored::Collection( "d0" , d0_vec );
205
206 auto match_et_col = Monitored::Collection( "match_et" , match_et_vec );
207 auto match_highet_col = Monitored::Collection( "match_ethigh" , match_highet_vec );
208 auto match_pt_col = Monitored::Collection( "match_pt" , match_pt_vec );
209 auto match_eta_col = Monitored::Collection( "match_eta" , match_eta_vec );
210 auto match_phi_col = Monitored::Collection( "match_phi" , match_phi_vec );
211 auto match_avgmu_col = Monitored::Collection( "match_avgmu" , match_avgmu_vec );
212 auto match_npvtx_col = Monitored::Collection( "match_npvtx" , match_npvtx_vec );
213 auto match_ptvarcone20rel_col = Monitored::Collection( "match_ptvarcone20rel" , match_ptvarcone20rel_vec );
214 auto match_ptvarcone30rel_col = Monitored::Collection( "match_ptvarcone30rel" , match_ptvarcone30rel_vec );
215
216 auto match_z0_col = Monitored::Collection( "match_z0" , match_z0_vec );
217 auto match_d0_col = Monitored::Collection( "match_d0" , match_d0_vec );
218
219 auto et_passed_col = Monitored::Collection( "et_passed" , et_passed_vec );
220 auto et_failed_col = Monitored::Collection( "et_failed" , et_failed_vec );
221 auto highet_passed_col = Monitored::Collection( "highet_passed" , highet_passed_vec );
222 auto highet_failed_col = Monitored::Collection( "highet_failed" , highet_failed_vec );
223 auto pt_passed_col = Monitored::Collection( "pt_passed" , pt_passed_vec );
224 auto eta_passed_col = Monitored::Collection( "eta_passed" , eta_passed_vec );
225 auto eta_failed_col = Monitored::Collection( "eta_failed" , eta_failed_vec );
226 auto phi_passed_col = Monitored::Collection( "phi_passed" , phi_passed_vec );
227 auto avgmu_passed_col = Monitored::Collection( "avgmu_passed" , avgmu_passed_vec );
228 auto npvtx_passed_col = Monitored::Collection( "npvtx_passed" , npvtx_passed_vec );
229 auto ptvarcone20rel_passed_col = Monitored::Collection( "ptvarcone20rel_passed" , ptvarcone20rel_passed_vec );
230 auto ptvarcone30rel_passed_col = Monitored::Collection( "ptvarcone30rel_passed" , ptvarcone30rel_passed_vec );
231
232 auto z0_passed_col = Monitored::Collection( "z0_passed" , z0_passed_vec );
233 auto d0_passed_col = Monitored::Collection( "d0_passed" , d0_passed_vec );
234
235 // For ET efficiency analysis in eta slices
236 auto et_slice0_col = Monitored::Collection( "et_slice0" , et_slice0_vec );
237 auto et_slice1_col = Monitored::Collection( "et_slice1" , et_slice1_vec );
238 auto et_slice2_col = Monitored::Collection( "et_slice2" , et_slice2_vec );
239 auto et_slice3_col = Monitored::Collection( "et_slice3" , et_slice3_vec );
240
241 auto et_slice0_passed_col = Monitored::Collection( "et_slice0_passed" , et_slice0_passed_vec );
242 auto et_slice1_passed_col = Monitored::Collection( "et_slice1_passed" , et_slice1_passed_vec );
243 auto et_slice2_passed_col = Monitored::Collection( "et_slice2_passed" , et_slice2_passed_vec );
244 auto et_slice3_passed_col = Monitored::Collection( "et_slice3_passed" , et_slice3_passed_vec );
245
246 unsigned iObj=0;
247
248 SG::Decorator<bool> pidwordDec("is"+pidword);
249 for( auto pairObj : pairObjs ){
250
251 bool pid=true;
252 bool isPassed = acceptObjs[iObj].getCutResult( level );
253 float et=0.;
254 float ptvarcone20rel = -99.0;
255 float ptvarcone30rel = -99.0;
256 float z0 = -99.0;
257 float d0 = -99.0;
258 const auto *eg = pairObj.first;
259 ATH_MSG_DEBUG("Default pid " << pid << " te " << isPassed);
261 ATH_MSG_DEBUG("Offline Electron with pidword " << pidword);
262 const xAOD::Electron* el =static_cast<const xAOD::Electron*> (eg);
263 pid=pidwordDec(*el);
264 ATH_MSG_DEBUG("Electron pid " << pid);
265 et = getEt(el)/Gaudi::Units::GeV;
266 if (el->pt() > 0) {
267 ptvarcone20rel = getIsolation_ptvarcone20(el)/el->pt();
268 ptvarcone30rel = getIsolation_ptvarcone30(el)/el->pt();
269 }
270 z0 = getTrack_z0(el);
271 d0 = getTrack_d0(el);
272 }
273 else et=eg->caloCluster()->et()/Gaudi::Units::GeV;
274
275 float eta = eg->caloCluster()->etaBE(2);
276 float phi = eg->phi();
277 float pt = eg->pt()/Gaudi::Units::GeV;
278 float avgmu=lbAverageInteractionsPerCrossing( ctx );
279 float npvtx=0.0;
280
281 ATH_MSG_DEBUG("PID decision efficiency " << pidwordDec(*eg));
282
283 if(pid){
284 et_vec.push_back( et );
285 pt_vec.push_back( pt );
286 highet_vec.push_back( et );
287
288 if(et > etthr+1.0){
289 eta_vec.push_back(eta);
290 phi_vec.push_back(phi);
291 avgmu_vec.push_back(avgmu);
292 npvtx_vec.push_back(npvtx);
293 ptvarcone20rel_vec.push_back(ptvarcone20rel);
294 ptvarcone30rel_vec.push_back(ptvarcone30rel);
295 z0_vec.push_back(z0);
296 d0_vec.push_back(d0);
297 }
298
299 if(abs(eta)<=0.8){
300 et_slice0_vec.push_back(et);
301 }else if( abs(eta) > 0.80 && abs(eta) <= 1.37 ){
302 et_slice1_vec.push_back(et);
303 }else if( abs(eta) > 1.37 && abs(eta) <= 1.54 ){
304 et_slice2_vec.push_back(et);
305 }else if( abs(eta) > 1.54 && abs(eta) <= 2.50 ){
306 et_slice3_vec.push_back(et);
307 }
308
309 if(isPassed) {
310 match_et_vec.push_back( et );
311 match_pt_vec.push_back( pt );
312 match_highet_vec.push_back( et );
313
314 if(et > etthr+1.0){
315 match_eta_vec.push_back(eta);
316 match_phi_vec.push_back(phi);
317 match_avgmu_vec.push_back(avgmu);
318 match_npvtx_vec.push_back(npvtx);
319 match_ptvarcone20rel_vec.push_back(ptvarcone20rel);
320 match_ptvarcone30rel_vec.push_back(ptvarcone30rel);
321 match_z0_vec.push_back(z0);
322 match_d0_vec.push_back(d0);
323 }
324
325 et_passed_vec.push_back( true );
326 et_failed_vec.push_back( false );
327 pt_passed_vec.push_back( true );
328 highet_passed_vec.push_back( true );
329 highet_failed_vec.push_back( false );
330
331 if(abs(eta)<=0.8){
332 et_slice0_passed_vec.push_back(true);
333 }else if( abs(eta) > 0.80 && abs(eta) <= 1.37 ){
334 et_slice1_passed_vec.push_back(true);
335 }else if( abs(eta) > 1.37 && abs(eta) <= 1.54 ){
336 et_slice2_passed_vec.push_back(true);
337 }else if( abs(eta) > 1.54 && abs(eta) <= 2.50 ){
338 et_slice3_passed_vec.push_back(true);
339 }
340
341 if(et > etthr+1.0){
342 eta_passed_vec.push_back( true );
343 eta_failed_vec.push_back( false );
344 phi_passed_vec.push_back( true );
345 avgmu_passed_vec.push_back( true );
346 npvtx_passed_vec.push_back( true );
347 ptvarcone20rel_passed_vec.push_back( true );
348 ptvarcone30rel_passed_vec.push_back( true );
349 z0_passed_vec.push_back( true );
350 d0_passed_vec.push_back( true );
351 }
352 } // Passes Trigger selection
353 else {
354
355 et_passed_vec.push_back( false );
356 et_failed_vec.push_back( true );
357 pt_passed_vec.push_back( false );
358 highet_passed_vec.push_back( false );
359 highet_failed_vec.push_back( true );
360
361 if(abs(eta)<=0.8){
362 et_slice0_passed_vec.push_back(false);
363 }else if( abs(eta) > 0.80 && abs(eta) <= 1.37 ){
364 et_slice1_passed_vec.push_back(false);
365 }else if( abs(eta) > 1.37 && abs(eta) <= 1.54 ){
366 et_slice2_passed_vec.push_back(false);
367 }else if( abs(eta) > 1.54 && abs(eta) <= 2.50 ){
368 et_slice3_passed_vec.push_back(false);
369 }
370
371 if(et > etthr+1.0){
372 eta_passed_vec.push_back( false );
373 eta_failed_vec.push_back( true );
374 phi_passed_vec.push_back( false );
375 avgmu_passed_vec.push_back( false );
376 npvtx_passed_vec.push_back( false );
377 ptvarcone20rel_passed_vec.push_back( false );
378 ptvarcone30rel_passed_vec.push_back( false );
379 z0_passed_vec.push_back( false );
380 d0_passed_vec.push_back( false );
381 }
382 } // Fails Trigger selection
383
384 } // Passes offline pid, fill histograms
385 iObj++;
386 }
387
388 fill( monGroup, et_col, highet_col, pt_col, eta_col, phi_col, avgmu_col, npvtx_col, ptvarcone20rel_col, ptvarcone30rel_col, z0_col, d0_col,
389 match_et_col, match_highet_col, match_pt_col, match_eta_col, match_phi_col, match_avgmu_col, match_npvtx_col, match_ptvarcone20rel_col, match_ptvarcone30rel_col,match_z0_col,match_d0_col,
390 et_passed_col, et_failed_col, highet_passed_col, highet_failed_col, pt_passed_col, eta_passed_col, eta_failed_col, phi_passed_col, avgmu_passed_col, npvtx_passed_col, ptvarcone20rel_passed_col, ptvarcone30rel_passed_col, z0_passed_col, d0_passed_col,
391 et_slice0_col,et_slice1_col,et_slice2_col,et_slice3_col,et_slice0_passed_col,et_slice1_passed_col,et_slice2_passed_col,et_slice3_passed_col);
392
393}
394// *********************************************************************************
395
396
398 const TrigInfo& info,
399 const std::vector< std::pair< const xAOD::Egamma *,
400 const TrigCompositeUtils::Decision* >>& pairObjs,
401 const std::vector< asg::AcceptData >& acceptObjs ) const
402{
403 auto monGroup = getGroup(info.trigger+"_Inefficiency");
404 unsigned iObj=0;
405 SG::Decorator<bool> pidwordDec("is"+pidword);
406 for( auto pairObj : pairObjs ){
407
408 bool pid=true;
409 bool isPassedL1Calo = acceptObjs[iObj].getCutResult( "L1Calo");
410 bool isPassedL2Calo = acceptObjs[iObj].getCutResult( "L2Calo");
411 bool isPassedL2 = acceptObjs[iObj].getCutResult( "L2" );
412 bool isPassedEFCalo = acceptObjs[iObj].getCutResult( "EFCalo");
413 bool isPassedHLT = acceptObjs[iObj].getCutResult( "HLT" );
414
415 const auto *eg = pairObj.first;
417 ATH_MSG_DEBUG("Offline Electron with pidword " << pidword);
418 const xAOD::Electron* el =static_cast<const xAOD::Electron*> (eg);
419 pid=pidwordDec(*el);
420 ATH_MSG_DEBUG("Electron pid " << pid);
421 }
422 if(pid){
423 if(!isPassedL1Calo){
424 fillLabel(monGroup, "InefficiencyCounts", "L1Calo" );
425 }if(!isPassedL2Calo){
426 fillLabel(monGroup, "InefficiencyCounts", "L2Calo" );
427 }if(!isPassedL2){
428 fillLabel(monGroup, "InefficiencyCounts", "L2" );
429 }if(!isPassedEFCalo){
430 fillLabel(monGroup, "InefficiencyCounts", "EFCalo" );
431 }if(!isPassedHLT){
432 fillLabel(monGroup, "InefficiencyCounts", "HLT" );
433 }
434 }
435 iObj++;
436 }
437}
438
439
440void TrigEgammaMonitorAnalysisAlgorithm::fillDistributions( const EventContext& ctx, const std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >>& pairObjs,
441 const TrigInfo& info ) const
442{
443
444 const std::string trigger = info.trigger;
445
446 unsigned int condition=TrigDefs::Physics;
447
448 // Offline
449 std::vector<const xAOD::Egamma*> eg_vec;
450 std::vector<const xAOD::Electron*> el_vec;
451 for( auto pairObj: pairObjs )
452 {
453 eg_vec.push_back(pairObj.first);
454 if( xAOD::EgammaHelpers::isElectron(pairObj.first)){
455 const xAOD::Electron* elOff = static_cast<const xAOD::Electron*> (pairObj.first);
456 el_vec.push_back(elOff);
457 }
458 }
459
460 // Offline
461 fillShowerShapes( trigger, eg_vec, false );
462 fillTracking( ctx, trigger, el_vec, false );
463
464 // L1Calo
465 {
466 // Fill L1 features
467 auto initRois = tdt()->features<TrigRoiDescriptorCollection>(trigger,condition,"",TrigDefs::allFeaturesOfType,"initialRoI");
468
469 if (info.L1Legacy){
470 std::vector<const xAOD::EmTauRoI*> l1_vec;
471 for( auto &initRoi: initRois ){
472 if( !initRoi.link.isValid() ) continue;
473 const auto *feat = match()->getL1Feature( initRoi.source );
474 if(feat) l1_vec.push_back(feat);
475 }
476 fillL1Calo( trigger, l1_vec );
477 }else{
478 std::vector<const xAOD::eFexEMRoI*> l1_vec;
479 for( auto &initRoi: initRois ){
480 if( !initRoi.link.isValid() ) continue;
481 const auto *feat = match()->getL1eEMFeature( initRoi.source );
482 if(feat) l1_vec.push_back(feat);
483 }
484 fillL1eEM( trigger, l1_vec );
485 }
486
487 }
488
489
490 // L2Calo
491 {
492 std::vector<const xAOD::TrigEMCluster*> emCluster_vec;
493 auto vec = tdt()->features<xAOD::TrigEMClusterContainer>(trigger,condition ,match()->key("FastCalo") );
494 for(auto &featLinkInfo : vec ){
495 if(! featLinkInfo.isValid() ) continue;
496 const auto *feat = *(featLinkInfo.link);
497 if(!feat) continue;
498 emCluster_vec.push_back(feat);
499 }
500 fillL2Calo( trigger, emCluster_vec );
501 }
502 // EFCalo
503 {
504 std::string key = match()->key("PrecisionCalo_Electron");
505 if(info.signature == "Photon" or info.signature == "g") key = match()->key("PrecisionCalo_Photon");
506 if(info.lrt) key = match()->key("PrecisionCalo_LRT");
507 if(info.ion) key = match()->key("PrecisionCalo_HI");
508
509 std::vector<const xAOD::CaloCluster* > clus_vec;
510 auto vec = tdt()->features<xAOD::CaloClusterContainer>(trigger,condition,key);
511 for(auto &featLinkInfo : vec ){
512 if(! featLinkInfo.isValid() ) continue;
513 const auto *feat = *(featLinkInfo.link);
514 if(!feat) continue;
515 clus_vec.push_back(feat);
516 }
517 fillEFCalo( trigger, clus_vec );
518 }
519
520 if ( info.signature == "Electron" or info.signature == "e" ){
521
522 // L2 Electron
523 {
524 std::string key = match()->key("FastElectrons");
525 if(info.lrt) key = match()->key("FastElectrons_LRT");
526
527 std::vector<const xAOD::TrigElectron*> el_vec;
528 // Get only passed objects
529 auto vec = tdt()->features<xAOD::TrigElectronContainer>(trigger,condition,key );
530 for( auto &featLinkInfo : vec ){
531 if(! featLinkInfo.isValid() ) continue;
532 const auto *feat = *(featLinkInfo.link);
533 if(!feat) continue;
534 el_vec.push_back(feat);
535 }
536 fillL2Electron( trigger, el_vec );
537 }
538 // HLT Electron
539 {
540 std::string key = match()->key("Electrons_GSF");
541 if(info.nogsf) key = match()->key("Electrons");
542 if(info.lrt) key = match()->key("Electrons_LRT");
543
544 std::vector<const xAOD::Electron*> el_vec;
545 std::vector<const xAOD::Egamma*> eg_vec;
546 auto vec = tdt()->features<xAOD::ElectronContainer>(trigger, condition ,key );
547 for( auto &featLinkInfo : vec ){
548 if(! featLinkInfo.isValid() ) continue;
549 const auto *feat = *(featLinkInfo.link);
550 if(!feat) continue;
551 el_vec.push_back(feat);
552 eg_vec.push_back(feat);
553 }
554 fillShowerShapes( trigger, eg_vec, true );
555 fillTracking( ctx, trigger, el_vec, true );
556 }
557 }else if ( info.signature == "Photon" or info.signature == "g"){
558 // Fast Photon
559 {
560 std::string key = match()->key("FastPhotons");
561 std::vector<const xAOD::TrigPhoton*> ph_vec;
562 // Get only passed objects
563 auto vec = tdt()->features<xAOD::TrigPhotonContainer>(trigger,condition,key );
564 for( auto &featLinkInfo : vec ){
565 if(! featLinkInfo.isValid() ) continue;
566 const auto *feat = *(featLinkInfo.link);
567 if(!feat) continue;
568 ph_vec.push_back(feat);
569 }
570 fillL2Photon( trigger, ph_vec );
571 }
572
573 // HLT Photon
574 {
575 std::vector<const xAOD::Egamma*> ph_vec;
576 auto vec = tdt()->features<xAOD::PhotonContainer>(trigger,condition ,match()->key("Photons") );
577 for( auto &featLinkInfo : vec ){
578 if(! featLinkInfo.isValid() ) continue;
579 const auto *feat = *(featLinkInfo.link);
580 if(!feat) continue;
581 ph_vec.push_back(feat);
582 }
583 fillShowerShapes( trigger, ph_vec, true );
584 }
585 }else{
586 ATH_MSG_INFO( "Chain type not specified" );
587 }
588
589}
590
591
592
593
594void TrigEgammaMonitorAnalysisAlgorithm::fillL1Calo( const std::string &trigger, const std::vector< const xAOD::EmTauRoI* >& l1_vec ) const
595{
596 auto monGroup = getGroup(trigger+"_Distributions_L1Calo");
597
598 std::vector<float> eta_vec, phi_vec, energy_vec, roi_et_vec, emIso_vec, hadCore_vec;
599
600 auto eta_col = Monitored::Collection( "eta" , eta_vec );
601 auto phi_col = Monitored::Collection( "phi" , phi_vec );
602 auto energy_col = Monitored::Collection( "energy" , energy_vec );
603 auto roi_et_col = Monitored::Collection( "roi_et" , roi_et_vec );
604 auto emIso_col = Monitored::Collection( "emIso" , emIso_vec );
605 auto hadCore_col = Monitored::Collection( "hadCore" , hadCore_vec );
606
607 for( const auto *l1 : l1_vec )
608 {
609 if(!l1) continue;
610 eta_vec.push_back( l1->eta() );
611 phi_vec.push_back( l1->phi() );
612 energy_vec.push_back( l1->emClus()/Gaudi::Units::GeV );
613 roi_et_vec.push_back( l1->eT()/Gaudi::Units::GeV );
614 emIso_vec.push_back( l1->emIsol()/Gaudi::Units::GeV );
615 hadCore_vec.push_back( l1->hadCore()/Gaudi::Units::GeV );
616 }
617
618 fill( monGroup, eta_col, phi_col, energy_col, roi_et_col, emIso_col, hadCore_col );
619
620}
621
622
623void TrigEgammaMonitorAnalysisAlgorithm::fillL1eEM( const std::string &trigger, const std::vector< const xAOD::eFexEMRoI* >& l1_vec ) const
624{
625 auto monGroup = getGroup(trigger+"_Distributions_L1Calo");
626
627 std::vector<float> eta_vec, phi_vec, et_vec, wstot_vec, reta_vec, rhad_vec;
628
629 auto et_col = Monitored::Collection( "et" , et_vec );
630 auto eta_col = Monitored::Collection( "eta" , eta_vec );
631 auto phi_col = Monitored::Collection( "phi" , phi_vec );
632 auto wstot_col = Monitored::Collection( "Wstot" , wstot_vec );
633 auto reta_col = Monitored::Collection( "Reta" , reta_vec );
634 auto rhad_col = Monitored::Collection( "Rhad" , rhad_vec );
635
636
637 for( const auto *l1 : l1_vec )
638 {
639 if(!l1) continue;
640 et_vec.push_back( l1->et()/Gaudi::Units::GeV );
641 eta_vec.push_back( l1->eta() );
642 phi_vec.push_back( l1->phi() );
643 wstot_vec.push_back( l1->Wstot() );
644 reta_vec.push_back( l1->Reta() );
645 rhad_vec.push_back( l1->Rhad() );
646 }
647
648 fill( monGroup, eta_col, phi_col, et_col, wstot_col, reta_col, rhad_col );
649
650}
651
652
653
654void TrigEgammaMonitorAnalysisAlgorithm::fillL2Calo(const std::string &trigger, const std::vector< const xAOD::TrigEMCluster *>& emCluster_vec) const
655{
656 auto monGroup = getGroup(trigger+"_Distributions_L2Calo");
657
658 std::vector<float> et_vec,highet_vec, eta_vec, phi_vec;
659
660 auto et_col = Monitored::Collection("et" , et_vec );
661 auto highet_col = Monitored::Collection("highet" , highet_vec );
662 auto eta_col = Monitored::Collection("eta", eta_vec );
663 auto phi_col = Monitored::Collection("phi", phi_vec );
664
665 for ( const auto *emCluster : emCluster_vec )
666 {
667 if(!emCluster) continue;
668 et_vec.push_back( emCluster->et()/Gaudi::Units::GeV );
669 highet_vec.push_back( emCluster->et()/Gaudi::Units::GeV );
670 eta_vec.push_back( emCluster->eta() );
671 phi_vec.push_back( emCluster->phi() );
672 }
673
674 fill( monGroup, et_col, eta_col, phi_col, highet_col );
675
676
677}
678
679
680
681void TrigEgammaMonitorAnalysisAlgorithm::fillL2Electron(const std::string &trigger, const std::vector< const xAOD::TrigElectron* >& el_vec) const
682{
683
684 auto monGroup = getGroup(trigger+"_Distributions_L2Electron");
685
686 std::vector<float> et_vec, eta_vec, phi_vec, highet_vec;
687
688 auto et_col = Monitored::Collection("et" , et_vec );
689 auto highet_col = Monitored::Collection("highet" , highet_vec );
690 auto eta_col = Monitored::Collection("eta", eta_vec );
691 auto phi_col = Monitored::Collection("phi", phi_vec );
692
693 for ( const auto *el : el_vec )
694 {
695 if(!el) continue;
696 et_vec.push_back( el->pt()/Gaudi::Units::GeV );
697 highet_vec.push_back( el->pt()/Gaudi::Units::GeV );
698 eta_vec.push_back( el->eta() );
699 phi_vec.push_back( el->phi() );
700 }
701
702 fill( monGroup, et_col, eta_col, phi_col, highet_col );
703}
704
705void TrigEgammaMonitorAnalysisAlgorithm::fillL2Photon(const std::string &trigger, const std::vector< const xAOD::TrigPhoton* >& ph_vec) const
706{
707
708 auto monGroup = getGroup(trigger+"_Distributions_L2Photon");
709
710 std::vector<float> et_vec, eta_vec, phi_vec, highet_vec;
711
712 auto et_col = Monitored::Collection("et" , et_vec );
713 auto highet_col = Monitored::Collection("highet" , highet_vec );
714 auto eta_col = Monitored::Collection("eta", eta_vec );
715 auto phi_col = Monitored::Collection("phi", phi_vec );
716
717 for ( const auto *ph : ph_vec )
718 {
719 if(!ph) continue;
720 et_vec.push_back( ph->pt()/Gaudi::Units::GeV );
721 highet_vec.push_back( ph->pt()/Gaudi::Units::GeV );
722 eta_vec.push_back( ph->eta() );
723 phi_vec.push_back( ph->phi() );
724 }
725
726 fill( monGroup, et_col, eta_col, phi_col, highet_col );
727}
728
729
730void TrigEgammaMonitorAnalysisAlgorithm::fillEFCalo(const std::string &trigger, const std::vector< const xAOD::CaloCluster*>& clus_vec) const
731{
732
733 auto monGroup = getGroup( trigger + "_Distributions_EFCalo" );
734
735
736 std::vector<float> energyBE0_vec, energyBE1_vec, energyBE2_vec, energyBE3_vec,
737 energy_vec, et_vec, eta_vec, phi_vec, eta_calo_vec, phi_calo_vec, highet_vec;
738
739
740
741 auto energyBE0_col = Monitored::Collection("energyBE0", energyBE0_vec);
742 auto energyBE1_col = Monitored::Collection("energyBE1", energyBE1_vec);
743 auto energyBE2_col = Monitored::Collection("energyBE2", energyBE2_vec);
744 auto energyBE3_col = Monitored::Collection("energyBE3", energyBE3_vec);
745 auto energy_col = Monitored::Collection("energy" , energy_vec );
746 auto et_col = Monitored::Collection("et" , et_vec );
747 auto highet_col = Monitored::Collection("highet" , highet_vec );
748 auto eta_col = Monitored::Collection("eta" , eta_vec );
749 auto phi_col = Monitored::Collection("phi" , phi_vec );
750 auto eta_calo_col = Monitored::Collection("eta_calo" , eta_calo_vec );
751 auto phi_calo_col = Monitored::Collection("phi_calo" , phi_calo_vec );
752
753 for ( const auto *clus : clus_vec )
754 {
755 double tmpeta = -999.;
756 if(!clus->retrieveMoment(xAOD::CaloCluster::ETACALOFRAME,tmpeta))
757 tmpeta=-999.;
758 double tmpphi = -999.;
759 if(!clus->retrieveMoment(xAOD::CaloCluster::PHICALOFRAME,tmpphi))
760 tmpphi=-999.;
761
762 energyBE0_vec.push_back( clus->energyBE(0)/Gaudi::Units::GeV );
763 energyBE1_vec.push_back( clus->energyBE(1)/Gaudi::Units::GeV );
764 energyBE2_vec.push_back( clus->energyBE(2)/Gaudi::Units::GeV );
765 energyBE3_vec.push_back( clus->energyBE(3)/Gaudi::Units::GeV );
766 energy_vec.push_back( clus->e()/Gaudi::Units::GeV );
767 et_vec.push_back( clus->et()/Gaudi::Units::GeV );
768 highet_vec.push_back( clus->et()/Gaudi::Units::GeV );
769 eta_vec.push_back( clus->eta() );
770 phi_vec.push_back( clus->phi() );
771 eta_calo_vec.push_back( tmpeta );
772 phi_calo_vec.push_back( tmpphi );
773
774 }
775
776
777 fill( monGroup, energyBE0_col, energyBE1_col, energyBE2_col, energyBE3_col,
778 energy_col, et_col, eta_col, phi_col, eta_calo_col, phi_calo_col, highet_col);
779}
780
781
782
783
784
785void TrigEgammaMonitorAnalysisAlgorithm::fillShowerShapes(const std::string &trigger, const std::vector<const xAOD::Egamma*>& eg_vec , bool online) const
786{
787
788 ATH_MSG_DEBUG("Fill SS distributions: " << trigger);
789 auto monGroup = getGroup( trigger + ( online ? "_Distributions_HLT" : "_Distributions_Offline") );
790
791 std::vector<float> Rhad_vec, Rhad1_vec, Reta_vec, Rphi_vec, weta1_vec, weta2_vec,
792 f1_vec, f3_vec, eratio_vec, et_vec, highet_vec , eta_vec, phi_vec, topoetcone20_vec, topoetcone40_shift_vec,
793 topoetcone20_rel_vec, topoetcone40_shift_rel_vec, ptvarcone20_rel_vec, pt_vec, mu_vec, pt_track_vec, z0_vec, res_etVsEt_vec, res_eprobht_vec, res_cnv_et_vec;
794
795 auto Rhad_col = Monitored::Collection("Rhad" , Rhad_vec );
796 auto Rhad1_col = Monitored::Collection("Rhad1" , Rhad1_vec );
797 auto Reta_col = Monitored::Collection("Reta" , Reta_vec );
798 auto Rphi_col = Monitored::Collection("Rphi" , Rphi_vec );
799 auto weta1_col = Monitored::Collection("weta1" , weta1_vec );
800 auto weta2_col = Monitored::Collection("weta2" , weta2_vec );
801 auto f1_col = Monitored::Collection("f1" , f1_vec );
802 auto f3_col = Monitored::Collection("f3" , f3_vec );
803 auto eratio_col = Monitored::Collection("eratio" , eratio_vec );
804 auto et_col = Monitored::Collection("et" , et_vec );
805 auto highet_col = Monitored::Collection("highet" , highet_vec );
806 auto eta_col = Monitored::Collection("eta" , eta_vec );
807 auto phi_col = Monitored::Collection("phi" , phi_vec );
808 auto topoetcone20_col = Monitored::Collection("topoetcone20", topoetcone20_vec);
809 auto topoetcone40_shift_col = Monitored::Collection("topoetcone40_shift", topoetcone40_shift_vec );
810 auto topoetcone20_rel_col = Monitored::Collection("topoetcone20_rel", topoetcone20_rel_vec);
811 auto topoetcone40_shift_rel_col = Monitored::Collection("topoetcone40_shift_rel", topoetcone40_shift_rel_vec );
812 auto ptvarcone20_rel_col = Monitored::Collection("ptvarcone20_rel", ptvarcone20_rel_vec );
813 auto pt_col = Monitored::Collection("pt", pt_vec );
814 auto mu_col = Monitored::Collection("mu", mu_vec );
815 auto pt_track_col = Monitored::Collection("pt_track", pt_track_vec );
816 auto z0_col = Monitored::Collection("z0", z0_vec );
817 auto res_etVsEt_col = Monitored::Collection("res_etVsEt", res_etVsEt_vec );
818 auto res_eprobht_col = Monitored::Collection("res_eprobht", res_eprobht_vec );
819 auto res_cnv_et_col = Monitored::Collection("res_cnv_et", res_cnv_et_vec );
820
821 for ( const auto *eg : eg_vec ){
822
823 if(!eg) continue;
824
825 Rhad_vec.push_back( getShowerShape_Rhad(eg));
826 Rhad1_vec.push_back( getShowerShape_Rhad(eg));
827 Reta_vec.push_back( getShowerShape_Reta(eg));
828 Rphi_vec.push_back( getShowerShape_Rphi(eg));
829 weta1_vec.push_back( getShowerShape_weta1(eg));
830 weta2_vec.push_back( getShowerShape_weta2(eg));
831 f1_vec.push_back( getShowerShape_f1(eg));
832 f3_vec.push_back( getShowerShape_f3(eg));
833 eratio_vec.push_back( getShowerShape_Eratio(eg));
834 et_vec.push_back( eg->pt()/Gaudi::Units::GeV);
835 highet_vec.push_back( eg->pt()/Gaudi::Units::GeV);
836 eta_vec.push_back( eg->eta());
837 phi_vec.push_back( eg->phi());
838 topoetcone20_vec.push_back( getIsolation_topoetcone20(eg)/Gaudi::Units::GeV);
839 topoetcone40_shift_vec.push_back( (getIsolation_topoetcone40(eg)-2450)/Gaudi::Units::GeV );
840
841 if (eg->pt() > 0) {
842 topoetcone20_rel_vec.push_back( getIsolation_topoetcone20(eg)/eg->pt());
843 topoetcone40_shift_rel_vec.push_back( (getIsolation_topoetcone40(eg)-2450)/eg->pt() );
844 }
845
846 }// Loop over egamma objects
847
848 fill( monGroup, Rhad_col, Rhad1_col, Reta_col, Rphi_col, weta1_col, weta2_col,
849 f1_col, f3_col, eratio_col, et_col, highet_col , eta_col, phi_col, topoetcone20_col, topoetcone40_shift_col,
850 topoetcone20_rel_col, topoetcone40_shift_rel_col, ptvarcone20_rel_col, pt_col, mu_col, pt_track_col, z0_col, res_etVsEt_col, res_eprobht_col, res_cnv_et_col);
851
852}
853
854
855void TrigEgammaMonitorAnalysisAlgorithm::fillTracking(const EventContext& ctx, const std::string &trigger, const std::vector< const xAOD::Electron *>& eg_vec, bool online ) const
856{
857
858 ATH_MSG_DEBUG("Fill tracking");
859
860 auto monGroup = getGroup( trigger + ( online ? "_Distributions_HLT" : "_Distributions_Offline") );
861
862 std::vector<float> deta1_vec, deta1_EMECA_vec, deta1_EMECC_vec, deta1_EMEBA_vec, deta1_EMEBC_vec, deta2_vec, dphi2_vec,
863 dphiresc_vec, eprobht_vec, npixhits_vec, nscthits_vec, charge_vec, ptcone20_vec, ptvarcone20_vec, ptcone30_vec, ptvarcone30_vec, z0_vec, d0_vec, d0sig_vec,
864 pt_vec,pt_trk_vec, ptcone20_rel_vec, ptvarcone20_rel_vec, ptcone30_rel_vec, ptvarcone30_rel_vec, eta_vec, mu_vec;
865
866 auto deta1_col = Monitored::Collection( "deta1" , deta1_vec );
867 auto deta1_EMECA_col = Monitored::Collection( "deta1_EMECA" , deta1_EMECA_vec );
868 auto deta1_EMECC_col = Monitored::Collection( "deta1_EMECC" , deta1_EMECC_vec );
869 auto deta1_EMEBA_col = Monitored::Collection( "deta1_EMEBA" , deta1_EMEBA_vec );
870 auto deta1_EMEBC_col = Monitored::Collection( "deta1_EMEBC" , deta1_EMEBC_vec );
871 auto deta2_col = Monitored::Collection( "deta2" , deta2_vec );
872 auto dphi2_col = Monitored::Collection( "dphi2" , dphi2_vec );
873 auto dphiresc_col = Monitored::Collection( "dphiresc" , dphiresc_vec );
874 auto eprobht_col = Monitored::Collection( "eprobht" , eprobht_vec );
875 auto npixhits_col = Monitored::Collection( "npixhits" , npixhits_vec );
876 auto nscthits_col = Monitored::Collection( "nscthits" , nscthits_vec );
877 auto charge_col = Monitored::Collection( "charge" , charge_vec );
878 auto ptcone20_col = Monitored::Collection( "ptcone20" , ptcone20_vec );
879 auto ptvarcone20_col = Monitored::Collection( "ptvarcone20" , ptvarcone20_vec );
880 auto ptcone30_col = Monitored::Collection( "ptcone30" , ptcone30_vec );
881 auto ptvarcone30_col = Monitored::Collection( "ptvarcone30" , ptvarcone30_vec );
882 auto z0_col = Monitored::Collection( "z0" , z0_vec );
883 auto d0_col = Monitored::Collection( "d0" , d0_vec );
884 auto d0sig_col = Monitored::Collection( "d0sig" , d0sig_vec );
885 auto pt_col = Monitored::Collection( "pt" , pt_vec );
886 auto pt_trk_col = Monitored::Collection( "pt_track" , pt_trk_vec );
887 auto ptcone20_rel_col = Monitored::Collection( "ptcone20_rel", ptcone20_rel_vec );
888 auto ptvarcone20_rel_col = Monitored::Collection( "ptvarcone20_rel" , ptvarcone20_rel_vec );
889 auto ptcone30_rel_col = Monitored::Collection( "ptcone30_rel", ptcone30_rel_vec );
890 auto ptvarcone30_rel_col = Monitored::Collection( "ptvarcone30_rel" , ptvarcone30_rel_vec );
891
892 auto eta_col = Monitored::Collection( "eta" , eta_vec );
893 auto mu_col = Monitored::Collection( "mu" , mu_vec );
894
895
896 for ( const auto *eg : eg_vec ){
897
898 if(!eg) continue;
899
900 float cleta = 0.;
901 if(eg->caloCluster()) cleta=eg->caloCluster()->eta();
902 else cleta=eg->eta();
903
904 deta1_vec.push_back( getCaloTrackMatch_deltaEta1(eg));
905
906 if(cleta > 1.375 && cleta < 3.2)
907 deta1_EMECA_vec.push_back( getCaloTrackMatch_deltaEta1(eg));
908 if(cleta < -1.375 && cleta > -3.2)
909 deta1_EMECC_vec.push_back( getCaloTrackMatch_deltaEta1(eg));
910 if(cleta > 0 && cleta < 1.375)
911 deta1_EMEBA_vec.push_back( getCaloTrackMatch_deltaEta1(eg));
912 if(cleta < 0 && cleta > -1.375)
913 deta1_EMEBC_vec.push_back( getCaloTrackMatch_deltaEta1(eg));
914
915 deta2_vec.push_back( getCaloTrackMatch_deltaEta2(eg));
916 dphi2_vec.push_back( getCaloTrackMatch_deltaPhi2(eg));
917 dphiresc_vec.push_back( getCaloTrackMatch_deltaPhiRescaled2(eg));
918 eprobht_vec.push_back( getTrackSummaryFloat_eProbabilityHT(eg));
919 npixhits_vec.push_back( getTrackSummary_numberOfPixelHits(eg));
920 nscthits_vec.push_back( getTrackSummary_numberOfSCTHits(eg));
921 charge_vec.push_back( eg->charge());
922 ptcone20_vec.push_back( getIsolation_ptcone20(eg)/Gaudi::Units::GeV);
923 ptvarcone20_vec.push_back( getIsolation_ptvarcone20(eg)/Gaudi::Units::GeV);
924 ptcone30_vec.push_back( getIsolation_ptcone30(eg)/Gaudi::Units::GeV);
925 ptvarcone30_vec.push_back( getIsolation_ptvarcone30(eg)/Gaudi::Units::GeV);
926
927 // Quantities directly from tracks
928 ATH_MSG_DEBUG("Get track Quantities");
929 z0_vec.push_back( getTrack_z0(eg));
930 d0_vec.push_back( getTrack_d0(eg));
931 d0sig_vec.push_back(getD0sig(eg));
932 pt_vec.push_back( eg->pt()/Gaudi::Units::GeV);
933 pt_trk_vec.push_back( getTrack_pt(eg)/Gaudi::Units::GeV);
934 eta_vec.push_back(eg->eta());
935
936 const float avgmu=lbAverageInteractionsPerCrossing( ctx );
937 mu_vec.push_back( avgmu );
938
939 if (eg->pt() > 0) {
940 ptcone20_rel_vec.push_back( getIsolation_ptcone20(eg)/eg->pt());
941 ptvarcone20_rel_vec.push_back( getIsolation_ptvarcone20(eg)/eg->pt());
942 ptcone30_rel_vec.push_back( getIsolation_ptcone30(eg)/eg->pt());
943 ptvarcone30_rel_vec.push_back( getIsolation_ptvarcone30(eg)/eg->pt());
944 }
945
946 }
947
948
949 fill( monGroup, deta1_col, deta1_EMECA_col, deta1_EMECC_col, deta1_EMEBA_col, deta1_EMEBC_col, deta2_col, dphi2_col,
950 dphiresc_col, eprobht_col, npixhits_col, nscthits_col, charge_col, ptcone20_col, ptvarcone20_col, ptcone30_col, ptvarcone30_col, z0_col, d0_col, d0sig_col,
951 pt_col, ptcone20_rel_col, ptvarcone20_rel_col, ptcone30_rel_col, ptvarcone30_rel_col, eta_col, mu_col,pt_trk_col);
952}
953
954
955
957//
958//
959
960
962 const std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >>& pairObjs,
963 const TrigInfo& info ) const
964{
965
966 std::vector< std::pair< const xAOD::Egamma*, const xAOD::EmTauRoI * >> pair_l1_vec;
967 std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >> pair_eg_vec;
968 const std::string trigger = info.trigger;
969
970 SG::Decorator<bool> pidnameDec("is"+info.pidname);
971 for( auto pairObj : pairObjs ){
972
973 const xAOD::Egamma* eg = pairObj.first;
974 const auto *feat = pairObj.second;
975
976 if (feat){
977
978 //
979 // Get only off and l1 where the offline object passed by the offline pid selector
980 //
981 const auto *l1 = match()->getL1Feature( feat );
982 if(eg->type()==xAOD::Type::Electron){
983 const xAOD::Electron* el = static_cast<const xAOD::Electron*>(eg);
984 float et = getEt(el)/Gaudi::Units::GeV;
985 if( et < info.etthr-5.0) continue;
986 if(!pidnameDec(*eg)) continue;
987 pair_eg_vec.emplace_back(el,feat);
988 if(l1) pair_l1_vec.emplace_back(eg,l1 );
989 }
990 else if(eg->type()==xAOD::Type::Photon){
991 float et = getCluster_et(eg)/Gaudi::Units::GeV;
992 if( et < info.etthr-5.0) continue;
993 pair_eg_vec.emplace_back(eg,feat);
994 if(l1) pair_l1_vec.emplace_back(eg,l1 );
995 }
996 }
997
998 }
999
1000 // Fill L1Calo for all level 1 objects found
1001 fillL1CaloResolution( trigger, pair_l1_vec );
1002 fillL1CaloAbsResolution( trigger, pair_l1_vec );
1003 fillL2CaloResolution( trigger, pair_eg_vec );
1004
1005 // Fill HLT electron for all onl objects found
1006 if ( info.signature=="Electron" or info.signature == "e"){
1007 fillHLTElectronResolution( ctx, trigger, pair_eg_vec, info );
1008 }
1009 else if ( info.signature=="Photon" or info.signature == "g"){
1010 fillHLTPhotonResolution( ctx, trigger, pair_eg_vec, info );
1011 }
1012
1013}
1014
1015
1016
1017
1019 const std::vector< std::pair< const xAOD::Egamma*, const xAOD::EmTauRoI * >>& pairObjs ) const
1020{
1021 auto monGroup = getGroup( trigger + "_Resolutions_L1Calo" );
1022
1023 std::vector<float> eta_vec, res_et_vec;
1024
1025 auto eta_col = Monitored::Collection( "eta" , eta_vec );
1026 auto res_et_col = Monitored::Collection( "res_et" , res_et_vec );
1027
1028
1029 for (const auto & pairObj : pairObjs){
1030 const auto *off = pairObj.first;
1031 const auto *l1 = pairObj.second;
1032 ATH_MSG_DEBUG("Fill L1CaloResolution");
1033 if(off->type()==xAOD::Type::Electron){
1034 const xAOD::Electron* eloff =static_cast<const xAOD::Electron*> (off);
1035 eta_vec.push_back( l1->eta() );
1036 res_et_vec.push_back( (l1->emClus()-getEt(eloff))/getEt(eloff) ) ;
1037
1038 }
1039 }
1040
1041 fill( monGroup, eta_col, res_et_col );
1042}
1043
1044
1045
1046
1047
1049 const std::vector< std::pair< const xAOD::Egamma*, const xAOD::EmTauRoI * >>& pairObjs ) const
1050{
1051 auto monGroup = getGroup( trigger + "_AbsResolutions_L1Calo" );
1052
1053 std::vector<float> eta_vec, res_et_vec;
1054
1055 auto eta_col = Monitored::Collection( "eta" , eta_vec );
1056 auto res_et_col = Monitored::Collection( "res_et" , res_et_vec );
1057
1058
1059 for (const auto & pairObj : pairObjs){
1060 const auto *off = pairObj.first;
1061 const auto *l1 = pairObj.second;
1062 ATH_MSG_DEBUG("Fill L1CaloAbsResolution");
1063 if(off->type()==xAOD::Type::Electron){
1064 const xAOD::Electron* eloff =static_cast<const xAOD::Electron*> (off);
1065 eta_vec.push_back( l1->eta() );
1066 res_et_vec.push_back( (l1->emClus()-getEt(eloff))/Gaudi::Units::GeV ) ;
1067 }
1068 }
1069
1070 fill( monGroup, eta_col, res_et_col );
1071}
1072
1073
1074
1075
1076void TrigEgammaMonitorAnalysisAlgorithm::fillHLTElectronResolution(const EventContext& ctx, const std::string &trigger,
1077 const std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >>& pairObjs,
1078 const TrigInfo& info) const
1079{
1080
1081 auto monGroup = getGroup( trigger + "_Resolutions_HLT" );
1082
1083 std::vector<float> res_pt_vec, res_et_vec, res_phi_vec, res_eta_vec, res_deta1_vec, res_deta2_vec, res_dphi2_vec, res_dphiresc_vec,
1084 res_z0_vec, res_d0_vec, res_d0sig_vec, res_eprobht_vec, res_npixhits_vec, res_nscthits_vec, res_Rhad_vec, res_Rhad1_vec, res_Reta_vec,
1085 res_Rphi_vec, res_weta1_vec, res_weta2_vec, res_wtots1_vec, res_f1_vec, res_f3_vec, res_eratio_vec, res_ethad_vec, res_ethad1_vec,
1086 et_vec, eta_vec, mu_vec, pt_vec;
1087 std::vector<float> res_ptcone20_vec, res_ptcone20_rel_vec, res_ptvarcone20_vec, res_ptvarcone20_rel_vec;
1088 std::vector<float> res_etInEta0_vec, res_etInEta1_vec, res_etInEta2_vec, res_etInEta3_vec;
1089
1090
1091 auto et_col = Monitored::Collection( "et" , et_vec );
1092 auto pt_col = Monitored::Collection( "pt" , pt_vec );
1093 auto eta_col = Monitored::Collection( "eta" , eta_vec );
1094 auto mu_col = Monitored::Collection( "mu" , mu_vec );
1095
1096 // For calo
1097 auto res_et_col = Monitored::Collection( "res_et" , res_et_vec );
1098 auto res_eta_col = Monitored::Collection( "res_eta" , res_eta_vec );
1099 auto res_phi_col = Monitored::Collection( "res_phi" , res_phi_vec );
1100 auto res_ethad_col = Monitored::Collection( "res_ethad" , res_ethad_vec );
1101 auto res_ethad1_col = Monitored::Collection( "res_ethad1" , res_ethad1_vec );
1102 auto res_Rhad_col = Monitored::Collection( "res_Rhad" , res_Rhad_vec );
1103 auto res_Rhad1_col = Monitored::Collection( "res_Rhad1" , res_Rhad1_vec );
1104 auto res_Reta_col = Monitored::Collection( "res_Reta" , res_Reta_vec );
1105 auto res_Rphi_col = Monitored::Collection( "res_Rphi" , res_Rphi_vec );
1106 auto res_weta1_col = Monitored::Collection( "res_weta1" , res_weta1_vec );
1107 auto res_weta2_col = Monitored::Collection( "res_weta2" , res_weta2_vec );
1108 auto res_wtots1_col = Monitored::Collection( "res_wtots1" , res_wtots1_vec );
1109 auto res_f1_col = Monitored::Collection( "res_f1" , res_f1_vec );
1110 auto res_f3_col = Monitored::Collection( "res_f3" , res_f3_vec );
1111 auto res_eratio_col = Monitored::Collection( "res_eratio" , res_eratio_vec );
1112
1113 auto res_etInEta0_col = Monitored::Collection( "res_etInEta0" , res_etInEta0_vec );
1114 auto res_etInEta1_col = Monitored::Collection( "res_etInEta1" , res_etInEta1_vec );
1115 auto res_etInEta2_col = Monitored::Collection( "res_etInEta2" , res_etInEta2_vec );
1116 auto res_etInEta3_col = Monitored::Collection( "res_etInEta3" , res_etInEta3_vec );
1117
1118 // For electron
1119 auto res_pt_col = Monitored::Collection( "res_pt" , res_pt_vec );
1120 auto res_deta1_col = Monitored::Collection( "res_deta1" , res_deta1_vec );
1121 auto res_deta2_col = Monitored::Collection( "res_deta2" , res_deta2_vec );
1122 auto res_dphi2_col = Monitored::Collection( "res_dphi2" , res_dphi2_vec );
1123 auto res_dphiresc_col = Monitored::Collection( "res_dphiresc" , res_dphiresc_vec );
1124 auto res_z0_col = Monitored::Collection( "res_z0" , res_z0_vec );
1125 auto res_d0_col = Monitored::Collection( "res_d0" , res_d0_vec );
1126 auto res_d0sig_col = Monitored::Collection( "res_d0sig" , res_d0sig_vec );
1127 auto res_eprobht_col = Monitored::Collection( "res_eprobht" , res_eprobht_vec );
1128 auto res_npixhits_col = Monitored::Collection( "res_npixhits" , res_npixhits_vec );
1129 auto res_nscthits_col = Monitored::Collection( "res_nscthits" , res_nscthits_vec );
1130 auto res_ptcone20_col = Monitored::Collection( "res_ptcone20" , res_ptcone20_vec );
1131 auto res_ptcone20_rel_col = Monitored::Collection( "res_ptcone20_rel" , res_ptcone20_rel_vec );
1132 auto res_ptvarcone20_col = Monitored::Collection( "res_ptvarcone20" , res_ptvarcone20_vec );
1133 auto res_ptvarcone20_rel_col = Monitored::Collection( "res_ptvarcone20_rel" , res_ptvarcone20_rel_vec );
1134
1135
1136
1137
1138 // Check for zero before filling
1139 ATH_MSG_DEBUG("Fill Resolution");
1140
1141 std::string key = match()->key("Electrons_GSF");
1142 if(info.nogsf) key = match()->key("Electrons");
1143 if(info.lrt) key = match()->key("Electrons_LRT");
1144
1145 for ( const auto & pairObj : pairObjs ){
1146
1147 const xAOD::Electron *off = static_cast<const xAOD::Electron*>(pairObj.first);
1148 const xAOD::Electron *onl=nullptr;
1149
1150
1151 { // Get the closest electron object from the trigger starting with deltaR = 0.15
1152 float maxDeltaR=0.05;
1153 auto vec = tdt()->features<xAOD::ElectronContainer>(trigger,TrigDefs::Physics ,key );
1154 for(auto &featLinkInfo : vec ){
1155 if(! featLinkInfo.isValid() ) continue;
1156 const auto *feat = *(featLinkInfo.link);
1157 if(!feat) continue;
1158 float deltaR = dR( off->eta(), off->phi(), feat->eta(), feat->phi() );
1159 if( deltaR < maxDeltaR){
1160 maxDeltaR=deltaR;
1161 onl=feat;
1162 }
1163 }
1164 }
1165
1166 if(!onl) continue;
1167
1168 float val_off=0.;
1169 const float onl_eta=onl->eta();
1170 const float feta = abs(onl_eta);
1171 const float onl_et = getEt(onl)/Gaudi::Units::GeV;
1172 const float avgmu=lbAverageInteractionsPerCrossing( ctx );
1173 const float dummy=-999;
1174
1175 eta_vec.push_back( onl_eta );
1176 et_vec.push_back( onl_et );
1177 mu_vec.push_back( avgmu );
1178
1179 val_off=getTrack_pt(off);
1180 if(val_off!=0.){
1181 res_pt_vec.push_back( (getTrack_pt(off)-val_off)/val_off );
1182 }else{
1183 }
1184
1185
1186 val_off=getEt(off);
1187 if(val_off!=0.){
1188 res_et_vec.push_back( (getEt(onl)-val_off)/val_off );
1189 if( feta < 1.37 )
1190 res_etInEta0_vec.push_back((getEt(onl)-val_off)/val_off);
1191 else if( feta >=1.37 && feta <= 1.52 )
1192 res_etInEta1_vec.push_back((getEt(onl)-val_off)/val_off);
1193 else if( feta >= 1.55 && feta < 1.8 )
1194 res_etInEta2_vec.push_back((getEt(onl)-val_off)/val_off);
1195 else if( feta >= 1.8 && feta < 2.45 )
1196 res_etInEta3_vec.push_back((getEt(onl)-val_off)/val_off);
1197 }
1198
1199 val_off=off->eta();
1200 if(val_off!=0.){
1201 res_eta_vec.push_back( (onl_eta-val_off)/val_off );
1202 }else{
1203 res_eta_vec.push_back( dummy );
1204 }
1205
1206 val_off=off->phi();
1207 if(val_off!=0.){
1208 res_phi_vec.push_back( (onl->phi()-val_off)/val_off );
1209 }else{
1210 res_phi_vec.push_back(dummy );
1211 }
1212
1213 val_off=getShowerShape_ethad(off);
1214 if(val_off!=0.) {
1215 res_ethad_vec.push_back((getShowerShape_ethad(onl)-val_off)/val_off);
1216 }else{
1217 res_ethad_vec.push_back( dummy );
1218 }
1219
1220 val_off=getShowerShape_ethad1(off);
1221 if(val_off!=0){
1222 res_ethad1_vec.push_back((getShowerShape_ethad1(onl)-val_off)/val_off);
1223 }else{
1224 res_ethad1_vec.push_back( dummy);
1225 }
1226
1227 val_off=getShowerShape_Rhad(off);
1228 if(val_off!=0.){
1229 res_Rhad_vec.push_back( (getShowerShape_Rhad(onl)-val_off)/val_off );
1230 }else{
1231 res_Rhad_vec.push_back( dummy );
1232 }
1233
1234 val_off=getShowerShape_Rhad1(off);
1235 if(val_off!=0.){
1236 res_Rhad1_vec.push_back( (getShowerShape_Rhad1(onl)-val_off)/val_off );
1237 }else{
1238 res_Rhad1_vec.push_back( dummy );
1239 }
1240
1241 val_off=getShowerShape_Reta(off);
1242 if(val_off!=0.){
1243 res_Reta_vec.push_back( (getShowerShape_Reta(onl)-val_off)/val_off );
1244 }else{
1245 res_Reta_vec.push_back( dummy );
1246 }
1247
1248 val_off=getShowerShape_Rphi(off);
1249 if(val_off!=0.){
1250 res_Rphi_vec.push_back( (getShowerShape_Rphi(onl)-val_off)/val_off );
1251 }else{
1252 res_Rphi_vec.push_back( (getShowerShape_Rphi(onl)-val_off)/val_off );
1253 }
1254
1255 val_off=getShowerShape_weta1(off);
1256 if(val_off!=0.){
1257 res_weta1_vec.push_back( (getShowerShape_weta1(onl)-val_off)/val_off );
1258 }else{
1259 res_weta1_vec.push_back( dummy );
1260 }
1261
1262 val_off=getShowerShape_weta2(off);
1263 if(val_off!=0.){
1264 res_weta2_vec.push_back( (getShowerShape_weta2(onl)-val_off)/val_off );
1265 }else{
1266 res_weta2_vec.push_back( dummy );
1267 }
1268
1269 val_off=getShowerShape_wtots1(off);
1270 if(val_off!=0.){
1271 res_wtots1_vec.push_back( (getShowerShape_wtots1(onl)-val_off)/val_off );
1272 }else{
1273 res_wtots1_vec.push_back( dummy );
1274 }
1275
1276 val_off=getShowerShape_f1(off);
1277 if(val_off!=0.){
1278 res_f1_vec.push_back( (getShowerShape_f1(onl)-val_off)/val_off );
1279 }else{
1280 res_f1_vec.push_back(dummy );
1281 }
1282
1283 val_off=getShowerShape_f3(off);
1284 if(val_off!=0.){
1285 res_f3_vec.push_back( (getShowerShape_f3(onl)-val_off)/val_off );
1286 }else{
1287 res_f3_vec.push_back( dummy );
1288 }
1289
1290 val_off=getShowerShape_Eratio(off);
1291 if(val_off!=0.){
1292 res_eratio_vec.push_back( (getShowerShape_Eratio(onl)-val_off)/val_off );
1293 }else{
1294 res_eratio_vec.push_back( dummy );
1295 }
1296
1297
1298 //
1299 // Track variables
1300 //
1301
1302 val_off=getTrack_pt(off);
1303 if(val_off!=0.){
1304 res_pt_vec.push_back( (getTrack_pt(onl)-val_off)/val_off );
1305 }else{
1306 res_pt_vec.push_back( dummy );
1307 }
1308
1309 val_off=getEt(off);
1310 if(val_off!=0.) {
1311 res_et_vec.push_back( (getEt(onl)-val_off)/val_off );
1312 }else{
1313 res_et_vec.push_back( dummy );
1314 }
1315
1316 val_off=getCaloTrackMatch_deltaEta1(off);
1317 if(val_off!=0.) {
1318 res_deta1_vec.push_back( (getCaloTrackMatch_deltaEta1(onl)-val_off)/val_off );
1319 }else{
1320 res_deta1_vec.push_back( dummy );
1321 }
1322
1323 val_off=getCaloTrackMatch_deltaEta2(off);
1324 res_deta2_vec.push_back( (getCaloTrackMatch_deltaEta2(onl)-val_off)/val_off );
1325 val_off=getCaloTrackMatch_deltaPhi2(off);
1326 if(val_off!=0.) {
1327 res_dphi2_vec.push_back( (getCaloTrackMatch_deltaPhi2(onl)-val_off)/val_off );
1328 }else{
1329 res_dphi2_vec.push_back(dummy );
1330 }
1331
1332 val_off=getCaloTrackMatch_deltaPhiRescaled2(off);
1333 res_dphiresc_vec.push_back( (getCaloTrackMatch_deltaPhiRescaled2(onl)-val_off)/val_off );
1334 // Resolution of Z0 of the track
1335 val_off=getTrack_z0(off);
1336 if(val_off!=0.) {
1337 res_z0_vec.push_back( getTrack_z0(onl)-val_off );
1338 }else{
1339 res_z0_vec.push_back( dummy );
1340 }
1341
1342 // Absolute resolution for impact parameter
1343 val_off=getTrack_d0(off);
1344 if(val_off!=0.) {
1345 res_d0_vec.push_back( getTrack_d0(onl)-val_off );
1346 }else{
1347 res_d0_vec.push_back( dummy );
1348 }
1349
1350 val_off=getD0sig(off);
1351 if(val_off!=0.) {
1352 res_d0sig_vec.push_back( getD0sig(onl)-val_off );
1353 }else{
1354 res_d0sig_vec.push_back( dummy );
1355 }
1356
1357 // Absolute resolution on track summary ints/floats
1358 val_off=getTrackSummaryFloat_eProbabilityHT(off);
1359 res_eprobht_vec.push_back( (getTrackSummaryFloat_eProbabilityHT(onl)-val_off) );
1360 res_npixhits_vec.push_back( getTrackSummary_numberOfPixelHits(onl)-getTrackSummary_numberOfPixelHits(onl) );
1361 res_nscthits_vec.push_back( getTrackSummary_numberOfSCTHits(onl)-getTrackSummary_numberOfSCTHits(onl) );
1362
1363
1364
1365
1366 if(info.isolated){
1367
1368 float val_off=getIsolation_ptcone20(off);
1369 if (val_off > 0.) {
1370 res_ptcone20_vec.push_back((getIsolation_ptcone20(onl)-val_off)/val_off);
1371 if (getEt(onl) > 0. && getEt(off) > 0.) {
1372 const float reliso_onl=getIsolation_ptcone20(onl)/getEt(onl);
1373 const float reliso_off=getIsolation_ptcone20(off)/getEt(off);
1374 res_ptcone20_rel_vec.push_back((reliso_onl-reliso_off)/reliso_off);
1375 }else{
1376 res_ptcone20_rel_vec.push_back(dummy);
1377 }
1378 }else{
1379 res_ptcone20_vec.push_back(dummy);
1380 res_ptcone20_rel_vec.push_back(dummy);
1381 }
1382
1383 // ptvarcone20 isolation
1384 val_off=getIsolation_ptvarcone20(off);
1385 if (val_off > 0.) {
1386 if (getEt(onl) > 0. && getEt(off) > 0.) {
1387 res_ptvarcone20_vec.push_back((getIsolation_ptvarcone20(onl)-val_off)/val_off);
1388 const float reliso_onl=getIsolation_ptvarcone20(onl)/getEt(onl);
1389 const float reliso_off=getIsolation_ptvarcone20(off)/getEt(off);
1390 res_ptvarcone20_rel_vec.push_back((reliso_onl-reliso_off)/reliso_off);
1391 }else{
1392 res_ptvarcone20_rel_vec.push_back(dummy);
1393 }
1394 }else{
1395 res_ptvarcone20_vec.push_back(dummy);
1396 res_ptvarcone20_rel_vec.push_back(dummy);
1397 }
1398
1399 }
1400
1401
1402
1403
1404
1405 } // Loop over all offline objects
1406
1407 // Fill everything
1408 fill( monGroup ,
1409 et_col ,
1410 pt_col ,
1411 eta_col ,
1412 mu_col ,
1413 res_pt_col ,
1414 res_et_col ,
1415 res_eta_col ,
1416 res_phi_col ,
1417 res_deta1_col ,
1418 res_deta2_col ,
1419 res_dphi2_col ,
1420 res_dphiresc_col,
1421 res_z0_col ,
1422 res_d0_col ,
1423 res_d0sig_col ,
1424 res_eprobht_col ,
1425 res_npixhits_col,
1426 res_nscthits_col,
1427 res_ethad_col ,
1428 res_ethad1_col ,
1429 res_Rhad_col ,
1430 res_Rhad1_col ,
1431 res_Reta_col ,
1432 res_Rphi_col ,
1433 res_weta1_col ,
1434 res_weta2_col ,
1435 res_wtots1_col ,
1436 res_f1_col ,
1437 res_f3_col ,
1438 res_eratio_col ,
1439 res_ptcone20_col ,
1440 res_ptcone20_rel_col ,
1441 res_ptvarcone20_col ,
1442 res_ptvarcone20_rel_col ,
1443 res_etInEta0_col,
1444 res_etInEta1_col,
1445 res_etInEta2_col,
1446 res_etInEta3_col );
1447
1448
1449
1450}
1451
1452
1453
1454
1455
1456void TrigEgammaMonitorAnalysisAlgorithm::fillHLTPhotonResolution(const EventContext& ctx, const std::string &trigger,
1457 const std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >>& pairObjs,
1458 const TrigInfo& info) const
1459{
1460
1461 auto monGroup = getGroup( trigger + "_Resolutions_HLT" );
1462
1463 std::vector<float> res_phi_vec, res_eta_vec, res_Rhad_vec, res_Rhad1_vec, res_Reta_vec, res_ethad_vec, res_ethad1_vec,
1464 res_Rphi_vec, res_weta1_vec, res_weta2_vec, res_wtots1_vec, res_f1_vec, res_f3_vec, res_eratio_vec, et_vec, eta_vec, mu_vec;
1465
1466 std::vector<float> res_et_vec, res_et_cnv_vec, res_et_uncnv_vec, res_cnv_et_vec, res_uncnv_et_vec;
1467 std::vector<float> res_etInEta0_vec, res_etInEta1_vec, res_etInEta2_vec, res_etInEta3_vec;
1468 std::vector<float> res_cnv_etInEta0_vec, res_cnv_etInEta1_vec, res_cnv_etInEta2_vec, res_cnv_etInEta3_vec;
1469 std::vector<float> res_uncnv_etInEta0_vec, res_uncnv_etInEta1_vec, res_uncnv_etInEta2_vec, res_uncnv_etInEta3_vec;
1470
1471
1472
1473 std::vector<float> res_topoetcone20_vec, res_topoetcone20_rel_vec;
1474
1475 auto et_col = Monitored::Collection( "et" , et_vec );
1476 auto eta_col = Monitored::Collection( "eta" , eta_vec );
1477 auto mu_col = Monitored::Collection( "mu" , mu_vec );
1478
1479 // For calo
1480 auto res_eta_col = Monitored::Collection( "res_eta" , res_eta_vec );
1481 auto res_phi_col = Monitored::Collection( "res_phi" , res_phi_vec );
1482 auto res_ethad_col = Monitored::Collection( "res_ethad" , res_ethad_vec );
1483 auto res_ethad1_col = Monitored::Collection( "res_ethad1" , res_ethad1_vec );
1484 auto res_Rhad_col = Monitored::Collection( "res_Rhad" , res_Rhad_vec );
1485 auto res_Rhad1_col = Monitored::Collection( "res_Rhad1" , res_Rhad1_vec );
1486 auto res_Reta_col = Monitored::Collection( "res_Reta" , res_Reta_vec );
1487 auto res_Rphi_col = Monitored::Collection( "res_Rphi" , res_Rphi_vec );
1488 auto res_weta1_col = Monitored::Collection( "res_weta1" , res_weta1_vec );
1489 auto res_weta2_col = Monitored::Collection( "res_weta2" , res_weta2_vec );
1490 auto res_wtots1_col = Monitored::Collection( "res_wtots1" , res_wtots1_vec );
1491 auto res_f1_col = Monitored::Collection( "res_f1" , res_f1_vec );
1492 auto res_f3_col = Monitored::Collection( "res_f3" , res_f3_vec );
1493 auto res_eratio_col = Monitored::Collection( "res_eratio" , res_eratio_vec );
1494
1495
1496 auto res_et_col = Monitored::Collection( "res_et" , res_et_vec );
1497 auto res_et_cnv_col = Monitored::Collection( "res_et_cnv" , res_et_cnv_vec );
1498 auto res_cnv_et_col = Monitored::Collection( "res_cnv_et" , res_cnv_et_vec );
1499 auto res_uncnv_et_col = Monitored::Collection( "res_uncnv_et" , res_uncnv_et_vec );
1500 auto res_et_uncnv_col = Monitored::Collection( "res_et_uncnv" , res_et_uncnv_vec );
1501 auto res_etInEta0_col = Monitored::Collection( "res_etInEta0" , res_etInEta0_vec );
1502 auto res_etInEta1_col = Monitored::Collection( "res_etInEta1" , res_etInEta1_vec );
1503 auto res_etInEta2_col = Monitored::Collection( "res_etInEta2" , res_etInEta2_vec );
1504 auto res_etInEta3_col = Monitored::Collection( "res_etInEta3" , res_etInEta3_vec );
1505 auto res_cnv_etInEta0_col = Monitored::Collection( "res_cnv_etInEta0" , res_cnv_etInEta0_vec );
1506 auto res_cnv_etInEta1_col = Monitored::Collection( "res_cnv_etInEta1" , res_cnv_etInEta1_vec );
1507 auto res_cnv_etInEta2_col = Monitored::Collection( "res_cnv_etInEta2" , res_cnv_etInEta2_vec );
1508 auto res_cnv_etInEta3_col = Monitored::Collection( "res_cnv_etInEta3" , res_cnv_etInEta3_vec );
1509 auto res_uncnv_etInEta0_col = Monitored::Collection( "res_uncnv_etInEta0" , res_uncnv_etInEta0_vec);
1510 auto res_uncnv_etInEta1_col = Monitored::Collection( "res_uncnv_etInEta1" , res_uncnv_etInEta1_vec);
1511 auto res_uncnv_etInEta2_col = Monitored::Collection( "res_uncnv_etInEta2" , res_uncnv_etInEta2_vec);
1512 auto res_uncnv_etInEta3_col = Monitored::Collection( "res_uncnv_etInEta3" , res_uncnv_etInEta3_vec);
1513
1514 // For photon
1515 auto res_topoetcone20_col = Monitored::Collection( "res_topoetcone20" , res_topoetcone20_vec );
1516 auto res_topoetcone20_rel_col = Monitored::Collection( "res_topoetcone20_rel" , res_topoetcone20_rel_vec );
1517
1518
1519
1520
1521 // Check for zero before filling
1522 ATH_MSG_DEBUG("Fill Resolution");
1523
1524
1525
1526 for ( const auto & pairObj : pairObjs ){
1527
1528 const xAOD::Photon *off = static_cast<const xAOD::Photon*>(pairObj.first);
1529 const xAOD::Photon *onl=nullptr;
1530
1531
1532 { // Get the closest electron object from the trigger starting with deltaR = 0.15
1533 float maxDeltaR=0.05;
1534 auto vec = tdt()->features<xAOD::PhotonContainer>(trigger,TrigDefs::Physics ,match()->key("Photons") );
1535 for(auto &featLinkInfo : vec ){
1536 if(! featLinkInfo.isValid() ) continue;
1537 const auto *feat = *(featLinkInfo.link);
1538 if(!feat) continue;
1539 float deltaR = dR( off->eta(), off->phi(), feat->eta(), feat->phi() );
1540 if( deltaR < maxDeltaR){
1541 maxDeltaR=deltaR;
1542 onl=feat;
1543 }
1544 }
1545 }
1546
1547 // If not found, skip this off object!
1548 if(!onl) continue;
1549
1550 float val_off=0.;
1551 const float onl_eta=onl->eta();
1552 const float feta = abs(onl_eta);
1553 const float onl_et = getCluster_et(onl)/Gaudi::Units::GeV;
1554 const float dummy=-999;
1555
1556 const float avgmu=lbAverageInteractionsPerCrossing( ctx );
1557 et_vec.push_back( onl_et );
1558 eta_vec.push_back( onl_eta );
1559 mu_vec.push_back( avgmu );
1560
1561
1562 val_off=getCluster_et(off);
1563 if(val_off!=0.){
1564 res_et_vec.push_back( (getCluster_et(onl)-val_off)/val_off );
1565 if( feta < 1.37 )
1566 res_etInEta0_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1567 else if( feta >=1.37 && feta <= 1.52 )
1568 res_etInEta1_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1569 else if( feta >= 1.55 && feta < 1.8 )
1570 res_etInEta2_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1571 else if( feta >= 1.8 && feta < 2.45 )
1572 res_etInEta3_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1573
1575 res_et_cnv_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1576 if( feta < 1.37 )
1577 res_cnv_etInEta0_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1578 else if( feta >=1.37 && feta <= 1.52 )
1579 res_cnv_etInEta1_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1580 else if( feta >= 1.55 && feta < 1.8 )
1581 res_cnv_etInEta2_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1582 else if( feta >= 1.8 && feta < 2.45 )
1583 res_cnv_etInEta3_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1584 }else{
1585 res_et_uncnv_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1586 if( feta < 1.37 )
1587 res_uncnv_etInEta0_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1588 else if( feta >=1.37 && feta <= 1.52 )
1589 res_uncnv_etInEta1_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1590 else if( feta >= 1.55 && feta < 1.8 )
1591 res_uncnv_etInEta2_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1592 else if( feta >= 1.8 && feta < 2.45 )
1593 res_uncnv_etInEta3_vec.push_back((getCluster_et(onl)-val_off)/val_off);
1594 }
1595 }
1596
1597 val_off=off->eta();
1598 if(val_off!=0.){
1599 res_eta_vec.push_back( (onl_eta-val_off)/val_off ) ;
1600 }else{
1601 res_eta_vec.push_back( dummy ) ;
1602 }
1603
1604 val_off=off->phi();
1605 if(val_off!=0.){
1606 res_phi_vec.push_back( (onl->phi()-val_off)/val_off );
1607 }else{
1608 res_phi_vec.push_back(dummy );
1609 }
1610
1611 val_off=getShowerShape_ethad(off);
1612 if(val_off!=0.) {
1613 res_ethad_vec.push_back((getShowerShape_ethad(onl)-val_off)/val_off);
1614 }else{
1615 res_ethad_vec.push_back(dummy);
1616 }
1617
1618 val_off=getShowerShape_ethad1(off);
1619 if(val_off!=0){
1620 res_ethad1_vec.push_back((getShowerShape_ethad1(onl)-val_off)/val_off);
1621 }else{
1622 res_ethad1_vec.push_back(dummy);
1623 }
1624
1625 val_off=getShowerShape_Rhad(off);
1626 if(val_off!=0.){
1627 res_Rhad_vec.push_back( (getShowerShape_Rhad(onl)-val_off)/val_off );
1628 }else{
1629 res_Rhad_vec.push_back(dummy );
1630 }
1631
1632 val_off=getShowerShape_Rhad1(off);
1633 if(val_off!=0.){
1634 res_Rhad1_vec.push_back( (getShowerShape_Rhad1(onl)-val_off)/val_off );
1635 }else{
1636 res_Rhad1_vec.push_back(dummy );
1637 }
1638
1639 val_off=getShowerShape_Reta(off);
1640 if(val_off!=0.){
1641 res_Reta_vec.push_back( (getShowerShape_Reta(onl)-val_off)/val_off );
1642 }else{
1643 res_Reta_vec.push_back( dummy );
1644 }
1645
1646 val_off=getShowerShape_Rphi(off);
1647 if(val_off!=0.){
1648 res_Rphi_vec.push_back( (getShowerShape_Rphi(onl)-val_off)/val_off );
1649 }else{
1650 res_Rphi_vec.push_back(dummy );
1651 }
1652
1653 val_off=getShowerShape_weta1(off);
1654 if(val_off!=0.){
1655 res_weta1_vec.push_back( (getShowerShape_weta1(onl)-val_off)/val_off );
1656 }else{
1657 res_weta1_vec.push_back( dummy );
1658 }
1659
1660 val_off=getShowerShape_weta2(off);
1661 if(val_off!=0.){
1662 res_weta2_vec.push_back( (getShowerShape_weta2(onl)-val_off)/val_off );
1663 }else{
1664 res_weta2_vec.push_back(dummy);
1665 }
1666
1667 val_off=getShowerShape_wtots1(off);
1668 if(val_off!=0.){
1669 res_wtots1_vec.push_back( (getShowerShape_wtots1(onl)-val_off)/val_off );
1670 }else{
1671 res_wtots1_vec.push_back( dummy );
1672 }
1673
1674 val_off=getShowerShape_f1(off);
1675 if(val_off!=0.){
1676 res_f1_vec.push_back( (getShowerShape_f1(onl)-val_off)/val_off );
1677 }else{
1678 res_f1_vec.push_back( dummy );
1679 }
1680
1681 val_off=getShowerShape_f3(off);
1682 if(val_off!=0.){
1683 res_f3_vec.push_back( (getShowerShape_f3(onl)-val_off)/val_off );
1684 }else{
1685 res_f3_vec.push_back( dummy );
1686 }
1687
1688 val_off=getShowerShape_Eratio(off);
1689 if(val_off!=0.){
1690 res_eratio_vec.push_back( (getShowerShape_Eratio(onl)-val_off)/val_off);
1691 }else{
1692 res_eratio_vec.push_back( dummy);
1693 }
1694
1695
1696 if( info.isolated ){
1697 // topoetcone20 isolation
1698 float val_off=getIsolation_topoetcone20(off);
1699 float etonl=onl->pt();
1700 float etoff=off->pt();
1701 if (val_off > 0.) {
1702 res_topoetcone20_vec.push_back((getIsolation_topoetcone20(onl)-val_off)/val_off);
1703 if (etonl > 0. && etoff > 0.) {
1704 const float reliso_onl=getIsolation_topoetcone20(onl)/etonl;
1705 const float reliso_off=getIsolation_topoetcone20(off)/etoff;
1706 res_topoetcone20_rel_vec.push_back((reliso_onl-reliso_off)/reliso_off);
1707 }else{
1708 res_topoetcone20_rel_vec.push_back(dummy);
1709 }
1710 }else{
1711 res_topoetcone20_vec.push_back(dummy);
1712 res_topoetcone20_rel_vec.push_back(dummy);
1713 }
1714 }
1715
1716
1717
1718 } // Loop over all offline objects
1719
1720 // Fill everything
1721 fill( monGroup ,
1722 et_col ,
1723 eta_col ,
1724 mu_col ,
1725 res_et_col ,
1726 res_eta_col ,
1727 res_phi_col ,
1728 res_ethad_col ,
1729 res_ethad1_col ,
1730 res_Rhad_col ,
1731 res_Rhad1_col ,
1732 res_Reta_col ,
1733 res_Rphi_col ,
1734 res_weta1_col ,
1735 res_weta2_col ,
1736 res_wtots1_col ,
1737 res_f1_col ,
1738 res_f3_col ,
1739 res_eratio_col ,
1740 res_topoetcone20_col ,
1741 res_topoetcone20_rel_col ,
1742 res_etInEta0_col,
1743 res_etInEta1_col,
1744 res_etInEta2_col,
1745 res_etInEta3_col,
1746 res_et_uncnv_col,
1747 res_cnv_etInEta0_col,
1748 res_cnv_etInEta1_col,
1749 res_cnv_etInEta2_col,
1750 res_cnv_etInEta3_col,
1751 res_et_cnv_col,
1752 res_cnv_et_col,
1753 res_uncnv_et_col,
1754 res_uncnv_etInEta0_col,
1755 res_uncnv_etInEta1_col,
1756 res_uncnv_etInEta2_col,
1757 res_uncnv_etInEta3_col
1758 );
1759
1760
1761
1762}
1763
1764
1766 const std::vector< std::pair< const xAOD::Egamma*, const TrigCompositeUtils::Decision * >>& pairObjs ) const
1767
1768{
1769 ATH_MSG_DEBUG("Fill L2Calo Resolution");
1770
1771 auto monGroup = getGroup( trigger + "_Resolutions_L2Calo" );
1772
1773 std::vector<float> res_et_vec, res_phi_vec, res_eta_vec, res_Rhad_vec, res_Rhad1_vec, res_Reta_vec, res_ethad_vec, res_ethad1_vec,
1774 res_Rphi_vec, res_weta2_vec, res_f1_vec, res_f3_vec, res_eratio_vec, et_vec, eta_vec, res_etVsEt_vec;
1775
1776
1777 auto et_col = Monitored::Collection( "et" , et_vec );
1778 auto eta_col = Monitored::Collection( "eta" , eta_vec );
1779 auto res_et_col = Monitored::Collection( "res_et" , res_et_vec );
1780 auto res_eta_col = Monitored::Collection( "res_eta" , res_eta_vec );
1781 auto res_phi_col = Monitored::Collection( "res_phi" , res_phi_vec );
1782 auto res_ethad_col = Monitored::Collection( "res_ethad" , res_ethad_vec );
1783 auto res_ethad1_col = Monitored::Collection( "res_ethad1" , res_ethad1_vec );
1784 auto res_Rhad_col = Monitored::Collection( "res_Rhad" , res_Rhad_vec );
1785 auto res_Rhad1_col = Monitored::Collection( "res_Rhad1" , res_Rhad1_vec );
1786 auto res_Reta_col = Monitored::Collection( "res_Reta" , res_Reta_vec );
1787 auto res_Rphi_col = Monitored::Collection( "res_Rphi" , res_Rphi_vec );
1788 auto res_weta2_col = Monitored::Collection( "res_weta2" , res_weta2_vec );
1789 auto res_f1_col = Monitored::Collection( "res_f1" , res_f1_vec );
1790 auto res_f3_col = Monitored::Collection( "res_f3" , res_f3_vec );
1791 auto res_eratio_col = Monitored::Collection( "res_eratio" , res_eratio_vec );
1792 auto res_etVsEt_col = Monitored::Collection( "res_etVsEt" , res_etVsEt_vec );
1793
1794
1795
1796
1797 for ( const auto & pairObj : pairObjs ){
1798
1799
1800 const xAOD::Egamma *off = pairObj.first;
1801 const xAOD::TrigEMCluster *onl=nullptr;
1802
1803 { // Get the closest electron object from the trigger starting with deltaR = 0.15
1804 float maxDeltaR=0.05;
1805 auto vec = tdt()->features<xAOD::TrigEMClusterContainer>(trigger,TrigDefs::Physics ,match()->key("FastCalo") );
1806 for(auto &featLinkInfo : vec ){
1807 if(! featLinkInfo.isValid() ) continue;
1808 const auto *feat = *(featLinkInfo.link);
1809 if(!feat) continue;
1810 float deltaR = dR( off->eta(), off->phi(), feat->eta(), feat->phi() );
1811 if( deltaR < maxDeltaR){
1812 maxDeltaR=deltaR;
1813 onl=feat;
1814 }
1815 }
1816 }
1817
1818 if(!onl) continue;
1819
1820 et_vec.push_back(onl->et()*1e-3);
1821 eta_vec.push_back(onl->eta());
1822 const float dummy=-999;
1823
1824 float val_off=0.;
1825
1826 val_off=off->caloCluster()->et();
1827 if(val_off!=0.){
1828 res_et_vec.push_back(((onl->et())-val_off)/val_off);
1829 }else{
1830 res_et_vec.push_back(dummy);
1831 }
1832
1833 val_off=off->caloCluster()->eta();
1834 if(val_off!=0.){
1835 res_eta_vec.push_back((onl->eta()-val_off)/val_off);
1836 }else{
1837 res_eta_vec.push_back(dummy);
1838 }
1839
1840 val_off=off->caloCluster()->phi();
1841 if(val_off!=0.){
1842 res_phi_vec.push_back((onl->phi()-val_off)/val_off);
1843 }else{
1844 res_phi_vec.push_back((onl->phi()-val_off)/val_off);
1845 }
1846
1847 float elonl_ethad = onl->energy( CaloSampling::HEC0 ); elonl_ethad += onl->energy( CaloSampling::HEC1 );
1848 elonl_ethad += onl->energy( CaloSampling::HEC2 ); elonl_ethad += onl->energy( CaloSampling::HEC3 );
1849 elonl_ethad += onl->energy( CaloSampling::TileBar0 ); elonl_ethad += onl->energy( CaloSampling::TileExt0 );
1850 elonl_ethad += onl->energy( CaloSampling::TileBar1 ); elonl_ethad += onl->energy( CaloSampling::TileExt1 );
1851 elonl_ethad += onl->energy( CaloSampling::TileBar2 ); elonl_ethad += onl->energy( CaloSampling::TileExt2 );
1852 elonl_ethad /= TMath::CosH(onl->eta() );
1853 val_off=getShowerShape_ethad(off);
1854 if(val_off!=0.){
1855 res_ethad_vec.push_back((elonl_ethad-val_off)/val_off);
1856 }else{
1857 res_ethad_vec.push_back(dummy);
1858 }
1859
1860 val_off=getShowerShape_ethad1(off);
1861 if(val_off!=0.){
1862 res_ethad1_vec.push_back(( (onl->ehad1()/TMath::Abs(onl->eta()) )-val_off)/val_off);
1863 }else{
1864 res_ethad1_vec.push_back(dummy);
1865 }
1866
1867 float elonl_Rhad = elonl_ethad / onl->energy() ;
1868 val_off=getShowerShape_Rhad(off);
1869 if(val_off!=0.){
1870 res_Rhad_vec.push_back(( elonl_Rhad-val_off)/val_off);
1871 }else{
1872 res_Rhad_vec.push_back(dummy);
1873 }
1874
1875 float elonl_Rhad1 = onl->ehad1() / onl->energy() ;
1876 val_off=getShowerShape_Rhad1(off);
1877 if(val_off!=0.){
1878 res_Rhad1_vec.push_back(( elonl_Rhad1-val_off)/val_off);
1879 }else{
1880 res_Rhad1_vec.push_back(dummy);
1881 }
1882
1883 float onl_reta= 999.0;
1884 if ( fabsf ( onl->e277() ) > 0.01 ) onl_reta = onl->e237() / onl->e277();
1885 val_off=getShowerShape_Reta(off);
1886 if(val_off!=0.){
1887 res_Reta_vec.push_back( (onl_reta -val_off)/val_off);
1888 }else{
1889 res_Reta_vec.push_back(dummy);
1890 }
1891
1892 val_off=getShowerShape_weta2(off);
1893 if(val_off!=0.){
1894 res_weta2_vec.push_back(( (onl->weta2())-val_off)/val_off);
1895 }else{
1896 res_weta2_vec.push_back(dummy);
1897 }
1898
1899 float onl_f1 = onl->energy(CaloSampling::EMB1)+onl->energy(CaloSampling::EME1);
1900 onl_f1 /= onl->energy();
1901 val_off=getShowerShape_f1(off);
1902 if(val_off!=0.){
1903 res_f1_vec.push_back(( (onl_f1)-val_off)/val_off);
1904 }else{
1905 res_f1_vec.push_back(dummy);
1906 }
1907
1908 float onl_f3 = onl->energy(CaloSampling::EMB3)+onl->energy(CaloSampling::EME3);
1909 onl_f3 /= onl->energy();
1910 val_off=getShowerShape_f3(off);
1911 if(val_off!=0.){
1912 res_f3_vec.push_back(( (onl_f3)-val_off)/val_off);
1913 }else{
1914 res_f3_vec.push_back(dummy);
1915 }
1916
1917 float onl_eratio = 999.0;
1918 if ( fabsf(onl->emaxs1() + onl->e2tsts1()) > 0.01 )
1919 onl_eratio = (onl->emaxs1() - onl->e2tsts1()) / (onl->emaxs1() + onl->e2tsts1());
1920 val_off=getShowerShape_Eratio(off);
1921 if(val_off!=0.){
1922 res_eratio_vec.push_back(( (onl_eratio)-val_off)/val_off);
1923 }else{
1924 res_eratio_vec.push_back(dummy);
1925 }
1926
1927 }// Loop over all pair objects
1928
1929
1930 // Fill everything
1931 fill( monGroup ,
1932 et_col ,
1933 eta_col ,
1934 res_et_col ,
1935 res_eta_col ,
1936 res_phi_col ,
1937 res_ethad_col ,
1938 res_ethad1_col ,
1939 res_Rhad_col ,
1940 res_Rhad1_col ,
1941 res_Reta_col ,
1942 res_Rphi_col ,
1943 res_weta2_col ,
1944 res_f1_col ,
1945 res_f3_col ,
1946 res_eratio_col ,
1947 res_etVsEt_col
1948 );
1949
1950}
1951
Scalar eta() const
pseudorapidity method
Scalar deltaR(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
std::vector< size_t > vec
Helper class to provide type-safe access to aux data.
struct _triginfo TrigInfo
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Declare a monitored scalar variable.
void fillEfficiencies(const EventContext &ctx, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &, const TrigInfo &, const bool) const
void fillTracking(const EventContext &ctx, const std::string &trigger, const std::vector< const xAOD::Electron * > &eg_vec, bool online) const
void fillEFCalo(const std::string &trigger, const std::vector< const xAOD::CaloCluster * > &clus_vec) const
void fillShowerShapes(const std::string &trigger, const std::vector< const xAOD::Egamma * > &eg_vec, bool online) const
void fillL2Calo(const std::string &trigger, const std::vector< const xAOD::TrigEMCluster * > &emCluster_vec) const
virtual StatusCode initialize() override
initialize
void fillL1eEM(const std::string &trigger, const std::vector< const xAOD::eFexEMRoI * > &l1_vec) const
void fillHLTPhotonResolution(const EventContext &ctx, const std::string &trigger, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &pairObjs, const TrigInfo &info) const
void fillHLTElectronResolution(const EventContext &ctx, const std::string &trigger, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &pairObjs, const TrigInfo &info) const
void fillL1CaloAbsResolution(const std::string &trigger, const std::vector< std::pair< const xAOD::Egamma *, const xAOD::EmTauRoI * > > &pairObjs) const
void fillL2CaloResolution(const std::string &trigger, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &pairObjs) const
TrigEgammaMonitorAnalysisAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
void fillEfficiency(const EventContext &ctx, const std::string &subgroup, const std::string &level, const std::string &pidword, const TrigInfo &info, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &pairObjs, const std::vector< asg::AcceptData > &acceptObjs, const std::string &dirname) const
void fillL1CaloResolution(const std::string &trigger, const std::vector< std::pair< const xAOD::Egamma *, const xAOD::EmTauRoI * > > &pairObjs) const
void fillL2Photon(const std::string &trigger, const std::vector< const xAOD::TrigPhoton * > &eg_vec) const
void fillInefficiency(const std::string &pidword, const TrigInfo &info, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &pairObjs, const std::vector< asg::AcceptData > &acceptObjs) const
void fillL2Electron(const std::string &trigger, const std::vector< const xAOD::TrigElectron * > &el_vec) const
void fillDistributions(const EventContext &ctx, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &, const TrigInfo &) const
void fillResolutions(const EventContext &ctx, const std::vector< std::pair< const xAOD::Egamma *, const TrigCompositeUtils::Decision * > > &pairObjs, const TrigInfo &info) const
*****************************************************************************************************...
void fillLabel(const ToolHandle< GenericMonitoringTool > &groupHandle, const std::string &histname, const std::string &label) const
void fillL1Calo(const std::string &trigger, const std::vector< const xAOD::EmTauRoI * > &l1_vec) const
Gaudi::Property< std::vector< std::string > > m_isemname
isem names
TrigEgammaMonitorBaseAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
const ToolHandle< TrigEgammaMatchingToolMT > & match() const
Get the e/g match tool.
float dR(const float, const float, const float, const float) const
Get delta R.
Gaudi::Property< bool > m_detailedHists
Include more detailed histograms.
const ToolHandle< Trig::TrigDecisionTool > & tdt() const
Get the TDT.
Gaudi::Property< bool > m_doEmulation
Do emulation.
float getEt(const xAOD::Electron *eg) const
Gaudi::Property< std::vector< std::string > > m_lhname
lh names
asg::AcceptData setAccept(const TrigCompositeUtils::Decision *, const TrigInfo &, const bool) const
Set the accept object for all trigger levels.
virtual StatusCode initialize() override
initialize
float getD0sig(const xAOD::Electron *eg) const
ToolHandle< Trig::TrigEgammaEmulationToolMT > m_emulatorTool
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
@ ETACALOFRAME
Eta in the calo frame (for egamma).
@ PHICALOFRAME
Phi in the calo frame (for egamma).
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition Egamma_v1.cxx:66
virtual Type::ObjectType type() const override=0
The type of the object as a simple enumeration, remains pure virtual in e/gamma.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition Egamma_v1.cxx:71
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition Egamma_v1.cxx:76
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx) const
Calculate the average mu, i.e.
std::string label(const std::string &format, int i)
Definition label.h:19
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
static const unsigned int allFeaturesOfType
Run 3 "enum". Return all features along legs (still with type and container checks).
@ Photon
The object is a photon.
Definition ObjectType.h:47
@ Electron
The object is an electron.
Definition ObjectType.h:46
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
TrigElectronContainer_v1 TrigElectronContainer
Declare the latest version of the container.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
TrigEMClusterContainer_v1 TrigEMClusterContainer
Define the latest version of the trigger EM cluster container.
TrigPhotonContainer_v1 TrigPhotonContainer
Declare the latest version of the container.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
Photon_v1 Photon
Definition of the current "egamma version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Electron_v1 Electron
Definition of the current "egamma version".
Extra patterns decribing particle interation process.
std::string dirname(std::string name)
Definition utils.cxx:200