CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DDStreamer Class Reference

Streaming the DDD transient store from/into a std::istream/std::ostream */. More...

#include <DDStreamer.h>

Public Member Functions

 DDStreamer ()
 constructs a streamer object with yet undefined std::istream and std::ostream More...
 
 DDStreamer (std::istream &readFrom)
 creates a streamer object for reading More...
 
 DDStreamer (std::ostream &writeTo)
 creates a streamer object for writing More...
 
void read ()
 populate DDD transient objects from the std::istream refetrred to by member i_ More...
 
void read (std::istream &is)
 populate DDD transient objects from the given std::istream is More...
 
void setInput (std::istream &i)
 set the istream for DDStreamer::read() More...
 
void setOutput (std::ostream &o)
 set the std::ostream for DDStreamer::write() More...
 
void write ()
 stream all DDD transient objects to the std::ostream referred to by member o_ More...
 
void write (std::ostream &os)
 stream all DDD transient objects to the given std::ostream os More...
 
virtual ~DDStreamer ()
 does nothing; usefull only if another streamer derives from DDStreamer More...
 

Protected Member Functions

void materials_read ()
 read all instances of DDMaterial More...
 
void materials_write ()
 write all instances of DDMaterial More...
 
void names_read ()
 read all instances of DDName More...
 
void names_write ()
 write all instances of DDName More...
 
void parts_read ()
 read all instances of DDLogicalPart More...
 
void parts_write ()
 write all instances of DDLogicalPart More...
 
void pos_read ()
 read the graph structure for DDCompactView::graph() More...
 
void pos_write ()
 write the graph structure of DDCompactView::graph() More...
 
void rots_read ()
 read all instances of DDRotation More...
 
void rots_write ()
 write all instances of DDRotation More...
 
void solids_read ()
 read all instances of DDSolid More...
 
void solids_write ()
 write all instances of DDSolid More...
 
void specs_read ()
 read all instances of More...
 
void specs_write ()
 write all instances of DDSpecifics More...
 
void vars_read ()
 read the dictionlary of ClhepEvaluator More...
 
void vars_write ()
 write the dictionary of ClhepEvaluator More...
 

Private Attributes

const DDCompactViewcpv_
 
std::istream * i_
 
std::ostream * o_
 

Detailed Description

Streaming the DDD transient store from/into a std::istream/std::ostream */.

DDStreamer can be used to write the DDD transient object into a std::ostram and to retrieve them again via an std::istream.


The streamer can also be used together with DDLParser. Once possible usage scenario would be to load most of the geometrical DDD information via the streamer and parse some addional DDD XML documents containing SpecPar-information using DDLParser.


If DDStreamer is used together with DDLParser, the user has to ensure that reading in via DDStreamer::read() is done BEFORE invoking DDLParser to guarantee internal consistensies of the DDD objects.



// writing:
#include<fstream>
std::ofstream file("pers.txt");
DDStreamer streamer(file);
streamer.write();
// reading:
#include<fstream>
std::ifstream file("pers.txt");
DDStreamer streamer(filer);
streamer.read();

Definition at line 41 of file DDStreamer.h.

Constructor & Destructor Documentation

DDStreamer::DDStreamer ( )

constructs a streamer object with yet undefined std::istream and std::ostream

Definition at line 21 of file DDStreamer.cc.

22  : cpv_(0), o_(0), i_(0)
23  {
24  }
std::istream * i_
Definition: DDStreamer.h:126
const DDCompactView * cpv_
Definition: DDStreamer.h:124
std::ostream * o_
Definition: DDStreamer.h:125
DDStreamer::DDStreamer ( std::istream &  readFrom)

creates a streamer object for reading

Definition at line 37 of file DDStreamer.cc.

References edm::hlt::Exception, and i_.

38  : cpv_(0), o_(0), i_(0)
39 {
40  if (is) {
41  i_ = &is;
42  }
43  else {
44  throw cms::Exception("DDException") << "DDStreamer::DDStreamer(std::ostream&): not valid std::ostream";
45  }
46 }
std::istream * i_
Definition: DDStreamer.h:126
const DDCompactView * cpv_
Definition: DDStreamer.h:124
std::ostream * o_
Definition: DDStreamer.h:125
DDStreamer::DDStreamer ( std::ostream &  writeTo)

creates a streamer object for writing

Definition at line 26 of file DDStreamer.cc.

References edm::hlt::Exception, and o_.

27  : cpv_(0), o_(0), i_(0)
28 {
29  if (os) {
30  o_ = &os;
31  }
32  else {
33  throw cms::Exception("DDException") << "DDStreamer::DDStreamer(std::ostream&): not valid std::ostream";
34  }
35 }
std::istream * i_
Definition: DDStreamer.h:126
const DDCompactView * cpv_
Definition: DDStreamer.h:124
std::ostream * o_
Definition: DDStreamer.h:125
DDStreamer::~DDStreamer ( )
virtual

does nothing; usefull only if another streamer derives from DDStreamer

Definition at line 48 of file DDStreamer.cc.

48 {}

Member Function Documentation

void DDStreamer::materials_read ( )
protected

read all instances of DDMaterial

Definition at line 284 of file DDStreamer.cc.

References a, DDMaterial::addMaterial(), AlCaHLTBitMon_QueryRunRegistry::comp, ztail::d, DCOUT, dd_get_name(), i, i_, j, visualization-live-secondInstance_cfg::m, gen::n, DDBase< N, C >::name(), and detailsBasic3DVector::z.

Referenced by read().

