/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Mdc/MdcAlignAlg/MdcAlignAlg-00-01-04/share/distAlign/src/include/fun.h File Reference

#include <string>
#include <cstring>
#include <vector>
#include "TROOT.h"
#include "TObjArray.h"

Go to the source code of this file.

Functions

std::vector< std::stringgetHistList ()
std::vector< std::stringgetHistList (std::string path)

Variables

const double CC = 2.99792458E10
const double PI = 3.141592653
const double PI2 = 6.283185307
const double HFPI = 1.570796327
const int WIRENMAX = 6796
const int LAYERNMAX = 43
const int CELLNMAX = 288
const int INNERNMAX = 8
const int NEP = 16
const int NTRKPAR = 5
const int NTRKPARALL = 10


Function Documentation

std::vector<std::string> getHistList ( std::string  path  ) 

std::vector<std::string> getHistList (  ) 

Definition at line 14 of file fun.cpp.

00015 {
00016    vector<string> fnames;
00017 
00018    string command(
00019          "JobOutputDir=`/bin/ls -dt1 joboutput-* 2>/dev/null | head -1`\n"
00020          "if [ -d \"${JobOutputDir}\" ]; then\n"
00021          "  find ${JobOutputDir} -name hist.root\n"
00022          "fi\n"
00023          );
00024 
00025    stringstream fnstream;
00026 
00027    char* fnbuf   = new char[1024];
00028    FILE* fstream = popen(command.c_str(), "r");
00029 
00030    while ( fgets(fnbuf, 1024, fstream) != NULL ) {
00031       fnstream << fnbuf;
00032    }
00033 
00034    string fname;
00035    while ( ! (fnstream>>fname).eof() ) {
00036       fnames.push_back(fname);
00037    }
00038 
00039    pclose(fstream);
00040    delete [] fnbuf;
00041 
00042    if ( fnames.empty() ) {
00043       cout << "WARNING: Failed to retrieve hist files in the current directory!" << endl;
00044 //       exit(1);
00045    }
00046    return fnames;
00047 }


Variable Documentation

const double CC = 2.99792458E10

Definition at line 11 of file fun.h.

const int CELLNMAX = 288

Definition at line 18 of file fun.h.

const double HFPI = 1.570796327

Definition at line 14 of file fun.h.

const int INNERNMAX = 8

Definition at line 19 of file fun.h.

const int LAYERNMAX = 43

Definition at line 17 of file fun.h.

const int NEP = 16

Definition at line 20 of file fun.h.

const int NTRKPAR = 5

Definition at line 21 of file fun.h.

const int NTRKPARALL = 10

Definition at line 22 of file fun.h.

const double PI = 3.141592653

Definition at line 12 of file fun.h.

const double PI2 = 6.283185307

Definition at line 13 of file fun.h.

const int WIRENMAX = 6796

Definition at line 16 of file fun.h.


Generated on Tue Nov 29 23:16:44 2016 for BOSS_7.0.2 by  doxygen 1.4.7