minos Namespace Reference

---------------------------------------------------------------------------- More...

Classes

class  WhiteBoardRegistry
 ---------------------------------------------------------------------------- More...

Functions

RegistryGetWhiteBoardRegistry (std::string rname)
 ----------------------------------------------------------------------------
bool GetFromWhiteBoard (std::string rname, std::string rkey, Short_t &val)
 ----------------------------------------------------------------------------
bool GetFromWhiteBoard (std::string rname, std::string rkey, Int_t &val)
bool GetFromWhiteBoard (std::string rname, std::string rkey, UInt_t &val)
bool GetFromWhiteBoard (std::string rname, std::string rkey, Double_t &val)
bool GetFromWhiteBoard (std::string rname, std::string rkey, Char_t &val)
bool GetFromWhiteBoard (std::string rname, std::string rkey, const char *&val)
bool GetFromWhiteBoard (std::string rname, std::string rkey, std::string &val)
bool GetFromWhiteBoard (std::string rname, std::string rkey, VldTimeStamp &vts)
bool PostOnWhiteBoard (std::string rname, std::string rkey, Short_t val)
 ----------------------------------------------------------------------------
bool PostOnWhiteBoard (std::string rname, std::string rkey, Int_t val)
bool PostOnWhiteBoard (std::string rname, std::string rkey, UInt_t val)
bool PostOnWhiteBoard (std::string rname, std::string rkey, Double_t val)
bool PostOnWhiteBoard (std::string rname, std::string rkey, Char_t val)
bool PostOnWhiteBoard (std::string rname, std::string rkey, const char *val)
bool PostOnWhiteBoard (std::string rname, std::string rkey, std::string val)
bool PostOnWhiteBoard (std::string rname, std::string rkey, VldTimeStamp vts)

Detailed Description

----------------------------------------------------------------------------


Function Documentation

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
VldTimeStamp vts 
)

Definition at line 172 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00173 {
00174   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00175   if ( ! reg ) {
00176     MSG("DataUtil",Msg::kWarning)
00177       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00178       << rname << "\" -- how odd" << std::endl;
00179     return false;
00180   }
00181   // registry only knows about ints ... not VldTimeStamps
00182   // this is a little tricky because we'll store/fetch each of the two parts
00183   int isec, ins;
00184   std::string rkeySec  = rkey + ".vtsSec";
00185   std::string rkeyNano = rkey + ".vtsNano";
00186   bool got_sec = reg->Get(rkeySec.c_str(),isec);
00187   bool got_ns  = reg->Get(rkeyNano.c_str(),ins);
00188   bool got_both = got_sec && got_ns;
00189   if ( got_both ) {
00190     val = VldTimeStamp((time_t)isec,ins);
00191   }
00192   return got_both;
00193 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
std::string &  val 
)

Definition at line 154 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00155 {
00156   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00157   if ( ! reg ) {
00158     MSG("DataUtil",Msg::kWarning)
00159       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00160       << rname << "\" -- how odd" << std::endl;
00161     return false;
00162   }
00163   // registry only knows about const char* ... not std::strings
00164   const char* stmp;
00165   bool got_it = reg->Get(rkey.c_str(),stmp);
00166   if ( got_it ) {
00167     val = stmp;  // convert to a std::string
00168   }
00169   return got_it;
00170 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
const char *&  val 
)

Definition at line 141 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00142 {
00143   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00144   if ( ! reg ) {
00145     MSG("DataUtil",Msg::kWarning)
00146       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00147       << rname << "\" -- how odd" << std::endl;
00148     return false;
00149   }
00150   bool got_it = reg->Get(rkey.c_str(),val);
00151   return got_it;
00152 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
Char_t &  val 
)

Definition at line 128 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00129 {
00130   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00131   if ( ! reg ) {
00132     MSG("DataUtil",Msg::kWarning)
00133       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00134       << rname << "\" -- how odd" << std::endl;
00135     return false;
00136   }
00137   bool got_it = reg->Get(rkey.c_str(),val);
00138   return got_it;
00139 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
Double_t &  val 
)