285 {
286  DCOUT('Y', "DDStreamer::materials_read()");
287  std::istream & is = *i_;
288  //DDMaterial::clear();
289  size_t n=0;
290  is >> n;
291  size_t i=0;
292  for (; i < n; ++i) { // Materials
293  is.ignore(1000,'@');
294  DDName dn = dd_get_name(is);
295  double z(0), a(0), d(0);
296  is >> z;
297  is >> a;
298  is >> d;
299  int comp(0);
300  is >> comp; // composites
301  if (comp) { // composite material
302  DDMaterial m(dn,d);
303  DCOUT('y', "read-comp-material=" << m.name());
304  int j=0;
305  for(; j<comp; ++j) {
306  DDName cname(dd_get_name(is));
307  double fm(0);
308  is >> fm;
309  DDMaterial constituent(cname);
310  DCOUT('y', " read-composite=" << constituent.name());
311  m.addMaterial(constituent,fm);
312  }
313  }
314  else { // elementary material
315  DDMaterial m(dn,z,a,d);
316  DCOUT('y', "read-elem-material=" << m.name());
317  }
318  }
319 }
int i
Definition: DBlmapReader.cc:9
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
float float float z
DDName dd_get_name(std::istream &is)
Definition: DDStreamer.cc:92
tuple d
Definition: ztail.py:151
std::istream * i_
Definition: DDStreamer.h:126
int j
Definition: DBlmapReader.cc:9
double a
Definition: hdecay.h:121
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::materials_write ( )
protected

write all instances of DDMaterial

Definition at line 255 of file DDStreamer.cc.

References DDMaterial::a(), DDBase< DDName, DDI::Material * >::begin(), DDMaterial::constituent(), DCOUT, dd_count(), DDMaterial::density(), DDBase< DDName, DDI::Material * >::end(), j, visualization-live-secondInstance_cfg::m, DDBase< N, C >::name(), nameout(), DDMaterial::noOfConstituents(), o_, and DDMaterial::z().

Referenced by write().

256 {
257  DCOUT('Y', "DDStreamer::materials_write()");
258  std::ostream & os = *o_;
259  DDMaterial::iterator<DDMaterial> it(DDMaterial::begin()), ed(DDMaterial::end());
260  size_t no = dd_count(DDMaterial());
261  os << no << std::endl;
262  for (; it != ed; ++it) {
263  if (! it->isDefined().second) continue;
264  const DDMaterial & m = *it;
265  os << "--Material: " << m.name() << " @ " ;
266  nameout(os,m.name());
267  DCOUT('y', "write-material=" << m.name());
268  os << ' ' << m.z() << ' ' << m.a() << ' ' << m.density() << ' ';
269 
270  int noc = m.noOfConstituents();
271  os << noc;
272  int j=0;
273  for (; j<noc; ++j) {
274  DCOUT('y', " write-const-material=" << m.constituent(j).first.name());
275  os << ' ';
276  nameout(os,m.constituent(j).first.name());
277  os << ' ' << m.constituent(j).second;
278  }
279  os << std::endl;
280  }
281 }
double a() const
returns the atomic mass
Definition: DDMaterial.cc:97
const N & name() const
Definition: DDBase.h:82
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double z() const
retruns the atomic number
Definition: DDMaterial.cc:103
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
Definition: DDMaterial.cc:89
int j
Definition: DBlmapReader.cc:9
size_t dd_count(const T &)
Definition: DDStreamer.cc:214
double density() const
returns the density
Definition: DDMaterial.cc:109
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
Definition: DDMaterial.cc:83
std::ostream * o_
Definition: DDStreamer.h:125
void nameout(std::ostream &o, const DDName &n)
Definition: DDStreamer.cc:104
static DDI::Store< DDName, DDI::Material * >::iterator begin()
Definition: DDBase.h:70
static DDI::Store< DDName, DDI::Material * >::iterator end()
Definition: DDBase.h:69
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::names_read ( )
protected

read all instances of DDName

Definition at line 189 of file DDStreamer.cc.

