KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVSimDirFilterAnalyser.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Thu Mar 23 14:02:40 2017
2 //Author: John Frankland,,,
3 
5 #include <KVClassFactory.h>
6 #include <KVDataSetManager.h>
7 #include <KVExpDB.h>
8 #include <KVTriggerConditions.h>
9 #include "KVMultiDetArray.h"
10 
12 
13 
14 
19 {
20  // Default constructor
21 }
22 
23 
24 
25 
28 
30 {
31  // Destructor
32 
34 }
35 
36 
37 
40 
42 {
43  // Use options passed to KVEventSelector to initialise dataset used for filter
44 
45  if (!gDataSetManager) {
48  }
50 }
51 
52 
53 
57 
59 {
60  // Use options passed to KVEventSelector to initialise kinematics for reaction
61  // and build experimental set-up
62 
63  KVString system = fAnalysisClass->GetOpt("System");
64  fSystem = gExpDB->GetSystem(system);
65  if (fSystem) {
67  }
68  else {
69  fKinematics = new KV2Body(system);
70  fKinematics->SetBit(kCanDelete); // clean up in destructor
72  }
73  KVString run = fAnalysisClass->GetOpt("Run");
74  fRun = gExpDB->GetDBRun(run.Atoi());
77 }
78 
79 
80 
85 
87 {
88  // Called by KVEventSelector just after reading new event and just before
89  // calling user analysis.
90  // Set minimum acceptable multiplicity for event.
92 }
93 
94 
95 
98 
100 {
101  // Generate a new filtered analysis selector class
102 
103  KVClassFactory cf(kvsname, "Analysis of filtered simulated events", "",
104 #ifndef USING_ROOT6
105  kTRUE, "FilteredEventAnalysisTemplate");
106 #else
107  kTRUE, "ROOT6FilteredEventAnalysisTemplate");
108 #endif
109  cf.AddImplIncludeFile("KVReconstructedNucleus.h");
110  cf.AddImplIncludeFile("KVBatchSystem.h");
111 
112  cf.GenerateCode();
113 }
114 
115 
116 #ifdef USING_ROOT6
117 
128 
130 {
131  // When called from the InitRun() method of a user's analysis class, this method will ensure that only data
132  // compatible with the experimental trigger will be provided for analysis in the user's Analysis() method.
133  //
134  // This will be done by searching for a KVTriggerConditions plugin class defined for the currently-analysed
135  // dataset, defined like so:
136  //
137  //~~~~
138  //+Plugin.KVTriggerConditions: [dataset] [classname] [libname] "[default constructor]()"
139  //~~~~
140 
141  TPluginHandler* ph = KVBase::LoadPlugin("KVTriggerConditions", gDataSet->GetName());
142  if (!ph) {
143  Info("SetTriggerConditionsForRun",
144  "No definition of trigger conditions available for dataset %s",
145  gDataSet->GetName());
146  return;
147  }
148  std::unique_ptr<KVTriggerConditions> trig((KVTriggerConditions*) ph->ExecPlugin(0));
149  trig->SetTriggerConditionsForRun(fAnalysisClass, run);
150 }
151 
152 #endif
153 //____________________________________________________________________________//
154 
155 
KVDataSetManager * gDataSetManager
KVDataSet * gDataSet
Definition: KVDataSet.cpp:30
KVExpDB * gExpDB
Definition: KVExpDB.cpp:12
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char Char_t
const Bool_t kTRUE
Relativistic binary kinematics calculator.
Definition: KV2Body.h:165
void CalculateKinematics()
Definition: KV2Body.cpp:678
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Definition: KVBase.cpp:756
Factory class for generating skeleton files for new classes.
void GenerateCode()
Generate header and implementation file for currently-defined class.
void AddImplIncludeFile(const Char_t *filename)
KV2Body * GetKinematics()
Definition: KVDBSystem.cpp:79
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
void cd() const
Definition: KVDataSet.cpp:735
virtual void SetCurrentRun(KVDBRun *)
KVEvent * GetEvent() const
virtual TString GetOpt(const Char_t *option) const
virtual KVDBSystem * GetSystem(const Char_t *system) const
Definition: KVExpDB.h:83
KVDBRun * GetDBRun(Int_t number) const
Definition: KVExpDB.h:74
virtual void SetMinimumOKMultiplicity(KVEvent *) const
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
Class piloting analyses of simulated data.
Manage user analysis of filtered simulation data.
virtual ~KVSimDirFilterAnalyser()
Destructor.
static void Make(const Char_t *kvsname="MyFilteredAnalysis")
Generate a new filtered analysis selector class.
KVDBRun * fRun
currently analysed run
KVEventSelector * fAnalysisClass
user analysis class
void preInitAnalysis()
Use options passed to KVEventSelector to initialise dataset used for filter.
KVDBSystem * fSystem
currently analysed system
KV2Body * fKinematics
kinematics of reaction
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
Set trigger conditions for analysis of reconstructed data.
virtual const char * GetName() const
void SetBit(UInt_t f)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Info(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs, const T &... params)
Int_t Atoi() const