49 throw cms::Exception(
"DDException") <<
"DDStreamer::DDStreamer(std::ostream&): not valid std::ostream";
60 throw cms::Exception(
"DDException") <<
"DDStreamer::DDStreamer(std::ostream&): not valid std::ostream";
85 while ((i=is.get()) && i != d) ;
86 while ((i=is.get()) && i != d) {
117 o <<
'"' << n.
name() <<
'"' <<
' ' <<
'"' << n.
ns() <<
'"' ;
132 throw cms::Exception(
"DDException") <<
"DDStreamer::write(): bad std::ostream";
142 throw cms::Exception(
"DDException") <<
"DDStreamer::read(): bad std::istream";
149 std::streamsize prec(os.precision());
150 os << std::setprecision(26) << std::scientific;
164 os << resetiosflags((std::ios_base::fmtflags)0);
165 os << std::setprecision(prec);
188 std::ostream & os = *
o_;
191 DDName::IdToName::const_iterator it(ids.begin()), ed(ids.end());
192 os << ids.size() << std::endl;
194 for (; it != ed; ++it) {
195 os <<
'"' << (*it)->first.first <<
'"' <<
' ' 196 <<
'"' << (*it)->first.second <<
'"' <<
' ' 197 << count << std::endl;
206 std::istream & is = *
i_;
232 for (; it!=ed; ++it) {
233 if (it->isDefined().second) {
252 const char *
d = (
const char *)(&(b.
val_));
255 os.write(d,
sizeof(
double));
262 char *
d = (
char *)(&(b.
val_));
264 is.read(d,
sizeof(
double));
271 std::ostream & os = *
o_;
274 os << no << std::endl;
275 for (; it != ed; ++it) {
276 if (! it->isDefined().second)
continue;
278 os <<
"--Material: " << m.
name() <<
" @ " ;
280 os <<
' ' << m.
z() <<
' ' << m.
a() <<
' ' << m.
density() <<
' ';
297 std::istream & is = *
i_;
305 double z(0),
a(0),
d(0);
334 edm::LogError(
"DDStreamer") <<
"DDStreamer::dd_stream_booleans(): solid=" << s.
name() <<
" has no rotation. Using unit-rot." << std::endl;
354 std::ostream & os = *
o_;
357 os << no << std::endl;
358 for (; it != ed; ++it) {
359 if (! it->isDefined().second)
continue;
363 os <<
' ' << s.
shape() <<
' ';
376 os.write((
char*)(&(*p.begin())),ps*
sizeof(double));
398 throw cms::Exception(
"DDException") <<
"DDStreamer::get_boolean_param(): inconsistent sequence! no blank delimiter before trans!";
411 std::istream & is = *
i_;
442 throw cms::Exception(
"DDException") <<
"DDStreamer::solids_read(): messed up in boolean solid reading!";
451 else if ( (shape==
ddbox ) ||
467 std::vector<double>
p(npars);
473 edm::LogError(
"DDStreamer") <<
"delimiter: " << c << std::endl;
474 throw cms::Exception(
"DDException") <<
"DDStreamer::solids_read(): wrong separator in atomic for atomic solids parameters";
476 is.read((
char*)&(*(p.begin())),npars*
sizeof(double));
489 edm::LogError(
"DDStreamer") <<
"wrong solid enum: " << shape << std::endl;
490 throw cms::Exception(
"DDException") <<
"Error in DDStreamer::solids_read(), wrong shape-enum!";
497 std::ostream & os = *
o_;
500 os << no << std::endl;
501 for (; it != ed; ++it) {
502 if (! it->isDefined().second)
continue;
504 os <<
"--Part: " << lp.
name() <<
" @ ";
517 std::istream & is = *
i_;
537 rm.GetComponents(v,v+9);
538 for (
int i=0;
i<9;
i++)
543 os <<
"--Rot: " << r.
name() <<
" @ ";
558 std::ostream & os = *
o_;
561 os << no << std::endl;
563 for (; it != ed; ++it) {
564 if (! it->isDefined().second)
continue;
578 for (
int i=0;
i<9;
i++) {
579 is >>
w; v[
i]=w.val_;
581 r.SetComponents(v,v+9);
586 std::istream & is = *
i_;
596 throw cms::Exception(
"DDException") <<
"DDStreamer::rots_read(): inconsitency! no blank separator found!";
609 DDCompactView::graph_type::const_iterator it = g.
begin_iter();
610 DDCompactView::graph_type::const_iterator ed = g.
end_iter();
611 std::ostream & os = *
o_;
618 DDCompactView::graph_type::const_iterator iit = g.
begin_iter();
619 DDCompactView::graph_type::const_iterator eed = g.
end_iter();
621 for(; iit != eed; ++iit) {
624 os << count << std::endl;
628 for(; it != ed; ++it) {
629 os <<
"--Pos[" << count <<
"]: @ "; ++
count;
631 nameout(os, it->from().name());
634 os <<
' ' << it->edge()->copyno_;
637 os <<
' ' <<
B(tr.x()) <<
B(tr.y()) <<
B(tr.z());
649 if (ro.name() == unit_rot_name) {
650 if(ro.isDefined().second) {
651 if(*(ro.rotation()) != unit_rot) {
672 std::istream & is = *
i_;
686 edm::LogWarning(
"DDStreamer") <<
"DDStreamer::pos_read(): The CompactView already contains some position information." << std::endl
687 <<
" It may cause an inconsistent geometry representation!" << std::endl << std::endl;
688 throw cms::Exception(
"DDException") <<
"DDStreamer::pos_read() failed; CompactView has already been populated by another data source";
697 if (cr !=
' ')
throw cms::Exception(
"DDException") <<
"DDStreamer::pos_read(): inconsistent sequence! no blank delimiter found!";
705 char rottype = is.get();
722 std::string message =
"DDStreamer::pos_read(): could not determine type of rotation\n";
766 std::ostream & os = *
o_;
769 os << no << std::endl;
770 for (; it != ed; ++it) {
771 if (! it->isDefined().second)
continue;
775 os <<
' ' << sp.
selection().size() << std::endl;
776 std::vector<DDPartSelection>::const_iterator sit(sp.
selection().begin()), sed(sp.
selection().end());
777 for (; sit != sed; ++sit) {
778 os << *sit << std::endl;
780 os << sp.
specifics().size() << std::endl;
781 DDsvalues_type::const_iterator vit(sp.
specifics().begin()), ved(sp.
specifics().end());
782 for (; vit != ved; ++vit) {
784 os <<
' ' <<
'"' << v.
name() <<
'"' <<
' ';
791 os << v.
size() <<
' ';
796 os <<
'"' << v[
i].first <<
'"' <<
' ' << v[
i].second <<
' ';
802 const std::vector<std::string> & vs = v.
strings();
804 os <<
'"' << vs[
i] <<
'"' <<
' ';
815 std::istream & is = *
i_;
826 std::vector<std::string> ps;
828 for (; ii < nps; ++
ii) {
836 for(; ii<nps; ++
ii) {
842 std::vector<DDValuePair> valv;
846 for(; iii<no; ++iii) {
851 valv.push_back(valp);
858 for(; iii<no; ++iii) {
861 valv.push_back(valp);
868 std::sort(sv.begin(),sv.end());
876 std::ostream & os = *
o_;
880 const std::vector<std::string> & vars = eval->
variables();
881 const std::vector<std::string> &
vals = eval->
values();
882 if (vars.size() != vals.size()) {
883 throw cms::Exception(
"DDException") <<
"DDStreamer::vars_write(): different size of variable names & values!";
885 size_t i(0),
s(vars.size());
886 os <<
s << std::endl;
888 os <<
'"' << vars[
i] <<
'"' <<
' ' 889 <<
'"' << vals[
i] <<
'"' << std::endl;
893 throw cms::Exception(
"DDException") <<
"DDStreamer::vars_write(): expression-evaluator is not a ClhepEvaluator-implementation!";
900 std::istream & is = *
i_;
911 eval->
set(name,value);
915 throw cms::Exception(
"DDException") <<
"DDStreamer::vars_write(): expression-evaluator is not a ClhepEvaluator-implementation!";
void materials_write()
write all instances of DDMaterial
const std::string & name(void) const
the name of the DDValue
void solids_write()
write all instances of DDSolid
adj_list::size_type size() const
double a() const
returns the atomic mass
void dd_stream_reflected(std::ostream &os, DDSolid s)
const DDRotationMatrix * rotation() const
Returns the read-only rotation-matrix.
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
def_type isDefined() const
void read()
populate DDD transient objects from the std::istream refetrred to by member i_
void dd_get_boolean_params(std::istream &is, DDRotation &r, DDTranslation &t, DDSolid &a, DDSolid &b)
DDMaterial is used to define and access material information.
DDEnums::Category category(void) const
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...)
void pos_write()
write the graph structure of DDCompactView::graph()
void dd_rot_bin_in(std::istream &is, DDRotationMatrix &r)
const graph_type & graph() const
Provides read-only access to the data structure of the compact-view.
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
void vars_write()
write the dictionary of ClhepEvaluator
void specs_write()
write all instances of DDSpecifics
const std::string & ns() const
Returns the namespace.
DDName is used to identify DDD entities uniquely.
void names_read()
read all instances of DDName
void setEvalState(bool newState)
set to true, if the double-values (method DDValue::doubles()) make sense
std::string dd_get_delimit(std::istream &is, char d)
void parts_write()
write all instances of DDLogicalPart
virtual ~DDStreamer()
does nothing; usefull only if another streamer derives from DDStreamer
DDTranslation translation(void) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
void dd_rot_bin_out(std::ostream &os, const DDRotationMatrix &rm)
type of data representation of DDCompactView
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::ostream & operator<<(std::ostream &os, double_binary b)
A DDSolid represents the shape of a part.
DDSolid solidB(void) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
DDName dd_get_name(std::istream &is)
void vars_read()
read the dictionlary of ClhepEvaluator
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
std::map< std::pair< std::string, std::string >, id_type > Registry
int addMaterial(const DDMaterial &m, double fm)
adds a material to the mixture proportional to its fraction-mass fm.
void write()
stream all DDD transient objects to the std::ostream referred to by member o_
static value_type & instance()
double z() const
retruns the atomic number
void solids_read()
read all instances of DDSolid
static const char *const name(DDSolidShape s)
DDSolid unreflected(void) const
static DDSolid intersection(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
DDRotation rotation(void) const
void dd_stream_booleans(std::ostream &os, DDSolid s, DDSolidShape)
void dd_rot_out(std::ostream &os, const DDRotation &r)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
void specs_read()
read all instances of
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
const std::vector< std::string > & variables() const
access to the clhep-implementation of the dictionary variables
DDSolidShape shape(void) const
The type of the solid.
def template(fileName, svg, replaceme="REPLACEME")
const_iterator begin_iter() const
const std::vector< std::string > & values() const
static void defineId(const std::pair< std::string, std::string > &, id_type id)
register pre-defined ids
std::istream & operator>>(std::istream &is, double_binary &b)
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
size_t dd_count(const T &)
DDSolid solidA(void) const
void rots_read()
read all instances of DDRotation
void names_write()
write all instances of DDName
void parts_read()
read all instances of DDLogicalPart
std::vector< Registry::const_iterator > IdToName
void pos_read()
read the graph structure for DDCompactView::graph()
double density() const
returns the density
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
static void createConstantsFromEvaluator()
creates all DDConstants from the variables of the ClhepEvaluator
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
const DDsvalues_type & specifics() const
Reference to the user-data attached to all nodes selected by the selections-strings given through sel...
static DDSolid reflection(const DDName &name, const DDSolid &s)
void materials_read()
read all instances of DDMaterial
DDName dd_get_name_string(std::istream &is)
void nameout(std::ostream &o, const DDName &n)
void rots_write()
write all instances of DDRotation
void set(const std::string &ns, const std::string &name, const std::string &exprValue)
unsigned int size() const
the size of the stored value-pairs (std::string,double)
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
DDStreamer()
constructs a streamer object with yet undefined std::istream and std::ostream
void nameout_strings(std::ostream &o, const DDName &n)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
DDsvalues_type::value_type DDsvalues_Content_type
Interface to attach user specific data to nodes in the expanded-view.
const_iterator end_iter() const
const std::vector< DDPartSelection > & selection() const
Gives a reference to the collection of part-selections.