Definition at line 115 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00116 {
00117   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00118   if ( ! reg ) {
00119     MSG("DataUtil",Msg::kWarning)
00120       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00121       << rname << "\" -- how odd" << std::endl;
00122     return false;
00123   }
00124   bool got_it = reg->Get(rkey.c_str(),val);
00125   return got_it;
00126 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
UInt_t &  val 
)

Definition at line 97 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00098 {
00099   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00100   if ( ! reg ) {
00101     MSG("DataUtil",Msg::kWarning)
00102       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00103       << rname << "\" -- how odd" << std::endl;
00104     return false;
00105   }
00106   // registry only knows about ints ... not unsigned ints
00107   int itmp = val;
00108   bool got_it = reg->Get(rkey.c_str(),itmp);
00109   if ( got_it ) {
00110     val = (UInt_t)(itmp);
00111   }
00112   return got_it;
00113 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
Int_t &  val 
)

Definition at line 84 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

00085 {
00086   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00087   if ( ! reg ) {
00088     MSG("DataUtil",Msg::kWarning)
00089       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00090       << rname << "\" -- how odd" << std::endl;
00091     return false;
00092   }
00093   bool got_it = reg->Get(rkey.c_str(),val);
00094   return got_it;
00095 }

bool minos::GetFromWhiteBoard ( std::string  rname,
std::string  rkey,
Short_t &  val 
)

----------------------------------------------------------------------------

Definition at line 66 of file WhiteBoardRegistry.cxx.

