KaliVeda
Toolkit for HIC analysis
KVRDP_INDRAFAZIA_DropUncorrEventsInFirstRunFile.cpp
1 #include "KVRDP_INDRAFAZIA_DropUncorrEventsInFirstRunFile.h"
2 #include "KVMultiDetArray.h"
3 
4 
5 
7 
9 {
10  fRunlist.Set(GetDataSetEnv(dataset, "SkipUncorEventsAtRunBegin", ""));
11  auto first_file = !runnumber.has_index();
12  return (first_file && fRunlist.Contains(runnumber.run()));
13 }
14 
15 
16 
18 
20 {
21  std::cout << "Avoid using uncorrelated INDRA/FAZIA events at beginning of run" << std::endl;
22 
23  std::cout << "\nDue to the way Narval handles data buffers, at the beginning of a new run" << std::endl;
24  std::cout << "('run' in the sense of Narval: a run begins when 'Start' is pressed, it can" << std::endl;
25  std::cout << "be written in several files) there is typically a buffer of only INDRA or" << std::endl;
26  std::cout << "only FAZIA events (a few hundreds), uncorrelated with anything else." << std::endl;
27 
28  std::cout << "\nIn order to be sure to only treat correlated data which could have been" << std::endl;
29  std::cout << "merged if required (if the INDRA-FAZIA time coincidence is in the window)," << std::endl;
30  std::cout << "this patch will skip all events until the first merged INDRA-FAZIA event" << std::endl;
31  std::cout << "is read, thereafter all events are accepted." << std::endl;
32 
33  std::cout << "\nThis is only applied to the runs found in the following dataset variable:" << std::endl;
34 
35  std::cout << "\n~~~" << std::endl;
36  std::cout << " [dataset].SkipUncorEventsAtRunBegin: [runlist]" << std::endl;
37  std::cout << "~~~" << std::endl;
38 
39  std::cout << "\nwhere the run numbers to be given are those of Narval. Obviously, when no correlation is" << std::endl;
40  std::cout << "expected (alpha source or other calibration runs, or running independently" << std::endl;
41  std::cout << "without merger), the condition should not be applied (it could reject all" << std::endl;
42  std::cout << "events)." << std::endl;
43 }
44 
45 
46 
48 
50 {
51  if (!fReject) return kFALSE;
52  fReject = !(mda->GetArray("INDRA")->HandledRawData() && mda->GetArray("FAZIA")->HandledRawData());
53  if (fReject) {
55  }
56  else
57  Info("SkipEvent", "Beginning analysis after skipping %d events...", events_skipped);
58 
59  return fReject;
60 }
61 
62 
64 
65 
66 
bool Bool_t
constexpr Bool_t kFALSE
static ValType GetDataSetEnv(const KVString &dataset, const KVString &type, const ValType &defval)
Definition: KVBase.h:304
Base class for describing the geometry of a detector array.
Bool_t HandledRawData() const
virtual KVMultiDetArray * GetArray(const Char_t *) const
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
void Set(const TString &l)
Definition: KVNumberList.h:135
Avoid using uncorrelated INDRA/FAZIA events at beginning of run.
Bool_t IsRequired(TString dataset, const run_index_t &runnumber)
virtual void Info(const char *method, const char *msgfmt,...) const
Specifies a runfile according to run number and file index ,.
Definition: run_index.h:33
int run() const
Definition: run_index.h:52
bool has_index() const
Definition: run_index.h:61
ClassImp(TPyArg)