ATLAS Offline Software
JetVariable.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 namespace JetVar {
9 
10  std::unique_ptr<Variable> Variable::create(const std::string & name, const std::string &type, int index){
11 
12  // if known name, return the corresponding dedicated class
13  if(name=="e") return std::make_unique<EVar>(name);
14  if(name=="et") return std::make_unique<EtVar>(name);
15  if(name=="pz") return std::make_unique<PzVar>(name);
16  if(name=="nconstit") return std::make_unique<NconstitVar>(name);
17  if(name=="abseta") return std::make_unique<AbsEtaVar>(name);
18  if(name=="|eta|") return std::make_unique<AbsEtaVar>(name);
19  if(name=="rapidity") return std::make_unique<Rapidity>(name);
20  if(name=="fCharged") return std::make_unique<FChargedVar>(name);
21  if(name=="EM3Frac") return std::make_unique<EM3FracVar>(name);
22  if(name=="Tile0Frac") return std::make_unique<Tile0FracVar>(name);
23 
24  // Else assume we're looking for an attribute attached to the jet
25  if(type=="float") return std::make_unique<VariableAtt<float> >(name);
26  if(type=="int") return std::make_unique<VariableAtt<int> >(name);
27  if(type=="vecfloat") return std::make_unique<VariableAtt<std::vector<float> > >(name, index);
28  if(type=="vecint") return std::make_unique<VariableAtt< std::vector<int> > >(name, index);
29 
30 
31  return nullptr;
32  }
33 
34 
35 }
index
Definition: index.py:1
JetVar::Variable::create
static std::unique_ptr< Variable > create(const std::string &name, const std::string &type="float", int index=-1)
create and return a new Variable of a given name & type.
Definition: JetVariable.cxx:10
JetVar
Definition: JetSelectorAttribute.h:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
JetVar::Variable::name
virtual std::string name() const
Definition: JetVariable.h:65
JetVariable.h
DeMoScan.index
string index
Definition: DeMoScan.py:364
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78