9 #include "KVDBSystem.h"
12 #include "KVNumberList.h"
16 #include "KVDBTable.h"
17 #include <KVUnownedList.h>
28 fZtarget = fAtarget = fZbeam = fAbeam = 0;
58 KVDBSystem::~KVDBSystem()
124 while ((run = (
KVDBRun*)next()))
216 if (!(other_runs = other_sys->
GetRuns()))
220 return (
first == other_first ? 0 : (other_first >
first ? -1 : 1));
239 while ((db = (
KVDBRun*) nxt()))
257 while ((run = (
KVDBRun*)next())) {
302 f <<
"Runs: " << runlist.
AsString() << endl;
344 fEbeam = target_thickness = 0;
347 char next_char =
f.peek();
348 if (next_char ==
'+') {
352 cout <<
"New System : " <<
line.Data() << endl;
355 Error(
"Load",
"Should read system name : %s\n",
line.Data());
358 next_char =
f.peek();
359 while (next_char !=
'+' &&
f.good() && !
f.eof()) {
360 if ((next_char >=
'0') && (next_char <=
'9')) {
363 cout <<
"Zproj = " <<
fZbeam <<
" Ztarg = " <<
fZtarget <<
" targ_thick = " << target_thickness <<
" Ebeam = " <<
fEbeam << endl;
371 if (
line.BeginsWith(
"Target")) {
373 line.Remove(0,
line.Index(
":") + 1);
376 sscanf(
line.Data(),
"%d %f", &nlay, &
angle);
379 for (
int i = 0; i < nlay; i++) {
381 sscanf(
line.Data(),
"%s %f", mat, &thick);
387 else if (
line.BeginsWith(
"Runs")) {
388 line.Remove(0,
line.Index(
":") + 1);
390 cout <<
"Runs : " <<
line.Data() << endl;
392 else if (
line.BeginsWith(
"Run Range")) {
393 line.Remove(0,
line.Index(
":") + 1);
395 sscanf(
line.Data(),
"%i %i", &frun, &lrun);
396 runlist.
Add(
Form(
"%i-%i", frun, lrun));
397 cout <<
"Run range : " <<
line.Data() << endl;
400 next_char =
f.peek();
434 std::map<int,KVDBRun*> run_map;
436 run_number = rl.
Next();
437 if(run_number>=idx_mult) run_number/=idx_mult;
438 if(run_map[run_number])
continue;
441 if (run->GetSystem()) {
451 Info(
"SetRuns",
"Could not add link for run %d", run_number);
475 if (!
rec->InheritsFrom(
"KVDBRun")) {
476 Error(
"AddRun",
"Called with pointer to an object of class %s; should inherit from KVDBRun!",
488 Info(
"AddRun",
"Could not add link for run %d", run->
GetNumber());
556 cout <<
"________________________________________________________" <<
557 endl <<
"System : " <<
GetName() << endl;
560 cout <<
"Runs : " <<
r.AsString() << endl;
561 cout <<
" Zbeam : " <<
fZbeam
562 << endl <<
" Abeam : " <<
fAbeam << endl <<
" Ebeam : " <<
fEbeam
563 <<
" A.MeV" << endl <<
" Ztarget : " <<
fZtarget << endl <<
564 " Atarget : " <<
fAtarget << endl <<
" Target Thickness : " <<
569 "________________________________________________________" << endl;
581 cout <<
"KVDBSystem : " <<
GetName() <<
" Runs : " <<
r.AsString() << endl;
687 while (i < 3 && !
name.End()) {
689 if (i < 2) tmp +=
" ";
710 name.Remove(
name.Index(reac), reac.Length() + 1);
Option_t Option_t TPoint TPoint angle
char * Form(const char *fmt,...)
Relativistic binary kinematics calculator.
void SetTarget(const KVNucleus &)
Set target for reaction.
void SetProjectile(const KVNucleus &)
Set projectile for reaction.
void CalculateKinematics()
KVNucleus * GetNucleus(Int_t i) const
Double_t GetCMEnergy() const
Return available kinetic energy in centre of mass.
virtual const Char_t * GetType() const
Cross-reference in a KVDataBase.
virtual void SetUniqueStatus(Bool_t unique)
Record folder for the database.
virtual Bool_t AddKey(KVDBKey *key, Bool_t check=kTRUE)
TString fFullPathTable
full path to parent table in folder structure
virtual Bool_t AddLink(const Char_t *key_name, KVDBRecord *rec, Bool_t linkback=kTRUE)
virtual void RemoveLink(const Char_t *key_name, KVDBRecord *rec, Bool_t linkback=kTRUE)
Remove the link between this record and the record "rec" in the DB table"key_name".
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
virtual void RemoveAllLinks(const Char_t *key)
Remove all links between this record and the records in the DB table"key_name".
virtual Int_t GetNumber() const
Description of an experimental run in database ,,.
KVDBSystem * GetSystem() const
Int_t GetNGoodRunFiles() const
Database class used to store information on different colliding systems studied during an experiment....
Int_t Compare(const TObject *) const override
UInt_t GetZtarget() const
.............. inline functions ...............
Bool_t IsCollision() const
retourne kTRUE, si le systeme est une collision ie projectile+cible
UInt_t GetAtarget() const
KVUnownedList * _GetRuns()
void ls(Option_t *option="*") const override
Float_t fEbeam
Energy of the beam in MeV/nucleon.
Int_t GetNGoodRunFiles() const
KVUnownedList * GetRuns() const
Returns a sorted list of all the runs associated with this system.
void RemoveRun(KVDBRecord *)
void Save(std::ostream &) const
Float_t GetTargetThickness() const
void AddRun(KVDBRecord *)
void SetRuns(KVNumberList &, int=1)
TString GetBatchNameWithoutEnergy()
KV2Body * GetKinematics()
KVUnownedList * fRunlist
used to store pointer to sorted list of runs
UInt_t fAbeam
Mass of the projectile nucleus.
Double_t GetZVtot() const
TString GetReactionNameWithoutEnergy()
TString GetReactionEnergyWithoutName()
KVDBTable * GetRunsTable()
Int_t fRuns
temporary variable used to stock number of associated runs
KV2Body * fCinema
used to calculate kinematics of entrance channel
UInt_t fZtarget
charge of the target nucleus
KVTarget * fTarget
physical target used for experiment run
void GetRunList(KVNumberList &) const
Fills the KVNumberList object with the list of all run numbers associated with this system.
void Load(std::istream &, int=1)
UInt_t fZbeam
temporary variable used to stock number of available events
UInt_t fAtarget
Mass of the target nucleus.
void Print(Option_t *option="") const override
virtual KVDBRecord * GetRecord(const Char_t *rec_name) const
Extended TList class which owns its objects by default.
void Sort(Bool_t order=kSortAscending)
Description of physical materials used to construct detectors & targets; interface to range tables.
Double_t GetAreaDensity() const
Bool_t IsIsotopic() const
Description of properties and kinematics of atomic nuclei.
const Char_t * GetSymbol(Option_t *opt="") const
Strings used to represent a set of ranges of values.
void Clear(Option_t *="") override
Empty number list, reset it to initial state.
const Char_t * AsString(Int_t maxchars=0) const
void SetList(const TString &)
void Add(Int_t)
Add value 'n' to the list.
TVector3 GetMomentum() const
void SetEnergy(Double_t e)
Wrapper for TRefArray adding some functionality.
void Add(TObject *obj) override
TObject * At(Int_t idx) const override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Calculation/correction of energy losses of particles through an experimental target.
void Print(Option_t *opt="") const override
void SetAngleToBeam(Double_t a)
Int_t NumberOfLayers() const
void AddLayer(const Char_t *material, Double_t thick)
KVList * GetLayers() const
Double_t GetAngleToBeam()
Gives angle of target to incident beam direction in degrees.
Extended TList class which does not own its objects by default.
virtual void SetTitle(const char *title="")
const char * GetName() const override
virtual void SetName(const char *name)
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * Data() const
TString & ReplaceAll(const char *s1, const char *s2)