KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDataPatch_INDRA_SanityChecks.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Fri Feb 7 16:31:27 2020
2 //Author: John Frankland,,,
3 
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->GetIDCode() >= 2 && n->GetIDCode() <= 4) || n->GetIDCode() == 6) {
56  if (!n->IsIdentified() || !n->IsZMeasured() || !n->GetIdentifyingTelescope()) {
57  // should this be labelled code5 (stopped first stage) ?
58  if (n->GetReconstructionTrajectory()->GetN() == 1 && !n->GetStoppingDetector()->IsType("CSI"))
59  n->SetIDCode(kIDCode5);
60  else
61  n->SetIDCode(kIDCode14);
62 
64  }
65  else if (n->IsZMeasured()) {
66  if (n->GetZ() < 1 || n->GetZ() > 92) {
67  n->SetIDCode(kIDCode14);
68  n->SetIsUnidentified();
69  n->SetZMeasured(kFALSE);
71  }
72  }
73  if (n->GetIDCode() == 2 && n->GetIdentifyingTelescope()->IsType("CSI_R_L") && n->IsAMeasured()) {
74  if (n->GetZ() > 5) {
75  n->SetIDCode(kIDCode14);
76  n->SetIsUnidentified();
77  n->SetZMeasured(kFALSE);
78  n->SetAMeasured(kFALSE);
80  }
81  else {
82  if ((n->GetZ() == 1 && n->GetA() > 3)
83  || ((n->GetZ() == 2 && (n->GetA() < 3 || n->GetA() == 5 || n->GetA() > 6)))) {
84  n->SetIDCode(kIDCode14);
85  n->SetIsUnidentified();
86  n->SetZMeasured(kFALSE);
87  n->SetAMeasured(kFALSE);
89  }
90  }
91  }
92  }
93  if (n->GetECode() > 0 && n->GetECode() < 3) {
94  if (n->GetE() <= 0) {
95  n->SetECode(kECode0);
96  n->SetIsUncalibrated();
98  }
99  }
100 }
101 
102 
103 
105 
107 {
108  std::cout << "General sanity checks:\n";
109  std::cout << " - any particle with 'good' ID codes should have\n";
110  std::cout << " IsIdentified() = true\n";
111  std::cout << " IsZMeasured() = true\n";
112  std::cout << " GetIdentifyingTelescope() returns pointer to ID telescope\n";
113  std::cout << " - any particle with IsZMeasured()=true should have:\n";
114  std::cout << " 1 <= Z <= 92\n";
115  std::cout << " - any particle with 'good' calib codes should have\n";
116  std::cout << " E>0\n";
117  std::cout << " - any particle identified in CsI-RL should have\n";
118  std::cout << " Z<6\n";
119  std::cout << " no 4H, no 5He or 7He\n";
120 }
121 
122 
123 
@ kIDCode5
@ kIDCode14
@ kECode0
KVINDRA * gIndra
Definition: KVINDRA.cpp:88
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const 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:54
Nuclei reconstructed from data measured in the INDRA array.
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
Nuclei reconstructed from data measured by a detector array .
RooCmdArg ClassName(const char *name)
const Int_t n
gr SetName("gr")
const char * Class