30 public JEquals<tree_info>
48 tree_info(TTree* tree) :
53 name = tree->GetName();
54 number_of_entries = tree->GetEntries();
55 number_of_bytes = tree->GetTotBytes();
57 TBranch* branch =
dynamic_cast<TBranch*
>(tree->GetListOfBranches()->At(0));
60 type = branch->GetClassName();
72 bool equals(
const tree_info&
object)
const
74 return ((this->
name ==
"" ||
object.
name ==
"" || this->
name ==
object.
name) &&
86 return (name !=
"" &&
type !=
"");
97 friend inline std::ostream&
operator<<(std::ostream& out,
const tree_info&
object)
101 return out << setw(24) << left <<
object.name <<
' '
102 << setw(32) << left <<
object.type <<
' '
103 << setw(10) << right <<
object.number_of_entries <<
' '
104 << setw( 6) << right << (
object.number_of_bytes >> 20) <<
" [MB]";
109 Long64_t number_of_entries;
110 Long64_t number_of_bytes;
120 static bool equals(
const std::string&
first,
const std::string& second)
125 if (first ==
"") {
return true; }
126 if (second ==
"") {
return true; }
132 return first == second;
146 int main(
int argc,
char **argv)
171 JParser<> zap(
"Auxiliary program to print ROOT TTree information.");
180 catch(
const exception &error) {
181 FATAL(error.what() << endl);
184 gErrorIgnoreLevel = kFatal;
188 int number_of_errors = 0;
192 TFile*
file = TFile::Open(file_name->c_str());
198 cerr << *file_name <<
" not opened." << endl;
204 cout << *file_name << endl;
207 TIter iter(file->GetListOfKeys(), kIterBackward);
209 for (TKey* _key; (_key = (TKey*) iter.Next()) != NULL; ) {
211 TKey* p =
dynamic_cast<TKey*
>(file->GetListOfKeys()->Before(_key));
213 if (p == NULL || strcmp(_key->GetName(), p->GetName()) != 0) {
215 tb = tree_info(dynamic_cast<TTree*>(_key->ReadObj()));
217 if (tb.is_valid() && ta == tb) {
222 format.write(cout, key) <<
' ';
232 return (number_of_errors == 0 ? 0 : 1);
Utility class to parse command line options.
int main(int argc, char *argv[])
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
static JGlob getFilenames
Function object to get list of files for given pattern.
bool is_valid(const json &js)
Check validity of JSon data.
Utility class to parse parameter values.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
Utility class to parse parameter values.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
then set_variable PMT_FILE set_variable DAQ_FILE set_variable OUTPUT_FILE set_variable DETECTOR else fatal Wrong number of arguments fi JPrintTree f $DAQ_FILE type
std::string getClassname(const std::string &type_name)
Get type name, i.e. part after JEEP::TYPENAME_SEPARATOR.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of auxiliary base class for comparison of data structures.
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
General purpose messaging.
then fatal The output file must have the wildcard in the name
Utility class to parse command line options.
bool equals(const JFirst_t &first, const JSecond_t &second, const double precision=std::numeric_limits< double >::min())
Check equality.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.