References DCOUT, dd_get_delimit(), DDName::defineId(), i, i_, DDI::Singleton< I >::instance(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by read().

190 {
191  DCOUT('Y', "DDStreamer::names_read()");
192  std::istream & is = *i_;
195 
196  size_t s;
197  is >> s;
198  ids.clear();
199  //ids.resize(s);
200  reg.clear();
201  size_t i(0);
202  //std::string nm; getline(is,nm);
203  for (; i<s; ++i) {
204  std::string nm(dd_get_delimit(is,'"'));
205  std::string ns(dd_get_delimit(is,'"'));
206  size_t id(0);
207  is >> id;
208  DDName::defineId(std::make_pair(nm,ns),id);
209  }
210 }
int i
Definition: DBlmapReader.cc:9
std::string dd_get_delimit(std::istream &is, char d)
Definition: DDStreamer.cc:65
std::map< std::pair< std::string, std::string >, id_type > Registry
Definition: DDName.h:26
static value_type & instance()
std::istream * i_
Definition: DDStreamer.h:126
static void defineId(const std::pair< std::string, std::string > &, id_type id)
register pre-defined ids
Definition: DDName.cc:63
std::vector< Registry::const_iterator > IdToName
Definition: DDName.h:27
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::names_write ( )
protected

write all instances of DDName

Definition at line 170 of file DDStreamer.cc.

References prof2calltree::count, DCOUT, DDI::Singleton< I >::instance(), and o_.

Referenced by write().

171 {
172  DCOUT('Y', "DDStreamer::names_write()");
173  std::ostream & os = *o_;
175 
176  DDName::IdToName::const_iterator it(ids.begin()), ed(ids.end());
177  os << ids.size() << std::endl;
178  size_t count(0);
179  for (; it != ed; ++it) {
180  os << '"' << (*it)->first.first << '"' << ' '
181  << '"' << (*it)->first.second << '"' << ' '
182  << count << std::endl;
183  ++count;
184  }
185 
186 }
static value_type & instance()
std::vector< Registry::const_iterator > IdToName
Definition: DDName.h:27
std::ostream * o_
Definition: DDStreamer.h:125
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::parts_read ( )
protected

read all instances of DDLogicalPart

Definition at line 513 of file DDStreamer.cc.

References eostools::cat(), DCOUT, dd_get_name(), i, i_, and gen::n.

Referenced by read().

514 {
515  DCOUT('Y', "DDStreamer::parts_read()");
516  std::istream & is = *i_;
517  //DDLogicalPart::clear();
518  size_t n=0;
519  is >> n;
520  size_t i=0;
521  for (; i < n; ++i) { // LogicalParts
522  is.ignore(1000,'@');
523  DDName dn = dd_get_name(is);
524  size_t cat(0);
525  is >> cat;
527  DDName mat = dd_get_name(is);
528  DDName sol = dd_get_name(is);
529  DDLogicalPart lp(dn,mat,sol,categ);
530  DCOUT('y', "read-lp=" << lp);
531  }
532 }
int i
Definition: DBlmapReader.cc:9
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
DDName dd_get_name(std::istream &is)
Definition: DDStreamer.cc:92
std::istream * i_
Definition: DDStreamer.h:126
def cat
Definition: eostools.py:398
Category
Definition: DDEnums.h:7
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::parts_write ( )
protected

write all instances of DDLogicalPart

Definition at line 492 of file DDStreamer.cc.

References DDBase< DDName, DDI::LogicalPart * >::begin(), DDLogicalPart::category(), DCOUT, dd_count(), DDBase< DDName, DDI::LogicalPart * >::end(), DDLogicalPart::material(), DDBase< N, C >::name(), nameout(), o_, and DDLogicalPart::solid().

Referenced by write().

493 {
494  DCOUT('Y', "DDStreamer::parts_write()");
495  std::ostream & os = *o_;
496  DDLogicalPart::iterator<DDLogicalPart> it(DDLogicalPart::begin()), ed(DDLogicalPart::end());
497  size_t no = dd_count(DDLogicalPart());
498  os << no << std::endl;
499  for (; it != ed; ++it) {
500  if (! it->isDefined().second) continue;
501  const DDLogicalPart & lp = *it;
502  os << "--Part: " << lp.name() << " @ ";
503  nameout(os,lp.name());
504  os << ' ' << lp.category() << ' ';
505  nameout(os,lp.material().name());
506  os << ' ';
507  nameout(os,lp.solid().name());
508  os << std::endl;
509  }
510 }
const N & name() const
Definition: DDBase.h:82
DDEnums::Category category(void) const
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
size_t dd_count(const T &)
Definition: DDStreamer.cc:214
std::ostream * o_
Definition: DDStreamer.h:125
void nameout(std::ostream &o, const DDName &n)
Definition: DDStreamer.cc:104
static DDI::Store< DDName, DDI::LogicalPart * >::iterator begin()
Definition: DDBase.h:70
static DDI::Store< DDName, DDI::LogicalPart * >::iterator end()
Definition: DDBase.h:69
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
void DDStreamer::pos_read ( )
protected

read the graph structure for DDCompactView::graph()

Definition at line 675 of file DDStreamer.cc.

References CommonMethods::cp(), DCOUT, dd_get_name(), dd_rot_bin_in(), DDanonymousRot(), edm::hlt::Exception, g, DDCompactView::graph(), i, i_, DDI::Singleton< I >::instance(), makeMuonMisalignmentScenario::matrix, python.rootplot.argparse::message, gen::n, DDBase< N, C >::name(), DDCompactView::position(), dbtoconf::root, makeMuonMisalignmentScenario::rot, graph< N, E >::size(), AlCaHLTBitMon_QueryRunRegistry::string, edmStreamStallGrapher::t, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by read().

676 {
677  DCOUT('Y', "DDStreamer::pos_read()");
678  std::istream & is = *i_;
679  is.ignore(1000,'@');
680  DDName rtname = dd_get_name(is);
681  DDLogicalPart root(rtname);
682  DCOUT('y', "root is: " << root.name());
683  DDRootDef::instance().set(root);
684  size_t n=0;
685  is >> n;
686  size_t i=0;
687  DDCompactView cpv;
689  // DDPositioner pos_(&cpv);
690  //LogDebug << "===== GRAPH SIZE = " << g.size() << " ======" << std::endl << std::endl;
691  if (g.size()) {
692  edm::LogWarning("DDStreamer") << std::endl;
693  edm::LogWarning("DDStreamer") << "DDStreamer::pos_read(): The CompactView already contains some position information." << std::endl
694  << " It may cause an inconsistent geometry representation!" << std::endl << std::endl;
695  throw cms::Exception("DDException") << "DDStreamer::pos_read() failed; CompactView has already been populated by another data source";
696  }
697  for (; i < n; ++i) { // Positions
698  is.ignore(1000,'@');
699  DDName from(dd_get_name(is));
700  DDName to(dd_get_name(is));
701  std::string cp;
702  is >> cp;
703  char cr = is.get();
704  if (cr != ' ') throw cms::Exception("DDException") << "DDStreamer::pos_read(): inconsistent sequence! no blank delimiter found!";
705  //double x,y,z;
706  B x,y,z;
707  is >> x;
708  is >> y;
709  is >> z;
710  DDTranslation t(x.val_,y.val_,z.val_);
711  is.ignore();
712  char rottype = is.get();
714  //DDName rotname;
715  DDRotation rot;
716  switch(rottype) {
717  case 'a': // anonymous rotation
718  is.ignore();
719  matrix = new DDRotationMatrix;
720  dd_rot_bin_in(is,*matrix);
721  rot = DDanonymousRot(matrix);
722  break;
723  case 'u': // unit rotation
724  break;
725  case 'r': // regular (named) rotation
726  rot = DDRotation(dd_get_name(is));
727  break;
728  default:
729  std::string message = "DDStreamer::pos_read(): could not determine type of rotation\n";
730  throw cms::Exception("DDException") << message;
731  }
732  //DDName rot(dd_get_name(is));
733  cpv.position(DDLogicalPart(to),DDLogicalPart(from),cp,t,rot);
734  DCOUT('y', " pos-read: f=" << from << " to=" << to << " t=" << t << " r=" << rot);
735  }
736 }
adj_list::size_type size() const
Definition: adjgraph.h:201
int i
Definition: DBlmapReader.cc:9
void dd_rot_bin_in(std::istream &is, DDRotationMatrix &r)
Definition: DDStreamer.cc:576
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)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
type of data representation of DDCompactView
Definition: DDCompactView.h:77
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
Definition: Activities.doc:4
float float float z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDRotation DDanonymousRot(DDRotationMatrix *rot)
Defines a anonymous rotation or rotation-reflection matrix.
Definition: DDRotation.cc:194
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDName dd_get_name(std::istream &is)
Definition: DDStreamer.cc:92
static value_type & instance()
std::istream * i_
Definition: DDStreamer.h:126
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
Definition: DDAxes.h:10
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
string root
initialization
Definition: dbtoconf.py:70
void DDStreamer::pos_write ( )
protected

