10#include "KVElasticScatterEvent.h"
11#include "KVPosition.h"
12#include "KVASMultiDetArray.h"
14#include "KVDetector.h"
15#include "KVTelescope.h"
18#include "KVNamedParameter.h"
143 Error(
"SetSystem",
"KVDBSystem pointer is not valid");
196 if (
name ==
"TARG") {
201 if (
name !=
"PROJ") {
202 Warning(
"SetDiffNucleus",
"%s Le nom en argument doit etre PROJ ou TARG, par defaut on choisit le projectile",
name.Data());
254 if (choix >= 0 && choix <= 2)
285 if (sname ==
"PROJ")
return proj;
286 else if (sname ==
"TARG")
return targ;
299 if (ii == 1)
return proj;
300 else if (ii == 2)
return targ;
331 if (gMultiDetArray) {
340 Warning(
"MakeDetection",
"Detection asked but no multiDetArray defined");
390 Info(
"GenereKV2Body",
"On genere le KV2Body");
441 if (layer_name ==
"") {
446 if (!(mat =
GetTarget()->GetLayer(layer_name))) {
447 printf(
"le nom du layer %s ne correspond a aucun present dans le cible\n", layer_name.
Data());
448 printf(
"Attention le layer doit etre appele par son symbol (ie Calcium -> Ca)");
520 Error(
"ValidateEntrance",
"Il n'y a pas de noyau projectile -> use SetProjNucleus()");
525 Info(
"ValidateEntrance",
"Il n'y a pas de noyau cible");
527 Error(
"ValidateEntrance",
"Il n'y a pas de noyau cible -> use SetTargNucleus() ou SetTargetMaterial");
532 Info(
"ValidateEntrance",
"Definition du noyau cible via DefineTargetNucleusFromLayer()");
552 Warning(
"ValidateEntrance",
"Pas de calcul de perte dans la cible ... ");
557 Info(
"ValidateEntrance",
"The elastic scatter events will not be detected/filtered");
561 Info(
"ValidateEntrance",
"Fin de GenereKV2Body");
587 Info(
"Process",
"Je Suis dans Process ... Youpee");
594 while (nn < ntimes) {
597 if ((nn % 1000) == 0) {
598 Info(
"Process",
"%d/%d diffusions treated", nn, ntimes);
633 knuc.GetParameters()->Clear();
634 knuc.RemoveAllGroups();
652 if (tmax <= kb2->GetMinAngleLab(
kDiffNuc)) {
742 printf(
"%lf / %lf\n", eLostInTarget,
proj->
GetKE());
780 Double_t eLostInTarget = knuc.GetKE();
782 eLostInTarget -= knuc.GetKE();
783 knuc.GetParameters()->SetValue(
"TARGET Out", eLostInTarget);
784 knuc.SetMomentum(*knuc.GetPInitial());
828 if (choix == 2) ediff = ediff2;
832 Bool_t sol2 = (ediff == ediff2);
855 ptot -= knuc->
Vect();
1037 printf(
"#####################\n");
1038 printf(
"## KVElasticScatterEvent::Print() ##\n");
1039 printf(
"# Diffusion elastique traitee :\n");
1040 printf(
"# %s+%s@%1.2lf MeV/A\n",
1046 printf(
"-------------------------\n");
1047 printf(
"# Propagation dans une cible de:\n");
1050 printf(
"#\ttype:%s epaisseur:%lf (mg/cm**2) / %lf\n",
1053 GetTarget()->GetLayerByIndex(nn + 1)->GetThickness()
1057 printf(
"-------------------------\n");
1059 printf(
"# Detection par %s\n", gMultiDetArray->
GetName());
1061 printf(
"#####################\n");
1080 Info(
"DefineHistos",
"DefineHistos");
1086 lhisto->
Add(
new TH2F(
"phi_theta",
"phi_theta", 180, 0, 180, 360, 0, 360));
1094 Info(
"DefineHistos",
"Creation de l histo interaction dans la cible");
1096 lhisto->
Add(
new TH1F(
"target_layer_depth",
"target_layer_depth",
TMath::Nint(thickness * 110), 0, thickness * 1.1));
1169 Info(
"DefineTrees",
"DefineTrees");
1234 if (tmin != -1)
th_min = tmin;
1235 if (tmax != -1)
th_max = tmax;
1236 if (pmin != -1)
phi_min = pmin;
1237 if (pmax != -1)
phi_max = pmax;
1262 Double_t tmin = -1, tmax = -1, pmin = -1, pmax = -1;
1278 Warning(
"DefineAngularRange(KVASMultiDetArray*)",
"Needs reimplementing");
1297 printf(
"les objects de type %s ne sont pas implemente dans KVElasticScatterEvent::DefineAngularRange\n", obj->
IsA()->
GetName());
1315 if (opt ==
"min")
return th_min;
1316 else if (opt ==
"max")
return th_max;
1332 if (opt ==
"min")
return phi_min;
1333 else if (opt ==
"max")
return phi_max;
R__EXTERN TRandom * gRandom
Relativistic binary kinematics calculator.
Double_t GetMaxAngleLab(Int_t i) const
void Print(Option_t *opt="") const
Double_t GetMinAngleLab(Int_t i) const
Double_t GetXSecRuthLab(Double_t ThetaLab_Proj, Int_t OfNucleus=3) const
Double_t GetELab(Double_t ThetaCM, Int_t OfNucleus) const
void CalculateKinematics()
KVNucleus * GetNucleus(Int_t i) const
virtual void SetNumber(UInt_t num)
virtual const Char_t * GetType() const
Database class used to store information on different colliding systems studied during an experiment....
KV2Body * GetKinematics()
KVTarget * GetTarget() const
Base class for detector geometry description.
simulate ElasticScatterEvent and answer of a given (multi-)detector : A + B -> A + B
virtual void SetProjNucleus(KVNucleus *nuc)
Define new projectile nucleus.
virtual void SetSystem(KVDBSystem *sys)
KVHashList * ltree
to store tree
virtual TVector3 & GetInteractionPointInTargetLayer()
return the last interaction point in the target
void Print(Option_t *="") const
virtual void ClearTrees()
Efface la liste des arbres et leur contenu et met le pointeur a zero.
virtual void DefineAngularRange(TObject *)
void SetDiffNucleus(KVString name="PROJ")
virtual void SetTargNucleus(KVNucleus *nuc)
Define new target nucleus.
virtual void DefineHistos()
Bool_t IsIsotropic() const
retoune kTRUE si l'option choisi est isotrope
virtual void SetAnglesForDiffusion(Double_t theta, Double_t phi)
void SetRandomOption(Option_t *opt="isotropic")
Bool_t IsTargMatSet() const
KVHashList * GetTrees() const
return the list where histo are stored
virtual void TreateEvent()
KVTarget * GetTarget() const
return the current target material
virtual void Process(Int_t ntimes=1, Bool_t reset=kTRUE)
void PropagateInTargetLayer()
virtual void ClearHistos()
Efface la liste des histo et leur contenu et met le pointeur a zero.
virtual void ResetHistos()
Reset histo in the list.
virtual void SetTargetMaterial(KVTarget *targ, Bool_t IsRandomized=kTRUE)
KVReconstructedEvent * rec_evt
void NewInteractionPointInTargetLayer()
void SetDetectionOn(Bool_t On=kTRUE)
KVHashList * GetHistos() const
return the list where histo are stored
Bool_t IsProjNucSet() const
Bool_t IsDetectionOn() const
Int_t kTreatedNevts
number of diffusion performed
virtual ~KVElasticScatterEvent()
Destructor.
virtual void Reset()
Set contents/entries to zero for predifined histograms, trees.
KVHashList * lhisto
to store control histogram
virtual Bool_t ValidateEntrance()
virtual void DefineTrees()
virtual void MakeDiffusion()
KVNucleus * GetNucleus(const Char_t *name) const
return the current projectile ("PROJ") or the target ("TARG") nucleus
void ChooseKinSol(Int_t choix=1)
Bool_t DefineTargetNucleusFromLayer(KVString layer_name="")
Bool_t IsTargNucSet() const
Double_t GetPhi(KVString opt) const
Double_t GetTheta(KVString opt) const
virtual void ResetTrees()
void Clear(Option_t *opt="")
static void MakeEventBranch(TTree *tree, const TString &branchname, T &event, Int_t bufsize=10000000)
KVNameValueList * GetParameters() const
Extended version of ROOT THashList.
Description of physical materials used to construct detectors & targets; interface to range tables.
Double_t GetAreaDensity() const
virtual void DetectEvent(KVEvent *event, KVReconstructedEvent *rec_event, const Char_t *detection_frame="")
void SetFilterType(Int_t t)
virtual void SetSimMode(Bool_t on=kTRUE)
virtual void SetTarget(KVTarget *target)
void SetValue(const Char_t *name, value_type value)
virtual void Clear(Option_t *opt="")
Description of properties and kinematics of atomic nuclei.
virtual void Print(Option_t *t="") const
Display nucleus parameters.
virtual void Copy(TObject &) const
Copy this KVNucleus into the KVNucleus object referenced by "obj".
void SetZandA(Int_t z, Int_t a)
Set atomic number and mass number.
void SetZAandE(Int_t z, Int_t a, Double_t ekin)
Set atomic number, mass number, and kinetic energy in MeV.
void SetTheta(Double_t theta)
void SetPhi(Double_t phi)
TVector3 GetMomentum() const
Double_t GetTheta() const
void SetKE(Double_t ecin)
void SetMomentum(const TVector3 *v)
void Set4Mom(const TLorentzVector &p)
void SetE0(TVector3 *e=0)
KVNameValueList * GetParameters() const
void SetName(const Char_t *nom)
Set Name of the particle.
Base class used for handling geometry in a multidetector array.
virtual void GetRandomAngles(Double_t &th, Double_t &ph, Option_t *t="isotropic")
virtual void SetAzimuthalMinMax(Double_t min, Double_t max)
Set min and max azimuthal angles and calculate (mean) phi.
Double_t GetPhiMax() const
Double_t GetPhiMin() const
Double_t GetThetaMin() const
virtual void SetPolarMinMax(Double_t min, Double_t max)
Set min and max polar angles and calculate (mean) theta.
Double_t GetThetaMax() const
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
virtual TObject * FindObject(const char *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual TObject * Last() const
virtual void Execute(const char *method, const char *params, Int_t *error=0)
virtual void Add(TObject *obj)
Container class for simulated nuclei, KVSimNucleus.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Calculation/correction of energy losses of particles through an experimental target.
void SetIncoming(Bool_t r=kTRUE)
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
TVector3 & GetInteractionPoint(KVParticle *part=0)
void SetRandomized(Bool_t r=kTRUE)
KVMaterial * GetLayerByIndex(Int_t ilayer) const
Double_t GetThickness() const
void SetInteractionLayer(Int_t ilayer, TVector3 &dir)
void SetOutgoing(Bool_t r=kTRUE)
Int_t GetLayerIndex(TVector3 &depth)
KVList * GetLayers() const
Associates two detectors placed one behind the other.
Particle * GetParticleWithName(const Char_t *name) const
virtual Int_t GetMult(Option_t *opt="") const
Wrapper class for iterating over nuclei in KVSimEvent accessed through base pointer or reference.
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
virtual Int_t GetEntries() const
virtual void SetXTitle(const char *title)
virtual void SetYTitle(const char *title)
const char * GetName() const override
TClass * IsA() const override
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual TClass * IsA() const
virtual void Info(const char *method, const char *msgfmt,...) const
virtual Double_t Uniform(Double_t x1, Double_t x2)
const char * Data() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
RVec< PromoteTypes< T0, T1 > > pow(const RVec< T0 > &v, const T1 &y)
constexpr Double_t DegToRad()