Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Measurement.cxx
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: Kyle Cranmer, George Lewis
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11/** \class RooStats::HistFactory::Measurement
12 * \ingroup HistFactory
13The RooStats::HistFactory::Measurement class can be used to construct a model
14by combining multiple RooStats::HistFactory::Channel objects. It also allows
15to set some general properties like the integrated luminosity, its relative
16uncertainty or the functional form of constraints on nuisance parameters.
17*/
18
19
22
23#include "HFMsgService.h"
24
25#include <TFile.h>
26#include <TSystem.h>
27#include <TTimeStamp.h>
28
29#include <ctime>
30#include <iostream>
31#include <algorithm>
32#include <sys/stat.h>
33
34
35using namespace std;
36
38
39/// Standard constructor
41 : fLumi(1.0), fLumiRelErr(.10), fBinLow(0), fBinHigh(1), fExportOnly(false)
42{
43
44}
45
46/*
47RooStats::HistFactory::Measurement::Measurement(const Measurement& other) :
48 POI( other.POI ), Lumi( other.Lumi ), LumiRelErr( other.LumiRelErr ),
49 BinLow( other.BinLow ), BinHigh( other.BinHigh ), ExportOnly( other.ExportOnly ),
50 channels( other.channels ), OutputFilePrefix( other.outputFilePrefix ),
51 constantParams( other.constantParams ), { ; }
52*/
53
54/// Standard constructor specifying name and title of measurement
55RooStats::HistFactory::Measurement::Measurement(const char *Name, const char *Title)
56 : TNamed(Name, Title), fLumi(1.0), fLumiRelErr(.10), fBinLow(0), fBinHigh(1), fExportOnly(false)
57{
58
59}
60
61
62/// Set a parameter in the model to be constant.
63/// the parameter does not have to exist yet, the information will be used when
64/// the model is actually created.
65///
66/// Also checks if the parameter is already set constant.
67/// We don't need to set it constant twice,
68/// and we issue a warning in case this is a hint
69/// of a possible bug
71{
72
73
74 if( std::find(fConstantParams.begin(), fConstantParams.end(), param) != fConstantParams.end() ) {
75 cxcoutWHF << "Warning: Setting parameter: " << param
76 << " to constant, but it is already listed as constant. "
77 << "You may ignore this warning."
78 << std::endl;
79 return;
80 }
81
82 fConstantParams.push_back( param );
83
84}
85
86
87/// Set parameter of the model to given value
88void RooStats::HistFactory::Measurement::SetParamValue( const std::string& param, double value )
89{
90 // Check if this parameter is already set to a value
91 // If so, issue a warning
92 // (Not sure if we want to throw an exception here, or
93 // issue a warning and move along. Thoughts?)
94 if( fParamValues.find(param) != fParamValues.end() ) {
95 cxcoutWHF << "Warning: Chainging parameter: " << param
96 << " value from: " << fParamValues[param]
97 << " to: " << value
98 << std::endl;
99 }
100
101 // Store the parameter and its value
102 cxcoutIHF << "Setting parameter: " << param
103 << " value to " << value
104 << std::endl;
105
106 fParamValues[param] = value;
107
108}
109
110
111/// Add a preprocessed function by giving the function a name,
112/// a functional expression, and a string with a bracketed list of dependencies (eg "SigXsecOverSM[0,3]")
113void RooStats::HistFactory::Measurement::AddPreprocessFunction( std::string name, std::string expression, std::string dependencies )
114{
115
116
117 PreprocessFunction func(name, expression, dependencies);
118 AddFunctionObject(func);
119
120}
121
122/// Returns a list of defined preprocess function expressions
124{
125
126
127 std::vector<std::string> PreprocessFunctionExpressions;
128 for( unsigned int i = 0; i < fFunctionObjects.size(); ++i ) {
129 std::string expression = fFunctionObjects.at(i).GetCommand();
130 PreprocessFunctionExpressions.push_back( expression );
131 }
132 return PreprocessFunctionExpressions;
133}
134
135/// Set constraint term for given systematic to Gamma distribution
136void RooStats::HistFactory::Measurement::AddGammaSyst(std::string syst, double uncert)
137{
138 fGammaSyst[syst] = uncert;
139}
140
141/// Set constraint term for given systematic to LogNormal distribution
142void RooStats::HistFactory::Measurement::AddLogNormSyst(std::string syst, double uncert)
143{
144 fLogNormSyst[syst] = uncert;
145}
146
147/// Set constraint term for given systematic to uniform distribution
149{
150 fUniformSyst[syst] = 1.0; // Is this parameter simply a dummy?
151}
152
153/// Define given systematics to have no external constraint
155{
156 fNoSyst[syst] = 1.0; // dummy value
157}
158
159/// Check if the given channel is part of this measurement
161{
162
163
164 for( unsigned int i = 0; i < fChannels.size(); ++i ) {
165
166 Channel& chan = fChannels.at(i);
167 if( chan.GetName() == ChanName ) {
168 return true;
169 }
170
171 }
172
173 return false;
174
175}
176
177
178/// Get channel with given name from this measurement
179/// throws an exception in case the channel is not found
181{
182 for( unsigned int i = 0; i < fChannels.size(); ++i ) {
183
184 Channel& chan = fChannels.at(i);
185 if( chan.GetName() == ChanName ) {
186 return chan;
187 }
188
189 }
190
191 // If we get here, we didn't find the channel
192
193 cxcoutEHF << "Error: Did not find channel: " << ChanName
194 << " in measurement: " << GetName() << std::endl;
195 throw hf_exc();
196
197 // No Need to return after throwing exception
198 // return RooStats::HistFactory::BadChannel;
199
200
201}
202
203/*
204 void RooStats::HistFactory::Measurement::Print( Option_t* option ) const {
205 RooStats::HistFactory::Measurement::Print( std::cout );
206 return;
207 }
208*/
209
210/// Print information about measurement object in tree-like structure to given stream
212{
213
214
215 stream << "Measurement Name: " << GetName()
216 << "\t OutputFilePrefix: " << fOutputFilePrefix
217 << "\t POI: ";
218 for(unsigned int i = 0; i < fPOI.size(); ++i) {
219 stream << fPOI.at(i);
220 }
221 stream << "\t Lumi: " << fLumi
222 << "\t LumiRelErr: " << fLumiRelErr
223 << "\t BinLow: " << fBinLow
224 << "\t BinHigh: " << fBinHigh
225 << "\t ExportOnly: " << fExportOnly
226 << std::endl;
227
228
229 if( !fConstantParams.empty() ) {
230 stream << "Constant Params: ";
231 for( unsigned int i = 0; i < fConstantParams.size(); ++i ) {
232 stream << " " << fConstantParams.at(i);
233 }
234 stream << std::endl;
235 }
236
237 if( !fFunctionObjects.empty() ) {
238 stream << "Preprocess Functions: ";
239 for( unsigned int i = 0; i < fFunctionObjects.size(); ++i ) {
240 stream << " " << fFunctionObjects.at(i).GetCommand();
241 }
242 stream << std::endl;
243 }
244
245 if( !fChannels.empty() ) {
246 stream << "Channels:" << std::endl;
247 for( unsigned int i = 0; i < fChannels.size(); ++i ) {
248 fChannels.at(i).Print( stream );
249 }
250 }
251
252 cxcoutIHF << "End Measurement: " << GetName() << std::endl;
253
254}
255
256
257/// Create XML files for this measurement in the given directory.
258/// XML files can be configured with a different output prefix
259/// Create an XML file for this measurement
260/// First, create the XML driver
261/// Then, create xml files for each channel
262void RooStats::HistFactory::Measurement::PrintXML( std::string directory, std::string newOutputPrefix )
263{
264 // First, check that the directory exists:
265 auto testExists = [](const std::string& theDirectory) {
266 void* dir = gSystem->OpenDirectory(theDirectory.c_str());
267 bool exists = dir != nullptr;
268 if (exists)
270
271 return exists;
272 };
273
274 if ( !directory.empty() && !testExists(directory) ) {
275 int success = gSystem->MakeDirectory(directory.c_str() );
276 if( success != 0 ) {
277 cxcoutEHF << "Error: Failed to make directory: " << directory << std::endl;
278 throw hf_exc();
279 }
280 }
281
282 // If supplied new Prefix, use that one:
283
284 cxcoutPHF << "Printing XML Files for measurement: " << GetName() << std::endl;
285
286 std::string XMLName = std::string(GetName()) + ".xml";
287 if( !directory.empty() ) XMLName = directory + "/" + XMLName;
288
289 ofstream xml( XMLName.c_str() );
290
291 if( ! xml.is_open() ) {
292 cxcoutEHF << "Error opening xml file: " << XMLName << std::endl;
293 throw hf_exc();
294 }
295
296
297 // Add the time
298 xml << "<!--" << std::endl;
299 xml << "This xml file created automatically on: " << std::endl;
300/*
301 time_t t = time(0); // get time now
302 struct tm * now = localtime( &t );
303 xml << (now->tm_year + 1900) << '-'
304 << (now->tm_mon + 1) << '-'
305 << now->tm_mday
306 << std::endl;
307*/
308 // LM: use TTimeStamp
309 TTimeStamp t;
310 UInt_t year = 0;
311 UInt_t month = 0;
312 UInt_t day = 0;
313 t.GetDate(true, 0, &year, &month, &day);
314 xml << year << '-'
315 << month << '-'
316 << day
317 << std::endl;
318
319 xml << "-->" << std::endl;
320
321 // Add the doctype
322 xml << "<!DOCTYPE Combination SYSTEM 'HistFactorySchema.dtd'>" << std::endl << std::endl;
323
324 // Add the combination name
325 if (newOutputPrefix.empty() ) newOutputPrefix = fOutputFilePrefix;
326 xml << "<Combination OutputFilePrefix=\"" << newOutputPrefix /*OutputFilePrefix*/ << "\" >" << std::endl << std::endl;
327
328 // Add the Preprocessed Functions
329 for( unsigned int i = 0; i < fFunctionObjects.size(); ++i ) {
330 RooStats::HistFactory::PreprocessFunction func = fFunctionObjects.at(i);
331 func.PrintXML(xml);
332 /*
333 xml << "<Function Name=\"" << func.GetName() << "\" "
334 << "Expression=\"" << func.GetExpression() << "\" "
335 << "Dependents=\"" << func.GetDependents() << "\" "
336 << "/>" << std::endl;
337 */
338 }
339
340 xml << std::endl;
341
342 // Add the list of channels
343 for( unsigned int i = 0; i < fChannels.size(); ++i ) {
344 xml << " <Input>" << "./";
345 if (!directory.empty() ) xml << directory << "/";
346 xml << GetName() << "_" << fChannels.at(i).GetName() << ".xml" << "</Input>" << std::endl;
347 }
348
349 xml << std::endl;
350
351 // Open the Measurement, Set Lumi
352 xml << " <Measurement Name=\"" << GetName() << "\" "
353 << "Lumi=\"" << fLumi << "\" "
354 << "LumiRelErr=\"" << fLumiRelErr << "\" "
355 //<< "BinLow=\"" << fBinLow << "\" "
356 // << "BinHigh=\"" << fBinHigh << "\" "
357 << "ExportOnly=\"" << (fExportOnly ? std::string("True") : std::string("False")) << "\" "
358 << " >" << std::endl;
359
360
361 // Set the POI
362 xml << " <POI>" ;
363 for(unsigned int i = 0; i < fPOI.size(); ++i) {
364 if(i==0) xml << fPOI.at(i);
365 else xml << " " << fPOI.at(i);
366 }
367 xml << "</POI> " << std::endl;
368
369 // Set the Constant Parameters
370 if(!fConstantParams.empty()) {
371 xml << " <ParamSetting Const=\"True\">";
372 for( unsigned int i = 0; i < fConstantParams.size(); ++i ) {
373 if (i==0) xml << fConstantParams.at(i);
374 else xml << " " << fConstantParams.at(i);;
375 }
376 xml << "</ParamSetting>" << std::endl;
377 }
378
379 // Set the Parameters with new Constraint Terms
380 std::map<std::string, double>::iterator ConstrItr;
381
382 // Gamma
383 for( ConstrItr = fGammaSyst.begin(); ConstrItr != fGammaSyst.end(); ++ConstrItr ) {
384 xml << "<ConstraintTerm Type=\"Gamma\" RelativeUncertainty=\""
385 << ConstrItr->second << "\">" << ConstrItr->first
386 << "</ConstraintTerm>" << std::endl;
387 }
388 // Uniform
389 for( ConstrItr = fUniformSyst.begin(); ConstrItr != fUniformSyst.end(); ++ConstrItr ) {
390 xml << "<ConstraintTerm Type=\"Uniform\" RelativeUncertainty=\""
391 << ConstrItr->second << "\">" << ConstrItr->first
392 << "</ConstraintTerm>" << std::endl;
393 }
394 // LogNormal
395 for( ConstrItr = fLogNormSyst.begin(); ConstrItr != fLogNormSyst.end(); ++ConstrItr ) {
396 xml << "<ConstraintTerm Type=\"LogNormal\" RelativeUncertainty=\""
397 << ConstrItr->second << "\">" << ConstrItr->first
398 << "</ConstraintTerm>" << std::endl;
399 }
400 // NoSyst
401 for( ConstrItr = fNoSyst.begin(); ConstrItr != fNoSyst.end(); ++ConstrItr ) {
402 xml << "<ConstraintTerm Type=\"NoSyst\" RelativeUncertainty=\""
403 << ConstrItr->second << "\">" << ConstrItr->first
404 << "</ConstraintTerm>" << std::endl;
405 }
406
407
408 // Close the Measurement
409 xml << " </Measurement> " << std::endl << std::endl;
410
411 // Close the combination
412 xml << "</Combination>" << std::endl;
413
414 xml.close();
415
416 // Now, make the xml files
417 // for the individual channels:
418
419 std::string prefix = std::string(GetName()) + "_";
420
421 for( unsigned int i = 0; i < fChannels.size(); ++i ) {
422 fChannels.at(i).PrintXML( directory, prefix );
423 }
424
425
426 cxcoutPHF << "Finished printing XML files" << std::endl;
427
428}
429
430
431/// A measurement, once fully configured, can be saved into a ROOT
432/// file. This will persitify the Measurement object, along with any
433/// channels and samples that have been added to it. It can then be
434/// loaded, potentially modified, and used to create new models.
435///
436/// Write every histogram to the file.
437/// Edit the measurement to point to this file
438/// and to point to each histogram in this file
439/// Then write the measurement itself.
441{
442
443 // Create a temporary measurement
444 // (This is the one that is actually written)
445 RooStats::HistFactory::Measurement outMeas( *this );
446
447 std::string OutputFileName = file->GetName();
448
449 // Collect all histograms from file:
450 // HistCollector collector;
451
452
453 for( unsigned int chanItr = 0; chanItr < outMeas.fChannels.size(); ++chanItr ) {
454
455 // Go to the main directory
456 // in the file
457 file->cd();
458 file->Flush();
459
460 // Get the name of the channel:
461 RooStats::HistFactory::Channel& channel = outMeas.fChannels.at( chanItr );
462 std::string chanName = channel.GetName();
463
464
465 if( ! channel.CheckHistograms() ) {
466 cxcoutEHF << "Measurement.writeToFile(): Channel: " << chanName
467 << " has uninitialized histogram pointers" << std::endl;
468 throw hf_exc();
469 return;
470 }
471
472 // Get and cache the histograms for this channel:
473 //collector.CollectHistograms( channel );
474 // Do I need this...?
475 // channel.CollectHistograms();
476
477 // Make a directory to store the histograms
478 // for this channel
479
480 TDirectory* chanDir = file->mkdir( (chanName + "_hists").c_str() );
481 if( chanDir == nullptr ) {
482 cxcoutEHF << "Error: Cannot create channel " << (chanName + "_hists")
483 << std::endl;
484 throw hf_exc();
485 }
486 chanDir->cd();
487
488 // Save the data:
489 TDirectory* dataDir = chanDir->mkdir( "data" );
490 if( dataDir == nullptr ) {
491 cxcoutEHF << "Error: Cannot make directory " << chanDir << std::endl;
492 throw hf_exc();
493 }
494 dataDir->cd();
495
496 channel.fData.writeToFile( OutputFileName, GetDirPath(dataDir) );
497
498 /*
499 // Write the data file to this directory
500 TH1* hData = channel.data.GetHisto();
501 hData->Write();
502
503 // Set the location of the data
504 // in the output measurement
505
506 channel.data.InputFile = OutputFileName;
507 channel.data.HistoName = hData->GetName();
508 channel.data.HistoPath = GetDirPath( dataDir );
509 */
510
511 // Loop over samples:
512
513 for( unsigned int sampItr = 0; sampItr < channel.GetSamples().size(); ++sampItr ) {
514
515 RooStats::HistFactory::Sample& sample = channel.GetSamples().at( sampItr );
516 std::string sampName = sample.GetName();
517
518 cxcoutPHF << "Writing sample: " << sampName << std::endl;
519
520 file->cd();
521 chanDir->cd();
522 TDirectory* sampleDir = chanDir->mkdir( sampName.c_str() );
523 if( sampleDir == nullptr ) {
524 cxcoutEHF << "Error: Directory " << sampName << " not created properly" << std::endl;
525 throw hf_exc();
526 }
527 std::string sampleDirPath = GetDirPath( sampleDir );
528
529 if( ! sampleDir ) {
530 cxcoutEHF << "Error making directory: " << sampName
531 << " in directory: " << chanName
532 << std::endl;
533 throw hf_exc();
534 }
535
536 // Write the data file to this directory
537 sampleDir->cd();
538
539 sample.writeToFile( OutputFileName, sampleDirPath );
540 /*
541 TH1* hSample = sample.GetHisto();
542 if( ! hSample ) {
543 std::cout << "Error getting histogram for sample: "
544 << sampName << std::endl;
545 throw -1;
546 }
547 sampleDir->cd();
548 hSample->Write();
549
550 sample.InputFile = OutputFileName;
551 sample.HistoName = hSample->GetName();
552 sample.HistoPath = sampleDirPath;
553 */
554
555 // Write the histograms associated with
556 // systematics
557
558 /* THIS IS WHAT I"M COMMENTING
559 sample.GetStatError().writeToFile( OutputFileName, sampleDirPath );
560
561 // Must write all systematics that contain internal histograms
562 // (This is not all systematics)
563
564 for( unsigned int i = 0; i < sample.GetHistoSysList().size(); ++i ) {
565 sample.GetHistoSysList().at(i).writeToFile( OutputFileName, sampleDirPath );
566 }
567 for( unsigned int i = 0; i < sample.GetHistoFactorList().size(); ++i ) {
568 sample.GetHistoFactorList().at(i).writeToFile( OutputFileName, sampleDirPath );
569 }
570 for( unsigned int i = 0; i < sample.GetShapeSysList().size(); ++i ) {
571 sample.GetShapeSysList().at(i).writeToFile( OutputFileName, sampleDirPath );
572 }
573 END COMMENT */
574 /*
575 sample.statError.writeToFile( OutputFileName, sampleDirPath );
576
577 // Now, get the Stat config histograms
578 if( sample.statError.HistoName != "" ) {
579 TH1* hStatError = sample.statError.GetErrorHist();
580 if( ! hStatError ) {
581 std::cout << "Error getting stat error histogram for sample: "
582 << sampName << std::endl;
583 throw -1;
584 }
585 hStatError->Write();
586
587 sample.statError.InputFile = OutputFileName;
588 sample.statError.HistoName = hStatError->GetName();
589 sample.statError.HistoPath = sampleDirPath;
590
591 }
592 */
593
594 }
595
596 }
597
598
599 // Finally, write the measurement itself:
600
601 cxcoutPHF << "Saved all histograms" << std::endl;
602
603 file->cd();
604 outMeas.Write();
605
606 cxcoutPHF << "Saved Measurement" << std::endl;
607
608}
609
610/// Return the directory's path,
611/// stripped of unnecessary prefixes
613{
614
615
616 std::string path = dir->GetPath();
617
618 if( path.find(':') != std::string::npos ) {
619 size_t index = path.find(':');
620 path.replace( 0, index+1, "" );
621 }
622
623 path = path + "/";
624
625 return path;
626
627 /*
628 if( path.find(":") != std::string::npos ) {
629 size_t index = path.find(":");
630 SampleName.replace( 0, index, "" );
631 }
632
633 // Remove the file:
634 */
635
636}
637
638
639/// The most common way to add histograms to channels is to have them
640/// stored in ROOT files and to give HistFactory the location of these
641/// files. This means providing the path to the ROOT file and the path
642/// and name of the histogram within that file. When providing these
643/// in a script, HistFactory doesn't load the histogram from the file
644/// right away. Instead, once all such histograms have been supplied,
645/// one should run this method to open all ROOT files and to copy and
646/// save all necessary histograms.
648
649
650 for( unsigned int chanItr = 0; chanItr < fChannels.size(); ++chanItr) {
651
652 RooStats::HistFactory::Channel& chan = fChannels.at( chanItr );
653
654 chan.CollectHistograms();
655
656 }
657
658}
659
660
661
#define cxcoutPHF
#define cxcoutIHF
#define cxcoutWHF
#define cxcoutEHF
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Definition TGX11.cxx:110
R__EXTERN TSystem * gSystem
Definition TSystem.h:560
This class encapsulates all information for the statistical interpretation of one experiment.
Definition Channel.h:30
HistFactory::Data fData
Definition Channel.h:91
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
Definition Channel.h:76
std::string GetName() const
get name of channel
Definition Channel.h:42
void writeToFile(std::string FileName, std::string DirName)
Definition Data.cxx:44
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
Definition Measurement.h:31
void writeToFile(TFile *file)
A measurement, once fully configured, can be saved into a ROOT file.
void AddGammaSyst(std::string syst, double uncert)
Set constraint term for given systematic to Gamma distribution.
std::string GetDirPath(TDirectory *dir)
Return the directory's path, stripped of unnecessary prefixes.
void AddLogNormSyst(std::string syst, double uncert)
Set constraint term for given systematic to LogNormal distribution.
void PrintXML(std::string Directory="", std::string NewOutputPrefix="")
Print to a stream.
RooStats::HistFactory::Channel & GetChannel(std::string)
Get channel with given name from this measurement throws an exception in case the channel is not foun...
void SetParamValue(const std::string &param, double value)
Set a parameter to a specific value (And optionally fix it)
void CollectHistograms()
The most common way to add histograms to channels is to have them stored in ROOT files and to give Hi...
bool HasChannel(std::string)
Check if the given channel is part of this measurement.
void AddUniformSyst(std::string syst)
Set constraint term for given systematic to uniform distribution.
void PrintTree(std::ostream &=std::cout)
Print information about measurement object in tree-like structure to given stream.
Measurement()
Standard constructor.
void AddNoSyst(std::string syst)
Define given systematics to have no external constraint.
void AddConstantParam(const std::string &param)
Add a parameter to be set as constant (Similar to ParamSetting method below)
void AddPreprocessFunction(std::string name, std::string expression, std::string dependencies)
Add a preprocessed function by giving the function a name, a functional expression,...
std::vector< std::string > GetPreprocessFunctions() const
Returns a list of defined preprocess function expressions.
std::vector< RooStats::HistFactory::Channel > fChannels
Channels that make up this measurement.
std::string GetName() const
get name of sample
Definition Sample.h:82
void writeToFile(std::string FileName, std::string DirName)
Definition Sample.cxx:95
Describe directory structure in memory.
Definition TDirectory.h:45
virtual const char * GetPath() const
Returns the full path of the directory.
virtual Bool_t cd()
Change current directory to "this" directory.
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
Definition TFile.h:53
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition TObject.cxx:880
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition TSystem.cxx:832
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition TSystem.cxx:823
virtual int MakeDirectory(const char *name)
Make a directory.
Definition TSystem.cxx:814
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition TTimeStamp.h:45
UInt_t GetDate(Bool_t inUTC=kTRUE, Int_t secOffset=0, UInt_t *year=nullptr, UInt_t *month=nullptr, UInt_t *day=nullptr) const
Return date in form of 19971224 (i.e.
Definition file.py:1