write the graph structure of DDCompactView::graph()

Definition at line 609 of file DDStreamer.cc.

References graph< N, E >::begin_iter(), prof2calltree::count, DCOUT, dd_rot_bin_out(), graph< N, E >::end_iter(), g, DDCompactView::graph(), DDI::Singleton< I >::instance(), DDBase< N, C >::name(), nameout(), and o_.

Referenced by write().

610 {
611  DCOUT('Y', "DDStreamer::pos_write()");
612  DDCompactView cpv;
613  const DDCompactView::graph_type & g = cpv.graph();
614  DDCompactView::graph_type::const_iterator it = g.begin_iter();
615  DDCompactView::graph_type::const_iterator ed = g.end_iter();
616  std::ostream & os = *o_;
617  // first the root
618  DDLogicalPart rt = DDRootDef::instance().root();
619  os << "--Root: @ ";
620  nameout(os,rt.name());
621  os << std::endl;
622  //os << g.edge_size() << std::endl;
623  DDCompactView::graph_type::const_iterator iit = g.begin_iter();
624  DDCompactView::graph_type::const_iterator eed = g.end_iter();
625  size_t count(0);
626  for(; iit != eed; ++iit) {
627  ++count;
628  }
629  os << count << std::endl;
630  count=0;
631  DDName unit_rot_name;
632  DDRotationMatrix unit_rot;
633  for(; it != ed; ++it) {
634  os << "--Pos[" << count << "]: @ "; ++count;
635  //const DDLogicalPart & fr = it->from();
636  nameout(os, it->from().name());
637  os << ' ';
638  nameout(os, it->to().name());
639  os << ' ' << it->edge()->copyno_;
640  const DDTranslation & tr = it->edge()->translation();
641  //os << ' ' << B(tr.x()) << ' ' << B(tr.y()) << ' ' << B(tr.z());
642  os << ' ' << B(tr.x()) << B(tr.y()) << B(tr.z());
643  const DDRotation & ro = it->edge()->rot_;
644  os << ' ';
645  /* if it's an anonymous rotation stemming from an AlgoPosPart
646  then it's id must be the one of a unit rotation AND
647  it must be defined at this point AND it must not be the
648  unit rotation.
649  A character identifier is issues to mark the type of the rotation:
650  a ... anonymous rotation, followed by the binary numbers of the matrix
651  u ... unit-rotation matrix, no values following
652  r ... regular defined rotation-matrix (named rotation matrix) followed by name-id
653  */
654  if (ro.name() == unit_rot_name) {
655  if(ro.isDefined().second) {
656  if(*(ro.rotation()) != unit_rot) {
657  os << "a ";
658  dd_rot_bin_out(os,*(ro.rotation()));
659  }
660  else {
661  os << "u ";
662  }
663  }
664  }
665  else {
666  os << "r ";
667  nameout(os, ro.name());
668  }
669  os << std::endl;
670  }
671 
672 }
const N & name() const
Definition: DDBase.h:82
double_binary B
Definition: DDStreamer.cc:234
const graph_type & graph() const
Provides read-only access to the data structure of the compact-view.
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
void dd_rot_bin_out(std::ostream &os, const DDRotationMatrix &rm)
Definition: DDStreamer.cc:534
type of data representation of DDCompactView
Definition: DDCompactView.h:77
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
Definition: Activities.doc:4
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
static value_type & instance()
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
const_iterator begin_iter() const
Definition: adjgraph.h:190
std::ostream * o_
Definition: DDStreamer.h:125
void nameout(std::ostream &o, const DDName &n)
Definition: DDStreamer.cc:104
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
const_iterator end_iter() const
Definition: adjgraph.h:192
void DDStreamer::read ( )

populate DDD transient objects from the std::istream refetrred to by member i_

Definition at line 120 of file DDStreamer.cc.

References edm::hlt::Exception, and i_.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

121 {
122  if (i_ && *i_) {
123  read(*i_);
124  }
125  else {
126  throw cms::Exception("DDException") << "DDStreamer::read(): bad std::istream";
127  }
128 }
void read()
populate DDD transient objects from the std::istream refetrred to by member i_
Definition: DDStreamer.cc:120
std::istream * i_
Definition: DDStreamer.h:126
void DDStreamer::read ( std::istream &  is)

populate DDD transient objects from the given std::istream is

Definition at line 153 of file DDStreamer.cc.

References i_, materials_read(), names_read(), parts_read(), pos_read(), rots_read(), solids_read(), specs_read(), and vars_read().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

154 {
155 
156  i_=&is;
157  names_read();
158  vars_read();
159 
160  materials_read();
161  solids_read();
162  parts_read();
163 
164  pos_read();
165  specs_read();
166  rots_read();
167 }
void names_read()
read all instances of DDName
Definition: DDStreamer.cc:189
void vars_read()
read the dictionlary of ClhepEvaluator
Definition: DDStreamer.cc:911
void solids_read()
read all instances of DDSolid
Definition: DDStreamer.cc:405
std::istream * i_
Definition: DDStreamer.h:126
void specs_read()
read all instances of
Definition: DDStreamer.cc:823
void rots_read()
read all instances of DDRotation
Definition: DDStreamer.cc:586
void parts_read()
read all instances of DDLogicalPart
Definition: DDStreamer.cc:513
void pos_read()
read the graph structure for DDCompactView::graph()
Definition: DDStreamer.cc:675
void materials_read()
read all instances of DDMaterial
Definition: DDStreamer.cc:284
void DDStreamer::rots_read ( )
protected

