KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVReconstructedNucleus.cpp
Go to the documentation of this file.
1 #include "Riostream.h"
3 #include "KVIDTelescope.h"
4 #include "KVGroup.h"
5 #include "KVMultiDetArray.h"
6 #include "KVACQParam.h"
7 
8 using namespace std;
9 
11 
12 
13 
14 
17 
19 {
20  //default initialisation
21  fReconTraj = nullptr;
22  fRealZ = fRealA = 0.;
23  fDetNames = "/";
24  fIDTelName = "";
25  fIDTelescope = nullptr;
26  fNSegDet = 0;
27  fAnalStatus = 99;
28  fTargetEnergyLoss = 0;
29  ResetBit(kIsIdentified);
30  ResetBit(kIsCalibrated);
31  ResetBit(kCoherency);
32  ResetBit(kZMeasured);
33  ResetBit(kAMeasured);
34 }
35 
36 
37 
38 
41 
42 KVReconstructedNucleus::KVReconstructedNucleus() : fIDResults("KVIdentificationResult", 5)
43 {
44  //default ctor.
45  init();
46 }
47 
48 
49 
52 
54  : KVNucleus(), fIDResults("KVIdentificationResult", 5)
55 {
56  //copy ctor
57  init();
58 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
59  obj.Copy(*this);
60 #else
61  ((KVReconstructedNucleus&) obj).Copy(*this);
62 #endif
63 }
64 
65 
66 
67 
71 
72 void KVReconstructedNucleus::Streamer(TBuffer& R__b)
73 {
74  // Stream an object of class KVReconstructedNucleus.
75  //Customized streamer.
76 
77  UInt_t R__s, R__c;
78  if (R__b.IsReading()) {
79  Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
80  if (R__v < 17) {
81  // Before v17, fIDResults was a static array: KVIdentificationResult fIDresults[5]
82  // We convert this to the new TClonesArray format
83  KVNucleus::Streamer(R__b);
84  fDetNames.Streamer(R__b);
85  fIDTelName.Streamer(R__b);
86  if (R__v >= 16) {
87  R__b >> fNSegDet;
88  R__b >> fAnalStatus;
89  }
90  R__b >> fRealZ;
91  R__b >> fRealA;
92  R__b >> fTargetEnergyLoss;
93  int R__i;
94  KVIdentificationResult id_array[5];
95  for (R__i = 0; R__i < 5; R__i++) {
96  id_array[R__i].Streamer(R__b);
97  id_array[R__i].Copy(*GetIdentificationResult(R__i + 1));
98  }
99  R__b.CheckByteCount(R__s, R__c, KVReconstructedNucleus::IsA());
100  }
101  else
102  R__b.ReadClassBuffer(KVReconstructedNucleus::Class(), this, R__v, R__s, R__c);
103  // if the multidetector object exists, update some informations
104  // concerning the detectors etc. hit by this particle
105  if (gMultiDetArray) {
107  fReconTraj = nullptr;
109  fIDTelescope = nullptr;
111  if (fReconTraj) {
112  if (R__v < 16) fNSegDet = fReconTraj->GetNumberOfIndependentIdentifications(); // fNSegDet/fAnalStatus non-persistent before v.16
113  }
114  else {
115  TIter next_det(&fDetList);
116  KVDetector* det;
117  while ((det = (KVDetector*)next_det())) {
118  det->AddHit(this);
119  if (det->IsDetecting()) { //to be coherent with AddDetector() method
120  if (R__v < 16) fNSegDet += det->GetSegment(); // fNSegDet/fAnalStatus non-persistent before v.16
121  //modify detector's counters depending on particle's identification state
122  if (IsIdentified())
124  else
126  }
127  }
128  }
129  }
130  }
131  else {
132  R__b.WriteClassBuffer(KVReconstructedNucleus::Class(), this);
133  }
134 }
135 
136 
137 
138 
140 
142 {
143  switch (GetStatus()) {
144  case kStatusOK:
145  cout <<
146  "Particle alone in group, or identification independently of other particles in group is directly possible." << endl;
147  break;
148 
149  case kStatusOKafterSub:
150  cout <<
151  "Particle reconstructed after identification of others in group and subtraction of their calculated energy losses in common detectors."
152  << endl;
153  break;
154 
155  case kStatusOKafterShare:
156  cout <<
157  "Particle identification estimated after arbitrary sharing of energy lost in common detectors between several reconstructed particles."
158  << endl;
159  break;
160 
162  cout <<
163  "Particle stopped in first stage of telescope. Estimation of minimum Z."
164  << endl;
165  break;
166 
167  case kStatusPileupDE:
168  cout <<
169  "Undetectable pile-up in first member of identifying telesscope (apparent status=OK). Would lead to incorrect identification by DE-E method (Z and/or A overestimated)."
170  << endl;
171  break;
172 
173  case kStatusPileupGhost:
174  cout <<
175  "Undetectable ghost particle in filtered simulation. Another particle passed through all of the same detectors (pile-up)."
176  << endl;
177  break;
178 
179 
180  default:
181  cout << GetStatus() << endl;
182  break;
183  }
184 }
185 
186 
187 
190 
192 {
193  // Returns kTRUE if particle was detected in array with given name
194  return GetArrayName() == name;
195 }
196 
197 
198 
201 
203 {
204  // Returns name of array particle was detected in (if known)
205  if (GetParameters()->HasStringParameter("ARRAY")) return GetParameters()->GetStringValue("ARRAY");
207  return "";
208 }
209 
210 
211 
213 
215 {
216 
217  int ndets = GetNumDet();
218  if (ndets) {
219 
220  for (int i = ndets - 1; i >= 0; i--) {
221  KVDetector* det = GetDetector(i);
222  if (det) det->Print("data");
223  }
224  for (int i = 1; i <= GetNumberOfIdentificationResults(); i++) {
226  if (idr->IDattempted) idr->Print();
227  }
228  }
229  if (GetStoppingDetector()) cout << "STOPPED IN : " <<
230  GetStoppingDetector()->GetName() << endl;
231  if (IsIdentified()) {
232  if (GetIdentifyingTelescope()) cout << "IDENTIFIED IN : " <<
233  GetIdentifyingTelescope()->GetName() << endl;
234  cout << " =======> ";
235  cout << " Z=" << GetZ() << " A=" << GetA();
236  if (IsAMeasured()) cout << " Areal=" << GetRealA();
237  else cout << " Zreal=" << GetRealZ();
238  }
239  else {
240  cout << "(unidentified)" << endl;
241  }
242  if (IsCalibrated()) {
243  cout << " Total Energy = " << GetEnergy() << " MeV, Theta=" << GetTheta() << " Phi=" << GetPhi() << endl;
244  cout << " Target energy loss correction : " << GetTargetEnergyLoss() << " MeV" << endl;
245  }
246  else {
247  cout << "(uncalibrated)" << endl;
248  }
249  cout << "RECONSTRUCTION STATUS : " << endl;
251  if (fReconTraj) fReconTraj->ls();
252  if (GetParameters()->GetNpar()) GetParameters()->Print();
253 }
254 
255 
256 
257 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
258 
263 
265 #else
267 #endif
268 {
269  //
270  //Copy this to obj
271  //
272  KVNucleus::Copy(obj);
274  robj.SetIdentifyingTelescope(GetIdentifyingTelescope());
275  robj.fDetNames = fDetNames;
276  robj.SetRealZ(GetRealZ());
277  robj.SetRealA(GetRealA());
278  robj.SetTargetEnergyLoss(GetTargetEnergyLoss());
279  robj.fReconTraj = fReconTraj;
280  robj.fIDTelescope = fIDTelescope;
281  robj.fNSegDet = fNSegDet;
282  robj.fAnalStatus = fAnalStatus;
283  // copy id results
284  Int_t nidres = GetNumberOfIdentificationResults();
285  for (int i = 1; i <= nidres; ++i) {
286  GetIdentificationResult(i)->Copy(*robj.GetIdentificationResult(i));
287  }
288  robj.SetBit(kIsIdentified, TestBit(kIsIdentified));
289  robj.SetBit(kIsCalibrated, TestBit(kIsCalibrated));
290  robj.SetBit(kCoherency, TestBit(kCoherency));
291  robj.SetBit(kZMeasured, TestBit(kZMeasured));
292  robj.SetBit(kAMeasured, TestBit(kAMeasured));
293 }
294 
295 
296 
301 
303 {
304  // Copy all characteristics of 'other' and also change all references to
305  // 'other' to references to 'this' (i.e. in detectors hit by particle).
306  // 'other' will not be fully valid after this operation (shouldn't be used further)
307 
308  other->Copy(*this);
309  KVGeoDetectorNode* node;
310  const KVReconNucTrajectory* traj = other->GetReconstructionTrajectory();
311  traj->IterateFrom();
312  while ((node = traj->GetNextNode())) {
313  KVDetector* d = node->GetDetector();
314  d->GetHits()->Remove(const_cast<KVReconstructedNucleus*>(other));
315  d->GetHits()->Add(this);
316  }
317 }
318 
319 
320 
324 
326 {
327  // Reset nucleus. Calls KVNucleus::Clear.
328  // if opt!="N": Calls KVGroup::Reset for the group where it was reconstructed.
329 
330  KVNucleus::Clear(opt);
331  if (GetGroup() && strncmp(opt, "N", 1))
332  GetGroup()->Reset();
333  fDetList.Clear();
334  fIDResults.Clear("C");
335  init();
336 }
337 
338 
339 
345 
347 {
348  //Add a detector to the list of those through which the particle passed.
349  //Put reference to detector into fDetectors array, increase number of detectors by one.
350  //As this is only used in initial particle reconstruction, we add 1 unidentified particle to the detector.
351 
352  //add name of detector to fDetNames
353  fDetNames += det->GetName();
354  fDetNames += "/";
355  // store pointer to detector
356  fDetList.Add(det);
357  if (det->IsDetecting()) {
358  //add segmentation index of detector to total segmentation index of particle
359  fNSegDet += det->GetSegment();
360  //add 1 unidentified particle to the detector
362  }
363 
364 }
365 
366 
367 
371 
373 {
374  // this method modifies the reconstructed trajectory
375  // probably called during the identification coherency check
376  fReconTraj = t;
377  fDetNames = t->GetPathString();//to store/retrieve reconstruction trajectory on file
378 }
379 
380 
381 
384 
386 {
387  // Method called in initial reconstruction of particle.
388 
389  fReconTraj = t;
391  t->AddUnidentifiedParticle(0);//add 1 unidentified particle to each detector on trajectory
392  fDetNames = t->GetPathString();//to store/retrieve reconstruction trajectory on file
393 }
394 
395 
396 
397 
410 
412 {
413  //Reconstruction of a detected nucleus from the successive energy losses
414  //measured in a series of detectors/telescopes.
415  //
416  //Starting from detector *kvd, collect information from all detectors placed directly
417  //in front of *kvd (kvd->GetAlignedDetectors()),
418  //these are the detectors the particle has passed through.
419  //
420  //Each one is added to the particle's list (KVReconstructedNucleus::AddDetector), and,
421  //if it is not an unsegmented detector, it is marked as having been "analysed"
422  //(KVDetector::SetAnalysed) in order to stop it being considered as a starting point for another
423  //particle reconstruction.
424 
425  fNSegDet = 0;
426  SetParameter("ARRAY", kvd->GetNameOfArray());
427  //get list of detectors through which particle passed
428  if (kvd->GetGroup()) {
429  TList* aligned = kvd->GetAlignedDetectors();
430  if (aligned) {
431 
432  TIter next_aligned(aligned);
433  KVDetector* d;
434  while ((d = (KVDetector*) next_aligned())) {
435  AddDetector(d);
436  d->AddHit(this); // add particle to list of particles hitting detector
437  d->SetAnalysed(kTRUE); //cannot be used to seed another particle
438  }
439  }
440  kvd->GetGroup()->AddHit(this);
441  }
442 }
443 
444 
445 
446 
455 
457 {
458  // Try to identify this nucleus by calling the Identify() function of each
459  // ID telescope crossed by it, starting with the telescope where the particle stopped, in order
460  // - only attempt identification in ID telescopes containing the stopping detector.
461  // - only telescopes which have been correctly initialised for the current run are used,
462  // i.e. those for which KVIDTelescope::IsReadyForID() returns kTRUE.
463  // This continues until a successful identification is achieved or there are no more ID telescopes to try.
464  // The identification code corresponding to the identifying telescope is set as the identification code of the particle.
465 
466 
468  if (idt_list && idt_list->GetSize() > 0) {
469 
470  KVIDTelescope* idt;
471  TIter next(idt_list);
472  Int_t idnumber = 1;
473  Int_t n_success_id = 0;//number of successful identifications
474  while ((idt = (KVIDTelescope*) next())) {
476 
477 
478  if (idt->IsReadyForID()) { // is telescope able to identify for this run ?
479 
480  IDR->IDattempted = kTRUE;
481  idt->Identify(IDR);
482 
483  if (IDR->IDOK) n_success_id++;
484  }
485  else
486  IDR->IDattempted = kFALSE;
487 
488  if (n_success_id < 1 &&
489  ((!IDR->IDattempted) || (IDR->IDattempted && !IDR->IDOK))) {
490  // the particle is less identifiable than initially thought
491  // we may have to wait for secondary identification
492  Int_t nseg = GetNSegDet();
493  SetNSegDet(TMath::Max(nseg - 1, 0));
494  //if there are other unidentified particles in the group and NSegDet is < 2
495  //then exact status depends on segmentation of the other particles : reanalyse
496  if (GetNSegDet() < 2 && GetNUnidentifiedInGroup(GetGroup()) > 1) {
498  return;
499  }
500  //if NSegDet = 0 it's hopeless
501  if (!GetNSegDet()) {
503  return;
504  }
505  }
506 
507 
508  }
509 
510  }
511 
512 }
513 
514 
515 
516 
522 
524 {
525  // First-order coherency analysis of reconstructed particles
526  //
527  // This method is kept for backwards compatibility. it is called by
528  // KVReconstructedEvent::Streamer when reading old data
529 
530  if (GetNUnidentifiedInGroup(grp) > 1) { //if there is more than one unidentified particle in the group
531 
532  UShort_t n_nseg_1 = 0;
533  if (!grp->GetParticles()) {
534  ::Error("KVReconstructedNucleus::AnalyseParticlesInGroup", "No particles in group ?");
535  return;
536  }
537  TIter next(grp->GetParticles());
539  //loop over particles counting up different cases
540  while ((nuc = (KVReconstructedNucleus*) next())) {
541  //ignore identified particles
542  if (nuc->IsIdentified())
543  continue;
544 
545  if (nuc->GetNSegDet() >= 2) {
546  //all part.s crossing 2 or more independent detectors are fine
548  }
549  else if (nuc->GetNSegDet() == 1) {
550  //only 1 independent detector hit => depends on what's in the rest
551  //of the group
552  n_nseg_1++;
553  }
554  else {
555  //part.s crossing 0 independent detectors (i.E. arret ChIo)
556  //can not be reconstructed
558  }
559  }
560  next.Reset();
561  //loop again, setting status
562  while ((nuc = (KVReconstructedNucleus*) next())) {
563  if (nuc->IsIdentified())
564  continue; //ignore identified particles
565 
566  if (nuc->GetNSegDet() == 1) {
567  if (n_nseg_1 == 1) {
568  //just the one ? then we can get it no problem
569  //after identifying the others and subtracting their calculated
570  //energy losses from the "dependent"/"non-segmented" detector
571  //(i.E. the ChIo)
573  }
574  else {
575  //more than one ? then we can make some wild guess by sharing the
576  //"non-segmented" (i.e. ChIo) contribution between them, but
577  //I wouldn't trust it as far as I can spit
579  }
580  //one possibility remains: the particle may actually have stopped e.g.
581  //in the DE detector of a DE-E telescope, in which case AnalStatus = 3
582  if (nuc->GetIDTelescopes()->GetSize() == 0) {
583  //no ID telescopes with which to identify particle
585  }
586  }
587  }
588  }
589  else if (GetNUnidentifiedInGroup(grp) == 1) {
590  //only one unidentified particle in group: if NSegDet>=1 then it's OK
591 
592  //loop over particles looking for the unidentified one
593  TIter next(grp->GetParticles());
595  while ((nuc = (KVReconstructedNucleus*) next()))
596  if (!nuc->IsIdentified())
597  break;
598 
599  if (nuc->GetNSegDet() > 0) {
600  //OK no problem
602  }
603  else {
604  //dead in the water
606  }
607  //one possibility remains: the particle may actually have stopped e.g. in the 1st member
608  //of a telescope, in which case AnalStatus = 3
609  if (nuc->GetIDTelescopes()->GetSize() == 0) {
610  //no ID telescopes with which to identify particle
612  }
613  }
614 #ifdef KV_DEBUG
615  Info("AnalyseGroups", "OK after analysis of particles in groups");
616 #endif
617 }
618 
619 
620 
621 
634 
636 {
637  // Calculate angles theta and phi for nucleus based on the detectors on its reconstruction trajectory.
638  // The momentum is set using these angles, its mass and its kinetic energy.
639  //
640  // The detector with the smallest solid angle along the trajectory is the one which defines the
641  // angles for the reconstructed particle.
642  //
643  // The (optional) option string can be "random" or "mean":
644  //
645  // If "random" (default) the angles are drawn at random between the over the surface of the detector.
646  //
647  // If "mean" the (theta,phi) position of the centre of the detector is used to fix the nucleus' direction.
648 
649 
650  if (GetEnergy() <= 0.0)//don't try if particle has no correctly defined energy
651  return;
653  return;
654 
655  KVDetector* angle_det = nullptr;
656  double small_solid = 1.e+09;
659  while ((n = GetReconstructionTrajectory()->GetNextNode())) {
660  if (n->GetDetector()->GetSolidAngle() < small_solid) {
661  angle_det = n->GetDetector();
662  small_solid = n->GetDetector()->GetSolidAngle();
663  }
664  }
665  if (!strcmp(opt, "random")) {
666  //random angles
667  TVector3 dir = angle_det->GetRandomDirection("random");
668  SetMomentum(GetEnergy(), dir);
669  }
670  else {
671  //middle of telescope
672  TVector3 dir = angle_det->GetDirection();
673  SetMomentum(GetEnergy(), dir);
674  }
675 }
676 
677 
678 
679 
694 
696 {
697  //Calculate and set the energy of a (previously identified) reconstructed particle,
698  //including an estimate of the energy loss in the target.
699  //
700  //Starting from the detector in which the particle stopped, we add up the
701  //'corrected' energy losses in all of the detectors through which it passed.
702  //Whenever possible, for detectors which are not calibrated or not working,
703  //we calculate the energy loss. Measured & calculated energy losses are also
704  //compared for each detector, and may lead to new particles being seeded for
705  //subsequent identification. This is done by KVIDTelescope::CalculateParticleEnergy().
706  //
707  //For particles whose energy before hitting the first detector in their path has been
708  //calculated after this step we then add the calculated energy loss in the target,
709  //using gMultiDetArray->GetTargetEnergyLossCorrection().
710 
712  idt->CalculateParticleEnergy(this);
714  SetIsCalibrated();
715  //add correction for target energy loss - moving charged particles only!
716  Double_t E_targ = 0.;
717  if (GetZ() && GetEnergy() > 0) {
719  SetTargetEnergyLoss(E_targ);
720  }
721  Double_t E_tot = GetEnergy() + E_targ;
722  SetEnergy(E_tot);
723  // set particle momentum from telescope dimensions (random)
725  }
726 }
727 
728 
729 
734 
736 {
737  // Protected method, called when required to fill fDetList with pointers to
738  // the detectors whose names are stored in fDetNames.
739  // If gMultiDetArray=0x0, fDetList list will be empty.
740 
741  fDetList.Clear();
743 }
744 
745 
746 
750 
752 {
753  // Called by Streamer when reading in data
754  // The fDetNames string is used to associate the particle with its reconstruction trajectory
755 
756  if (gMultiDetArray) {
757  // for old data, detnames was written as "/DET_1/DET_2/..."
758  // trajectory paths are written as "DET_1/DET_2/..."
759  if (fDetNames[0] == '/') fDetNames.Remove(0, 1);
760  fDetNames.Begin("/");
761  KVString n_stop_det = fDetNames.Next();
762  KVDetector* stop_det = gMultiDetArray->GetDetector(n_stop_det);
763  if (stop_det) {
764  KVGroup* gr = stop_det->GetGroup();
765  gr->AddHit(this);//for backwards compatibility, group coherency analysis performed in KVReconstructedEvent::Streamer (old data)
766  fReconTraj = (KVReconNucTrajectory*)gr->FindReconTraj(fDetNames);
767  if (fReconTraj) {
770  while ((n = fReconTraj->GetNextNode())) {
771  n->GetDetector()->AddHit(this);
772  if (IsIdentified()) n->GetDetector()->IncrementIdentifiedParticles();
773  else n->GetDetector()->IncrementUnidentifiedParticles();
774  }
775  }
776  }
777  }
778 }
779 
780 
781 
787 
789 {
790  // Change the particle's reconstruction trajectory to a different one starting from the
791  // same stopping detector (and therefore in the same group).
792  //
793  // trajectory paths are written as "DET_1/DET_2/..."
794 
796  if (!new_traj) {
797  Error("ReplaceReconTraj", "Trajectory %s not found - meant to replace %s", traj_name.Data(), fReconTraj->GetTitle());
798  return;
799  }
800  // first iterate over existing trajectory and reset detectors
803  while ((n = fReconTraj->GetNextNode())) {
804  n->GetDetector()->RemoveHit(this);
805  if (IsIdentified()) n->GetDetector()->IncrementIdentifiedParticles(-1);
806  else n->GetDetector()->IncrementUnidentifiedParticles(-1);
807  }
808  // set new trajectory
809  fReconTraj = new_traj;
811  while ((n = fReconTraj->GetNextNode())) {
812  n->GetDetector()->AddHit(this);
813  if (IsIdentified()) n->GetDetector()->IncrementIdentifiedParticles();
814  else n->GetDetector()->IncrementUnidentifiedParticles();
815  }
816 }
817 
818 
819 
827 
829 {
830  // Set identification of nucleus from informations in identification result object
831  // The mass (A) information in KVIdentificationResult is only used if the mass
832  // was measured as part of the identification. Otherwise the nucleus' mass formula
833  // will be used to calculate A from the measured Z.
834  //
835  // The identifying telescope is set to idt.
836 
838  SetIDCode(idr->IDcode);
839  SetZMeasured(idr->Zident);
840  SetAMeasured(idr->Aident);
841  SetZ(idr->Z);
842  if (idr->Aident) {
843  SetA(idr->A);
844  SetRealA(idr->PID);
845  }
846  else {
847  SetRealZ(idr->PID);
848  }
849 }
850 
851 
852 
856 
858 {
859  // Subtract the calculated energy loss of this particle from the measured energy
860  // loss of all detectors it passed through.
861 
862  Double_t Einc = GetEnergy() - GetTargetEnergyLoss(); // energy before first detector
863  if (fReconTraj) {
865  KVGeoDetectorNode* node;
866  while ((node = fReconTraj->GetNextNode())) {
867  KVDetector* det = node->GetDetector();
868  Double_t Edet = det->GetEnergy();
869  Double_t dE = det->GetDeltaE(GetZ(), GetA(), Einc); // calculate apparent energy loss in active layer
870  Double_t Eres = det->GetERes(GetZ(), GetA(), Einc); // calculate energy after detector
871  Edet -= dE;
872  if (Edet < 0.1) Edet = 0.;
873  det->SetEnergyLoss(Edet);
874  Einc = Eres;
875  if (Einc < 0.1) break;
876  }
877  return;
878  }
879  // backwards compatibility for old data
881  KVDetector* det;
882  while ((det = (KVDetector*)nxt())) {
883  Double_t Edet = det->GetEnergy();
884  Double_t dE = det->GetDeltaE(GetZ(), GetA(), Einc); // calculate apparent energy loss in active layer
885  Double_t Eres = det->GetERes(GetZ(), GetA(), Einc); // calculate energy after detector
886  Edet -= dE;
887  if (Edet < 0.1) Edet = 0.;
888  det->SetEnergyLoss(Edet);
889  Einc = Eres;
890  if (Einc < 0.1) break;
891  }
892 }
893 
894 
895 
897 
899 {
900  printf(" A:%6s", GetParameters()->GetStringValue("ARRAY"));
901  if (GetStoppingDetector()) printf(" D:%10s", GetStoppingDetector()->GetName());
902  printf(" IDCODE=%2d", GetIDCode());
903  if (IsIdentified()) {
904  if (GetIdentifyingTelescope()) printf(" ID:%15s", GetIdentifyingTelescope()->GetName());
905  if (IsZMeasured()) printf(" Z=%2d", GetZ());
906  else printf(" ");
907  if (IsAMeasured()) printf(" A=%3d : ", GetA());
908  else printf(" : ");
909  if (IsCalibrated()) printf(" E=%g MeV", GetEnergy());
910  if (GetParameters()->IsValue("Coherent", false)) printf("/not coherent/");
911  if (GetParameters()->IsValue("Pileup", true)) printf("/pileup/");
912  }
913  printf("\n");
914 }
915 
916 
int Int_t
unsigned int UInt_t
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define d(i)
unsigned short UShort_t
short Version_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
const char Option_t
const Bool_t kIterBackward
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
void IncrementIdentifiedParticles(Int_t n=1)
Definition: KVDetector.h:492
void IncrementUnidentifiedParticles(Int_t n=1)
Definition: KVDetector.h:486
virtual Double_t GetERes(Int_t Z, Int_t A, Double_t Einc)
KVList * GetAlignedIDTelescopes()
Definition: KVDetector.cpp:875
KVGroup * GetGroup() const
virtual void SetEnergyLoss(Double_t e) const
Definition: KVDetector.h:332
virtual Double_t GetEnergy() const
Definition: KVDetector.h:308
const Char_t * GetNameOfArray() const
Definition: KVDetector.h:726
UShort_t GetSegment() const
Definition: KVDetector.h:772
virtual Bool_t IsDetecting() const
Definition: KVDetector.h:618
TVector3 GetDirection()
Definition: KVDetector.h:678
virtual TList * GetAlignedDetectors(UInt_t direction=1)
virtual Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc)
void AddHit(KVNucleus *part)
Definition: KVDetector.h:374
TVector3 GetRandomDirection(Option_t *t="isotropic")
Definition: KVDetector.h:666
virtual void Print(Option_t *option="") const
Definition: KVDetector.cpp:393
KVGeoDetectorNode * GetNextNode() const
TString GetPathString() const
void AddUnidentifiedParticle(int modify_identified=-1) const
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
void IterateBackFrom(const KVGeoDetectorNode *node0=nullptr) const
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
Group of detectors which can be treated independently of all others in array.
Definition: KVGroup.h:19
void Reset(Option_t *opt="")
Definition: KVGroup.cpp:114
const KVGeoDNTrajectory * FindReconTraj(const KVString &path)
Definition: KVGroup.h:97
KVGeoStrucElement * GetArray() const
Definition: KVGroup.h:44
KVList * GetParticles()
Definition: KVGroup.h:65
void AddHit(KVNucleus *kvd)
Definition: KVGroup.cpp:134
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:88
virtual Bool_t IsReadyForID()
@ kCalibStatus_NoCalibrations
virtual Bool_t Identify(KVIdentificationResult *, Double_t x=-1., Double_t y=-1.)
virtual void CalculateParticleEnergy(KVReconstructedNucleus *nuc)
virtual Int_t GetCalibStatus() const
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
void Print(Option_t *opt="") const
void Copy(TObject &) const
Copy this to obj.
Bool_t Aident
= kTRUE if A of particle established
Double_t PID
= "real" Z if Zident==kTRUE and Aident==kFALSE, "real" A if Zident==Aident==kTRUE
Int_t A
A of particle found (if Aident==kTRUE)
Int_t Z
Z of particle found (if Zident==kTRUE)
Int_t IDcode
a general identification code for this type of identification
Bool_t Zident
=kTRUE if Z of particle established
Extended TList class which owns its objects by default.
Definition: KVList.h:27
virtual Double_t GetTargetEnergyLossCorrection(KVReconstructedNucleus *)
virtual void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
KVIDTelescope * GetIDTelescope(const Char_t *name) const
Return pointer to DeltaE-E ID Telescope with "name".
virtual void Print(Option_t *opt="") const
const Char_t * GetStringValue(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
virtual void Clear(Option_t *opt="")
Definition: KVNucleus.cpp:298
Int_t GetA() const
Definition: KVNucleus.cpp:799
void SetA(Int_t a)
Definition: KVNucleus.cpp:655
void SetZ(Int_t z, Char_t mt=-1)
Definition: KVNucleus.cpp:704
virtual void Copy(TObject &) const
Copy this KVNucleus into the KVNucleus object referenced by "obj".
Definition: KVNucleus.cpp:834
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:770
KVNameValueList * GetParameters() const
Definition: KVParticle.h:735
Double_t GetTheta() const
Definition: KVParticle.h:641
void SetMomentum(const TVector3 &v)
Definition: KVParticle.h:535
const Char_t * GetName() const
return the field fName
Definition: KVParticle.cpp:416
Double_t GetEnergy() const
Definition: KVParticle.h:582
Double_t GetPhi() const
Definition: KVParticle.h:649
void SetParameter(const Char_t *name, ValType value) const
Definition: KVParticle.h:739
void SetEnergy(Double_t e)
Definition: KVParticle.h:560
Path through detector array used to reconstruct detected particle.
void ls(Option_t *="") const
Int_t GetNumberOfIndependentIdentifications() const
Nuclei reconstructed from data measured by a detector array ,.
virtual void Reconstruct(KVDetector *kvd)
KVDetector * GetDetector(const TString &label) const
virtual Bool_t IsZMeasured() const
virtual void SetAMeasured(Bool_t yes=kTRUE)
Float_t fRealZ
Z returned by identification routine.
void SetReconstructionTrajectory(const KVReconNucTrajectory *t)
Method called in initial reconstruction of particle.
virtual Double_t GetTargetEnergyLoss() const
void CopyAndMoveReferences(const KVReconstructedNucleus *)
Bool_t InArray(const TString &) const
Returns kTRUE if particle was detected in array with given name.
const KVReconNucTrajectory * fReconTraj
trajectory used to reconstruct particle
void ls(Option_t *="") const
Int_t GetNumberOfIdentificationResults() const
const KVSeqCollection * GetDetectorList() const
virtual void Print(Option_t *option="") const
Display nucleus parameters.
virtual void Copy(TObject &) const
KVIdentificationResult * GetIdentificationResult(Int_t i)
virtual void SubtractEnergyFromAllDetectors()
KVHashList fDetList
non-persistent list of pointers to detectors
const KVReconNucTrajectory * GetReconstructionTrajectory() const
Float_t fRealA
A returned by identification routine.
void SetIdentification(KVIdentificationResult *, KVIDTelescope *)
static UInt_t GetNUnidentifiedInGroup(KVGroup *grp)
virtual Int_t GetIDCode() const
const KVSeqCollection * GetIDTelescopes() const
TClonesArray fIDResults
results of every identification attempt made for this nucleus, in order of the ID telescopes used
KVDetector * GetStoppingDetector() const
void SetDetector(int i, KVDetector *);
virtual void SetTargetEnergyLoss(Double_t e)
KVString fDetNames
list of names of detectors through which particle passed
void ModifyReconstructionTrajectory(const KVReconNucTrajectory *t)
virtual void GetAnglesFromReconstructionTrajectory(Option_t *opt="random")
void init()
default initialisation
KVString fIDTelName
name of identification telescope which identified this particle (if any)
TString GetArrayName() const
Returns name of array particle was detected in (if known)
virtual void SetZMeasured(Bool_t yes=kTRUE)
Int_t fNSegDet
number of segmented/independent detectors hit by particle
void ReplaceReconTraj(const TString &traj_name)
Double_t fTargetEnergyLoss
calculated energy lost in target
virtual void Clear(Option_t *option="")
KVIDTelescope * GetIdentifyingTelescope() const
static void AnalyseParticlesInGroup(KVGroup *grp)
@ kStatusOKafterShare
of energy losses of other particles in the same group which have Status=0
@ kStatusStopFirstStage
(arbitrarily) between this and the other particle(s) with Status=2
@ kStatusPileupDE
telescope; a minimum Z could be estimated from the measured energy loss.
void SetIdentifyingTelescope(KVIDTelescope *i)
KVIDTelescope * fIDTelescope
non-persistent pointer to identification telescope
virtual Bool_t IsAMeasured() const
Int_t fAnalStatus
status of particle after analysis of reconstructed event
virtual void Clear(Option_t *option="")
virtual Int_t GetSize() const
virtual void Add(TObject *obj)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
void Begin(TString delim) const
Definition: KVString.cpp:562
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:675
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname)=0
Bool_t IsReading() const
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Clear(Option_t *option="")
void Reset()
virtual const char * GetName() const
virtual const char * GetTitle() const
void SetBit(UInt_t f)
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 & Remove(EStripType s, char c)
const Int_t n
TGraphErrors * gr
Double_t Max(Double_t a, Double_t b)