CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
CocoaToDDLMgr Class Reference

#include <CocoaToDDLMgr.h>

Public Member Functions

ALIint buildRotationNumber (OpticalObject *opto)
 
 CocoaToDDLMgr ()
 
void lv (OpticalObject *opto)
 
void ma (CocoaMaterialElementary *ma)
 
ALIbool materialIsRepeated (CocoaMaterialElementary *ma)
 
void measurementsAsSpecPars ()
 
void newPartPost (std::string name, std::string extension)
 
void newPartPre (std::string name)
 
void newSectPost (std::string name)
 
void newSectPost_lv (std::string name)
 
void newSectPost_ma (std::string name)
 
void newSectPost_pv (std::string name)
 
void newSectPost_ro (std::string name)
 
void newSectPost_so (std::string name)
 
void newSectPost_specPar (std::string name)
 
void newSectPre (std::string name, std::string type)
 
void newSectPre_lv (std::string name)
 
void newSectPre_ma (std::string name)
 
void newSectPre_pv (std::string name)
 
void newSectPre_ro (std::string name)
 
void newSectPre_so (std::string name)
 
void newSectPre_specPar (std::string name)
 
void pv (OpticalObject *opto)
 
void ro (const CLHEP::HepRotation &ro, int n)
 
std::string scrubString (const std::string &s)
 
void so (OpticalObject *opto)
 
void specPar (OpticalObject *opto)
 
void writeDDDFile (ALIstring filename)
 
void writeHeader (ALIstring filename)
 
void writeLogicalVolumes ()
 
void writeMaterials ()
 
void writePhysicalVolumes ()
 
void writeRotations ()
 
void writeSolids ()
 
void writeSpecPars ()
 
void writeSpecParsCocoa ()
 
 ~CocoaToDDLMgr ()
 

Static Public Member Functions

static CocoaToDDLMgrgetInstance ()
 

Private Attributes

ALIFileOut file_
 
std::string filename_
 
std::vector< CocoaMaterialElementary * > theMaterialList
 
std::vector< CLHEP::HepRotation > theRotationList
 

Static Private Attributes

static CocoaToDDLMgrinstance = nullptr
 

Detailed Description

Definition at line 26 of file CocoaToDDLMgr.h.

Constructor & Destructor Documentation

CocoaToDDLMgr::CocoaToDDLMgr ( )
inline

Definition at line 31 of file CocoaToDDLMgr.h.

Referenced by getInstance().

31 { };
CocoaToDDLMgr::~CocoaToDDLMgr ( )
inline

Member Function Documentation

ALIint CocoaToDDLMgr::buildRotationNumber ( OpticalObject opto)

Definition at line 815 of file CocoaToDDLMgr.cc.

References OpticalObject::rmLocal(), and theRotationList.

Referenced by pv(), and ~CocoaToDDLMgr().

816 {
817  ALIint rotnum = -1;
818 
819  if(opto->rmLocal().isIdentity() ) return rotnum;
820 
821  std::vector<CLHEP::HepRotation>::const_iterator ite;
822 
823  int nc = 0;
824  for( ite = theRotationList.begin(); ite != theRotationList.end(); ++ite) {
825  if( (*ite) == opto->rmLocal() ) {
826  rotnum = nc;
827  break;
828  }
829  nc++;
830  }
831 
832  if( rotnum == -1 ) {
833  theRotationList.push_back( opto->rmLocal() );
834  rotnum = theRotationList.size()-1;
835  }
836 
837  return rotnum;
838 
839 }
const CLHEP::HepRotation rmLocal() const
int ALIint
Definition: CocoaGlobals.h:15
std::vector< CLHEP::HepRotation > theRotationList
Definition: CocoaToDDLMgr.h:80
CocoaToDDLMgr * CocoaToDDLMgr::getInstance ( )
static

Definition at line 25 of file CocoaToDDLMgr.cc.

References CocoaToDDLMgr(), and instance.

Referenced by ~CocoaToDDLMgr().

26 {
27  if(!instance) {
28  instance = new CocoaToDDLMgr;
29  }
30  return instance;
31 }
static CocoaToDDLMgr * instance
Definition: CocoaToDDLMgr.h:74
void CocoaToDDLMgr::lv ( OpticalObject opto)

Definition at line 466 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, file_, OpticalObject::getMaterial(), CocoaMaterialElementary::getName(), dataset::name, OpticalObject::name(), OpticalObject::shortName(), AlCaHLTBitMon_QueryRunRegistry::string, and OpticalObject::type().

Referenced by writeLogicalVolumes(), and ~CocoaToDDLMgr().

467 {
468  std::string name = opto->shortName();
469  std::string rSolid = opto->shortName();
470  std::string sensitive = "unspecified";
471 
472  if( opto->type() == "system" ){
473  file_ << " <LogicalPart name=\""
474  << name << "\" category=\"" << sensitive << "\">" << std::endl
475  << " <rSolid name=\"" << rSolid << "\"/>" << std::endl
476  << " <rMaterial name=\"Hydrogen\""
477  << "/>" << std::endl
478  << " </LogicalPart>" << std::endl;
479  return;
480  }
481 
482 #ifdef gdebug_v
483  cout << "xml:lv " << opto->name() << std::endl;
484 #endif
485  file_ << " <LogicalPart name=\""
486  << name << "\" category=\"" << sensitive << "\">" << std::endl
487  << " <rSolid name=\"" << rSolid << "\"/>" << std::endl
488  << " <rMaterial name=\"" << opto->getMaterial()->getName() << "\""
489  << "/>" << std::endl
490  << " </LogicalPart>" << std::endl;
491 }
CocoaMaterialElementary * getMaterial() const
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
const ALIstring shortName() const
const ALIstring & name() const
Definition: OpticalObject.h:60
const ALIstring & type() const
Definition: OpticalObject.h:61
void CocoaToDDLMgr::ma ( CocoaMaterialElementary ma)

g*cm3;

Definition at line 221 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, file_, CocoaMaterialElementary::getA(), CocoaMaterialElementary::getDensity(), CocoaMaterialElementary::getName(), CocoaMaterialElementary::getSymbol(), CocoaMaterialElementary::getZ(), theMaterialList, and UC.

