KaliVeda
Toolkit for HIC analysis
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 #include "KVDetectorStack.h"
6 #include "KVReconstructedEvent.h"
7 #include "KVINDRADetector.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 = 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  int ring = N->GetStoppingDetector()->GetIndex() / 100;
59 
60  if (ring < 10) return;
61 
62  KVINDRADetector* csi;
63  if (!(csi = (KVINDRADetector*)N->GetStoppingDetector())->IsType("CSI")) return;
64 
65  auto si75 = (KVINDRADetector*)N->GetReconstructionTrajectory()->GetDetector("SI75");
66  auto sili = (KVINDRADetector*)N->GetReconstructionTrajectory()->GetDetector("SILI");
67  if(si75 || sili)
68  {
69  // check particle's energy is larger than punch through for CI-SI75-SILI
70  KVDetectorStack etalon_stack;
71  etalon_stack.Add(csi->GetChIo());
72  if(si75)
73  etalon_stack.Add(si75);
74  else
75  {Info("ApplyToParticle", "si75=%p sili=%p", si75, sili); N->GetReconstructionTrajectory()->Print();}
76  if(sili)
77  etalon_stack.Add(sili);
78  else
79  {Info("ApplyToParticle", "si75=%p sili=%p", si75, sili); N->GetReconstructionTrajectory()->Print();}
80  if (N->GetE() < etalon_stack.GetPunchThroughEnergy(N->GetZ(), N->GetA())) {
81  // it is not possible: this particle went straight from CI to CSI
82  // change trajectory
83  auto traj = (KVGeoDNTrajectory*)csi->GetNode()->GetTrajectories()->FindObjectWithMethod("2", "GetN");
84  N->ReplaceReconTraj(traj->GetName());
85  // redefine particle angles from new trajectory
86  if (fRandomAngles) N->GetAnglesFromReconstructionTrajectory("random");
87  else N->GetAnglesFromReconstructionTrajectory("mean");
88 
89  }
90  }
91 }
92 
93 
94 
96 
98 {
99  std::cout << "Apply the following correction to INDRA data:\n";
100  std::cout << " all particles identified in etalon modules by either CSI_R_L or CI_CSI\n";
101  std::cout << " identification were treated as if they passed through the etalon detectors.\n";
102  std::cout << " we check the coherency of this with the energy of the particle and\n";
103  std::cout << " correct when necessary\n";
104 }
105 
106 
107 
#define e(i)
#define N
Correct angular distributions for CsI & ChIo-CsI identified particles in etalon telescopes.
Correction to be applied to reconstructed calibrated data.
Definition: KVDataPatch.h:55
Easily calculate energy losses etc. in a stack of detectors.
Double_t GetPunchThroughEnergy(Int_t Z, Int_t A)
void Add(KVDetector *)
KVGeoDetectorNode * GetNode()
Definition: KVDetector.h:345
Path taken by particles through multidetector geometry.
const KVSeqCollection * GetTrajectories() const
Base class for detectors of INDRA array.
KVINDRADetector * GetChIo() const
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
virtual TObject * FindObjectWithMethod(const Char_t *retvalue, const Char_t *method) const
virtual void Info(const char *method, const char *msgfmt,...) const
RooCmdArg ClassName(const char *name)
gr SetName("gr")
const char * Class
ClassImp(TPyArg)