KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVIDGChIoSi.cpp
1/*
2$Id: KVIDGChIoSi.cpp,v 1.35 2009/05/05 15:57:52 franklan Exp $
3$Revision: 1.35 $
4$Date: 2009/05/05 15:57:52 $
5$Author: franklan $
6*/
7
8#include "KVIDGChIoSi.h"
9#include "KVIDZALine.h"
10#include "KVIDCutLine.h"
11#include "KVChIo.h"
12#include "KVSilicon.h"
13#include "TObjString.h"
14#include "TObjArray.h"
15#include "TROOT.h"
16#include "KVIdentificationResult.h"
17#include "KVIDTelescope.h"
18
19
22
25{
26 //Default constructor
27 init();
28}
29
30
31
34
36{
37 //constructor with a pattern
38 init();
39 SetPattern(pattern);
40}
41
42
43
47
49{
50 //default initialisations
51 //SetOnlyZId(kTRUE) is called
52
53 fBragg = fPunch = fSeuil = fEmaxSi = 0;
55}
56
57
58
59
62
64{
65 //Dtor.
66}
67
68
69
70
82
84{
85 // Sets fStatus for particle depending on its position in the grid.
86 //
87 // Returns kTRUE if the particle corresponding to point (x=esi,y=echio) in the ChIo-Si map
88 // is identifiable i.e. if it is contained within the region delimited by
89 // - the line indicating the limit of particles stopping in the ChIo (KVIDCutLine:"Seuil_Si", accpeted:"right")
90 // - the line indicating the maximum canal/energy Silicium before saturation (KVIDCutLine:"Emax_Si", accepted:"left")
91 // Particles which do not satisfy one of the following cuts:
92 // - the line indicating the lower limit of Z identification, or Bragg curve (KVIDCutLine:"Bragg_line", accepted:"right")
93 // - the line indicating the limit of particles punching through to the CsI (KVIDCutLine:"Punch_through", accepted:"above")
94 // are identified with a quality code warning.
95
96 Bool_t can_id = kTRUE;
97 //must be right of arret chio/seuil si line
98 if (fSeuil) {
99 can_id = fSeuil->WhereAmI(x, y, "right");
100 if (!can_id) {
101 const_cast < KVIDGChIoSi* >(this)->fICode = k_BelowSeuilSi;
102 if (rejected_by) *rejected_by = fSeuil->GetName();
103 return kFALSE;
104 };
105 }
106 //must be left of Emax_Si line
107 if (fEmaxSi) {
108 can_id = fEmaxSi->WhereAmI(x, y, "left");
109 if (!can_id) {
110 const_cast < KVIDGChIoSi* >(this)->fICode = k_RightOfEmaxSi;
111 if (rejected_by) *rejected_by = fEmaxSi->GetName();
112 return kFALSE;
113 };
114 }
115 return can_id;
116}
117
118
119
120
128
130{
131 // General initialisation method for identification grid.
132 // This method MUST be called once before using the grid for identifications.
133 // The ID lines are sorted.
134 // The natural line widths of all ID lines are calculated.
135 // The line with the largest Z (Zmax line) is found.
136 // Pointers to different 'OK lines' are initialised
137
139 fSeuil = (KVIDLine*)GetCut("Seuil_Si");
140 fBragg = (KVIDLine*)GetCut("Bragg_line");
141 fPunch = (KVIDLine*)GetCut("Punch_through");
142 fEmaxSi = (KVIDLine*)GetCut("Emax_Si");
143}
144
145
146
147
156
158{
159 // Called after reading a grid from an ascii file.
160 // Tries to convert information written by an old version of the class:
161 //
162 //<PARAMETER> Ring min=... ----> <PARAMETER> IDTelescopes=...
163 //<PARAMETER> Ring max=...
164 //<PARAMETER> Mod min=...
165 //<PARAMETER> Mod max=...
166
168 if (GetParameters()->HasParameter("IDTelescopes")) return;
169
170 Warning("BackwardsCompatibilityFix",
171 "This fix no longer works correctly. Dummy ID telescopes will be associated with this grid. There will be problems.");
172 if (GetParameters()->HasParameter("Rings")) { // && gIndra ) <== SHOULD NOT DEPEND ON KVINDRA!!!
173 KVNumberList Rings(GetParameters()->GetStringValue("Rings"));
174 KVNumberList Modules(GetParameters()->GetStringValue("Modules"));
175 int r, m;
176 Rings.Begin();
177 while (!Rings.End()) {
178 Modules.Begin();
179 r = Rings.Next();
180 while (!Modules.End()) {
181 m = Modules.Next();
182 KVIDTelescope* id = new KVIDTelescope();
183 id->SetName(Form("CI_SI_%02d%02d", r, m)); // gIndra->GetIDTelescope( Form("CI_SI_%02d%02d", r,m) ); <== SHOULD NOT DEPEND ON KVINDRA!!!
184 if (id) AddIDTelescope(id);
185 }
186 }
188 GetParameters()->RemoveParameter("Rings");
189 GetParameters()->RemoveParameter("Modules");
190 }
191 fSeuil = (KVIDLine*)GetCut("Seuil_Si");
192 fBragg = (KVIDLine*)GetCut("Bragg_line");
193 fPunch = (KVIDLine*)GetCut("Punch_through");
194 fEmaxSi = (KVIDLine*)GetCut("Emax_Si");
195 if (fSeuil)((KVIDCutLine*)fSeuil)->SetAcceptedDirection("right");
196 if (fBragg)((KVIDCutLine*)fBragg)->SetAcceptedDirection("right");
197 if (fPunch)((KVIDCutLine*)fPunch)->SetAcceptedDirection("above");
198 if (fEmaxSi)((KVIDCutLine*)fEmaxSi)->SetAcceptedDirection("left");
199 SetVarY("CI-E/PG/GG");
200 SetVarX("SI-E/PG/GG");
201 SetOnlyZId();
202}
203
204
205
217
219{
220 // After identification of the particle, we adjust the quality code
221 // (if the particle was well-identified by KVIDZAGrid::Identify, i.e. with
222 // fICode<KVIDZAGrid::kICODE4) if:
223 // the particle is below the 'Bragg_line' => quality code KVIDGChIoSi::k_LeftOfBragg
224 // in this case the Z given is a minimum value
225 // the particle is below the 'Punch_through' line
226 // => quality code KVIDGChIoSi::k_BelowPunchThrough, but the particle
227 // is in principle well identified, if a condition has been applied
228 // to make sure that the detector behind the silicon (i.e. CsI) did not
229 // fire.
230
231 KVIDZAGrid::Identify(x, y, idr);
232 // check Bragg & punch through for well identified particles
234 //identified particles below (left of) Bragg line : Z is a Zmin
235 if (fBragg && fBragg->WhereAmI(x, y, "left")) {
236 const_cast<KVIDGChIoSi*>(this)->fICode = k_LeftOfBragg;
237 idr->SetComment("Point to identify below Bragg curve. Z given is a Zmin");
238 }
239 //if a particle is well-identified (i.e. not too far from the identification lines)
240 //but it lies below the 'Punch_through' line, we give it a warning code
241 if (fPunch && fPunch->WhereAmI(x, y, "below")) {
242 const_cast<KVIDGChIoSi*>(this)->fICode = k_BelowPunchThrough;
243 idr->SetComment("warning: point below punch-through line");
244 }
245 idr->IDquality = fICode;
246 }
247 else if (fICode == KVIDZAGrid::kICODE7) {
248 // for particles above last line in grid, check if we are in fact in the Bragg zone
249 if (fBragg && fBragg->WhereAmI(x, y, "left")) {
250 const_cast<KVIDGChIoSi*>(this)->fICode = k_LeftOfBragg;
251 idr->SetComment("Point to identify below Bragg curve. Z given is a Zmin");
252 idr->IDOK = kTRUE;
253 idr->IDquality = fICode;
254 }
255
256 }
257}
258
259
ROOT::R::TRInterface & r
bool Bool_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
char * Form(const char *fmt,...)
Line in ID grid used to delimit regions where no identification is possible.
Definition KVIDCutLine.h:23
Identification grids for ChIo-Si telescopes of INDRA.
Definition KVIDGChIoSi.h:62
@ k_BelowPunchThrough
Definition KVIDGChIoSi.h:77
void BackwardsCompatibilityFix()
KVIDGChIoSi()
Default constructor.
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
KVIDLine * fPunch
punch-through line
Definition KVIDGChIoSi.h:67
virtual ~KVIDGChIoSi()
Dtor.
KVIDLine * fBragg
bragg line
Definition KVIDGChIoSi.h:66
virtual void Initialize()
KVIDLine * fSeuil
seuil silicium line
Definition KVIDGChIoSi.h:68
KVIDLine * fEmaxSi
saturation codeur silicon
Definition KVIDGChIoSi.h:69
virtual Bool_t IsIdentifiable(Double_t x, Double_t y, TString *rejected_by=nullptr) const
const KVNameValueList * GetParameters() const
Definition KVIDGraph.h:288
virtual void SetVarX(const char *v)
Definition KVIDGraph.h:525
void AddIDTelescope(KVBase *t)
Definition KVIDGraph.h:407
void WriteParameterListOfIDTelescopes()
virtual void SetVarY(const char *v)
Definition KVIDGraph.h:529
virtual void BackwardsCompatibilityFix()
void SetPattern(TString pattern)
Definition KVIDGraph.h:235
KVIDentifier * GetCut(const Char_t *name) const
Definition KVIDGraph.h:280
virtual void SetOnlyZId(Bool_t yes=kTRUE)
Base class for lines/cuts used for particle identification in 2D data maps.
Definition KVIDLine.h:143
Bool_t WhereAmI(Double_t px, Double_t py, Option_t *opt)
Base class for all detectors or associations of detectors in array which can identify charged particl...
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
virtual void Initialize()
Int_t fICode
code de retour
Definition KVIDZAGrid.h:85
Full result of one attempted particle identification.
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
void SetComment(const Char_t *c)
Int_t IDquality
specific quality code returned by identification procedure
void RemoveParameter(const Char_t *name)
Strings used to represent a set of ranges of values.
Bool_t End(void) const
void Begin(void) const
Int_t Next(void) const
const char * GetName() const override
virtual void Warning(const char *method, const char *msgfmt,...) const
Double_t y[n]
Double_t x[n]
void init()
TMarker m
ClassImp(TPyArg)