22#define TSelEventGen_cxx
45 : fBaseDir(
""), fNEvents(100000), fNTracks(100), fNTracksMax(-1),
46 fRegenerate(
kFALSE), fTotalGen(0), fFilesGenerated(0),
47 fGenerateFun(0), fChain(0)
76 Error(
"Begin",
"object 'PROOF_FilesToProcess' found but not a map"
79 Error(
"Begin",
"object 'PROOF_FilesToProcess' not found");
107 while ((obj = nxt())){
112 if (sinput.
Contains(
"PROOF_BenchmarkBaseDir")){
130 Warning(
"SlaveBegin",
"\"%s\" directory is not writable or not existing,"
131 " using default directory: %s",
137 Info(
"SlaveBegin",
"using non local base directory \"%s\"",
fBaseDir.
Data());
140 Info(
"SlaveBegin",
"using default directory: %s",
146 Error(
"SlaveBegin",
"PROOF_BenchmarkBaseDir not type TNamed");
150 if (sinput.
Contains(
"PROOF_BenchmarkNEvents")){
157 Error(
"SlaveBegin",
"PROOF_BenchmarkEvents not type TParameter"
162 if (sinput.
Contains(
"PROOF_BenchmarkNTracks")){
169 Error(
"SlaveBegin",
"PROOF_BenchmarkNTracks not type TParameter"
174 if (sinput.
Contains(
"PROOF_BenchmarkNTracksMax")){
181 Error(
"SlaveBegin",
"PROOF_BenchmarkNTracksMax not type TParameter"
186 if (sinput.
Contains(
"PROOF_BenchmarkRegenerate")){
190 found_regenerate=
kTRUE;
193 Error(
"SlaveBegin",
"PROOF_BenchmarkRegenerate not type TParameter"
198 if (sinput.
Contains(
"PROOF_GenerateFun")){
201 Error(
"SlaveBegin",
"PROOF_GenerateFun requires the TMacro object in the input list");
208 Warning(
"SlaveBegin",
"PROOF_BenchmarkBaseDir not found; using default:"
212 Warning(
"SlaveBegin",
"PROOF_BenchmarkNEvents not found; using default:"
216 Warning(
"SlaveBegin",
"PROOF_BenchmarkNTracks not found; using default:"
220 Warning(
"SlaveBegin",
"PROOF_BenchmarkNTracksMax not found; using default:"
223 Warning(
"SlaveBegin",
"PROOF_BenchmarkNTracksMax must be larger then"
224 " fNTracks=%d ; ignoring",
fNTracks);
228 if (!found_regenerate){
229 Warning(
"SlaveBegin",
"PROOF_BenchmarkRegenerate not found; using"
267 if (!
f ||
f->IsZombie())
return 0;
271 TTree* eventtree=
new TTree(
"EventTree",
"Event Tree");
274 const Int_t buffersize=32000;
275 eventtree->
Branch(
"event",
"Event", &ep, buffersize, 1);
285 while (sizenevents--){
291 event->Build(i++, ntrks, 0);
292 size_generated+=eventtree->
Fill();
339 Info(
"Process",
"entry %lld: file: '%s'", entry, fCurrent->
GetName());
341 Error(
"Process",
"entry %lld: no file specified!", entry);
376 if (
f && !
f->IsZombie()){
380 if (entries_file == neventstogenerate) {
382 Info(
"Process",
"bench file (%s, entries=%lld) exists:"
383 " skipping generation.",
filename.Data(), entries_file);
384 filesize =
f->GetSize();
398 Long_t devid, devbsz, devbtot, devbfree;
401 Long_t szneed = 1024 * 1024 * 1024, tomb = 1024 * 1024;
402 if (devbfree * devbsz < szneed || devbfree < 0.1 * devbtot) {
403 Error(
"Process",
"not enough free space on device (%ld MB < {%ld, %ld} MB):"
404 " skipping generation of: %s",
405 (devbfree * devbsz) / tomb,
406 szneed / tomb, (
Long_t) (0.1 * devbtot * devbsz / tomb),
422 if (
f && !
f->IsZombie()) {
423 filesize =
f->GetSize();
427 Error(
"Process",
"can not open generated file: %s",
filename.Data());
463 Info(
"SlaveTerminate",
464 "list '%s' of files generated by this worker added to the output list",
468 Warning(
"SlaveTerminate",
"no list of generated files defined!");
470 Warning(
"SlaveTerminate",
"list of generated files is empty!");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
R__EXTERN TProofServ * gProofServ
R__EXTERN TRandom * gRandom
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TSystem * gSystem
void SetName(const char *name)
const char * GetName() const override
Return name of this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Manages an element of a TDSet.
Bool_t cd() override
Change current directory to "this" directory.
Describe directory structure in memory.
virtual Bool_t cd()
Change current directory to "this" directory.
Class describing a generic file including meta information.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
This code implements the MD5 message-digest algorithm.
const char * AsString() const
Return message digest as string.
static TMD5 * FileChecksum(const char *file)
Returns checksum of specified file.
Class supporting a collection of lines with C++ code.
virtual Longptr_t Exec(const char *params=nullptr, Int_t *error=nullptr)
Execute this macro with params, if params is 0, default parameters (set via SetParams) are used.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Class used by TMap to store (key,value) pairs.
Named parameter, streamable and storable.
const AParamType & GetVal() const
const char * GetOrdinal() const
static void GetLocalServer(TString &dsrv)
Extract LOCALDATASERVER info in 'dsrv'.
static void FilterLocalroot(TString &path, const char *url="root://dum/")
If 'path' is local and 'dsrv' is Xrootd, apply 'path.Localroot' settings, if any.
const char * GetDataDir() const
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
Selector for event file generation.
void SlaveBegin(TTree *tree) override
The SlaveBegin() function is called after the Begin() function.
TSelEventGen()
pointer to the analyzed TTree or TChain
void Begin(TTree *) override
The Begin() function is called at the start of the query.
Long64_t GenerateFiles(const char *filename, Long64_t sizenevents)
Generate files for IO-bound run Input parameters filename: The name of the file to be generated sizen...
Bool_t Process(Long64_t entry) override
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
void SlaveTerminate() override
The SlaveTerminate() function is called after all entries or objects have been processed.
void Init(TTree *tree) override
void Print(Option_t *option="") const override
This method must be overridden when a class wants to print itself.
void Terminate() override
The Terminate() function is the last function to be called during a query.
TList * fInput
List of objects available during processing.
TSelectorList * fOutput
! List of objects created during processing
Long64_t fStatus
Selector status.
const char * GetOption() const override
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * HostName()
Return the system's host name.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
TFile * GetCurrentFile() const
Return pointer to the current file.
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
void Delete(Option_t *option="") override
Delete this tree from memory or/and disk.
virtual Long64_t GetEntries() const
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
void GetUUID(UChar_t uuid[16]) const
Return uuid in specified buffer (16 byte = 128 bits).
This class represents a WWW compatible URL.
const char * GetFile() const
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
const char * GetProtocol() const
void SetFile(const char *file)
ULong_t Hash(const void *txt, Int_t ntxt)
Calculates hash index from any char string.