Referenced by materialIsRepeated(), writeMaterials(), and ~CocoaToDDLMgr().

222 {
223  theMaterialList.push_back( ma );
224 
225 #ifdef gdebug
226  cout << " ma:" << ma->getName() << std::endl;
227 #endif
228 
229  ALIfloat density = ma->getDensity();
230 
231  // start tag
232  file_ << " <ElementaryMaterial";
233  ALIstring cSymbol = ma->getSymbol();
234 
235  // name attribute
236  file_ << " name=\"" << ma->getName() << "\"";
237 
238  // put out common attributes
239  // file_ << " density=\"" << UnitConverter(density,"Volumic Mass") << "\"";
240  file_ << " density=\"" << UC(density,"Volumic Mass") << "\"";
241  file_ << " symbol=\"" << ma->getSymbol() << "\"";
242 
243 
244  // finish last two attributes and end material element
245  file_ << " atomicWeight=\"" << (ma->getA()) << "*g/mole\""
246  << " atomicNumber=\"" << ma->getZ() << "\""
247  << "/>" << std::endl;
248 
249 }
float ALIfloat
Definition: CocoaGlobals.h:13
#define UC(val, category)
Definition: CocoaToDDLMgr.cc:9
std::vector< CocoaMaterialElementary * > theMaterialList
Definition: CocoaToDDLMgr.h:79
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
std::string ALIstring
Definition: CocoaGlobals.h:9
ALIbool CocoaToDDLMgr::materialIsRepeated ( CocoaMaterialElementary ma)

Definition at line 768 of file CocoaToDDLMgr.cc.

References ma(), and theMaterialList.

Referenced by writeMaterials(), and ~CocoaToDDLMgr().

769 {
770  ALIbool isRepeated = false;
771  std::vector<CocoaMaterialElementary*>::const_iterator ite;
772 
773  for(ite = theMaterialList.begin(); ite != theMaterialList.end(); ++ite ){
774  if( *(*ite) == *ma ){
775  isRepeated = true;
776  break;
777  }
778  }
779 
780  return isRepeated;
781 }
bool ALIbool
Definition: CocoaGlobals.h:19
std::vector< CocoaMaterialElementary * > theMaterialList
Definition: CocoaToDDLMgr.h:79
void ma(CocoaMaterialElementary *ma)
void CocoaToDDLMgr::measurementsAsSpecPars ( )

Definition at line 677 of file CocoaToDDLMgr.cc.

References Measurement::dim(), file_, cuy::ii, Model::MeasurementList(), OpticalObject::name(), Measurement::name(), Measurement::OptONameList(), Measurement::sigma(), AlCaHLTBitMon_QueryRunRegistry::string, Measurement::type(), Measurement::value(), Measurement::valueIsSimulated(), and Measurement::valueType().

Referenced by writeSpecPars(), and ~CocoaToDDLMgr().

678 {
679 
680  std::vector< Measurement* > measlist = Model::MeasurementList();
681  std::vector< Measurement* >::iterator mite;
682  std::vector<ALIstring>::iterator site;
683  std::multimap<OpticalObject*,Measurement*> optoMeasMap;
684  for( mite = measlist.begin(); mite != measlist.end(); ++mite ) {
685  auto &optolist = (*mite)->OptOList();
686  OpticalObject* opto = optolist[optolist.size()-1];
687  optoMeasMap.insert( std::multimap<OpticalObject*,Measurement*>::value_type(opto, *mite) );
688  }
689 
690  typedef std::multimap<OpticalObject*,Measurement*>::const_iterator itemom;
691  itemom omite;
692  std::pair<itemom, itemom > omitep;
693  itemom omite2, omite3;
694 
695  for( omite = optoMeasMap.begin(); omite != optoMeasMap.end(); ++omite ){
696  omitep = optoMeasMap.equal_range( (*omite).first );
697  if( omite != optoMeasMap.begin() && (*omite).first == (*omite3).first ) continue; // check that it is not the same OptO than previous one
698  omite3 = omite;
699  for( omite2 = omitep.first; omite2 != omitep.second; ++omite2 ){
700  OpticalObject* opto = (*(omite2)).first;
701  Measurement* meas = (*(omite2)).second;
702  std::vector<ALIstring> namelist = meas->OptONameList();
703  if( omite2 == omitep.first ){
704  file_ << " <SpecPar name=\"" << meas->name() << "_MEASUREMENT\">" << std::endl;
705  file_ << " <PartSelector path=\"/" << opto->name() << "\"/> " << std::endl;
706  }
707 
708  file_ << " <Parameter name=\"" << std::string("meas_name") << "\" value=\"" << meas->name() << "\" eval=\"false\" /> " << std::endl;
709  file_ << " <Parameter name=\"" << std::string("meas_type") << "\" value=\"" << meas->type() << "\" eval=\"false\" /> " << std::endl;
710  for( site = namelist.begin(); site != namelist.end(); ++site ){
711  file_ << " <Parameter name=\"" << std::string("meas_object_name_")+meas->name() << "\" value=\"" << (*site) << "\" eval=\"false\" /> " << std::endl;
712  }
713  for( ALIuint ii = 0; ii < meas->dim(); ii++ ){
714  file_ << " <Parameter name=\"" << std::string("meas_value_name_")+meas->name() << "\" value=\"" << meas->valueType(ii) << "\" eval=\"false\" /> " << std::endl;
715  file_ << " <Parameter name=\"" << std::string("meas_value_")+meas->name() << "\" value=\"" << meas->value(ii) << "\" eval=\"true\" /> " << std::endl;
716  file_ << " <Parameter name=\"" << std::string("meas_sigma_")+meas->name() << "\" value=\"" << meas->sigma(ii) << "\" eval=\"true\" /> " << std::endl;
717  file_ << " <Parameter name=\"" << std::string("meas_is_simulated_value_")+meas->name() << "\" value=\"" << meas->valueIsSimulated(ii) << "\" eval=\"true\" /> " << std::endl;
718  }
719 
720  }
721  file_ << " </SpecPar>" << std::endl;
722  }
723 }
bool valueIsSimulated(ALIint coor)
Definition: Measurement.h:205
const ALIuint dim() const
Definition: Measurement.h:82
const ALIstring valueType(ALIuint ii) const
Definition: Measurement.h:140
const ALIdouble * sigma() const
Definition: Measurement.h:132
const std::vector< ALIstring > & OptONameList() const
Definition: Measurement.h:105
ii
Definition: cuy.py:590
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
const ALIdouble * value() const
Definition: Measurement.h:125
const ALIstring & type() const
Definition: Measurement.h:86
const ALIstring & name() const
Definition: Measurement.h:90
const ALIstring & name() const
Definition: OpticalObject.h:60
static std::vector< Measurement * > & MeasurementList()
Definition: Model.h:79
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void CocoaToDDLMgr::newPartPost ( std::string  name,
std::string  extension 
)

