KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDataPatch_INDRA_CorrectEtalonTrajectories.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Fri Feb 7 13:42:32 2020
2 //Author: John Frankland,,,
3 
5 
6 #include <KVINDRAReconNuc.h>
7 #include <KVReconstructedEvent.h>
8 
10 
11 
12 
16  : KVDataPatch(), fRandomAngles(false)
17 {
18  // Default constructor
19  SetName(ClassName());
20  SetTitle(Class()->GetTitle());
21 }
22 
23 
24 
29 
31 {
32  // Will be called before ApplyToParticle
33  //
34  // Just need to know if event has mean or random angles
35 
36  fRandomAngles = dynamic_cast<KVReconstructedEvent*>(e)->HasRandomAngles();
37 }
38 
39 
40 
47 
49 {
50  // Apply the following correction to INDRA data:
51  // all particles identified in etalon modules by either CSI_R_L or CI_CSI
52  // identification were treated as if they passed through the etalon detectors.
53  // we check the coherency of this with the energy of the particle and
54  // correct when necessary
55 
56  if (!N->IsOK()) return; //only apply to well-identified/calibrated particles
57 
58  KVINDRAReconNuc* n = dynamic_cast<KVINDRAReconNuc*>(N);
59 
60  KVDetector* stop_det(nullptr), *si75(nullptr), *sili(nullptr);
61  if (n->GetRingNumber() >= 10 &&
62  (stop_det = n->GetStoppingDetector())->IsType("CSI")
63  &&
64  ((si75 = n->GetReconstructionTrajectory()->GetDetector("SI75"))
65  || (sili = n->GetReconstructionTrajectory()->GetDetector("SILI")))
66  ) {
67  // could particle have passed through SI75 and SILI ?
68  n->GetReconstructionTrajectory()->IterateBackFrom();
69  KVNucleus avatar(n->GetZ(), n->GetA(), n->GetMomentum());
70  Double_t E0 = avatar.GetE();
71  KVGeoDetectorNode* node(nullptr);
72  while ((node = n->GetReconstructionTrajectory()->GetNextNode())) {
73  E0 -= node->GetDetector()->GetELostByParticle(&avatar);
74  if (E0 <= 0) break;
75  }
76  if (node && !node->GetDetector()->IsType("CSI")) {
77  // particle could not have reached CsI: therefore it is on recon trajectory without etalon detector(s)
78  TIter next_tr(stop_det->GetNode()->GetTrajectories());
80  while ((tr = (KVGeoDNTrajectory*)next_tr())) {
81  // find trajectory starting from csi with neither si75 nor sili
82  bool no_si75 = !si75 || !tr->Contains(si75->GetNode());
83  bool no_sili = !sili || !tr->Contains(sili->GetNode());
84  if (no_si75 && no_sili) {
85  // name of this trajectory is title of recon trajectory we want
86  // replace particle's trajectory with corresponding recon trajectory
87  n->ReplaceReconTraj(tr->GetName());
88  // redefine particle angles from new trajectory
89  if (fRandomAngles) n->GetAnglesFromReconstructionTrajectory("random");
90  else n->GetAnglesFromReconstructionTrajectory("mean");
91  break;
92  }
93  }
94  }
95  }
96 }
97 
98 
99 
101 
103 {
104  std::cout << "Apply the following correction to INDRA data:\n";
105  std::cout << " all particles identified in etalon modules by either CSI_R_L or CI_CSI\n";
106  std::cout << " identification were treated as if they passed through the etalon detectors.\n";
107  std::cout << " we check the coherency of this with the energy of the particle and\n";
108  std::cout << " correct when necessary\n";
109 }
110 
111 
112 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define e(i)
double Double_t
#define N
virtual Bool_t IsType(const Char_t *typ) const
Definition: KVBase.h:184
Correct angular distributions for CsI & ChIo-CsI identified particles in etalon telescopes.
Correction to be applied to reconstructed calibrated data.
Definition: KVDataPatch.h:54
Base class for detector geometry description.
Definition: KVDetector.h:159
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
Definition: KVDetector.cpp:276
KVGeoDetectorNode * GetNode()
Definition: KVDetector.h:325
Path taken by particles through multidetector geometry.
Bool_t Contains(const Char_t *name) const
Information on relative positions of detectors & particle trajectories.
KVDetector * GetDetector() const
Nuclei reconstructed from data measured in the INDRA array.
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
Double_t GetE() const
Definition: KVParticle.h:654
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
virtual const char * GetName() const
RooCmdArg ClassName(const char *name)
const Int_t n
gr SetName("gr")
const char * Class