1 #ifndef __JROOT__JMANAGER__ 
    2 #define __JROOT__JMANAGER__ 
   27 namespace JPP { 
using namespace JROOT; }
 
   42   template<
class JKey_t, 
class JValue_t>
 
   45     public std::map<JKey_t, JPointer<JValue_t>>
 
   85       if (
string(this->
get()->GetName()).find(
wc) == string::npos) {
 
   86         THROW(
JException, 
"Invalid wildcard <" << this->
get()->GetName() << 
"> '" << 
wc << 
"'");
 
  108              std::ios::fmtflags format   = std::ios::fmtflags()) : 
 
  121       this->
get()->SetName(name.c_str());
 
  123       if (
string(this->
get()->GetName()).find(
wc) == string::npos) {
 
  124         THROW(
JException, 
"Invalid wildcard <" << this->
get()->GetName() << 
"> '" << 
wc << 
"'");
 
  149         this->
set((JValue_t*) manager.
get()->Clone());
 
  161       for (
typename map_type::iterator 
i = this->begin(); 
i != this->end(); ++
i) {
 
  180       typename map_type::iterator 
i = this->find(key);
 
  182       if (
i == this->end()) {
 
  184         string            buffer = this->
get()->GetName();
 
  185         string::size_type ipos   = buffer.find(
wc);
 
  193         buffer.replace(ipos, 1, os.str());
 
  195         JValue_t* p = (JValue_t*) this->
get()->Clone(buffer.c_str());
 
  199         this->insert(make_pair(key,p));
 
  218     static JManager Read(TDirectory& 
in, 
const char* 
const master, 
const char wildcard)
 
  227       const Ssiz_t  pos = buffer.Index(wildcard);
 
  229       const TString 
a   = buffer(0,     pos); 
 
  230       const TString b   = buffer(pos+1, buffer.Length()); 
 
  232       buffer.ReplaceAll(
"[", 
"\\[");
 
  233       buffer.ReplaceAll(
"]", 
"\\]");
 
  235       buffer.ReplaceAll(wildcard, 
".*");
 
  237       const TRegexp regexp(buffer);
 
  239       TIter iter(in.GetListOfKeys());
 
  241       for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
 
  243         const TString tag(key->GetName());
 
  247         if (tag.Index(regexp) != -1) {
 
  249           JValue_t* p = 
dynamic_cast<JValue_t*
>(key->ReadObj());
 
  255             string buffer = p->GetName();
 
  257             if (
a.Length() != 0) { buffer.replace(buffer.find(
a), 
a.Length(), 
""); }
 
  258             if (b.Length() != 0) { buffer.replace(buffer.find(b), b.Length(), 
""); }
 
  262             istringstream(buffer) >> key;
 
  264             manager.insert(make_pair(key, p));
 
  295     void Write(TDirectory& out, 
const bool wm = 
false)
 
  297       for (
typename map_type::iterator 
i = this->begin(); 
i != this->end(); ++
i) {
 
  298         out.WriteTObject(
i->second);
 
  302         out.WriteTObject(this->
get());
 
  313     void Write(
const char* file_name, 
const bool wm = 
false)
 
  315       TFile out(file_name, 
"RECREATE");
 
  317       this->
Write(out, wm) ;
 
  365   template<
class JKey_t, 
class JValue_t>
 
then echo Test string reversed by master(hit< return > to continue)." $DIR/JProcess -c "$DIR/JEcho" -rC fi if (( 1 ))
 
void clear()
Clear client objects. 
 
JManager(JValue_t *master, char wildcard= '%', JFormat_t format=JFormat_t())
Constructor. 
 
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
 
JPointer< JValue_t > ptr_type
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
then echo Enter input within $TIMEOUT_S seconds echo n User name
 
void Write(const char *file_name, const bool wm=false)
Write objects to file. 
 
std::map< JKey_t, ptr_type > map_type
 
JManager(JValue_t *master, const std::string &name, char wildcard= '%', std::ios::fmtflags format=std::ios::fmtflags())
Constructor. 
 
bool is_valid() const 
Check validity of pointer. 
 
bool resetObject(JManager< JKey_t, JValue_t > *object, const bool reset=false)
Reset JManager object. 
 
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
 
static JManager Read(TDirectory &in, const char *const master, const char wildcard)
Read objects from file into manager. 
 
JManager(const JManager &manager)
Copy constructor. 
 
Template implementation of class that holds pointer to object(s). 
 
void Write(TDirectory &out, const bool wm=false)
Write objects to file. 
 
void Read(TDirectory &in)
Read objects from file. 
 
JValue_t * operator[](JKey_t key)
Get pointer to object for given key. 
 
JManager()
Default constructor. 
 
friend TFile & operator>>(TFile &file, JManager &object)
Read manager from file. 
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
 
virtual void set(JClass_t *p) override
Set pointer. 
 
virtual JClass_t * get() const override
Get pointer. 
 
friend TFile & operator<<(TFile &file, JManager &object)
Write manager to file. 
 
virtual void reset() override
Reset pointer.