23 #define KVEVENT_PART_INDEX_OOB "Particle index %d out of bounds [1,%d]"
89 template <
typename Particle>
145 if (
fType == Type::Bad)
152 return static_cast<Particle*
>(*fIter);
174 if (!
e->GetParticleArray()->GetClass()->InheritsFrom(Particle::Class())) {
175 ::Warning(
"KVTemplateEvent::Iterator",
"KVTemplateEvent<%s>::Iterator for %s particles requested for event containing %s particles. Iteration is aborted.",
176 Particle::Class()->
GetName(), Particle::Class()->
GetName(),
e->GetParticleArray()->GetClass()->GetName());
191 if (!
e.GetParticleArray()->GetClass()->InheritsFrom(Particle::Class())) {
192 ::Warning(
"KVTemplateEvent::Iterator",
"KVTemplateEvent<%s>::Iterator for %s particles requested for event containing %s particles. Iteration is aborted.",
193 Particle::Class()->
GetName(), Particle::Class()->
GetName(),
e.GetParticleArray()->GetClass()->GetName());
207 if (!
e->GetParticleArray()->GetClass()->InheritsFrom(Particle::Class())) {
208 ::Warning(
"KVTemplateEvent::Iterator",
"KVTemplateEvent<%s>::Iterator for %s particles requested for event containing %s particles. Iteration is aborted.",
209 Particle::Class()->
GetName(), Particle::Class()->
GetName(),
e->GetParticleArray()->GetClass()->GetName());
212 if (
fType == Type::OK) {
217 else if (
fType == Type::Group) {
219 return n->BelongsToGroup(grp);
233 if (!
e.GetParticleArray()->GetClass()->InheritsFrom(Particle::Class())) {
234 ::Warning(
"KVTemplateEvent::Iterator",
"KVTemplateEvent<%s>::Iterator for %s particles requested for event containing %s particles. Iteration is aborted.",
235 Particle::Class()->
GetName(), Particle::Class()->
GetName(),
e.GetParticleArray()->GetClass()->GetName());
238 if (
fType == Type::OK) {
243 else if (
fType == Type::Group) {
245 return n->BelongsToGroup(grp);
260 template<
typename Po
interType = Particle>
263 return dynamic_cast<PointerType*
>(
current());
265 template<
typename ReferenceType = Particle>
268 return dynamic_cast<ReferenceType&
>(*
current());
270 template<
typename Po
interType = Particle>
273 return dynamic_cast<const PointerType*
>(
current());
275 template<
typename ReferenceType = Particle>
278 return dynamic_cast<const ReferenceType&
>(*
current());
331 if (t != Type::Null) {
333 if (
fType == Type::OK) {
338 else if (
fType == Type::Group) {
340 return n->BelongsToGroup(grp);
375 #ifdef __WITHOUT_TCA_CONSTRUCTED_AT
376 Particle* tmp = (Particle*) ConstructedAt(mult,
"C");
381 Error(
"AddParticle",
"Allocation failure, Mult=%d", mult);
396 return (Particle*)((*fParticles)[npart - 1]);
422 if (A > 0)
return (
Int_t)
GetSum(
"IsIsotope",
"int,int",
Form(
"%d,%d", Z, A), opt);
439 std::unique_ptr<TObjArray> spec(species.
Tokenize(
", "));
440 Int_t nspec = spec->GetEntries();
441 memset(mult, 0, nspec *
sizeof(
Int_t));
443 for (
int i = 0; i < nspec; i++) {
444 if (((
TObjString*)(*spec)[i])->String() == (*it).GetSymbol()) mult[i] += 1;
466 for (; it !=
end(); ++it) {
474 for (; it !=
end(); ++it) {
501 for (; it !=
end(); ++it) {
509 for (; it !=
end(); ++it) {
535 for (; it !=
end(); ++it) {
543 for (; it !=
end(); ++it) {
566 for (; it !=
end(); ++it) {
574 for (; it !=
end(); ++it) {
587 std::cout <<
"\nKVEvent with " <<
GetMult(t) <<
" particles :" << std::endl;
588 std::cout <<
"------------------------------------" << std::endl;
610 if (!tmp)
Warning(
"GetParticle",
"Particle not found: %s", group_name);
657 Bool_t ok_iter = (Opt ==
"OK");
661 else if (grp_iter)
fIter =
Iterator(
this, Iterator::Type::Group, Opt);
663 return &(*(
fIter++));
697 (*it).AddGroup(groupname);
707 if (cond->
Test(it.get_const_pointer()))(*it).AddGroup(groupname, from);
719 for (
auto& part : *
this) {
720 part.SetFrame(frame, ft);
735 for (
auto& part : *
this) {
736 part.SetFrame(newframe, oldframe, ft);
748 for (
auto& part : *
this) {
749 part.ChangeFrame(ft, name);
761 for (
auto& part : *
this) {
762 part.ChangeDefaultFrame(newdef, defname);
773 for (
auto& part : *
this) {
774 part.UpdateAllFrames();
778 template<
typename U = Particle>
779 typename std::enable_if<std::is_base_of<KVNucleus, U>::value>::type
804 template<
typename U = Particle>
805 typename std::enable_if<std::is_base_of<KVNucleus, U>::value>::type
813 for (
Iterator it =
begin(); it !=
end(); ++it) mass[i++] = (*it).GetMassGS();
816 template<
typename U = Particle>
817 typename std::enable_if<std::is_base_of<KVNucleus, U>::value,
Double_t>::type
838 for (
int i = 1; i <=
M; i++) {
842 return CN.GetMassGS() - sumM;
844 template<
typename U = Particle>
845 typename std::enable_if < !std::is_base_of<KVNucleus, U>::value,
Double_t >::type
855 template<
typename U = Particle>
856 typename std::enable_if<std::is_base_of<KVNucleus, U>::value,
Double_t>::type
875 for (
int i = 1; i <=
M; i++) {
879 return CN.GetMassGS() - sumM;
881 template<
typename U = Particle>
882 typename std::enable_if<std::is_base_of<KVNucleus, U>::value,
KVString>::type
898 TString st = (*it).GetSymbol();
905 if (pop == 1) partition += nvl.
GetNameAt(ii);
907 if (ii < nvl.
GetEntries() - 1) partition +=
" ";
912 template<
typename U = Particle>
913 typename std::enable_if < !std::is_base_of<KVNucleus, U>::value,
KVString >::type
935 (*it).SetFrameName(name);
992 Bool_t ok_iter = (Opt ==
"OK");
KVIonRangeTableMaterial * M
KVTemplateEvent< KVNucleus >::EventOKIterator EventOKIterator
KVTemplateEvent< KVNucleus >::EventGroupIterator EventGroupIterator
KVTemplateEvent< KVNucleus >::EventIterator EventIterator
#define KVEVENT_PART_INDEX_OOB
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Abstract base class container for multi-particle events.
KVNameValueList fParameters
general-purpose list of parameters
TClonesArray * fParticles
array of particles in event
const TClonesArray * GetParticleArray() const
virtual Int_t GetMult(Option_t *opt="") const
void SetParameter(const Char_t *name, ValType value) const
Handle a list of positive integers (partition)
void Add(TArrayI *tab)
void Fill(Double_t* tab,Int_t mult);
void Clear(Option_t *option="")
Classe dérivée de TNamed, Reinitialisation de l'object.
void SetPopulation(Int_t pop)
Initialise la population à "pop".
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
virtual void Print(Option_t *opt="") const
Int_t GetIntValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
const Char_t * GetNameAt(Int_t idx) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Class used for iterating over particles in events.
const PointerType * get_const_pointer() const
Iterator(const KVEvent *e, const KVTemplateParticleCondition< Particle > &selection)
Bool_t IsIterating() const
Particle & operator*() const
const Iterator & operator++()
std::forward_iterator_tag iterator_category
PointerType * get_pointer() const
Iterator(const Iterator &i)
ReferenceType & get_reference() const
Iterator(const KVEvent &e, Type t=Type::All, TString grp="")
std::ptrdiff_t difference_type
Iterator(const KVEvent &e, const KVTemplateParticleCondition< Particle > &selection)
KVTemplateParticleCondition< Particle > fSelection
Bool_t operator==(const Iterator &it) const
Iterator(const KVEvent *e, Type t=Type::All, TString grp="")
Bool_t operator!=(const Iterator &it) const
Particle * current() const
Bool_t AcceptableIteration()
Iterator & operator=(const Iterator &rhs)
void Reset(Type t=Type::Null, TString grp="")
const ReferenceType & get_const_reference() const
void SetIsIterating(Bool_t on=kTRUE)
Base class for event classes (containers for different types of particle objects)
std::enable_if< !std::is_base_of< KVNucleus, U >::value, KVString >::type get_partition_name()
EventIterator ConditionalIterator(const KVTemplateParticleCondition< Particle > &c)
void ResetGetNextParticle() const
void ChangeFrame(const KVFrameTransform &ft, const KVString &name="")
Particle * GetNextParticle(Option_t *opt="") const
std::enable_if< std::is_base_of< KVNucleus, U >::value >::type GetGSMasses(std::vector< Double_t > &mass)
void GetMasses(std::vector< Double_t > &mass)
virtual void ls(Option_t *t="") const
void DefineGroup(const Char_t *groupname, const Char_t *from="")
Int_t GetMultiplicity(Int_t Z, Int_t A=0, Option_t *opt="")
void SetFrame(const Char_t *newframe, const Char_t *oldframe, const KVFrameTransform &ft)
Particle * GetParticle(Int_t npart) const
Iterator GetNextParticleIterator(Option_t *opt) const
KVString GetPartitionName()
KVTemplateEvent(Int_t mult=50)
internal iterator used by GetNextParticle()
Particle * GetParticle(const Char_t *group_name) const
void FillHisto(TH1 *h, const Char_t *Nucleus_method, const Char_t *method_prototype, const Char_t *args, Option_t *opt="")
Double_t GetSum(const Char_t *Nucleus_method, Option_t *opt="")
std::enable_if< !std::is_base_of< KVNucleus, U >::value, Double_t >::type get_channel_qvalue() const
std::enable_if< std::is_base_of< KVNucleus, U >::value, KVString >::type get_partition_name()
std::enable_if< std::is_base_of< KVNucleus, U >::value, Double_t >::type get_channel_qvalue() const
void SetFrame(const Char_t *frame, const KVFrameTransform &ft)
Particle * GetParticleWithName(const Char_t *name) const
void DefineGroup(const Char_t *groupname, KVTemplateParticleCondition< Particle > *cond, const Char_t *from="")
void SetFrameName(const KVString &name)
std::enable_if< std::is_base_of< KVNucleus, U >::value, Double_t >::type GetGSChannelQValue() const
Double_t GetChannelQValue() const
void GetMultiplicities(Int_t mult[], const TString &species, Option_t *opt="")
std::enable_if< std::is_base_of< KVNucleus, U >::value >::type FillIntegerList(KVIntegerList *IL, Option_t *opt)
void FillHisto(TH1 *h, const Char_t *Nucleus_method, Option_t *opt="")
virtual Int_t GetMult(Option_t *opt="") const
void ChangeDefaultFrame(const Char_t *newdef, const Char_t *defname="")
Double_t GetSum(const Char_t *Nucleus_method, const Char_t *method_prototype, const Char_t *args, Option_t *opt="")
virtual void Print(Option_t *t="") const
Bool_t Test(const ParticleType *nuc) const
void Set(const KVString &name, const LambdaFunc &F)
TObject * ConstructedAt(Int_t idx)
virtual void Sort(Int_t upto=kMaxInt)
virtual Int_t Fill(const char *name, Double_t w)
static const EReturnType kLong
void InitWithPrototype(const char *function, const char *proto, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
static const EReturnType kDouble
virtual const char * GetName() const
Int_t GetEntriesFast() const
virtual TObject * FindObject(const char *name) const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
TObjArray * Tokenize(const TString &delim) const
const char * Data() const
auto All(const RVec< T > &v) -> decltype(v[0]==false)
Double_t Max(Double_t a, Double_t b)
EventGroupIterator(const KVEvent &event, const TString &grp)
EventGroupIterator(const KVEvent *event, const TString &grp)
EventIterator(const KVEvent &event, typename Iterator::Type t=Iterator::Type::All, const TString &grp="")
EventIterator(const KVEvent *event, typename Iterator::Type t=Iterator::Type::All, const TString &grp="")
EventIterator(const KVEvent *event, const KVTemplateParticleCondition< Particle > &selection)
EventIterator(const KVEvent &event, const KVTemplateParticleCondition< Particle > &selection)
EventOKIterator(const KVEvent &event)
EventOKIterator(const KVEvent *event)