KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVFAZIAIDSiCsI_FAZIASYM.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Tue Sep 8 16:14:25 2015
2 //Author: ,,,
3 
5 #include "KVDataSet.h"
6 //#include <cstdio>
7 //#include <cstdlib>
8 
10 
11 // BEGIN_HTML <!--
13 /* -->
14 <h2>KVFAZIAIDSiCsI</h2>
15 <h4>id telescope to manage FAZIA Si-CsI identification</h4>
16 <!-- */
17 // --> END_HTML
19 
20 
21 
25 {
26  // Default constructor
27  SetType("Si-CsI");
28  fBelowProton = 0;
29  fSiThreshold = 0;
30 
31 }
32 
33 
34 
37 
39 {
40  // Destructor
41 }
42 
43 
44 
45 
48 
50 {
51  //Particle identification and code setting using identification grid (class KVIDZAGrid).
52 
53  idr->SetIDType(GetType());
54  idr->IDattempted = kTRUE;
55 
56  //perform identification
57  Double_t si2 = (y < 0. ? GetIDMapY() : y);
58  Double_t csi = (x < 0. ? GetIDMapX() : x);
59 
60  //std::cout << "Inside KVFAZIAIDSiCsI_FAZIASYM::IDentify csi=" << csi << " si2=" << si2 << "\n";
61  //test if line below proton and si threshold are there
62  //if yes test the position of the point respect to
63  //these lines
64  //Bool_t OKproton = ((fBelowProton && fBelowProton->TestPoint(csi, si2)) || !fBelowProton);
65  //Bool_t OKthreshold = ((fSiThreshold && fSiThreshold->TestPoint(csi, si2)) || !fSiThreshold);
66  //if (OKproton && OKthreshold){
67 
68 
69  if (fBelowProton) {
72  }
73  else {
75  }
76 
77  if (TheGrid->IsIdentifiable(csi, si2)) {
78  // std::cout << "Identifico con TheGrid\n";
79  TheGrid->Identify(csi, si2, idr);
80  // cout << "Ho identificato con TheGrid" << endl;
81  // printf ("The Grid: %d %d %f\n", idr->Z, idr->A, idr->PID);
82 
83  //utilizzo TheGrid_lcp per identificare nuovamente Z=1 e Z=2
84  if (TheGrid_lcp->IsIdentifiable(csi, si2) && idr->Z <= 2 && idr->Z >= 0) {
85  //std::cout << "Identifico con TheGrid_lcp\n";
86  TheGrid_lcp->Identify(csi, si2, idr);
87  // cout << "Ho identificato con TheGrid_lcp" << endl;
88  //printf ("The Grid_lcp: %d %d %f\n", idr->Z, idr->A, idr->PID);
89  }
90  }
91  else {
92  idr->IDOK = kFALSE;
94  }
95 
96 
97 
98  // set general ID code
99  idr->IDcode = GetIDCode();
100 
101  return kTRUE;
102 
103 }
104 
105 
106 
107 
115 
117 {
118  // Initialisation of telescope before identification.
119  // This method MUST be called once before any identification is attempted.
120  // Initialisation of grid is performed here.
121  // IsReadyForID() will return kTRUE if a grid is associated to this telescope for the current run.
122  //std::cout << "Inizialize FAZIASYM SiCsI" << std::endl;
123  //TheGrid = (KVIDZAGrid*) GetIDGrid();
126  if (TheGrid) {
127  // std::cout << "Inizializzo TheGrid" << std::endl;
129  TheGrid->Initialize();
130  fBelowProton = (KVIDCutContour*)TheGrid->GetCut("PIEDESTAL");//fBelowProton = (KVIDCutLine*)TheGrid->GetCut("PIEDESTAL");
131  fSiThreshold = (KVIDCutLine*)TheGrid->GetCut("threshold");
133  }
134  else {
136  }
137 
138  if (TheGrid_lcp) {
139  //std::cout << "Inizializzo TheGrid_lcp" << std::endl;
142  fBelowProton = (KVIDCutContour*)TheGrid->GetCut("PIEDESTAL");//fBelowProton = (KVIDCutLine*)TheGrid->GetCut("PIEDESTAL");
143  fSiThreshold = (KVIDCutLine*)TheGrid_lcp->GetCut("threshold");
145  }
146  else {
148  }
149 
150  if (!gDataSet->HasCalibIdentInfos()) {// for filtering simulations
152  SetHasMassID();// in principle mass identification always possible
153  }
154 }
155 
156 
157 
164 
166 {
167  // For filtering simulations
168  //
169  // Z-dependence of A identification:
170  // all ok if Z<=14, decreasing probability for 15<=Z<=18
171  // no A identification for Z>18
172 
173  n->SetZMeasured();
174  fMassIDProb->SetParameters(16.5, .4);
175  Bool_t okmass = (n->GetZ() <= 14) || (n->GetZ() < 19 && gRandom->Uniform() < fMassIDProb->Eval(n->GetZ()));
176  if (okmass) {
177  n->SetAMeasured();
178  }
179  else
180  n->SetZ(n->GetZ());
181 }
182 
183 
KVDataSet * gDataSet
Definition: KVDataSet.cpp:30
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
R__EXTERN TRandom * gRandom
const Char_t * GetType() const
Definition: KVBase.h:170
Bool_t HasCalibIdentInfos() const
Definition: KVDataSet.h:396
KVIDZAGrid * TheGrid_lcp
telescope's grid for LCP identification (from Z=1 and Z=2)
void SetIdentificationStatus(KVReconstructedNucleus *n)
virtual Bool_t Identify(KVIdentificationResult *, Double_t x=-1., Double_t y=-1.)
Particle identification and code setting using identification grid (class KVIDZAGrid).
KVIDZAGrid * TheGrid
telescope's grid for principal identification (from Z=1 up to Z=20)
KVIDCutContour * fBelowProton
;KVIDCutLine* fBelowProton; //;
virtual ~KVFAZIAIDSiCsI_FAZIASYM()
Destructor.
static TF1 * fMassIDProb
Graphical contour for excluding/including regions in particle identification maps.
virtual Bool_t TestPoint(Double_t x, Double_t y)
Line in ID grid used to delimit regions where no identification is possible.
Definition: KVIDCutLine.h:22
KVIDentifier * GetCut(const Char_t *name) const
Definition: KVIDGraph.h:272
virtual Bool_t HasMassIDCapability() const
Definition: KVIDGraph.h:163
virtual Bool_t IsIdentifiable(Double_t, Double_t, TString *rejected_by=nullptr) const
Definition: KVIDGraph.cpp:1257
virtual Double_t GetIDMapY(Option_t *opt="")
virtual Double_t GetIDMapX(Option_t *opt="")
virtual UShort_t GetIDCode()
void SetHasMassID(Bool_t yes=kTRUE)
const KVList * GetListOfIDGrids() const
Identification grid with lines corresponding to different nuclear isotopes (KVIDZALine)
Definition: KVIDZAGrid.h:65
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
virtual void Initialize()
Full result of one attempted particle identification.
Bool_t IDattempted
=kTRUE if identification was attempted
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
Int_t deltaEpedestal
special code for handling particles which give no signal in deltaE
Int_t Z
Z of particle found (if Zident==kTRUE)
Int_t IDquality
specific quality code returned by identification procedure
Int_t IDcode
a general identification code for this type of identification
void SetIDType(const Char_t *t)
Nuclei reconstructed from data measured by a detector array ,.
virtual TObject * At(Int_t idx) const
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
void SetBit(UInt_t f)
void ResetBit(UInt_t f)
virtual Double_t Uniform(Double_t x1, Double_t x2)
Double_t y[n]
Double_t x[n]
const Int_t n