Commit f9c8ec4b authored by Enrico Bothmann's avatar Enrico Bothmann

Replace custom Smart_Pointer with std::shared_ptr

This has become possible because we require C++11 now
parent 6205aae8
......@@ -3,7 +3,8 @@
#include "AMEGIC++/Amplitude/Zfunctions/Basic_Func.H"
#include "AMEGIC++/Amplitude/Pfunc.H"
#include "ATOOLS/Org/Smart_Pointer.H"
#include <memory>
namespace AMEGIC {
class Zfunc_Calc;
......@@ -49,8 +50,8 @@ namespace AMEGIC {
std::string m_str;
Calc_List m_calclist;
Zfunc* p_equal;
SP(Zfunc_Calc) p_calculator;
Zfunc* p_equal;
std::shared_ptr<Zfunc_Calc> p_calculator;
Zfunc();
Zfunc(const Zfunc& z);
......
......@@ -32,7 +32,8 @@ void Zfunc_Generator::BuildZlist(Virtual_String_Generator* _sgen,Basic_Sfuncs* _
for (ZFCalc_Getter::Getter_List::const_iterator
git(zfclist.begin());git!=zfclist.end();++git) {
Zfunc_Calc *nc((*git)->GetObject(key));
if (nc!=NULL) zcalc.push_back(nc);
if (nc != nullptr)
zcalc.push_back(std::shared_ptr<Zfunc_Calc> {nc});
}
if (msg_LevelIsDebugging()) {
msg_Out()<<METHOD<<"(): {\n\n Implemented calculators:\n\n";
......
......@@ -4,7 +4,6 @@
#include "AMEGIC++/Main/Point.H"
#include <vector>
#include "AMEGIC++/Amplitude/Zfunc.H"
#include "ATOOLS/Org/Smart_Pointer.H"
namespace AMEGIC {
class Zfunc_Calc;
......@@ -12,7 +11,7 @@ namespace AMEGIC {
class Basic_Sfuncs;
class Virtual_String_Generator;
typedef std::vector<SP(Zfunc_Calc)> ZF_Vector;
typedef std::vector<std::shared_ptr<Zfunc_Calc>> ZF_Vector;
class Zfunc_Generator {
bool cutvecprop;
......
......@@ -2,7 +2,6 @@
#include "AMEGIC++/Amplitude/Zfunc_Generator.H"
#include "AMEGIC++/Main/Point.H"
#include "AMEGIC++/Amplitude/Zfunc.H"
#include "ATOOLS/Org/Smart_Pointer.C"
using namespace AMEGIC;
using namespace ATOOLS;
......@@ -12,8 +11,6 @@ using namespace ATOOLS;
#define OBJECT_TYPE AMEGIC::Zfunc_Calc
#include "ATOOLS/Org/Getter_Function.C"
namespace ATOOLS { template class SP(Zfunc_Calc); }
Zfunc_Calc::~Zfunc_Calc()
{
// for (size_t i(0);i<lorentzlist.size();++i) lorentzlist[i]->Delete();
......
......@@ -6,7 +6,6 @@
#include "AMEGIC++/Amplitude/Zfunctions/Basic_Func.H"
#include "AMEGIC++/Amplitude/Lorentz_Function.H"
#include "ATOOLS/Org/Getter_Function.H"
#include "ATOOLS/Org/Smart_Pointer.H"
#define Scalar_Args
......
#ifndef ATOOLS_Org_Command_Line_Interface_H
#define ATOOLS_Org_Command_Line_Interface_H
#include "ATOOLS/Org/Smart_Pointer.H"
#include <string>
#include <vector>
#include <map>
......
......@@ -16,8 +16,10 @@ void Info_Key::Assign(const std::string name,const size_t doubles,
info->AssignKey(*this,doubles,vectors);
}
void Info_Key::Assign(const std::string name,const size_t doubles,
const size_t vectors,const SP(Integration_Info) &info)
void Info_Key::Assign(const std::string name,
const size_t doubles,
const size_t vectors,
const std::shared_ptr<Integration_Info> &info)
{
m_name=name;
info->AssignKey(*this,doubles,vectors);
......
#ifndef ATOOLS_Org_Info_Key_H
#define ATOOLS_Org_Info_Key_H
#include "ATOOLS/Org/Smart_Pointer.H"
#include "ATOOLS/Math/Vector.H"
#include <string>
#include <vector>
#include <iostream>
#include <memory>
namespace ATOOLS {
......@@ -61,8 +61,10 @@ namespace ATOOLS {
// member functions
void Assign(const std::string name,const size_t doubles,
const size_t vectors,Integration_Info *const info);
void Assign(const std::string name,const size_t doubles,
const size_t vectors,const SP(Integration_Info) &info);
void Assign(const std::string name,
const size_t doubles,
const size_t vectors,
const std::shared_ptr<Integration_Info> &info);
inline Double_Container &Doubles() const;
inline Vector_Container &Vectors() const;
......
......@@ -2,9 +2,6 @@
#include "ATOOLS/Org/CXXFLAGS.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Smart_Pointer.C"
namespace ATOOLS { template class SP(Integration_Info); }
using namespace ATOOLS;
......
......@@ -47,8 +47,6 @@ localinc_HEADERS = \
CXXFLAGS.H \
Git_Info.H \
Return_Value.H \
Smart_Pointer.H \
Smart_Pointer.C \
Shell_Tools.H \
STL_Tools.H \
RUsage.H \
......
......@@ -155,7 +155,7 @@ template <class FileType>
My_File<FileType>::My_File(const std::string &path,
const std::string &file):
m_path(path), m_file(file),
p_file(NULL), m_mode(fom::permanent) {}
m_mode(fom::permanent) {}
template <class FileType>
My_File<FileType>::~My_File()
......@@ -166,13 +166,13 @@ My_File<FileType>::~My_File()
template <class FileType>
FileType *My_File<FileType>::operator()() const
{
return --p_file;
return p_file.get();
}
template <class FileType>
FileType *My_File<FileType>::operator->() const
{
return --p_file;
return p_file.get();
}
template <class FileType>
......@@ -203,15 +203,15 @@ template <class FileType>
bool My_File<FileType>::Open()
{
if (m_path=="" && m_file=="") {
p_file = new File_Type();
p_file = std::make_shared<File_Type>();
return false;
}
Close();
p_file = new File_Type();
std::ifstream *is=dynamic_cast<std::ifstream*>(&*p_file);
std::ofstream *os=dynamic_cast<std::ofstream*>(&*p_file);
p_file = std::make_shared<File_Type>();
std::ifstream *is=dynamic_cast<std::ifstream*>(p_file.get());
std::ofstream *os=dynamic_cast<std::ofstream*>(p_file.get());
if (is) {
p_stream = new MyStrStream();
p_stream = std::make_shared<MyStrStream>();
ZipEntry_Map::const_iterator zit=
s_zipfiles.find(m_path+m_file);
if (zit!=s_zipfiles.end()) {
......@@ -256,7 +256,7 @@ bool My_File<FileType>::Open()
return true;
}
if (os) {
p_stream = new MyStrStream();
p_stream = std::make_shared<MyStrStream>();
os->std::ios::rdbuf(p_stream->rdbuf());
os->seekp(0);
return true;
......@@ -267,8 +267,9 @@ bool My_File<FileType>::Open()
template <class FileType>
bool My_File<FileType>::Close()
{
if (p_file==NULL) return false;
std::ofstream *os=dynamic_cast<std::ofstream*>(&*p_file);
if (p_file == nullptr)
return false;
auto os = dynamic_cast<std::ofstream*>(p_file.get());
#ifdef USING__MPI
if (MPI::COMM_WORLD.Get_rank()==0)
#endif
......@@ -292,8 +293,8 @@ bool My_File<FileType>::Close()
}
}
p_file->close();
p_stream=NULL;
p_file=NULL;
p_stream.reset();
p_file.reset();
return true;
}
......
#ifndef ATOOLS_Org_My_File_H
#define ATOOLS_Org_My_File_H
#include "ATOOLS/Org/Smart_Pointer.H"
#include "ATOOLS/Org/MyStrStream.H"
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <memory>
namespace ATOOLS {
......@@ -38,8 +38,8 @@ namespace ATOOLS {
std::string m_path, m_file;
SP(File_Type) p_file;
SP(MyStrStream) p_stream;
std::shared_ptr<File_Type> p_file;
std::shared_ptr<MyStrStream> p_stream;
fom::code m_mode;
......
#include "ATOOLS/Org/STL_Tools.H"
#include "ATOOLS/Org/Smart_Pointer.C"
#include "ATOOLS/Phys/Flavour.H"
#include "ATOOLS/Math/Vector.H"
#include <fstream>
#include <string>
namespace ATOOLS {
template class SP(std::ifstream);
template class SP(std::ofstream);
template class SP(std::stringstream);
}
namespace std {
template <typename __Tp>
......
#include "ATOOLS/Org/Smart_Pointer.H"
#include "ATOOLS/Org/Shell_Tools.H"
template <class Class_Type> void ATOOLS::Smart_Pointer<Class_Type>::
Connect(const Smart_Pointer &ref) const
{
if ((p_this=ref.p_this)==NULL) return; p_owner=&ref;
if ((p_copy=ref.p_copy)!=NULL) p_copy->p_owner=this;
ref.p_copy=this;
}
template <class Class_Type> void
ATOOLS::Smart_Pointer<Class_Type>::Deconnect() const
{
if (p_owner) {
if ((p_owner->p_copy=p_copy)!=NULL) p_copy->p_owner=p_owner; }
else { if (p_copy) p_copy->p_owner=NULL;
else if (p_this!=NULL) delete p_this; }
p_owner=p_copy=NULL; p_this=NULL;
}
template <class Class_Type> const ATOOLS::Smart_Pointer<Class_Type> *
ATOOLS::Smart_Pointer<Class_Type>::FindOwner() const
{
if (p_owner) return p_owner->FindOwner();
return this;
}
template <class Class_Type>
void ATOOLS::Smart_Pointer<Class_Type>::PrintForward
(std::ostream &str,const bool all) const
{
if (all) {
str<<"("<<this<<")["<<Demangle(typeid(p_this).name())
<<"]: p_this = "<<p_this<<" {\n";
FindOwner()->PrintForward(str,false); str<<"}";
return;
}
str<<" ("<<this<<"): { p_owner = "<<p_owner
<<", p_copy = "<<p_copy<<" }\n";
if (p_copy!=NULL) p_copy->PrintForward(str);
}
#ifndef ATOOLS_Org_Smart_Pointer_H
#define ATOOLS_Org_Smart_Pointer_H
#ifndef NULL
#define NULL __null
#endif
#include <iostream>
#include <typeinfo>
namespace ATOOLS {
template <typename Class_Type>
class Smart_Pointer {
public:
typedef Class_Type Type;
/*!
\typedef Type
\brief Stores the object type
*/
private:
mutable Type *p_this;
/*!
\var p_this
\brief Stores the actual object pointer.
*/
mutable const Smart_Pointer *p_owner, *p_copy;
/*!
\var p_owner
\brief Stores a pointer to the Smart_Pointer
where p_this has been taken from. Is this by default.
*//*!
\var p_copy
\brief Stores a pointer to the first Smart_Pointer
having taken a copy of p_this. Is NULL by default.
*/
void Connect(const Smart_Pointer &ref) const;
/*!
\fn inline void Connect(const Smart_Pointer &ref)
\brief Connects to the chain of Smart_Pointers
belonging to ref.
*/
void Deconnect() const;
/*!
\fn inline void Deconnect()
\brief Deconnects from connected Smart_Pointers
and eventually deletes p_this.
*/
const Smart_Pointer *FindOwner() const;
/*!
\fn const Smart_Pointer &FindOwner() const
\brief Determines the first owner of p_this.
*/
public:
// constructors
inline Smart_Pointer():
p_this(NULL), p_owner(NULL), p_copy(NULL) { }
inline Smart_Pointer(Type *const type):
p_this(type), p_owner(NULL), p_copy(NULL) { }
inline Smart_Pointer(const Smart_Pointer &ref):
p_this(NULL), p_owner(NULL), p_copy(NULL) { Connect(ref); }
// destructor
inline ~Smart_Pointer() { Deconnect(); }
/*!
\fn inline ~Smart_Pointer()
\brief Removes the Smart_Pointer from its current chain.
Deletes p_this if no further Smart_Pointer holds it.
*/
// inline functions
inline Type &operator*() const { return *p_this; }
/*!
\fn inline Type &operator*() const
\brief Returns a reference to p_this.
*/
inline Type* operator->() const { return p_this; }
/*!
\fn inline Type *const operator->() const
\brief Returns a pointer to p_this.
*/
inline Type* operator--() const { return p_this; }
/*!
\fn inline Type *const operator--() const
\brief Returns a pointer to p_this.
*/
inline const Smart_Pointer &operator=(Type *const ref)
{
if (ref==p_this) return *this;
Deconnect(); p_this=ref; return *this;
}
/*!
\fn inline Type *const operator=(Type *const ref)
\brief If not equal to ref, sets p_this to ref.
Deconnects from connected Smart_Pointers
and eventually deletes p_this.
*/
inline const Smart_Pointer &operator=(const Smart_Pointer &ref)
{
if (ref==p_this) return *this;
Deconnect(); Connect(ref); return *this;
}
/*!
\fn inline Type *const operator=(Smart_Pointer &ref)
\brief If not equal to ref.p_this, sets p_this to ref.p_this.
Deconnects from connected Smart_Pointers
and eventually deletes p_this.
*/
inline bool operator==(const Smart_Pointer &ref) const
{ return ref.p_this==p_this; }
inline bool operator!=(const Smart_Pointer &ref) const
{ return !(*this==ref); }
inline bool operator<(const Smart_Pointer &ref) const
{ return ref.p_this<p_this; }
inline bool operator>=(const Smart_Pointer &ref) const
{ return !(*this<ref); }
inline bool operator>(const Smart_Pointer &ref) const
{ return ref.p_this>p_this; }
inline bool operator<=(const Smart_Pointer &ref) const
{ return !(*this>ref); }
inline bool operator==(const Type *ref) const { return ref==p_this; }
inline bool operator!=(const Type *ref) const { return !(p_this==ref); }
inline bool operator<(const Type *ref) const { return ref<p_this; }
inline bool operator>=(const Type *ref) const { return !(p_this<ref); }
inline bool operator>(const Type *ref) const { return ref>p_this; }
inline bool operator<=(const Type *ref) const { return !(p_this>ref); }
void PrintForward(std::ostream &str,const bool all=false) const;
};// end of class Smart_Pointer
/*!
\class Smart_Pointer
\brief Provides smart pointer handling
This class provides smart pointer handling. Once a pointer to an
object of type Class_Type has been passed to a corresponding
Smart_Pointer object it will automatically be deleted once the last
Smart_Pointer object assigned with it is destroyed.
The appropriate way to generate Smart_Pointers in the code
is as follows
\code
using namespace ATOOLS;
...
void Example_Function()
{
...
Example_Class *pointer = new Example_Class();
// call of constructor through #define directive
SP(Example_Class) smart_pointer_1;
// pointer assignment
smart_pointer_1=pointer;
...
// explicit call of constructor
Smart_Pointer<Example_Class> smart_pointer_2;
// smart pointer assignment
smart_pointer_2=smart_pointer_1;
...
}
\endcode
To avoid inlining problems, each class which is to be
used with Smart_Pointers must have the
template class SP(Class_Name) statement in its C-file.
From that file, include the implementation file Smart_Pointer.C, *not* the
header file Smart_Pointer.H. This is only necessary for the explicit
template instantiations. When only using Smart_Pointers it is sufficient to
include the header file Smart_Pointer.H, as usual.
*/
template <class Class_Type> inline std::ostream &
operator<<(std::ostream &str,const ATOOLS::Smart_Pointer<Class_Type> &p)
{
p.PrintForward(str,true);
return str;
}
}// end of namespace ATOOLS
#define SP(Class_Type) ATOOLS::Smart_Pointer<Class_Type>
#endif
......@@ -5,7 +5,6 @@
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Exception.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Smart_Pointer.H"
#include "ATOOLS/Org/Data_Reader.H"
#include "ATOOLS/Org/My_MPI.H"
......@@ -452,8 +451,8 @@ Blob_List Blob_List::Copy() const
if (signal) {
Blob_Data_Base* data = (*signal)["ATensor"];
if (data) {
SP(METOOLS::Amplitude2_Tensor) origamps = data->Get<SP(METOOLS::Amplitude2_Tensor)>();
SP(METOOLS::Amplitude2_Tensor) newamps(new METOOLS::Amplitude2_Tensor(*origamps));
auto origamps = data->Get<METOOLS::Amplitude2_Tensor_SP>();
auto newamps = std::make_shared<METOOLS::Amplitude2_Tensor>(*origamps);
newamps->UpdateParticlePointers(pmap);
data->Set(newamps);
}
......
......@@ -2,7 +2,6 @@
#include "ATOOLS/Phys/Blob.H"
#include "ATOOLS/Math/Random.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Smart_Pointer.C"
#include "ATOOLS/Org/Message.H"
#include <iomanip>
......@@ -13,8 +12,6 @@ namespace ATOOLS {
using namespace ATOOLS;
namespace ATOOLS { template class SP(Part_List); }
bool ATOOLS::Particle::operator==(Particle part)
{
if ((part.m_status==m_status)&&
......
......@@ -8,7 +8,6 @@
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Default_Reader.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Smart_Pointer.C"
#include "ATOOLS/Phys/Blob.H"
#include "MODEL/Main/Running_AlphaS.H"
#include "BEAM/Main/Beam_Spectra_Handler.H"
......@@ -897,6 +896,5 @@ namespace ATOOLS {
// Explicit template instantiations
template <> Blob_Data<Variation_Weights>::~Blob_Data() {}
template class Blob_Data<Variation_Weights>;
template class SP(Variation_Weights);
}
......@@ -24,7 +24,7 @@ Analysis_Object * ATOOLS::Getter<Analysis_Object,Argument_Matrix,
Event_Shapes_EE>::operator()(const Argument_Matrix &parameters) const
{
std::string inlist="FinalState", outlist="EEShapes";
ATOOLS::Particle_Qualifier_Base *qualifier=NULL;
Particle_Qualifier_Base_SP qualifier;
for (size_t i=0;i<parameters.size();++i) {
const std::vector<std::string> &cur=parameters[i];
if (cur[0]=="InList" && cur.size()>1) inlist=cur[1];
......@@ -32,11 +32,13 @@ Analysis_Object * ATOOLS::Getter<Analysis_Object,Argument_Matrix,
else if (cur[0]=="Qual" && cur.size()>1) {
if (ATOOLS::rpa->gen.Beam1().IsLepton() &&
ATOOLS::rpa->gen.Beam2().IsLepton()) {
qualifier = ATOOLS::Particle_Qualifier_Getter::GetObject(cur[1],cur[1]);
qualifier = Particle_Qualifier_Base_SP {
ATOOLS::Particle_Qualifier_Getter::GetObject(cur[1],cur[1])};
}
}
}
if (!qualifier) qualifier=new ATOOLS::Is_Not_Lepton();
if (!qualifier)
qualifier = std::make_shared<ATOOLS::Is_Not_Lepton>();
return new Event_Shapes_EE(inlist,outlist,qualifier);
}
......@@ -76,7 +78,7 @@ template class Blob_Data<Event_Shape_EE_Data>;
Event_Shapes_EE::Event_Shapes_EE(const std::string & _inlistname,
const std::string & _outlistname,
SP(Particle_Qualifier_Base) _quali) :
std::shared_ptr<Particle_Qualifier_Base> _quali) :
Final_Selector(_inlistname,_outlistname,-1,_quali),
m_startaxes(4), m_maxidentaxes(2), m_accuracy(1.e-4),
m_key(std::string("EvtShapeData"))
......
......@@ -38,7 +38,7 @@ namespace ANALYSIS {
public:
Event_Shapes_EE(const std::string & inlistname,
const std::string & outlistname,
SP(ATOOLS::Particle_Qualifier_Base) const);
std::shared_ptr<ATOOLS::Particle_Qualifier_Base> const);
void Evaluate(const ATOOLS::Blob_List &,double=1.,double ncount=1);
void Evaluate(const ATOOLS::Particle_List &,double=1.,double ncount=1);
Analysis_Object * GetCopy() const;
......
#include "AddOns/Analysis/Tools/Particle_Qualifier.H"
#include "ATOOLS/Phys/Blob.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Smart_Pointer.C"
using namespace ATOOLS;
namespace ATOOLS { template class SP(Particle_Qualifier_Base); }
Particle_Qualifier_Base::~Particle_Qualifier_Base()
{
}
......
......@@ -41,18 +41,19 @@ operator()(const Argument_Matrix &parameters) const
if (ATOOLS::rpa->gen.Beam1().IsLepton() &&
ATOOLS::rpa->gen.Beam2().IsLepton()) jetmode=1;
std::string inlist="FinalState", outlist="Analysed";
ATOOLS::Particle_Qualifier_Base *qualifier=NULL;
Particle_Qualifier_Base_SP qualifier;
for (size_t i=0;i<parameters.size();++i) {
const std::vector<std::string> &cur=parameters[i];
if (cur[0]=="InList" && cur.size()>1) inlist=cur[1];
else if (cur[0]=="OutList" && cur.size()>1) outlist=cur[1];
else if (cur[0]=="JetMode" && cur.size()>1) jetmode=ATOOLS::ToType<int>(cur[1]);
else if (cur[0]=="Qual" && cur.size()>1) {
if (!qualifier) delete qualifier;
qualifier = ATOOLS::Particle_Qualifier_Getter::GetObject(cur[1],cur[1]);
qualifier = Particle_Qualifier_Base_SP {
ATOOLS::Particle_Qualifier_Getter::GetObject(cur[1],cur[1])};
}
}
if (!qualifier) qualifier = new ATOOLS::Is_Not_Lepton();
if (!qualifier)
qualifier = std::make_shared<ATOOLS::Is_Not_Lepton>();
Final_Selector *selector = new Final_Selector(inlist,outlist,jetmode,qualifier);
selector->SetAnalysis(parameters());
for (size_t i=0;i<parameters.size();++i) {
......@@ -179,7 +180,7 @@ Final_Selector::Final_Selector(const std::string & inlistname,
Final_Selector::Final_Selector(const std::string & inlistname,
const std::string & outlistname,
int mode, SP(ATOOLS::Particle_Qualifier_Base) qualifier) :
int mode, Particle_Qualifier_Base_SP qualifier) :
p_qualifier(qualifier), m_inlistname(inlistname), m_outlistname(outlistname),
m_ownlist(false), m_extract(false), m_mode(mode), p_jetalg(NULL)
{
......@@ -187,9 +188,9 @@ Final_Selector::Final_Selector(const std::string & inlistname,
<<mode<<","<<qualifier<<")"<<std::endl;
m_name="Trigger";
switch (mode) {
case 1: p_jetalg = new Durham_Algorithm(--p_qualifier); break;
case 0: p_jetalg = new Kt_Algorithm(--p_qualifier); break;
case 3: p_jetalg = new DIS_Algorithm(--p_qualifier); break;
case 1: p_jetalg = new Durham_Algorithm(p_qualifier.get()); break;
case 0: p_jetalg = new Kt_Algorithm(p_qualifier.get()); break;
case 3: p_jetalg = new DIS_Algorithm(p_qualifier.get()); break;
default:
break;
}
......@@ -217,11 +218,11 @@ void Final_Selector::AddSelector(const Flavour & fl, const Final_Selector_Data &
switch(m_mode) {
case 2: p_jetalg = new
Calorimeter_Cone(fs.pt_min,fs.eta_min,fs.eta_max);break;
case 10: p_jetalg = new Midpoint_Cone(--p_qualifier,0,fs.f); break;
case 11: p_jetalg = new Midpoint_Cone(--p_qualifier,1,fs.f); break;
case 20: p_jetalg = new SISCone(--p_qualifier,fs.f); break;
case 30: p_jetalg = new MCFMCone(--p_qualifier,fs.f); break;
case 40: p_jetalg = new Kt_Algorithm(--p_qualifier); break;
case 10: p_jetalg = new Midpoint_Cone(p_qualifier.get(),0,fs.f); break;
case 11: p_jetalg = new Midpoint_Cone(p_qualifier.get(),1,fs.f); break;
case 20: p_jetalg = new SISCone(p_qualifier.get(),fs.f); break;
case 30: p_jetalg = new MCFMCone(p_qualifier.get(),fs.f); break;
case 40: p_jetalg = new Kt_Algorithm(p_qualifier.get()); break;
}
if (p_jetalg) p_jetalg->Setbflag(fs.bf);
}
......
......@@ -6,7 +6,6 @@
#include "AddOns/Analysis/Triggers/Calorimeter_Cone.H"
#include "AddOns/Analysis/Triggers/Kt_Algorithm.H"
#include "AddOns/Analysis/Triggers/Durham_Algorithm.H"
#include "ATOOLS/Org/Smart_Pointer.H"
#include <vector>
namespace ANALYSIS {
......@@ -29,12 +28,13 @@ namespace ANALYSIS {
typedef std::map<ATOOLS::Flavour,Final_Selector_Data> Final_Data_Map;
typedef std::map<std::pair<ATOOLS::Flavour,ATOOLS::Flavour>,Final_Selector_Data> Final_Correlator_Map;
using Particle_Qualifier_Base_SP
= std::shared_ptr<ATOOLS::Particle_Qualifier_Base>;
class Final_Selector : public Analysis_Object {
protected:
SP(ATOOLS::Particle_Qualifier_Base) p_qualifier;
Particle_Qualifier_Base_SP p_qualifier;
std::string m_inlistname, m_outlistname;
bool m_ownlist, m_extract;
int m_mode;
......@@ -57,7 +57,7 @@ namespace ANALYSIS {
public:
Final_Selector(const std::string &,const std::string &);
Final_Selector(const std::string &,const std::string &, int mode,
SP(ATOOLS::Particle_Qualifier_Base) qualifier=NULL);
Particle_Qualifier_Base_SP qualifier=nullptr);