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 = GetDataSetEnv(dataset,"SkipUncorEventsAtRunBegin","");
11  int index_multiplier = GetDataSetEnv(dataset,"DataSet.RunFileIndexMultiplier.raw", -1.0);
12  auto first_file = (runnumber%index_multiplier == 0);
13  runnumber/=index_multiplier;
14  return (first_file && fRunlist.Contains(runnumber));
15 }
16 
17 
18 
20 
22 {
23  std::cout << "Avoid using uncorrelated INDRA/FAZIA events at beginning of run" << std::endl;
24 
25  std::cout << "\nDue to the way Narval handles data buffers, at the beginning of a new run" << std::endl;
26  std::cout << "('run' in the sense of Narval: a run begins when 'Start' is pressed, it can" << std::endl;
27  std::cout << "be written in several files) there is typically a buffer of only INDRA or" << std::endl;
28  std::cout << "only FAZIA events (a few hundreds), uncorrelated with anything else." << std::endl;
29 
30  std::cout << "\nIn order to be sure to only treat correlated data which could have been" << std::endl;
31  std::cout << "merged if required (if the INDRA-FAZIA time coincidence is in the window)," << std::endl;
32  std::cout << "this patch will skip all events until the first merged INDRA-FAZIA event" << std::endl;
33  std::cout << "is read, thereafter all events are accepted." << std::endl;
34 
35  std::cout << "\nThis is only applied to the runs found in the following dataset variable:" << std::endl;
36 
37  std::cout << "\n~~~" << std::endl;
38  std::cout << " [dataset].SkipUncorEventsAtRunBegin: [runlist]" << std::endl;
39  std::cout << "~~~" << std::endl;
40 
41  std::cout << "\nwhere the run numbers to be given are those of Narval (i.e. without any" << std::endl;
42  std::cout << "'run-index multiplier' being applied). Obviously, when no correlation is" << std::endl;
43  std::cout << "expected (alpha source or other calibration runs, or running independently" << std::endl;
44  std::cout << "without merger), the condition should not be applied (it could reject all" << std::endl;
45  std::cout << "events)." << std::endl;
46 }
47 
48 
49 
51 
53 {
54  if(!fReject) return kFALSE;
55  fReject = !(mda->GetArray("INDRA")->HandledRawData() && mda->GetArray("FAZIA")->HandledRawData());
56  if(fReject) {
58  }
59  else
60  Info("SkipEvent","Beginning analysis after skipping %d events...", events_skipped);
61 
62  return fReject;
63 }
64 
65 
67 
68 
69 
int Int_t
bool Bool_t
constexpr Bool_t kFALSE
static const Char_t * GetDataSetEnv(const Char_t *dataset, const Char_t *type, const Char_t *defval)
Definition: KVBase.cpp:1619
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
Avoid using uncorrelated INDRA/FAZIA events at beginning of run.
virtual void Info(const char *method, const char *msgfmt,...) const
ClassImp(TPyArg)