References Registry::Get(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, and reg.

Referenced by EvtAddRawDigitBlockModule::Ana(), HepevtModule::FindOrCreateSimSnarlRecord(), DetSim::Get(), and MnvRawDigitSuppression::Reco().

00067 {
00068   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00069   if ( ! reg ) {
00070     MSG("DataUtil",Msg::kWarning) 
00071       << "minos::GetFromWhiteBoard: HEY! no registry \"" 
00072       << rname << "\" -- how odd" << std::endl;
00073     return false;
00074   }
00075   // registry only knows about ints ... not shorts
00076   int itmp = val;
00077   bool got_it = reg->Get(rkey.c_str(),itmp);
00078   if ( got_it ) {
00079     val = (Short_t)(itmp);
00080   }
00081   return got_it;
00082 }

Registry * minos::GetWhiteBoardRegistry ( std::string  rname  ) 

----------------------------------------------------------------------------

Definition at line 36 of file WhiteBoardRegistry.cxx.

References Msg::kDebug, MSG, and reg.

Referenced by EvtInfoInjectorModule::Ana(), GetFromWhiteBoard(), and PostOnWhiteBoard().

00037 {
00038   // Get a Registry object from the whiteboard with the given name
00039   // If it doesn't exist, create one (and post it)
00040   // If the whiteboard area ("Loon" folder under "root") doesn't exist
00041   // then create that as well.
00042 
00043   TFolder *lf = dynamic_cast<TFolder*>(gROOT->FindObject("//root/Loon"));
00044   if ( ! lf ) {
00045     MSG("DataUtil",Msg::kDebug) << "add Loon folder" << std::endl;
00046     lf = gROOT->GetRootFolder()->AddFolder("Loon","Loon WhiteBoard");
00047     gROOT->GetListOfBrowsables()->Add(lf,"Loon");
00048   }
00049   std::string objpath = "Loon/" + rname;
00050   Registry* reg = dynamic_cast<Registry*>
00051     (gROOT->GetRootFolder()->FindObject(objpath.c_str()));
00052   if ( ! reg ) {
00053     // no existing registry ... make a empty one
00054     reg = new Registry(false);
00055     reg->SetName(rname.c_str());
00056     // add it to the folder
00057     lf->Add(reg);
00058     MSG("DataUtil",Msg::kDebug) << "add Registry \"" << rname << "\"" 
00059                                 << std::endl;
00060   }
00061   return reg;
00062 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
VldTimeStamp  vts 
)

Definition at line 282 of file WhiteBoardRegistry.cxx.

References VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00283 {
00284   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00285   if ( ! reg ) {
00286     MSG("DataUtil",Msg::kWarning) << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00287               << rname << "\" -- how odd" << std::endl;
00288     return false;
00289   }
00290   // registry only knows about ints ... not VldTimeStamps
00291   // this is a little tricky because we'll store/fetch each of the two parts
00292   std::string rkeySec  = rkey + ".vtsSec";
00293   std::string rkeyNano = rkey + ".vtsNano";
00294   int isec = val.GetSec();
00295   int ins  = val.GetNanoSec();
00296   bool set_sec = reg->Set(rkeySec.c_str(),isec);
00297   bool set_ns = reg->Set(rkeyNano.c_str(),ins);
00298   return ( set_sec && set_ns );
00299 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
std::string  val 
)

Definition at line 270 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00271 {
00272   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00273   if ( ! reg ) {
00274     MSG("DataUtil",Msg::kWarning) << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00275               << rname << "\" -- how odd" << std::endl;
00276     return false;
00277   }
00278   // registry only knows about const char* ... not std::string
00279   return reg->Set(rkey.c_str(),val.c_str());
00280 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
const char *  val 
)

Definition at line 259 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00260 {
00261   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00262   if ( ! reg ) {
00263     MSG("DataUtil",Msg::kWarning) << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00264               << rname << "\" -- how odd" << std::endl;
00265     return false;
00266   }
00267   return reg->Set(rkey.c_str(),val);
00268 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
Char_t  val 
)

Definition at line 248 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00249 {
00250   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00251   if ( ! reg ) {
00252     MSG("DataUtil",Msg::kWarning) << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00253               << rname << "\" -- how odd" << std::endl;
00254     return false;
00255   }
00256   return reg->Set(rkey.c_str(),val);
00257 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
Double_t  val 
)

Definition at line 237 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00238 {
00239   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00240   if ( ! reg ) {
00241     MSG("DataUtil",Msg::kWarning) << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00242               << rname << "\" -- how odd" << std::endl;
00243     return false;
00244   }
00245   return reg->Set(rkey.c_str(),val);
00246 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
UInt_t  val 
)

Definition at line 223 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00224 {
00225   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00226   if ( ! reg ) {
00227     MSG("DataUtil",Msg::kWarning)
00228       << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00229       << rname << "\" -- how odd" << std::endl;
00230     return false;
00231   }
00232   // registry only knows about ints ... not Uint_t
00233   int itmp = (int)val;
00234   return reg->Set(rkey.c_str(),itmp);
00235 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
Int_t  val 
)

Definition at line 211 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

00212 {
00213   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00214   if ( ! reg ) {
00215     MSG("DataUtil",Msg::kWarning)
00216       << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00217       << rname << "\" -- how odd" << std::endl;
00218     return false;
00219   }
00220   return reg->Set(rkey.c_str(),val);
00221 }

bool minos::PostOnWhiteBoard ( std::string  rname,
std::string  rkey,
Short_t  val 
)

----------------------------------------------------------------------------

Definition at line 197 of file WhiteBoardRegistry.cxx.

References GetWhiteBoardRegistry(), Msg::kWarning, MSG, reg, and Registry::Set().

Referenced by EvtInfoInjectorModule::Ana(), and HepevtModule::Config().

00198 {
00199   Registry* reg = minos::GetWhiteBoardRegistry(rname);
00200   if ( ! reg ) {
00201     MSG("DataUtil",Msg::kWarning)
00202       << "minos::SetOnWhiteBoard: HEY! no registry \"" 
00203       << rname << "\" -- how odd" << std::endl;
00204     return false;
00205   }
00206   // registry only knows about ints ... not Short_t
00207   int itmp = val;
00208   return reg->Set(rkey.c_str(),itmp);
00209 }


Generated on 17 Jun 2018 for loon by  doxygen 1.6.1