KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVFAZIAIDTelescope.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Mon Feb 17 13:51:39 2014
2 //Author: John Frankland,,,
3 
4 #include "KVFAZIAIDTelescope.h"
5 
7 
9 
10 // BEGIN_HTML <!--
12 /* -->
13 <h2>KVFAZIAIDTelescope</h2>
14 <h4>Identification for FAZIA array</h4>
15 <!-- */
16 // --> END_HTML
18 
19 
20 
24 {
25  // Default constructor
26  if (!fMassIDProb) {
27  fMassIDProb = new TF1("FAZIA-MassIDProb", "1./(exp((x-[0])/[1])+1)", 0, 100);
28  fMaxZ = 22.5;
29  fSigmaZ = .5;
30 // fMassIDProb->SetParameters(22.5, .5);
31  }
32 }
33 
34 
35 
40 
42 {
43  //Add a detector to the telescope.
44  //The first detector added is the "DeltaE" member, the second the "Eresidual" member.
45  //Update name of telescope to "ID_[name of DE]_[name of E]"
46 
47  if (d) {
48  fDetectors.Add(d);
49  d->AddIDTelescope(this);
50  if (GetSize() > 1)
51  SetName(Form("ID_%s_%s_%d", GetDetector(1)->GetLabel(), GetDetector(2)->GetLabel(), GetDetector(1)->GetIndex()));
52  else
53  SetName(Form("ID_%s_%d", GetDetector(1)->GetLabel(), GetDetector(1)->GetIndex()));
54  }
55  else {
56  Warning("AddDetector", "Called with null pointer");
57  }
58 }
59 
60 
61 //const Char_t* KVFAZIAIDTelescope::GetNewName(KVString oldname)
62 //{
63 
64 // KVString tmp = "";
65 // KVString lab = "";
66 // oldname.Begin("_");
67 // KVString id = oldname.Next();
68 // if (id != "ID") return "unkonwn";
69 // if (oldname.End()) return "unkonwn";
70 // KVString det1 = oldname.Next();
71 // KVString det2 = "";
72 // if (!oldname.End()) {
73 // det2 = oldname.Next();
74 // }
75 // KVString newdet1 = KVFAZIADetector::GetNewName(det1.Data());
76 // newdet1.Begin("-");
77 // KVString labdet1 = newdet1.Next();
78 // KVString idxdet1 = newdet1.Next();
79 
80 // static KVString newname;
81 // if (det2 == "") {
82 // newname.Form("ID_%s_%s", labdet1.Data(), idxdet1.Data());
83 // }
84 // else {
85 // KVString newdet2 = KVFAZIADetector::GetNewName(det2.Data());
86 // newdet2.Begin("-");
87 // KVString labdet2 = newdet2.Next();
88 // newname.Form("ID_%s_%s_%s", labdet1.Data(), labdet2.Data(), idxdet1.Data());
89 // }
90 
91 // return newname.Data();
92 //}
93 
94 
100 
102 {
103  // For filtering simulations
104  //
105  // Z-dependence of A identification:
106  // fMassIDProb parameters has to set in the Initialize method
107 
108 
110 
111 // Info("SetIdentificationStatus","%s : %lf %lf",ClassName(),fMassIDProb->GetParameter(0),fMassIDProb->GetParameter(1));
112 
113  n->SetZMeasured();
114  Bool_t okmass = (gRandom->Uniform() < fMassIDProb->Eval(n->GetZ())) && CanIdentify(n->GetZ(), n->GetA());
115 
116  if (okmass) {
117  //reset A to the original mass in case of multiple call of this method
118  if (n->GetParameters()->HasParameter("OriginalMass")) n->SetA(n->GetParameters()->GetIntValue("OriginalMass"));
119  n->SetAMeasured(kTRUE);
120  }
121  else {
122  //save the original mass in the parameter list in case of multiple call of this method
123  n->GetParameters()->SetValue("OriginalMass", n->GetA());
124  double e = n->GetE();
125  n->SetZ(n->GetZ());
126  n->SetE(e);
127  n->SetAMeasured(kFALSE);
128  }
129 }
130 
131 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define d(i)
#define e(i)
const Bool_t kFALSE
bool Bool_t
const Bool_t kTRUE
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
const Char_t * GetLabel() const
Definition: KVBase.h:192
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
static TF1 * fMassIDProb
virtual void SetIdentificationStatus(KVReconstructedNucleus *n)
static const Char_t* GetNewName(KVString oldname);
virtual void AddDetector(KVDetector *d)
KVDetector * GetDetector(UInt_t n) const
virtual Bool_t CanIdentify(Int_t Z, Int_t)
KVList fDetectors
list of detectors in telescope
Definition: KVIDTelescope.h:95
UInt_t GetSize() const
Nuclei reconstructed from data measured by a detector array ,.
virtual void Add(TObject *obj)
virtual void SetParameters(const Double_t *params)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual void SetName(const char *name)
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual Double_t Uniform(Double_t x1, Double_t x2)
const Int_t n