read all instances of DDRotation

Definition at line 586 of file DDStreamer.cc.

References EnergyCorrector::c, DCOUT, dd_get_name(), dd_rot_bin_in(), edm::hlt::Exception, i, i_, gen::n, DDBase< N, C >::name(), and submit::rm.

Referenced by read().

587 {
588  DCOUT('Y', "DDStreamer::rots_read()");
589  std::istream & is = *i_;
590  //DDRotation::clear();
591  size_t n=0;
592  is >> n;
593  size_t i=0;
594  for (; i < n; ++i) { // Rotations
595  is.ignore(1000,'@');
596  DDName dn = dd_get_name(is);
597  char c = is.get();
598  if (c != ' ') {
599  throw cms::Exception("DDException") << "DDStreamer::rots_read(): inconsitency! no blank separator found!";
600  }
601 
603  dd_rot_bin_in(is,*rm);
604  DDRotation ddr = DDRotation(dn,rm);
605  DCOUT('y',"read-rots=" << ddr.name());
606  }
607 }
int i
Definition: DBlmapReader.cc:9
const N & name() const
Definition: DDBase.h:82
void dd_rot_bin_in(std::istream &is, DDRotationMatrix &r)
Definition: DDStreamer.cc:576
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDName dd_get_name(std::istream &is)
Definition: DDStreamer.cc:92
std::istream * i_
Definition: DDStreamer.h:126
string rm
Definition: submit.py:76
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::rots_write ( )
protected

write all instances of DDRotation

Definition at line 557 of file DDStreamer.cc.

References DDBase< DDName, DDRotationMatrix * >::begin(), DCOUT, dd_count(), dd_rot_out(), DDBase< DDName, DDRotationMatrix * >::end(), o_, and alignCSCRings::r.

Referenced by write().

