ATLAS Offline Software
Loading...
Searching...
No Matches
TrigBjetCnvTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// EDM include(s):
10
11// Local include(s):
12#include "TrigBjetCnvTool.h"
13
14namespace xAODMaker {
15
17 const std::string& name,
18 const IInterface* parent )
19 : AthAlgTool( type, name, parent ) {
20
21 // Declare the interface(s) provided by the tool:
22 declareInterface< ITrigBjetCnvTool >( this );
23 }
24
34 xAOD::BTaggingContainer* xaod ) const {
35
36 // A small sanity check. The output container should really be empty...
37 if( !xaod->empty() ) {
38 ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
39 << xaod->size() << ")" );
40 }
41
42 // Loop over the AOD objects:
45
46 float xTemp=-1;
47 float wTemp=-1;
48
49 for( ; aod_itr != aod_end; ++aod_itr ) {
50
51 // // Add a new muon RoI object to the output:
52 xAOD::BTagging* roi = new xAOD::BTagging();
53 xaod->push_back( roi );
54
55 // // Now fill it with data:
56 // roi->setRoiWord((*aod_itr)->roiId());
57
58
59 xTemp=(*aod_itr)->xSV();
60 wTemp=pow(10.,xTemp);
61 if(xTemp<-5)wTemp=-5;
62 if(wTemp>100.) wTemp=-10;
63 roi->setSV1_pb(wTemp);
64 roi->setSV1_pu(1.);
65 //
66
67 xTemp=(*aod_itr)->xIP2D();
68 wTemp=pow(10.,xTemp);
69 if(xTemp<-5)wTemp=-5;
70 if(wTemp>100.) wTemp=-10;
71 roi->setIP2D_pb(wTemp);
72 roi->setIP2D_pu(1.);
73
74 xTemp=(*aod_itr)->xIP3D();
75 wTemp=pow(10.,xTemp);
76 if(xTemp<-5)wTemp=-5;
77 if(wTemp>100.) wTemp=-10;
78 roi->setIP3D_pb(wTemp);
79 roi->setIP3D_pu(1.);
80
81 roi->setJetFitter_pb((*aod_itr)->xCHI2());
82 roi->setJetFitter_pu(1.);
83
84
85
86 // Here we put W-value instead of X-value; see https://indico.cern.ch/event/346066/contribution/4/material/slides/0.pdf
87 // x=-1.0*TMath::Log10(1-(w/(1+w))) = TMath::Log10(1+w)
88
89 float xComb_temp=(*aod_itr)->xComb();
90 float wComb_temp=-1;
91 wComb_temp=pow(10., xComb_temp)-1;
92 if(xComb_temp<-5)wComb_temp=-5;
93 if(wComb_temp>100.) wComb_temp=-10;
94 roi->setMV1_discriminant(wComb_temp);
95
96
97
98 }
99
100
101 // Return gracefully:
102 return StatusCode::SUCCESS;
103 }
104
105} // namespace xAODMaker
#define ATH_MSG_WARNING(x)
constexpr int pow(int base, int exp) noexcept
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
Container of TrigEFBjet objects to be stored in POOL.
virtual StatusCode convert(const TrigEFBjetContainer *aod, xAOD::BTaggingContainer *xaod) const override
Function that fills an existing xAOD::BTaggingContainer.
TrigBjetCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
void setIP3D_pb(float value)
set IP3D b probability
void setIP3D_pu(float value)
set IP3D light probability
void setIP2D_pu(float value)
set IP2D light probability
void setMV1_discriminant(float value)
set MV1 discriminant
void setSV1_pu(float value)
set SV1 light probability
void setIP2D_pb(float value)
set IP2D b probability
void setSV1_pb(float value)
set SV1 b probability
void setJetFitter_pu(float value)
set JetFitter light probability
void setJetFitter_pb(float value)
set JetFitter b probability
BTaggingContainer_v1 BTaggingContainer
Definition of the current "BTagging container version".
BTagging_v1 BTagging
Definition of the current "BTagging version".
Definition BTagging.h:17