ATLAS Offline Software
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 
14 namespace 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
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
BTagging.h
xAOD::BTagging_v1::setJetFitter_pu
void setJetFitter_pu(float value)
set JetFitter light probability
xAOD::BTagging_v1::setIP2D_pb
void setIP2D_pb(float value)
set IP2D b probability
TrigEFBjetContainer
Container of TrigEFBjet objects to be stored in POOL.
Definition: TrigEFBjetContainer.h:31
xAODMaker
Definition: StoreGateSvc.h:72
xAOD::BTagging_v1::setJetFitter_pb
void setJetFitter_pb(float value)
set JetFitter b probability
xAODMaker::TrigBjetCnvTool::TrigBjetCnvTool
TrigBjetCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: TrigBjetCnvTool.cxx:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::BTagging_v1::setIP3D_pu
void setIP3D_pu(float value)
set IP3D light probability
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
TrigEFBjetContainer.h
TrigBjetCnvTool.h
BTaggingContainer.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::BTagging_v1::setSV1_pu
void setSV1_pu(float value)
set SV1 light probability
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::BTagging
BTagging_v1 BTagging
Definition of the current "BTagging version".
Definition: BTagging.h:17
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::BTagging_v1::setIP2D_pu
void setIP2D_pu(float value)
set IP2D light probability
xAOD::BTagging_v1::setIP3D_pb
void setIP3D_pb(float value)
set IP3D b probability
xAODMaker::TrigBjetCnvTool::convert
virtual StatusCode convert(const TrigEFBjetContainer *aod, xAOD::BTaggingContainer *xaod) const override
Function that fills an existing xAOD::BTaggingContainer.
Definition: TrigBjetCnvTool.cxx:33
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::BTagging_v1::setMV1_discriminant
void setMV1_discriminant(float value)
set MV1 discriminant
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
xAOD::BTagging_v1::setSV1_pb
void setSV1_pb(float value)
set SV1 b probability
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.