KaliVeda
Toolkit for HIC analysis
KVDataPatch_E884_DataUniformization.cpp
1 #include "KVDataPatch_E884_DataUniformization.h"
2 #include "KVExpDB.h"
3 #include "KVFAZIA.h"
4 
5 
7 
8 class KVDataPatch_E884_DataUniformization::_impl
9 {
10  public:
11  _impl()
12  {
13  runlists[zn_zn_1] = "5-14";
15  bad_id_lists[zn_zn_1][KVFAZIA::IDCodes::ID_SI1_PSA] =
16  {"212, 211, 214, 443, 743, 834, 942, 1041, 1042, 1043, 1111"};
17  bad_id_lists[zn_zn_1][KVFAZIA::IDCodes::ID_SI1_SI2] =
18  {"112, 812, 12, 333, 442, 443, 941"};
19  bad_id_lists[zn_zn_1][KVFAZIA::IDCodes::ID_SI2_CSI] =
20  {"613, 821, 924"};
21 
22  runlists[zn_zn_2] = "15-23 61";
24  bad_id_lists[zn_zn_2][KVFAZIA::IDCodes::ID_SI1_PSA] =
25  {"212, 211, 214, 342, 531, 743, 811, 833, 834, 1041, 1042, 1043, 1111"};
26  bad_id_lists[zn_zn_2][KVFAZIA::IDCodes::ID_SI1_SI2] =
27  {"112, 812, 333, 342, 442, 443, 911"};
28  bad_id_lists[zn_zn_2][KVFAZIA::IDCodes::ID_SI2_CSI] =
29  {"821, 924"};
30 
31  runlists[zn_bi_1] = "26-43";
33  bad_id_lists[zn_bi_1][KVFAZIA::IDCodes::ID_SI1_PSA] =
34  {"212, 211, 214, 321, 313, 333, 342, 443, 533, 743, 833, 834, 813, 811, 942, 1031, 1041, 1042, 1043, 1111"};
35  bad_id_lists[zn_bi_1][KVFAZIA::IDCodes::ID_SI1_SI2] =
36  {"112, 812, 333, 342, 12, 442, 443, 533, 911, 941, 442, 1133"};
37  bad_id_lists[zn_bi_1][KVFAZIA::IDCodes::ID_SI2_CSI] =
38  {"123, 821, 924"};
39 
40  runlists[zn_al] = "44-53";
42  bad_id_lists[zn_al][KVFAZIA::IDCodes::ID_SI1_PSA] =
43  {"212, 211, 214, 342, 443, 811, 832, 1041, 1042, 1043"};
44  bad_id_lists[zn_al][KVFAZIA::IDCodes::ID_SI1_SI2] =
45  {"112, 342, 812, 442, 941"};
46  bad_id_lists[zn_al][KVFAZIA::IDCodes::ID_SI2_CSI] =
47  {"821, 924"};
48 
49  runlists[zn_bi_2] = "54-60";
51  bad_id_lists[zn_bi_2][KVFAZIA::IDCodes::ID_SI1_PSA] =
52  {"211, 212, 214, 342, 443, 531, 743, 832, 834, 942, 1041, 1042, 1043, 1111"};
53  bad_id_lists[zn_bi_2][KVFAZIA::IDCodes::ID_SI1_SI2] =
54  {"112, 812, 333, 442, 443, 533, 543, 832, 911, 941"};
55  bad_id_lists[zn_bi_2][KVFAZIA::IDCodes::ID_SI2_CSI] =
56  {"123, 543, 821, 924"};
57  }
58  bool is_required(int run)
59  {
60  for(auto& nl : runlists)
61  if(nl.second.Contains(run))
62  {
63  this_system = nl.first;
64  return true;
65  }
66  return false;
67  }
68  bool is_ok(KVFAZIA::IDCodes idcode, int index)
69  {
70  return !bad_id_lists[this_system][idcode].Contains(index);
71  }
72  void print_excluded()
73  {
74  std::cout << "\tSI1-PSA:\t" << bad_id_lists[this_system][KVFAZIA::IDCodes::ID_SI1_PSA].AsString() << std::endl;
75  std::cout << "\tSI1-SI2:\t" << bad_id_lists[this_system][KVFAZIA::IDCodes::ID_SI1_SI2].AsString() << std::endl;
76  std::cout << "\tSI2-CSI:\t" << bad_id_lists[this_system][KVFAZIA::IDCodes::ID_SI2_CSI].AsString() << std::endl;
77  }
78  private:
79  enum system_t
80  {
81  zn_zn_1,
82  zn_zn_2,
83  zn_bi_1,
84  zn_bi_2,
85  zn_al
86  };
87  system_t this_system;
88  std::map<system_t,KVNumberList> runlists;
89  using bad_id_list = std::map<KVFAZIA::IDCodes,KVNumberList>;
90  std::map<system_t, bad_id_list> bad_id_lists;
91 };
92 
93 
95  : KVDataPatch("KVDataPatch_E884_DataUniformization",
96  "Removes all particles identified in telescopes with atypical behaviour based on results of data quality audits"),
97  pimpl{std::make_unique<_impl>()}
98 {}
99 
101 
102 
104 
106 {
107  return dataset=="INDRAFAZIA.E884" && datatype=="recon" && pimpl->is_required(run_number);
108 }
109 
110 
111 
113 
115 {
116  if(!pimpl->is_ok((KVFAZIA::IDCodes)rnuc->GetIDCode(),rnuc->GetStoppingDetector()->GetIndex()))
117  {
118  rnuc->SetIsOK(kFALSE);
119  rnuc->GetParameters()->SetValue("EXCLUDED", "Excluded by KVDataPatch_E884_DataUniformization");
120  }
121 }
122 
123 
124 
126 
128 {
129  std::cout << "E884: Data uniformization, removes all particles identified in FAZIA telescopes with atypical behaviour\n\n";
130  std::cout << "Based on results of data quality audits, we exclude from analysis (declare as 'not OK') any particles identified in\n";
131  std::cout << "telescopes which do not follow the average behaviour of neighbouring telescopes (with similar theta)\n";
132  std::cout << "concerning:\n";
133  std::cout << " + largest Z identified\n";
134  std::cout << " + mean Z identified;\n";
135  std::cout << " + thresholds for Z or A identification.\n\n";
136  std::cout << "The excluded particles have a string parameter 'EXCLUDED'='Excluded by KVDataPatch_E884_DataUniformization'\n\n";
137  std::cout << "For this run, the excluded FAZIA telescopes are:\n";
138  pimpl->print_excluded();
139 }
140 
141 
int Int_t
bool Bool_t
constexpr Bool_t kFALSE
Bool_t IsRequired(TString, TString, Int_t, TString, Int_t, const TList *) override
void ApplyToParticle(KVReconstructedNucleus *) override
Correction to be applied to reconstructed calibrated data.
Definition: KVDataPatch.h:55
virtual Int_t GetIndex() const
Definition: KVDetector.h:848
IDCodes
Identification quality codes attributed to particles reconstructed from data.
Definition: KVFAZIA.h:131
void SetValue(const Char_t *name, value_type value)
void SetIsOK(Bool_t flag=kTRUE)
Definition: KVParticle.cpp:371
KVNameValueList * GetParameters() const
Definition: KVParticle.h:818
Nuclei reconstructed from data measured by a detector array .
virtual Int_t GetIDCode() const
KVDetector * GetStoppingDetector() const