Definition at line 203 of file CocoaToDDLMgr.cc.

References file_.

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

204 {
205  file_ << std::endl << "</DDDefinition>" << std::endl;
206  file_.close();
207 }
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
void CocoaToDDLMgr::newPartPre ( std::string  name)

Definition at line 184 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, file_, filename_, and dataset::name.

Referenced by writeHeader(), and ~CocoaToDDLMgr().

185 {
186  filename_=name;
187  file_.open(filename_.c_str());
188  file_.precision(8);
189  file_ << "<?xml version=\"1.0\"?>" << std::endl;
190 
191  // all files get schema references and namespaces.
192  file_ << "<DDDefinition xmlns=\"http://www.cern.ch/cms/DDL\""
193  << " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
194  << " xsi:schemaLocation=\"http://www.cern.ch/cms/DDL ../../DDLSchema/DDLSchema.xsd\">"
195  << std::endl << std::endl;
196 
197  #ifdef gdebug
198  cout << "part-pre:" << name << std::endl;
199  #endif
200 }
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::newSectPost ( std::string  name)

Definition at line 760 of file CocoaToDDLMgr.cc.

References file_.

Referenced by newSectPost_lv(), newSectPost_ma(), newSectPost_pv(), newSectPost_ro(), newSectPost_so(), newSectPost_specPar(), and ~CocoaToDDLMgr().

761 {
762  file_ << "</" << name << ">" << std::endl << std::endl;
763 }
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
void CocoaToDDLMgr::newSectPost_lv ( std::string  name)

Definition at line 494 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, and newSectPost().

Referenced by writeLogicalVolumes(), and ~CocoaToDDLMgr().

495 {
496  #ifdef gdebug
497  cout << " sect-lv-post:" << name << '-'<< std::endl;
498  #endif
499  newSectPost("LogicalPartSection");
500 }
void newSectPost(std::string name)
void CocoaToDDLMgr::newSectPost_ma ( std::string  name)

Definition at line 252 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, and newSectPost().

Referenced by writeMaterials(), and ~CocoaToDDLMgr().

253 {
254  #ifdef gdebug
255  cout << " sect-mat-post:" << name << '-' << std::endl;
256  #endif
257  newSectPost("MaterialSection");
258 }
void newSectPost(std::string name)
void CocoaToDDLMgr::newSectPost_pv ( std::string  name)

Definition at line 554 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, and newSectPost().

Referenced by writePhysicalVolumes(), and ~CocoaToDDLMgr().

555 {
556  #ifdef gdebug
557  cout << " sect-pv-post:" << name << '-' << std::endl;
558  #endif
559  newSectPost("PosPartSection");
560 }
void newSectPost(std::string name)
void CocoaToDDLMgr::newSectPost_ro ( std::string  name)

Definition at line 598 of file CocoaToDDLMgr.cc.

References newSectPost().

Referenced by writeRotations(), and ~CocoaToDDLMgr().

599 {
600  newSectPost("RotationSection");
601 }
void newSectPost(std::string name)
void CocoaToDDLMgr::newSectPost_so ( std::string  name)

Definition at line 446 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, and newSectPost().

Referenced by writeSolids(), and ~CocoaToDDLMgr().

447 {
448  #ifdef gdebug
449  cout << " sect-so-post:" << name << '-' << std::endl;
450  #endif
451  newSectPost("SolidSection");
452 }
void newSectPost(std::string name)
void CocoaToDDLMgr::newSectPost_specPar ( std::string  name)

Definition at line 744 of file CocoaToDDLMgr.cc.

References newSectPost().

Referenced by writeSpecPars(), and ~CocoaToDDLMgr().

745 {
746  newSectPost("SpecParSection");
747 }
void newSectPost(std::string name)
void CocoaToDDLMgr::newSectPre ( std::string  name,
std::string  type 
)

Definition at line 753 of file CocoaToDDLMgr.cc.

References file_.

Referenced by newSectPre_lv(), newSectPre_ma(), newSectPre_pv(), newSectPre_ro(), newSectPre_so(), and ~CocoaToDDLMgr().

754 {
755  file_ << "<" << type << " label=\"" << name << "\">" << std::endl;
756 }
type
Definition: HCALResponse.h:21
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
void CocoaToDDLMgr::newSectPre_lv ( std::string  name)

