KaliVeda
Toolkit for HIC analysis
KVDataPatch_INDRA_SanityChecks.cpp
1 //Created by KVClassFactory on Fri Feb 7 16:31:27 2020
2 //Author: John Frankland,,,
3 
4 #include "KVDataPatch_INDRA_SanityChecks.h"
5 
6 #include <KVINDRAReconNuc.h>
7 #include <KVINDRA.h>
8 
10 
11 
12 
16  : KVDataPatch()
17 {
18  // Default constructor
19  SetName(ClassName());
20  SetTitle(Class()->GetTitle());
21 }
22 
23 
24 
38 
40 {
41  // General sanity checks:
42  // - any particle with "good" ID codes should have:
43  // IsIdentified() = true
44  // IsZMeasured() = true
45  // GetIdentifyingTelescope() returns pointer to ID telescope
46  // - any particle with IsZMeasured()=true should have:
47  // 1 <= Z <= 92
48  // - any particle with 'good' calib codes should have
49  // E>0
50  // - any particle identified in CsI-RL should have
51  // Z<6
52  // no 4H, no 5He or 7He
53 
54  KVINDRAReconNuc* n = dynamic_cast<KVINDRAReconNuc*>(N);
55  if (!n) {
56  Fatal("ApplyToParticle", "Cannot apply this data patch to objects of class %s, only KVINDRAReconNuc objects", N->ClassName());
57  }
58  if ((n->GetIDCode() >= 2 && n->GetIDCode() <= 4) || n->GetIDCode() == 6) {
59  if (!n->IsIdentified() || !n->IsZMeasured() || !n->GetIdentifyingTelescope()) {
60  // should this be labelled code5 (stopped first stage) ?
61  if (n->GetReconstructionTrajectory()->GetN() == 1 && !n->GetStoppingDetector()->IsType("CSI"))
62  n->SetIDCode(KVINDRACodeMask::kIDCode5);
63  else
64  n->SetIDCode(KVINDRACodeMask::kIDCode14);
65 
67  }
68  else if (n->IsZMeasured()) {
69  if (n->GetZ() < 1 || n->GetZ() > 92) {
70  n->SetIDCode(KVINDRACodeMask::kIDCode14);
71  n->SetIsUnidentified();
72  n->SetZMeasured(kFALSE);
74  }
75  }
76  if (n->GetIDCode() == 2 && n->GetIdentifyingTelescope()->IsType("CSI_R_L") && n->IsAMeasured()) {
77  if (n->GetZ() > 5) {
78  n->SetIDCode(KVINDRACodeMask::kIDCode14);
79  n->SetIsUnidentified();
80  n->SetZMeasured(kFALSE);
81  n->SetAMeasured(kFALSE);
83  }
84  else {
85  if ((n->GetZ() == 1 && n->GetA() > 3)
86  || ((n->GetZ() == 2 && (n->GetA() < 3 || n->GetA() == 5 || n->GetA() > 6)))) {
87  n->SetIDCode(KVINDRACodeMask::kIDCode14);
88  n->SetIsUnidentified();
89  n->SetZMeasured(kFALSE);
90  n->SetAMeasured(kFALSE);
92  }
93  }
94  }
95  }
96  if (n->GetECode() > 0 && n->GetECode() < 3) {
97  if (n->GetE() <= 0) {
98  n->SetECode(KVINDRACodeMask::kECode0);
99  n->SetIsUncalibrated();
100  gIndra->AcceptParticleForAnalysis(n);
101  }
102  }
103 }
104 
105 
106 
108 
110 {
111  std::cout << "General sanity checks:\n";
112  std::cout << " - any particle with 'good' ID codes should have\n";
113  std::cout << " IsIdentified() = true\n";
114  std::cout << " IsZMeasured() = true\n";
115  std::cout << " GetIdentifyingTelescope() returns pointer to ID telescope\n";
116  std::cout << " - any particle with IsZMeasured()=true should have:\n";
117  std::cout << " 1 <= Z <= 92\n";
118  std::cout << " - any particle with 'good' calib codes should have\n";
119  std::cout << " E>0\n";
120  std::cout << " - any particle identified in CsI-RL should have\n";
121  std::cout << " Z<6\n";
122  std::cout << " no 4H, no 5He or 7He\n";
123 }
124 
125 
126 
constexpr Bool_t kFALSE
#define N
General sanity checks for old INDRA data.
void ApplyToParticle(KVReconstructedNucleus *)
Correction to be applied to reconstructed calibrated data.
Definition: KVDataPatch.h:55
Nuclei reconstructed from data measured in the INDRA array.
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
Nuclei reconstructed from data measured by a detector array .
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)