45 Deprecate(
"Prefer to use lambda functions to define KVParticleCondition objects.");
50 fCondition_raw = fCondition;
56 fCondition_brackets =
"(" + fCondition_raw +
")";
81 :
KVBase(cond,
"KVParticleCondition")
129 :
KVBase(cond,
"KVParticleCondition")
161 :
KVBase(
"KVParticleCondition",
"Particle selection criteria")
241 :
KVBase(
"KVParticleCondition",
"Particle selection criteria")
260 if (&obj !=
this) obj.
Copy(*
this);
444 Error(
"operator&&",
"Both KVParticleCondition objects must use lambda captures in order to do this");
507 Error(
"operator&&",
"Both KVParticleCondition objects must use lambda captures in order to do this");
640 new_class.
Prepend(
"KVParticleCondition_");
680 Info(
"Optimize",
"Using existing optimized condition %p",
fOptimal);
690 cf->
AddMethod(
"optimized_test",
"Bool_t",
"public",
false,
true);
695 KVString body(
" //Optimized Test method for particle condition\n");
719 Error(
"Optimize",
" *** Optimization failed for KVParticleCondition : %s",
fCondition.
Data());
720 Error(
"Optimize",
" *** Use method AddExtraInclude(const Char_t*) to give the names of all necessary header files for compilation of your condition.");
721 Fatal(
"Optimize",
" *** THIS CONDITION WILL BE EVALUATED AS kFALSE FOR ALL PARTICLES!!!");
738 Error(
"Optimize",
" *** Optimization failed for KVParticleCondition : %s",
fCondition.
Data());
739 Error(
"Optimize",
" *** Use method AddExtraInclude(const Char_t*) to give the names of all necessary header files for compilation of your condition.");
740 Fatal(
"Optimize",
" *** THIS CONDITION WILL BE EVALUATED AS kFALSE FOR ALL PARTICLES!!!");
751 Info(
"Optimize",
"Success");
763 Info(
"Print",
"object name = %s, address = %p",
GetName(),
this);
766 cout <<
" * fOptimal = " <<
fOptimal << endl;
767 cout <<
" * fNUsing = " <<
fNUsing << endl;
769 cout <<
" * classfactory :" << endl;
KVParticleCondition operator||(const KVParticleCondition &A, const KVParticleCondition &B)
KVParticleCondition operator&&(const KVParticleCondition &A, const KVParticleCondition &B)
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
virtual void Copy(TObject &) const
Make a copy of this object.
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Factory class for generating skeleton files for new classes.
void Print(Option_t *opt="") const
Print infos on object.
void GenerateCode()
Generate header and implementation file for currently-defined class.
void SetInheritAllConstructors(Bool_t yes=kTRUE)
const Char_t * GetImpFileName() const
void AddHeaderIncludeFile(const Char_t *filename)
void Copy(TObject &obj) const
Copy the state of this KVClassFactory to the one referenced by 'obj'.
void AddImplIncludeFile(const Char_t *filename)
const Char_t * GetClassName() const
void AddMethodBody(const Char_t *method_name, const KVString &body)
void AddMethodArgument(const Char_t *method_name, const Char_t *argument_type, const Char_t *argument_name="", const Char_t *default_value="")
KVClassMethod * AddMethod(const Char_t *name, const Char_t *return_type, const Char_t *access="public", Bool_t isVirtual=kFALSE, Bool_t isConst=kFALSE)
Extended version of ROOT THashList.
Handles particle selection criteria for data analysis classes ,.
LambdaFunc fSavedLambda2
used by || and &&
virtual ~KVParticleCondition()
default dtor
static KVHashList fgOptimized
list of optimized particle conditions
Bool_t fOptOK
false if optimisation failed (can't load generated code)
void logical_operator_lambda_condition_test() const
void CreateClassFactory() const
Initialises KVClassFactory object used for optimization if it doesn't exist.
KVClassFactory * cf
used to generate code for optimisation
Int_t fNUsing
number of classes using this as an optimized condition
void AddExtraInclude(const Char_t *inc_file)
KVParticleCondition & operator|=(const KVParticleCondition &)
enum KVParticleCondition::LogOp fOpType
KVParticleCondition()
default ctor
KVString fOptimizedClassName
name of generated class used for optimisation
KVParticleCondition & operator&=(const KVParticleCondition &)
KVString fCondition
string containing selection criteria with ";" at end
void Copy(TObject &) const
Copy this to obj.
KVString fCondition_raw
'raw' condition, i.e. no ';'
void SetClassFactory(KVClassFactory *CF)
void SetParticleClassName(const Char_t *cl)
KVParticleCondition & operator=(const KVParticleCondition &)
Set condition to be same as for existing KVParticleCondition object.
std::function< bool(const KVNucleus *)> LambdaFunc
KVString fCondition_brackets
condition with '(' and ')' around it
void Set(const KVString &name, const LambdaFunc &F)
const KVParticleCondition * fOptimal
void Print(Option_t *opt="") const
Print informations on object.
LambdaFunc fLambdaCondition
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
virtual const char * GetName() const
virtual void SetName(const char *name)
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Fatal(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs, const T &... params)
const char * Data() const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
TString & ReplaceAll(const char *s1, const char *s2)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
const char * AsString() const