KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVDataPatch_INDRA_CorrectEtalonTrajectories.cpp
1//Created by KVClassFactory on Fri Feb 7 13:42:32 2020
2//Author: John Frankland,,,
3
4#include "KVDataPatch_INDRA_CorrectEtalonTrajectories.h"
5
6#include <KVINDRAReconNuc.h>
7#include <KVReconstructedEvent.h>
8
10
11
12
14
16 : KVDataPatch(), fRandomAngles(false)
17{
18 // Default constructor
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 = 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 if (!n) {
60 Fatal("ApplyToParticle", "Cannot apply this data patch to objects of class %s, only KVINDRAReconNuc objects", N->ClassName());
61 }
62
63 KVDetector* stop_det(nullptr), *si75(nullptr), *sili(nullptr);
64 if (n->GetRingNumber() >= 10 &&
65 (stop_det = n->GetStoppingDetector())->IsType("CSI")
66 &&
67 ((si75 = n->GetReconstructionTrajectory()->GetDetector("SI75"))
68 || (sili = n->GetReconstructionTrajectory()->GetDetector("SILI")))
69 ) {
70 // could particle have passed through SI75 and SILI ?
71 n->GetReconstructionTrajectory()->IterateBackFrom();
72 KVNucleus avatar(n->GetZ(), n->GetA(), n->GetMomentum());
73 Double_t E0 = avatar.GetE();
74 KVGeoDetectorNode* node(nullptr);
75 while ((node = n->GetReconstructionTrajectory()->GetNextNode())) {
76 E0 -= node->GetDetector()->GetELostByParticle(&avatar);
77 if (E0 <= 0) break;
78 }
79 if (node && !node->GetDetector()->IsType("CSI")) {
80 // particle could not have reached CsI: therefore it is on recon trajectory without etalon detector(s)
81 TIter next_tr(stop_det->GetNode()->GetTrajectories());
83 while ((tr = (KVGeoDNTrajectory*)next_tr())) {
84 // find trajectory starting from csi with neither si75 nor sili
85 bool no_si75 = !si75 || !tr->Contains(si75->GetNode());
86 bool no_sili = !sili || !tr->Contains(sili->GetNode());
87 if (no_si75 && no_sili) {
88 // name of this trajectory is title of recon trajectory we want
89 // replace particle's trajectory with corresponding recon trajectory
90 n->ReplaceReconTraj(tr->GetName());
91 // redefine particle angles from new trajectory
92 if (fRandomAngles) n->GetAnglesFromReconstructionTrajectory("random");
93 else n->GetAnglesFromReconstructionTrajectory("mean");
94 break;
95 }
96 }
97 }
98 }
99}
100
101
102
104
106{
107 std::cout << "Apply the following correction to INDRA data:\n";
108 std::cout << " all particles identified in etalon modules by either CSI_R_L or CI_CSI\n";
109 std::cout << " identification were treated as if they passed through the etalon detectors.\n";
110 std::cout << " we check the coherency of this with the energy of the particle and\n";
111 std::cout << " correct when necessary\n";
112}
113
114
115
#define e(i)
double Double_t
#define N
virtual Bool_t IsType(const Char_t *typ) const
Definition KVBase.h:185
Correct angular distributions for CsI & ChIo-CsI identified particles in etalon telescopes.
Correction to be applied to reconstructed calibrated data.
Definition KVDataPatch.h:55
Base class for detector geometry description.
Definition KVDetector.h:160
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
KVGeoDetectorNode * GetNode()
Definition KVDetector.h:326
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:126
Double_t GetE() const
Definition KVParticle.h:652
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
const char * GetName() const override
virtual void Fatal(const char *method, const char *msgfmt,...) const
RooCmdArg ClassName(const char *name)
gr SetName("gr")
const Int_t n
const char * Class
ClassImp(TPyArg)