558 {
559  DCOUT('Y', "DDStreamer::rots_write()");
560  std::ostream & os = *o_;
561  DDRotation::iterator<DDRotation> it(DDRotation::begin()), ed(DDRotation::end());
562  size_t no = dd_count(DDRotation());
563  os << no << std::endl;
564  //DDName ano;
565  for (; it != ed; ++it) {
566  if (! it->isDefined().second) continue;
567  const DDRotation & r = *it;
568  //if (r.name().id() == ano.id()) {
569  // continue;
570  //}
571  dd_rot_out(os,r);
572  }
573 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
void dd_rot_out(std::ostream &os, const DDRotation &r)
Definition: DDStreamer.cc:542
size_t dd_count(const T &)
Definition: DDStreamer.cc:214
std::ostream * o_
Definition: DDStreamer.h:125
static DDI::Store< DDName, DDRotationMatrix * >::iterator begin()
Definition: DDBase.h:70
static DDI::Store< DDName, DDRotationMatrix * >::iterator end()
Definition: DDBase.h:69
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::setInput ( std::istream &  i)
inline

set the istream for DDStreamer::read()

Definition at line 69 of file DDStreamer.h.

References i, and i_.

69 { i_ = &i; }
int i
Definition: DBlmapReader.cc:9
std::istream * i_
Definition: DDStreamer.h:126
void DDStreamer::setOutput ( std::ostream &  o)
inline

set the std::ostream for DDStreamer::write()

Definition at line 72 of file DDStreamer.h.

References python.connectstrParser::o, and o_.

72 { o_ = &o; }
std::ostream * o_
Definition: DDStreamer.h:125
void DDStreamer::solids_read ( )
protected

read all instances of DDSolid

Definition at line 405 of file DDStreamer.cc.

References a, b, EnergyCorrector::c, DCOUT, dd_get_boolean_params(), dd_get_name(), ddbox, ddcons, ddintersection, ddpolycone_rrz, ddpolycone_rz, ddpolyhedra_rrz, ddpolyhedra_rz, ddpseudotrap, ddreflected, ddshapeless, ddsubtraction, ddtrap, ddtubs, ddunion, edm::hlt::Exception, i, i_, DDSolidFactory::intersection(), gen::n, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, DDSolidFactory::reflection(), DDSolidFactory::subtraction(), edmStreamStallGrapher::t, and DDSolidFactory::unionSolid().

Referenced by read().

406 {
407  DCOUT('Y', "DDStreamer::solids_read()");
408  std::istream & is = *i_;
409  //DDSolid::clear();
410  size_t n=0;
411  is >> n;
412  size_t i=0;
413  for (; i < n; ++i) { // Solids
414  is.ignore(1000,'@');
415  DDName dn = dd_get_name(is);
416 
417  size_t sp(0);
418  is >> sp;
419  DDSolidShape shape = DDSolidShape(sp);
420 
421  // boolean solids
422  if ( (shape==ddunion) | (shape==ddsubtraction) || (shape==ddintersection) ) {
423  DDRotation r;
425  DDSolid a;
426  DDSolid b;
427  dd_get_boolean_params(is,r,t,a,b);
428  switch (shape) {
429  case ddunion:
430  DDSolidFactory::unionSolid(dn,a,b,t,r);
431  break;
432  case ddintersection:
433  DDSolidFactory::intersection(dn,a,b,t,r);
434  break;
435  case ddsubtraction:
436  DDSolidFactory::subtraction(dn,a,b,t,r);
437  break;
438  default:
439  throw cms::Exception("DDException") << "DDStreamer::solids_read(): messed up in boolean solid reading!";
440  }
441  }
442 
443  // reflection solids
444  else if (shape==ddreflected) {
445  DDName ref_nm = dd_get_name(is);
446  DDSolidFactory::reflection(dn,ref_nm);
447  }
448  else if ( (shape==ddbox ) ||
449  (shape==ddtrap) ||
450  (shape==ddcons) ||
451  (shape==ddtubs) ||
452  (shape==ddpolycone_rz) ||
453  (shape==ddpolycone_rrz) ||
454  (shape==ddpolyhedra_rz) ||
455  (shape==ddpolyhedra_rrz) ||
456  (shape==ddpseudotrap) ||
457  (shape==ddshapeless) )
458  {
459  // read in the solid's parameters
460  size_t npars(0);
461  is >> npars;
462 
463  std::vector<double> p(npars);
464  if(npars) {
465  //edm::LogError("DDStreamer") << npars << flush << std::endl;
466  char c;
467  c = is.get();
468  if (c != ' ') {
469  edm::LogError("DDStreamer") << "delimiter: " << c << std::endl;
470  throw cms::Exception("DDException") << "DDStreamer::solids_read(): wrong separator in atomic for atomic solids parameters";
471  }
472  is.read((char*)&(*(p.begin())),npars*sizeof(double));
473  /*
474  size_t i(0);
475  for(; i< npars; ++i) {
476  double d(0);
477  is >> d;
478  p.push_back(d);
479  }
480  */
481  }
482  DDSolid so = DDSolid(dn,shape,p);
483  DCOUT('y', "read-solid=" << so);
484  }
485  else {
486  edm::LogError("DDStreamer") << "wrong solid enum: " << shape << std::endl;
487  throw cms::Exception("DDException") << "Error in DDStreamer::solids_read(), wrong shape-enum!";
488  }
489  }
490 }
int i
Definition: DBlmapReader.cc:9
void dd_get_boolean_params(std::istream &is, DDRotation &r, DDTranslation &t, DDSolid &a, DDSolid &b)
Definition: DDStreamer.cc:385
DDSolidShape
Definition: DDSolidShapes.h:6
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDName dd_get_name(std::istream &is)
Definition: DDStreamer.cc:92
std::istream * i_
Definition: DDStreamer.h:126
static DDSolid intersection(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:714
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:705
double b
Definition: hdecay.h:120
static DDSolid reflection(const DDName &name, const DDSolid &s)
Definition: DDSolid.cc:852
double a
Definition: hdecay.h:121
static DDSolid unionSolid(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:696
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::solids_write ( )
protected

write all instances of DDSolid

Definition at line 345 of file DDStreamer.cc.

References DDBase< DDName, DDI::Solid * >::begin(), DCOUT, dd_count(), dd_stream_booleans(), dd_stream_reflected(), ddintersection, ddreflected, ddsubtraction, ddunion, DDBase< DDName, DDI::Solid * >::end(), DDSolidShapesName::name(), DDBase< N, C >::name(), nameout(), o_, AlCaHLTBitMon_ParallelJobs::p, DDSolid::parameters(), alignCSCRings::s, and DDSolid::shape().

Referenced by write().

346 {
347  DCOUT('Y', "DDStreamer::solids_write()");
348  std::ostream & os = *o_;
349  DDSolid::iterator<DDSolid> it(DDSolid::begin()), ed(DDSolid::end());
350  size_t no = dd_count(DDSolid());
351  os << no << std::endl;
352  for (; it != ed; ++it) {
353  if (! it->isDefined().second) continue;
354  const DDSolid & s = *it;
355  DCOUT('y', "write-solid=" << s << " enum=" << s.shape());
356  os << "--Solid: " << s.name() << ' ' << DDSolidShapesName::name(s.shape()) << " @ ";
357  nameout(os,s.name());
358  os << ' ' << s.shape() << ' ';
359  switch (s.shape()) {
360  case ddunion: case ddsubtraction: case ddintersection:
361  dd_stream_booleans(os, s, s.shape());
362  break;
363  case ddreflected:
364  dd_stream_reflected(os, s);
365  break;
366  default:
367  size_t ps = s.parameters().size();
368  os << ps;
369  const std::vector<double> & p = s.parameters();
370  os << ' ';
371  os.write((char*)(&(*p.begin())),ps*sizeof(double));
372  /*
373  std::vector<double>::const_iterator it(p.begin()), ed(p.end());
374  for (; it != ed; ++it) {
375  os << ' ' << *it;
376  }
377  */
378  }
379  os << std::endl;
380  }
381 }
void dd_stream_reflected(std::ostream &os, DDSolid s)
Definition: DDStreamer.cc:339
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:150
const N & name() const
Definition: DDBase.h:82
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
static const char *const name(DDSolidShape s)
Definition: DDSolidShapes.h:21
void dd_stream_booleans(std::ostream &os, DDSolid s, DDSolidShape)
Definition: DDStreamer.cc:321
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:144
size_t dd_count(const T &)
Definition: DDStreamer.cc:214
std::ostream * o_
Definition: DDStreamer.h:125
void nameout(std::ostream &o, const DDName &n)
Definition: DDStreamer.cc:104
static DDI::Store< DDName, DDI::Solid * >::iterator begin()
Definition: DDBase.h:70
static DDI::Store< DDName, DDI::Solid * >::iterator end()
Definition: DDBase.h:69
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::specs_read ( )
protected

read all instances of

Definition at line 823 of file DDStreamer.cc.

References DCOUT, dd_get_delimit(), dd_get_name(), i, i_, cuy::ii, gen::n, mergeVDriftHistosByStation::name, query::result, alignCSCRings::s, DDValue::setEvalState(), python.multivaluedict::sort(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by read().

824 {
825  DCOUT('Y', "DDStreamer::specs_read()");
826  std::istream & is = *i_;
827  //DDSpecifics::clear();
828  size_t n=0;
829  is >> n;
830  size_t i=0;
831  for (; i < n; ++i) { // Specifics
832  is.ignore(1000,'@');
833  DDName sn(dd_get_name(is));
834  size_t nps(0);
835  is >> nps;
836  size_t ii=0;
837  std::vector<std::string> ps;
838  is.ignore(100,'\n');
839  for (; ii < nps; ++ii) {
840  std::string s;
841  getline(is,s);
842  DCOUT('y', "specs-ps=" << s);
843  ps.push_back(s);
844  }
845  is >> nps;
846  ii=0;
847  DDsvalues_type sv;
848  for(; ii<nps; ++ii) {
849  std::string name = dd_get_delimit(is,'"');
850  bool evl(false);
851  is >> evl;
852  size_t no(0);
853  is >> no;
854  std::vector<DDValuePair> valv;
855  DDValue result;
856  if (evl) {
857  size_t iii=0;
858  for(; iii<no; ++iii) {
859  std::string strv = dd_get_delimit(is,'"');
860  double dblv(0);
861  is >> dblv;
862  DDValuePair valp(strv,dblv);
863  valv.push_back(valp);
864  }
865  result = DDValue(name,valv);
866  result.setEvalState(true);
867  }
868  else {
869  size_t iii=0;
870  for(; iii<no; ++iii) {
871  std::string strv = dd_get_delimit(is,'"');
872  DDValuePair valp(strv,0);
873  valv.push_back(valp);
874  }
875  result = DDValue(name,valv);
876  result.setEvalState(false);
877  }
878  sv.push_back(DDsvalues_Content_type(result,result));
879  }
880  std::sort(sv.begin(),sv.end());
881  DDSpecifics sp(sn,ps,sv,false);
882  DCOUT('y', " specs-read: " << sp);
883  }
884 }
int i
Definition: DBlmapReader.cc:9
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
void setEvalState(bool newState)
set to true, if the double-values (method DDValue::doubles()) make sense
Definition: DDValue.cc:197
std::string dd_get_delimit(std::istream &is, char d)
Definition: DDStreamer.cc:65
int ii
Definition: cuy.py:588
DDName dd_get_name(std::istream &is)
Definition: DDStreamer.cc:92
std::istream * i_
Definition: DDStreamer.h:126
tuple result
Definition: query.py:137
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::...
Definition: DDsvalues.h:19
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
DDsvalues_type::value_type DDsvalues_Content_type
Definition: DDsvalues.h:20
Interface to attach user specific data to nodes in the expanded-view.
Definition: DDSpecifics.h:40
void DDStreamer::specs_write ( )
protected

write all instances of DDSpecifics

Definition at line 773 of file DDStreamer.cc.

References DDBase< DDName, DDI::Specific * >::begin(), DCOUT, dd_count(), DDBase< DDName, DDI::Specific * >::end(), i, DDValue::isEvaluated(), DDValue::name(), DDBase< N, C >::name(), nameout(), o_, alignCSCRings::s, DDSpecifics::selection(), DDValue::size(), DDSpecifics::specifics(), DDValue::strings(), and findQualityFiles::v.

Referenced by write().

774 {
775  DCOUT('Y', "DDStreamer::specs_write()");
776  std::ostream & os = *o_;
777  DDSpecifics::iterator<DDSpecifics> it(DDSpecifics::begin()), ed(DDSpecifics::end());
778  size_t no = dd_count(DDSpecifics());
779  os << no << std::endl;
780  for (; it != ed; ++it) {
781  if (! it->isDefined().second) continue;
782  const DDSpecifics & sp = *it;
783  os << "--Spec: @ ";
784  nameout(os,sp.name());
785  os << ' ' << sp.selection().size() << std::endl;
786  std::vector<DDPartSelection>::const_iterator sit(sp.selection().begin()), sed(sp.selection().end());
787  for (; sit != sed; ++sit) {
788  os << *sit << std::endl;
789  }
790  os << sp.specifics().size() << std::endl;
791  DDsvalues_type::const_iterator vit(sp.specifics().begin()), ved(sp.specifics().end());
792  for (; vit != ved; ++vit) {
793  const DDValue & v = vit->second;
794  os << ' ' << '"' << v.name() << '"' << ' ';
795  if (v.isEvaluated()) {
796  os << 1 << ' ';
797  }
798  else {
799  os << 0 << ' ';
800  }
801  os << v.size() << ' ';
802  if (v.isEvaluated()) {
803  size_t s=v.size();
804  size_t i=0;
805  for (; i<s; ++i) {
806  os << '"' << v[i].first << '"' << ' ' << v[i].second << ' ';
807  }
808  }
809  else {
810  size_t s=v.size();
811  size_t i=0;
812  const std::vector<std::string> & vs = v.strings();
813  for (; i<s; ++i) {
814  os << '"' << vs[i] << '"' << ' ';
815  }
816  }
817  os << std::endl;
818 
819  }
820  }
821 }
const std::string & name(void) const
the name of the DDValue
Definition: DDValue.h:55
int i
Definition: DBlmapReader.cc:9
const N & name() const
Definition: DDBase.h:82
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
Definition: DDValue.cc:203
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
Definition: DDValue.h:62
size_t dd_count(const T &)
Definition: DDStreamer.cc:214
const DDsvalues_type & specifics() const
Reference to the user-data attached to all nodes selected by the selections-strings given through sel...
Definition: DDSpecifics.cc:59
std::ostream * o_
Definition: DDStreamer.h:125
void nameout(std::ostream &o, const DDName &n)
Definition: DDStreamer.cc:104
static DDI::Store< DDName, DDI::Specific * >::iterator begin()
Definition: DDBase.h:70
unsigned int size() const
the size of the stored value-pairs (std::string,double)
Definition: DDValue.h:69
static DDI::Store< DDName, DDI::Specific * >::iterator end()
Definition: DDBase.h:69
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
Interface to attach user specific data to nodes in the expanded-view.
Definition: DDSpecifics.h:40
const std::vector< DDPartSelection > & selection() const
Gives a reference to the collection of part-selections.
Definition: DDSpecifics.cc:53
void DDStreamer::vars_read ( )
protected

read the dictionlary of ClhepEvaluator

Definition at line 911 of file DDStreamer.cc.

References DDConstant::createConstantsFromEvaluator(), DCOUT, dd_get_delimit(), ev, edm::hlt::Exception, i, i_, DDI::Singleton< I >::instance(), gen::n, mergeVDriftHistosByStation::name, ClhepEvaluator::set(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by read().

912 {
913  DCOUT('Y', "DDStreamer::vars_read()");
914  std::istream & is = *i_;
916  ClhepEvaluator * eval = dynamic_cast<ClhepEvaluator*>(&ev);
917  if (eval){
918  size_t n(0);
919  is >> n;
920  size_t i(0);
921 
922  for(; i<n; ++i) {
925  eval->set(name,value);
926  }
927  }
928  else {
929  throw cms::Exception("DDException") << "DDStreamer::vars_write(): expression-evaluator is not a ClhepEvaluator-implementation!";
930  }
932 }
int i
Definition: DBlmapReader.cc:9
bool ev
std::string dd_get_delimit(std::istream &is, char d)
Definition: DDStreamer.cc:65
static value_type & instance()
std::istream * i_
Definition: DDStreamer.h:126
static void createConstantsFromEvaluator()
creates all DDConstants from the variables of the ClhepEvaluator
Definition: DDConstant.cc:34
void set(const std::string &ns, const std::string &name, const std::string &exprValue)
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
void DDStreamer::vars_write ( )
protected

write the dictionary of ClhepEvaluator

Definition at line 887 of file DDStreamer.cc.

References ev, edm::hlt::Exception, i, DDI::Singleton< I >::instance(), o_, alignCSCRings::s, create_public_pileup_plots::vals, ClhepEvaluator::values(), and ClhepEvaluator::variables().

Referenced by write().

888 {
889  std::ostream & os = *o_;
891  ClhepEvaluator * eval = dynamic_cast<ClhepEvaluator*>(&ev);
892  if (eval){
893  const std::vector<std::string> & vars = eval->variables();
894  const std::vector<std::string> & vals = eval->values();
895  if (vars.size() != vals.size()) {
896  throw cms::Exception("DDException") << "DDStreamer::vars_write(): different size of variable names & values!";
897  }
898  size_t i(0), s(vars.size());
899  os << s << std::endl;
900  for (; i<s; ++i) {
901  os << '"' << vars[i] << '"' << ' '
902  << '"' << vals[i] << '"' << std::endl;
903  }
904  }
905  else {
906  throw cms::Exception("DDException") << "DDStreamer::vars_write(): expression-evaluator is not a ClhepEvaluator-implementation!";
907  }
908 }
int i
Definition: DBlmapReader.cc:9
bool ev
static value_type & instance()
const std::vector< std::string > & variables() const
access to the clhep-implementation of the dictionary variables
const std::vector< std::string > & values() const
std::ostream * o_
Definition: DDStreamer.h:125
void DDStreamer::write ( void  )

stream all DDD transient objects to the std::ostream referred to by member o_

Definition at line 110 of file DDStreamer.cc.

References edm::hlt::Exception, and o_.

Referenced by pkg.AbstractPkg::generate().

111 {
112  if (o_ && *o_) {
113  write(*o_);
114  }
115  else {
116  throw cms::Exception("DDException") << "DDStreamer::write(): bad std::ostream";
117  }
118 }
void write()
stream all DDD transient objects to the std::ostream referred to by member o_
Definition: DDStreamer.cc:110
std::ostream * o_
Definition: DDStreamer.h:125
void DDStreamer::write ( std::ostream &  os)

stream all DDD transient objects to the given std::ostream os

Definition at line 130 of file DDStreamer.cc.

References materials_write(), names_write(), o_, parts_write(), pos_write(), rots_write(), solids_write(), specs_write(), and vars_write().

Referenced by pkg.AbstractPkg::generate().

131 {
132  o_=&os;
133  std::streamsize prec(os.precision());
134  os << std::setprecision(26) << std::scientific;
135  names_write();
136  vars_write();
137 
138  materials_write();
139  solids_write();
140  parts_write();
141 
142  pos_write();
143  specs_write();
144 
145  rots_write();
146  //os << DDI::Singleton<DDName::IdToName>::instance().size() << std::endl;
147  //names_write();
148  os << resetiosflags((std::ios_base::fmtflags)0);
149  os << std::setprecision(prec);
150 }
void materials_write()
write all instances of DDMaterial
Definition: DDStreamer.cc:255
void solids_write()
write all instances of DDSolid
Definition: DDStreamer.cc:345
void pos_write()
write the graph structure of DDCompactView::graph()
Definition: DDStreamer.cc:609
void vars_write()
write the dictionary of ClhepEvaluator
Definition: DDStreamer.cc:887
void specs_write()
write all instances of DDSpecifics
Definition: DDStreamer.cc:773
void parts_write()
write all instances of DDLogicalPart
Definition: DDStreamer.cc:492
void names_write()
write all instances of DDName
Definition: DDStreamer.cc:170
std::ostream * o_
Definition: DDStreamer.h:125
void rots_write()
write all instances of DDRotation
Definition: DDStreamer.cc:557

Member Data Documentation

const DDCompactView* DDStreamer::cpv_
private

not used

Definition at line 124 of file DDStreamer.h.

std::istream* DDStreamer::i_
private

istream target for reading DDD objects

Definition at line 126 of file DDStreamer.h.

Referenced by DDStreamer(), materials_read(), names_read(), parts_read(), pos_read(), read(), rots_read(), setInput(), solids_read(), specs_read(), and vars_read().

std::ostream* DDStreamer::o_
private

std::ostream target for writing DDD objects

Definition at line 125 of file DDStreamer.h.

Referenced by DDStreamer(), materials_write(), names_write(), parts_write(), pos_write(), rots_write(), setOutput(), solids_write(), specs_write(), vars_write(), and write().