Definition at line 457 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, filename_, newSectPre(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writeLogicalVolumes(), and ~CocoaToDDLMgr().

458 {
459  #ifdef gdebug
460  cout << " sect-lv-pre:" << name << '-' << std::endl;
461  #endif
462  newSectPre(filename_,std::string("LogicalPartSection"));
463 }
void newSectPre(std::string name, std::string type)
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::newSectPre_ma ( std::string  name)

Definition at line 212 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, filename_, newSectPre(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writeMaterials(), and ~CocoaToDDLMgr().

213 {
214 #ifdef gdebug
215  std::cout << " sect-mat-pre:" << name << '-' << std::endl;
216 #endif
217  newSectPre(filename_,std::string("MaterialSection"));
218 }
void newSectPre(std::string name, std::string type)
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::newSectPre_pv ( std::string  name)

Definition at line 505 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, filename_, newSectPre(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writePhysicalVolumes(), and ~CocoaToDDLMgr().

506 {
507  #ifdef gdebug
508  cout << " sect-pv-pre:" << name << '-' << std::endl;
509  #endif
510  newSectPre(filename_,std::string("PosPartSection"));
511 }
void newSectPre(std::string name, std::string type)
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::newSectPre_ro ( std::string  name)

Definition at line 565 of file CocoaToDDLMgr.cc.

References filename_, newSectPre(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writeRotations(), and ~CocoaToDDLMgr().

566 {
567  newSectPre(filename_,std::string("RotationSection"));
568 }
void newSectPre(std::string name, std::string type)
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::newSectPre_so ( std::string  name)

Definition at line 263 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, filename_, newSectPre(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writeSolids(), and ~CocoaToDDLMgr().

264 {
265  #ifdef gdebug
266  cout << " sect-so-pre:" << name << '-' << std::endl;
267  #endif
268  newSectPre(filename_,std::string("SolidSection"));
269 }
void newSectPre(std::string name, std::string type)
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::newSectPre_specPar ( std::string  name)

Definition at line 606 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, file_, and filename_.

Referenced by writeSpecPars(), and ~CocoaToDDLMgr().

607 {
608  #ifdef gdebug
609  cout << " sect-lv-pre:" << name << '-' << std::endl;
610  #endif
611  //- newSectPre(filename_,std::string("SpecParSection"));
612  file_ << "<SpecParSection label=\"" << filename_ << "\" eval=\"true\">" << std::endl;
613 
614 }
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
std::string filename_
Definition: CocoaToDDLMgr.h:77
void CocoaToDDLMgr::pv ( OpticalObject opto)

Definition at line 514 of file CocoaToDDLMgr.cc.

References buildRotationNumber(), OpticalObject::centreLocal(), gather_cfg::cout, file_, OpticalObject::name(), OpticalObject::parent(), OpticalObject::shortName(), protons_cff::t, and UC.

Referenced by writePhysicalVolumes(), and ~CocoaToDDLMgr().

515 {
516  #ifdef gdebug_v
517  cout << " pv:" << opto->name()
518  << ':' << opto->parent()->name() << std::endl;
519  #endif
520 
521  // file_ << " <PosPart copyNumber=\"" << pv->GetCopyNo() << "\">" << std::endl;
522  file_ << " <PosPart copyNumber=\"" << "1" << "\">" << std::endl;
523  file_ << " <rParent name=\"";
524 
525  //t if (file!=filename_) file_ << file << ":";
526 
527  file_ << opto->parent()->shortName() << "\"/>" << std::endl;
528 
529  file_ << " <rChild name=\"";
530  //t if (file_d != filename_) file_<< file_d << ":";
531  file_ << opto->shortName();
532  file_ << "\"/>" << std::endl;
533 
534  int rotNumber = buildRotationNumber( opto );
535  //CocoaDDLRotation* rot = buildRotationNotRepeated( opto );
536 
537  if( rotNumber != -1 ) file_ << " <rRotation name=\"R" << rotNumber << "\"/>" << std::endl;
538 
539  CLHEP::Hep3Vector t = opto->centreLocal();
540  if(t != CLHEP::Hep3Vector()) { //if (0,0,0) write nothing
541  const CLHEP::Hep3Vector t = opto->centreLocal();
542 
543  file_ << " <Translation x=\"" << UC(t[0],"Length") << "\""
544  << " y=\"" << UC(t[1],"Length") << "\""
545  << " z=\"" << UC(t[2],"Length")<< "\" />"
546  << std::endl;
547  }
548 
549  file_ << " </PosPart>" << std::endl;
550 
551 }
const CLHEP::Hep3Vector centreLocal() const
#define UC(val, category)
Definition: CocoaToDDLMgr.cc:9
const OpticalObject * parent() const
Definition: OpticalObject.h:62
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
const ALIstring shortName() const
ALIint buildRotationNumber(OpticalObject *opto)
const ALIstring & name() const
Definition: OpticalObject.h:60
void CocoaToDDLMgr::ro ( const CLHEP::HepRotation &  ro,
int  n 
)

Definition at line 572 of file CocoaToDDLMgr.cc.

References file_, identity(), GlobalPosition_Frontier_DevDB_cff::tag, and UC.

Referenced by writeRotations(), and ~CocoaToDDLMgr().

573 {
574 
575  CLHEP::HepRotation roinv = inverseOf(ro);
576  //- G4ThreeVector v(1.,1.,1.);
577  //- G4ThreeVector a;
578  //- a = (*ro)*v;
579  bool identity = false;
580  ALIstring tag = " <Rotation name=\"R";
581  identity=roinv.isIdentity();
582 
583  //---- DDD convention is to use the inverse matrix, COCOA is the direct one!!!
584  if (! identity) {
585  file_ << tag << n << "\"";
586  file_ << " phiX=\"" << UC(roinv.phiX(),"Angle") << "\""
587  << " thetaX=\"" << UC(roinv.thetaX(),"Angle") << "\""
588  << " phiY=\"" << UC(roinv.phiY(),"Angle") << "\""
589  << " thetaY=\"" << UC(roinv.thetaY(),"Angle") << "\""
590  << " phiZ=\"" << UC(roinv.phiZ(),"Angle") << "\""
591  << " thetaZ=\"" << UC(roinv.thetaZ(),"Angle") << "\""
592  //<< " angleUnit=\"degree\"/>"
593  << " />" << std::endl;
594  }
595 }
#define UC(val, category)
Definition: CocoaToDDLMgr.cc:9
T identity(T t)
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
void ro(const CLHEP::HepRotation &ro, int n)
std::string ALIstring
Definition: CocoaGlobals.h:9
std::string CocoaToDDLMgr::scrubString ( const std::string &  s)

Definition at line 784 of file CocoaToDDLMgr.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~CocoaToDDLMgr().

785 {
786  std::string::const_iterator ampat;
787  static const std::string amp = "_"; //"&amp;";
788  std::string ret = "";
789  for (ampat = s.begin(); ampat != s.end(); ++ampat)
790  {
791  if (*ampat == '&')
792  ret = ret + amp;
793  else if (*ampat == '/')
794  ret = ret + ";";
795  else if (*ampat == ':')
796  ret = ret + '_';
797  else
798  ret = ret + *ampat;
799  }
800  // this works when used alone. when in this file it fails. i don't know why.
801  //for (ampat = s.begin(); ampat != s.end(); ampat++)
802  // {
803  // if (*ampat == '&'){
804  // s.insert(ampat+1, amp.begin(), amp.end());
805  // }
806  // }
807  // replace(s.begin(), s.end(), '/', ';');
808  //return s;
809  //cout << "AMP: " << ret << endl;
810  return ret;
811 }
void CocoaToDDLMgr::so ( OpticalObject opto)

Definition at line 272 of file CocoaToDDLMgr.cc.

References MessageLogger_cfi::cerr, gather_cfg::cout, cppFunctionSkipper::exception, file_, CocoaSolidShapeTubs::getDeltaPhiAngle(), CocoaSolidShapeTubs::getInnerRadius(), CocoaSolidShapeTubs::getOuterRadius(), CocoaSolidShapeTubs::getStartPhiAngle(), CocoaSolidShape::getType(), CocoaSolidShapeBox::getXHalfLength(), CocoaSolidShapeBox::getYHalfLength(), CocoaSolidShapeBox::getZHalfLength(), CocoaSolidShapeTubs::getZHalfLength(), ALIFileOut::name(), dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, and UC.

Referenced by writeSolids(), and ~CocoaToDDLMgr().

273 {
274  std::cout << " CocoaToDDLMgr::so( " << opto;
275 std::cout << " " << opto->shortName() << std::endl;
276 
277  std::string name = opto->shortName();
278 
279  if( opto->type() == "system" ){
280  // file_ << " <Box name=\"" << name << "\"";
281  file_ << " <Box name=\"" << opto->name() << "\"";
282  file_ << " dx=\"10.*m"
283  << "\" dy=\"10.*m"
284  << "\" dz=\"10.*m"
285  << "\"/>" << std::endl;
286  return;
287  }
288 
289  CocoaSolidShape* so = opto->getSolidShape();
290 
291  std::cout << " CocoaToDDLMgr::so( so " << so << std::endl;
292 std::string solidType = so->getType();
293 
294  if (solidType == "Box")
295  {
296  file_ << " <" << solidType << " name=\"" << name << "\"";
297  CocoaSolidShapeBox * sb = dynamic_cast<CocoaSolidShapeBox*>(so);
298  file_ << " dx=\"" << UC(sb->getXHalfLength(),"Length")
299  << "\" dy=\"" << UC(sb->getYHalfLength(),"Length")
300  << "\" dz=\"" << UC(sb->getZHalfLength(),"Length")
301  << "\"/>" << std::endl;
302  }
303  else if (solidType == "Tubs")
304  {
305  CocoaSolidShapeTubs * tu = dynamic_cast < CocoaSolidShapeTubs * > (so);
306  file_ << " <" << solidType
307  << " name=\"" << name << "\""
308  << " rMin=\"" << UC(tu->getInnerRadius(),"Length") << "\""
309  << " rMax=\"" << UC(tu->getOuterRadius(),"Length") << "\""
310  << " dz=\"" << UC(tu->getZHalfLength(),"Length") << "\""
311  << " startPhi=\"" << UC(tu->getStartPhiAngle(),"Angle") << "\""
312  << " deltaPhi=\"" << UC(tu->getDeltaPhiAngle(),"Angle") << "\""
313  << "/>" << std::endl;
314  }
315  /* else if (solidType == "Cons")
316  {
317  G4Cons * cn = dynamic_cast < G4Cons * > (so);
318  file_ << " <" << solidType
319  << " name=\"" << name << "\""
320  << " dz=\"" << UC(cn->getZHalfLength(),"Length") << "\""
321  << " rMin1=\"" << UC(cn->getInnerRadiusMinusZ(),"Length") << "\""
322  << " rMax1=\"" << UC(cn->getOuterRadiusMinusZ(),"Length") << "\""
323  << " rMin2=\"" << UC(cn->getInnerRadiusPlusZ(),"Length") << "\""
324  << " rMax2=\"" << UC(cn->getOuterRadiusPlusZ(),"Length") << "\""
325  << " startPhi=\"" << UC(cn->getStartPhiAngle(),"Angle") << "\""
326  << " deltaPhi=\"" << UC(cn->getDeltaPhiAngle(),"Angle") << "\""
327  //<< " lengthUnit=\"mm\" angleUnit=\"degree\"/>"
328  << " />" << std::endl;
329  }
330  else if (solidType == "Polycone")
331  {
332  G4Polycone * pc = dynamic_cast < G4Polycone * > (so);
333  file_ << " <Polycone name=\"" << name<< "\"";
334  bool isOpen = pc->IsOpen();
335  G4int numRZCorner = (dynamic_cast < G4Polycone * > (so))->getNumRZCorner();
336 
337  file_ << " startPhi=\"" << UC(pc->getStartPhi(),"Angle") << "\""
338  //<< " deltaPhi=\"" << UC(fabs((pc->getEndPhi()/deg - pc->getStartPhi()/deg))*deg,"Angle") << "\""
339  //<< " deltaPhi=\"" << UC(pc->getEndPhi(),"Angle") << "\""
340  << " deltaPhi=\"" << UC(pc->original_parameters->Opening_angle,"Angle") << "\""
341  //<< " angleUnit=\"degree\">"
342  << " >" << std::endl;
343 
344  G4PolyconeSideRZ rz;
345 
346  //liendl: FIXME put a switch which decides whether RZ or Rmin,Rmax,Z types should
347  // by generated ....
348  //outPolyZSections(rz, (dynamic_cast < G4Polycone * > (so)), numRZCorner);
349  G4double * zVal;
350  G4double * rmin;
351  G4double * rmax;
352  G4int zPlanes;
353  zPlanes = pc->original_parameters->Num_z_planes;
354  zVal = pc->original_parameters->Z_values;
355  rmin = pc->original_parameters->Rmin;
356  rmax = pc->original_parameters->Rmax;
357  outPolySections(zPlanes, zVal, rmin, rmax);
358  file_ << " </Polycone> " << std::endl;
359  }
360  else if (solidType == "Polyhedra")
361  {
362  // bool isOpen = (dynamic_cast < G4Polyhedra * > (so))->IsOpen();
363  G4Polyhedra * ph = (dynamic_cast < G4Polyhedra * > (so));
364  G4int numRZCorner = ph->getNumRZCorner();
365 
366  file_ << " <Polyhedra name=\"" << name<< "\""
367  << " numSide=\"" << ph->getNumSide() << "\""
368  << " startPhi=\"" << UC(ph->getStartPhi(),"Angle") << "\""
369  //<< " deltaPhi=\"" << UC(fabs((ph->getEndPhi()/deg - ph->getStartPhi()/deg))*deg,"Angle") << "\""
370  << " deltaPhi=\"" << UC(ph->original_parameters->Opening_angle,"Angle") << "\""
371  << " >" << std::endl;
372 
373  G4PolyhedraSideRZ rz;
374  //liendl: FIXME put a switch which decides whether RZ or Rmin,Rmax,Z types should
375  // by generated ....
376  // outPolyZSections(rz, (dynamic_cast < G4Polyhedra * > (so)), numRZCorner);
377  G4double * zVal;
378  G4double * rmin;
379  G4double * rmax;
380  // convertRad of ctor of G4Polyhedra(..) ....
381  G4double strangeG3G4Factor = cos(0.5*ph->original_parameters->Opening_angle/G4double(ph->getNumSide()));
382  G4int zPlanes;
383  zPlanes = ph->original_parameters->Num_z_planes;
384  zVal = ph->original_parameters->Z_values;
385  rmin = ph->original_parameters->Rmin;
386  rmax = ph->original_parameters->Rmax;
387  for (int i=0; i<zPlanes;++i) {
388  *(rmin+i) = *(rmin+i) * strangeG3G4Factor;
389  *(rmax+i) = *(rmax+i) * strangeG3G4Factor;
390  }
391  outPolySections(zPlanes, zVal, rmin, rmax);
392 
393  file_ << " </Polyhedra>" << std::endl;
394  }
395  else if (solidType == "Trapezoid")
396  {
397  // DDL fields
398  // ALP1, ALP2, Bl1, Bl2, Dz, H1, H2, Phi, Thet, TL1, TL2, lengthUnit, angleUnit
399  // Phi and Theta are !NOT!optional.
400  G4Trap * trp = dynamic_cast < G4Trap * > (so);
401  G4ThreeVector symAxis(trp->getSymAxis());
402  double theta, phi;
403  theta = symAxis.theta();
404  phi = symAxis.phi();
405 
406  file_ << " <" << solidType
407  << " name=\"" << name << "\""
408  << " dz=\"" << UC(trp->getZHalfLength(),"Length") << "\""
409  << " alp1=\"" << UC(atan(trp->getTanAlpha1()/rad),"Angle") << "\""
410  << " bl1=\"" << UC(trp->getXHalfLength1(),"Length") << "\""
411  << " tl1=\"" << UC(trp->getXHalfLength2(),"Length") << "\""
412  << " h1=\"" << UC(trp->getYHalfLength1(),"Length") << "\""
413  << " alp2=\"" << UC(atan(trp->getTanAlpha2()/rad),"Angle") << "\""
414  << " bl2=\"" << UC(trp->getXHalfLength3(),"Length") << "\""
415  << " tl2=\"" << UC(trp->getXHalfLength4(),"Length") << "\""
416  << " h2=\"" << UC(trp->getYHalfLength2(),"Length") << "\""
417  << " phi=\"" << UC(phi,"Angle") << "\""
418  << " theta=\"" << UC(theta,"Angle") << "\""
419  << " />" << std::endl ;
420  }
421  else if (solidType == "Trd1")
422  {
423  G4Trd * tr = dynamic_cast < G4Trd * > (so);
424  file_ << " <" << solidType
425  << " name=\"" << name << "\""
426  << " dz=\"" << UC(tr->getZHalfLength(),"Length") << "\""
427  << " dy1=\"" << UC(tr->getYHalfLength1(),"Length") << "\""
428  << " dy2=\"" << UC(tr->getYHalfLength2(),"Length")<< "\""
429  << " dx1=\"" << UC(tr->getXHalfLength1(),"Length") << "\""
430  << " dx2=\"" << UC(tr->getXHalfLength2(),"Length") << "\""
431  //<< " lengthUnit=\"mm\"/>"
432  << " />" << std::endl;
433  }
434  */
435  else
436  {
437  std::cerr << " <!-- NOT HANDLED: " << solidType << " name=\"" << name<< "\""
438  << ">" << std::endl
439  << " </" << solidType << "> -->" << std::endl;
440  std::exception();
441  }
442 
443 }
ALIfloat getOuterRadius() const
const ALIstring & name()
Definition: ALIFileOut.h:33
ALIfloat getStartPhiAngle() const
ALIstring getType() const
ALIfloat getZHalfLength() const
ALIfloat getDeltaPhiAngle() const
#define UC(val, category)
Definition: CocoaToDDLMgr.cc:9
ALIfloat getYHalfLength() const
ALIfloat getInnerRadius() const
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
ALIfloat getXHalfLength() const
void so(OpticalObject *opto)
ALIfloat getZHalfLength() const
void CocoaToDDLMgr::specPar ( OpticalObject opto)

Definition at line 618 of file CocoaToDDLMgr.cc.

References OpticalObject::CoordinateEntryList(), OpticalObject::ExtraEntryList(), file_, OpticalObject::getCmsswID(), cuy::ii, Entry::name(), OpticalObject::name(), Entry::quality(), Entry::sigma(), AlCaHLTBitMon_QueryRunRegistry::string, Entry::type(), OpticalObject::type(), UC, and Entry::value().

Referenced by writeSpecPars(), and ~CocoaToDDLMgr().

619 {
620  file_ << " <SpecPar name=\"" << opto->name() << "_PARAMS\">" << std::endl;
621  file_ << " <PartSelector path=\"/" << opto->name() << "\"/> " << std::endl;
622  file_ << " <Parameter name=\"cocoa_type\"" << " value=\"" << opto->type() << "\" eval=\"false\" /> " << std::endl;
623  file_ << " <Parameter name=\"cmssw_ID\"" << " value=\"" << opto->getCmsswID() << "\" /> " << std::endl;
624 
625  const std::vector< Entry* >& coord = opto->CoordinateEntryList();
626  for( int ii=3; ii<6; ii++ ){
627  Entry* ent = coord[ii];
628  file_ << " <Parameter name=\"" << ent->name()+std::string("_value") << "\" value=\"";
629  file_ << UC(ent->value(),"Angle");
630  file_ << "\" /> " << std::endl;
631  }
632  for( int ii=0; ii<6; ii++ ){
633  Entry* ent = coord[ii];
634  file_ << " <Parameter name=\"" << ent->name()+std::string("_sigma") << "\" value=\"";
635  if( ii < 3 ){
636  file_ << UC(ent->sigma(),"Length");
637  }else {
638  file_ << UC(ent->sigma(),"Angle");
639  }
640  file_ << "\" /> " << std::endl;
641  file_ << " <Parameter name=\"" << ent->name()+std::string("_quality") << "\" value=\"" << ent->quality() << "\" /> " << std::endl;
642  }
643 
644  const std::vector< Entry* >& extraEnt = opto->ExtraEntryList();
645  for( ALIuint ii=0; ii<extraEnt.size(); ii++ ){
646  Entry* ent = extraEnt[ii];
647  file_ << " <Parameter name=\"extra_entry\" value=\"" << ent->name() << "\" eval=\"false\" /> " << std::endl;
648  file_ << " <Parameter name=\"dimType\" value=\"" << ent->type() << "\" eval=\"false\" /> " << std::endl;
649  file_ << " <Parameter name=\"value\" value=\"";
650  if( ent->type() == "nodim" ) {
651  file_ << ent->value();
652  }else if( ent->type() == "length" ) {
653  file_ << UC(ent->value(),"Length");
654  }else if( ent->type() == "angle" ) {
655  file_ << UC(ent->value(),"Angle");
656  }
657  file_ << "\" eval=\"true\" /> " << std::endl;
658 
659  file_ << " <Parameter name=\"sigma\" value=\"";
660  if( ent->type() == "nodim" ) {
661  file_ << ent->sigma();
662  }else if( ent->type() == "length" ) {
663  file_ << UC(ent->sigma(),"Length");
664  }else if( ent->type() == "angle" ) {
665  file_ << UC(ent->sigma(),"Angle");
666  }
667  file_ << "\" eval=\"true\" /> " << std::endl;
668 
669  file_ << " <Parameter name=\"quality\" value=\"" << ent->quality() << "\" eval=\"true\" /> " << std::endl;
670  }
671 
672  file_ << " </SpecPar>" << std::endl;
673 
674 }
const ALIuint getCmsswID() const
const ALIstring & type() const
Definition: Entry.h:54
Definition: Entry.h:18
const std::vector< Entry * > & ExtraEntryList() const
Definition: OpticalObject.h:69
ALIdouble value() const
Definition: Entry.h:55
const std::vector< Entry * > & CoordinateEntryList() const
Definition: OpticalObject.h:65
#define UC(val, category)
Definition: CocoaToDDLMgr.cc:9
ii
Definition: cuy.py:590
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
const ALIstring & name() const
Definition: Entry.h:52
ALIint quality() const
Definition: Entry.h:59
const ALIstring & name() const
Definition: OpticalObject.h:60
unsigned int ALIuint
Definition: CocoaGlobals.h:17
const ALIstring & type() const
Definition: OpticalObject.h:61
ALIdouble sigma() const
Definition: Entry.h:57
void CocoaToDDLMgr::writeDDDFile ( ALIstring  filename)

Definition at line 34 of file CocoaToDDLMgr.cc.

References newPartPost(), writeHeader(), writeLogicalVolumes(), writeMaterials(), writePhysicalVolumes(), writeRotations(), writeSolids(), and writeSpecPars().

Referenced by ~CocoaToDDLMgr().

35 {
36  //---- Write header
38 
39  //---- Write materials
41 
42  //---- Write solids
43  writeSolids();
44 
45  //---- Write logical volumes
47 
48  //---- Write physical volumes
50 
51  //---- Write rotations
53 
54  //---- Write SpecPar's
55  writeSpecPars();
56 
57  newPartPost( filename, "" );
58 
59 
60 }
void writeRotations()
void writeLogicalVolumes()
void writeHeader(ALIstring filename)
void writeSolids()
void newPartPost(std::string name, std::string extension)
void writeMaterials()
void writePhysicalVolumes()
void writeSpecPars()
void CocoaToDDLMgr::writeHeader ( ALIstring  filename)

Definition at line 63 of file CocoaToDDLMgr.cc.

References newPartPre().

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

64 {
65  newPartPre( filename );
66 }
void newPartPre(std::string name)
void CocoaToDDLMgr::writeLogicalVolumes ( )

Definition at line 108 of file CocoaToDDLMgr.cc.

References lv(), newSectPost_lv(), newSectPre_lv(), and Model::OptOList().

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

109 {
110  newSectPre_lv("");
111 
112  auto &optolist = Model::OptOList();
113  for(auto ite = optolist.begin(); ite != optolist.end(); ite++ ){
114  bool alreadyWritten = false;
115  for(auto ite2 = optolist.begin(); ite2 != ite; ite2++ ){
116  if( (*ite)->shortName() == (*ite2)->shortName() ) {
117  alreadyWritten = true;
118  }
119  }
120  if( !alreadyWritten ) lv( *ite );
121  }
122 
123  newSectPost_lv("");
124 
125 }
void newSectPre_lv(std::string name)
void lv(OpticalObject *opto)
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
void newSectPost_lv(std::string name)
void CocoaToDDLMgr::writeMaterials ( )

Definition at line 69 of file CocoaToDDLMgr.cc.

References ma(), materialIsRepeated(), newSectPost_ma(), newSectPre_ma(), and Model::OptOList().

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

70 {
71  newSectPre_ma("");
72  auto &optolist = Model::OptOList();
73  for(auto ite = optolist.begin(); ite != optolist.end(); ite++ ){
74  if( (*ite)->type() == "system" ) continue;
75  CocoaMaterialElementary* mat = (*ite)->getMaterial();
76  //- std::cout << " mat of opto " << (*ite)->name() << " = " << mat->getName() << std::endl;
77  if( mat ) {
78  if( !materialIsRepeated( mat ) ) ma( mat );
79  }
80  }
81 
82  newSectPost_ma("");
83 }
ALIbool materialIsRepeated(CocoaMaterialElementary *ma)
void newSectPre_ma(std::string name)
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
void ma(CocoaMaterialElementary *ma)
void newSectPost_ma(std::string name)
void CocoaToDDLMgr::writePhysicalVolumes ( )

Definition at line 128 of file CocoaToDDLMgr.cc.

References newSectPost_pv(), newSectPre_pv(), Model::OptOList(), and pv().

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

129 {
130  newSectPre_pv("");
131 
132  auto &optolist = Model::OptOList();
133  for(auto ite = optolist.begin(); ite != optolist.end(); ite++ ){
134  if( (*ite)->type() == "system" ) continue;
135  pv( *ite );
136  }
137 
138  newSectPost_pv("");
139 
140 }
void newSectPost_pv(std::string name)
void pv(OpticalObject *opto)
void newSectPre_pv(std::string name)
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
void CocoaToDDLMgr::writeRotations ( )

Definition at line 144 of file CocoaToDDLMgr.cc.

References newSectPost_ro(), newSectPre_ro(), ro(), and theRotationList.

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

145 {
146  newSectPre_ro("");
147  std::vector<CLHEP::HepRotation>::const_iterator ite;
148  int nc = 0;
149  for( ite = theRotationList.begin(); ite != theRotationList.end(); ++ite) {
150  //- std::cout << nc << " rot size " << theRotationList.size() << std::endl;
151  ro( *ite, nc );
152  nc++;
153  }
154  newSectPost_ro("");
155 
156 }
void newSectPost_ro(std::string name)
std::vector< CLHEP::HepRotation > theRotationList
Definition: CocoaToDDLMgr.h:80
void ro(const CLHEP::HepRotation &ro, int n)
void newSectPre_ro(std::string name)
void CocoaToDDLMgr::writeSolids ( )

Definition at line 86 of file CocoaToDDLMgr.cc.

References gather_cfg::cout, newSectPost_so(), newSectPre_so(), Model::OptOList(), and so().

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

87 {
88  newSectPre_so("");
89 
90  auto &optolist = Model::OptOList();
91  for(auto ite = optolist.begin(); ite != optolist.end(); ite++ ){
92  bool alreadyWritten = false;
93  for(auto ite2 = optolist.begin(); ite2 != ite; ite2++ ){
94  if( (*ite)->shortName() == (*ite2)->shortName() ) {
95  alreadyWritten = true;
96  }
97  }
98 std::cout << " CocoaToDDLMgr::writeSolids() " << alreadyWritten << *ite;
99 std::cout << (*ite)->name() << std::endl;
100  if( !alreadyWritten ) so( *ite );
101  }
102 
103  newSectPost_so("");
104 
105 }
void newSectPre_so(std::string name)
void newSectPost_so(std::string name)
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
void so(OpticalObject *opto)
void CocoaToDDLMgr::writeSpecPars ( )

Definition at line 159 of file CocoaToDDLMgr.cc.

References measurementsAsSpecPars(), newSectPost_specPar(), newSectPre_specPar(), Model::OptOList(), specPar(), and writeSpecParsCocoa().

Referenced by writeDDDFile(), and ~CocoaToDDLMgr().

160 {
161  newSectPre_specPar("");
162 
163  auto &optolist = Model::OptOList();
164  for(auto ite = optolist.begin(); ite != optolist.end(); ite++ ){
165  if( (*ite)->type() == "system" ) continue;
166  specPar( *ite );
167  }
168 
170 
171  //---- Write Measurements's
173 
174 
176 
177 
178 }
void specPar(OpticalObject *opto)
void writeSpecParsCocoa()
void measurementsAsSpecPars()
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71
void newSectPost_specPar(std::string name)
void newSectPre_specPar(std::string name)
void CocoaToDDLMgr::writeSpecParsCocoa ( )

Definition at line 727 of file CocoaToDDLMgr.cc.

References file_, ALIFileOut::name(), and Model::OptOList().

Referenced by writeSpecPars(), and ~CocoaToDDLMgr().

728 {
729  file_ << "<!-- Define volumes as COCOA objects --> " << std::endl
730  << " <SpecPar name=\"COCOA\"> " << std::endl;
731 
732  auto &optolist = Model::OptOList();
733  for(auto ite = optolist.begin(); ite != optolist.end(); ite++ ){
734  if( (*ite)->type() == "system" ) continue;
735  file_ << " <PartSelector path=\"/" << (*ite)->name() << "\"/> " << std::endl;
736  }
737 
738  file_ << " <String name=\"COCOA\" value=\"COCOA\"/> " << std::endl
739  << " </SpecPar> " << std::endl;
740 
741 }
const ALIstring & name()
Definition: ALIFileOut.h:33
ALIFileOut file_
Definition: CocoaToDDLMgr.h:76
static std::vector< OpticalObject * > & OptOList()
Definition: Model.h:71

Member Data Documentation

ALIFileOut CocoaToDDLMgr::file_
private
std::string CocoaToDDLMgr::filename_
private
CocoaToDDLMgr * CocoaToDDLMgr::instance = nullptr
staticprivate

Definition at line 74 of file CocoaToDDLMgr.h.

Referenced by getInstance(), and production_tasks.Task::getname().

std::vector<CocoaMaterialElementary*> CocoaToDDLMgr::theMaterialList
private

Definition at line 79 of file CocoaToDDLMgr.h.

Referenced by ma(), and materialIsRepeated().

std::vector<CLHEP::HepRotation> CocoaToDDLMgr::theRotationList
private

Definition at line 80 of file CocoaToDDLMgr.h.

Referenced by buildRotationNumber(), and writeRotations().