CMS 3D CMS Logo

PrintGeomInfoAction Class Reference

#include <SimG4Core/PrintGeomInfo/interface/PrintGeomInfoAction.h>

Inheritance diagram for PrintGeomInfoAction:

SimWatcher Observer< const BeginOfJob * > Observer< const BeginOfRun * >

List of all members.

Public Member Functions

 PrintGeomInfoAction (edm::ParameterSet const &p)
 ~PrintGeomInfoAction ()

Private Member Functions

void add1touchable (G4LogicalVolume *lv, int &nTouch)
int countNoTouchables ()
void dumpG4LVLeaf (G4LogicalVolume *lv, uint leafDepth, uint count, std::ostream &out=std::cout)
void dumpG4LVList (std::ostream &out=std::cout)
void dumpG4LVTree (std::ostream &out=std::cout)
void dumpHierarchyLeafPVLV (G4LogicalVolume *lv, uint leafDepth, std::ostream &out=std::cout)
void dumpHierarchyTreePVLV (std::ostream &out=std::cout)
void dumpLV (G4LogicalVolume *lv, uint leafDepth, std::ostream &out=std::cout)
void dumpMaterialList (std::ostream &out=std::cout)
void dumpPV (G4VPhysicalVolume *pv, uint leafDepth, std::ostream &out=std::cout)
void dumpSolid (G4VSolid *sol, uint leafDepth, std::ostream &out=std::cout)
void dumpSummary (std::ostream &out=std::cout)
void dumpTouch (G4VPhysicalVolume *pv, uint leafDepth, std::ostream &out=std::cout)
G4LogicalVolume * getTopLV ()
G4VPhysicalVolume * getTopPV ()
std::string spacesFromLeafDepth (uint leafDepth)
void update (const BeginOfRun *run)
 This routine will be called when the appropriate signal arrives.
void update (const BeginOfJob *job)
 This routine will be called when the appropriate signal arrives.

Private Attributes

bool _dumpAtts
bool _dumpLV
bool _dumpLVList
bool _dumpLVTree
bool _dumpMaterial
bool _dumpPV
bool _dumpReplica
bool _dumpRotation
bool _dumpSense
bool _dumpSolid
bool _dumpSummary
bool _dumpTouch
G4NavigationHistory fHistory
std::string name
std::vector< std::string > names
int nchar
mpvpv thePVTree
G4VPhysicalVolume * theTopPV


Detailed Description

Definition at line 24 of file PrintGeomInfoAction.h.


Constructor & Destructor Documentation

PrintGeomInfoAction::PrintGeomInfoAction ( edm::ParameterSet const &  p  ) 

Definition at line 32 of file PrintGeomInfoAction.cc.

References _dumpAtts, _dumpLV, _dumpLVList, _dumpLVTree, _dumpMaterial, _dumpPV, _dumpReplica, _dumpRotation, _dumpSense, _dumpSolid, _dumpSummary, _dumpTouch, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::ParameterSet::getUntrackedParameter(), i, name, names, and nchar.

00033 {
00034     _dumpSummary = p.getUntrackedParameter<bool>("DumpSummary", true);
00035     _dumpLVTree  = p.getUntrackedParameter<bool>("DumpLVTree",  true);
00036     _dumpMaterial= p.getUntrackedParameter<bool>("DumpMaterial",false);
00037     _dumpLVList  = p.getUntrackedParameter<bool>("DumpLVList",  false);
00038     _dumpLV      = p.getUntrackedParameter<bool>("DumpLV",      false);
00039     _dumpSolid   = p.getUntrackedParameter<bool>("DumpSolid",   false);
00040     _dumpAtts    = p.getUntrackedParameter<bool>("DumpAttributes", false);
00041     _dumpPV      = p.getUntrackedParameter<bool>("DumpPV",      false);
00042     _dumpRotation= p.getUntrackedParameter<bool>("DumpRotation",false);
00043     _dumpReplica = p.getUntrackedParameter<bool>("DumpReplica", false);
00044     _dumpTouch   = p.getUntrackedParameter<bool>("DumpTouch",   false);
00045     _dumpSense   = p.getUntrackedParameter<bool>("DumpSense",   false);
00046     name  = p.getUntrackedParameter<std::string>("Name","*");
00047     nchar = name.find("*");
00048     name.assign(name,0,nchar);
00049     names = p.getUntrackedParameter<std::vector<std::string> >("Names");
00050     std::cout << "PrintGeomInfoAction:: initialised with verbosity levels:"
00051               << " Summary   " << _dumpSummary << " LVTree   " << _dumpLVTree
00052               << " LVList    " << _dumpLVList  << " Material " << _dumpMaterial
00053               << "\n                                                        "
00054               << " LV        " << _dumpLV      << " Solid    " << _dumpSolid 
00055               << " Attribs   " << _dumpAtts
00056               << "\n                                                        "
00057               << " PV        " << _dumpPV      << " Rotation " << _dumpRotation
00058               << " Replica   " << _dumpReplica
00059               << "\n                                                        "
00060               << " Touchable " << _dumpTouch << " for names (0-" << nchar 
00061               << ") = " << name 
00062               << "\n                                                        "
00063               << " Sensitive " << _dumpSense << " for " << names.size()
00064               << " namess";
00065     for (unsigned int i=0; i<names.size(); i++) std::cout << " " << names[i];
00066     std::cout << std::endl;
00067 }

PrintGeomInfoAction::~PrintGeomInfoAction (  ) 

Definition at line 69 of file PrintGeomInfoAction.cc.

00069 {}


Member Function Documentation

void PrintGeomInfoAction::add1touchable ( G4LogicalVolume *  lv,
int nTouch 
) [private]

Definition at line 203 of file PrintGeomInfoAction.cc.

References siz.

Referenced by countNoTouchables().

00204 {
00205     int siz = lv->GetNoDaughters();
00206     for(int ii = 0; ii < siz; ii++)
00207         add1touchable(lv->GetDaughter(ii)->GetLogicalVolume(), ++nTouch);
00208 }

int PrintGeomInfoAction::countNoTouchables (  )  [private]

Definition at line 194 of file PrintGeomInfoAction.cc.

References add1touchable(), getTopLV(), and lv.

Referenced by dumpSummary().

00195 {
00196     int nTouch = 0;
00197     G4LogicalVolume * lv = getTopLV();
00198     add1touchable(lv, nTouch);
00199     return nTouch;
00200 }

void PrintGeomInfoAction::dumpG4LVLeaf ( G4LogicalVolume *  lv,
uint  leafDepth,
uint  count,
std::ostream &  out = std::cout 
) [private]

Definition at line 177 of file PrintGeomInfoAction.cc.

References lat::endl().

Referenced by dumpG4LVTree().

00178 {
00179     for (uint ii=0; ii < leafDepth; ii++) out << "  ";
00180     out << " LV:(" << leafDepth << ") " << lv->GetName() << " (" << count
00181         << ")" << std::endl;
00182     //--- If a volume is placed n types as daughter of this LV, it should only be counted once
00183     std::map<G4LogicalVolume*, uint> lvCount;
00184     std::map<G4LogicalVolume*, uint>::const_iterator cite;
00185     for (int ii = 0; ii < lv->GetNoDaughters(); ii++) {
00186         cite = lvCount.find(lv->GetDaughter(ii)->GetLogicalVolume());
00187         if (cite != lvCount.end()) lvCount[cite->first] = (cite->second) + 1;
00188         else lvCount.insert(std::pair< G4LogicalVolume*,uint>(lv->GetDaughter(ii)->GetLogicalVolume(),1));
00189     }
00190     for (cite = lvCount.begin(); cite != lvCount.end(); cite++) 
00191         dumpG4LVLeaf((cite->first), leafDepth+1, (cite->second), out);
00192 }

void PrintGeomInfoAction::dumpG4LVList ( std::ostream &  out = std::cout  )  [private]

Definition at line 151 of file PrintGeomInfoAction.cc.

References lat::endl().

Referenced by update().

00152 {
00153     out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's List  " << std::endl;
00154     const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
00155     std::vector<G4LogicalVolume*>::const_iterator lvcite;
00156     for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) 
00157       out << "LV:" << (*lvcite)->GetName() << "\tMaterial: " << (*lvcite)->GetMaterial()->GetName() << std::endl;
00158 }

void PrintGeomInfoAction::dumpG4LVTree ( std::ostream &  out = std::cout  )  [private]

Definition at line 160 of file PrintGeomInfoAction.cc.

References dumpG4LVLeaf(), lat::endl(), getTopLV(), and lv.

Referenced by update().

00161 {
00162     out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Tree  " << std::endl;
00163     G4LogicalVolume * lv = getTopLV(); 
00164     dumpG4LVLeaf(lv,0,1,out);
00165 }

void PrintGeomInfoAction::dumpHierarchyLeafPVLV ( G4LogicalVolume *  lv,
uint  leafDepth,
std::ostream &  out = std::cout 
) [private]

Definition at line 228 of file PrintGeomInfoAction.cc.

References dumpLV(), and dumpPV().

Referenced by dumpHierarchyTreePVLV().

00229 {
00230     //----- Dump this LV 
00231     dumpLV(lv, leafDepth, out);
00232 
00233     //----- Get LV daughters from list of PV daughters
00234     mmlvpv lvpvDaughters;
00235     std::set< G4LogicalVolume * > lvDaughters;
00236     int NoDaughters = lv->GetNoDaughters();
00237     while ((NoDaughters--)>0)
00238     {
00239         G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
00240         lvpvDaughters.insert(mmlvpv::value_type(pvD->GetLogicalVolume(), pvD));
00241         lvDaughters.insert(pvD->GetLogicalVolume());
00242     }
00243  
00244     std::set< G4LogicalVolume * >::const_iterator scite;
00245     mmlvpv::const_iterator mmcite;
00246 
00247     //----- Dump daughters PV and LV
00248     for (scite = lvDaughters.begin(); scite != lvDaughters.end(); scite++) 
00249     {
00250         std::pair< mmlvpv::iterator, mmlvpv::iterator > mmER = lvpvDaughters.equal_range(*scite);    
00251         //----- Dump daughters PV of this LV
00252         for (mmcite = mmER.first ; mmcite != mmER.second; mmcite++) 
00253             dumpPV((*mmcite).second, leafDepth+1, out);
00254         //----- Dump daughters LV
00255         dumpHierarchyLeafPVLV(*scite, leafDepth+1, out );
00256     }
00257 }

void PrintGeomInfoAction::dumpHierarchyTreePVLV ( std::ostream &  out = std::cout  )  [private]

Definition at line 210 of file PrintGeomInfoAction.cc.

References _dumpTouch, dumpHierarchyLeafPVLV(), dumpPV(), dumpTouch(), getTopLV(), and theTopPV.

Referenced by update().

00211 {
00212     //dumps in the following order: 
00213     //    1) a LV with details
00214     //    2) list of PVs daughters of this LV with details
00215     //    3) list of LVs daughters of this LV and for each go to 1)
00216 
00217     //----- Get top PV
00218     G4LogicalVolume*  topLV = getTopLV();
00219   
00220     //----- Dump this leaf (it will recursively dump all the tree)
00221     dumpHierarchyLeafPVLV(topLV, 0, out);
00222     dumpPV(theTopPV, 0, out);
00223   
00224     //----- Dump the touchables (it will recursively dump all the tree)
00225     if (_dumpTouch) dumpTouch(theTopPV, 0, out);
00226 }

void PrintGeomInfoAction::dumpLV ( G4LogicalVolume *  lv,
uint  leafDepth,
std::ostream &  out = std::cout 
) [private]

Definition at line 259 of file PrintGeomInfoAction.cc.

References _dumpAtts, _dumpLV, _dumpSolid, dummy, dumpSolid(), lat::endl(), and spacesFromLeafDepth().

Referenced by dumpHierarchyLeafPVLV().

00260 {
00261     std::string spaces = spacesFromLeafDepth(leafDepth);
00262 
00263     //----- dump name 
00264     if (_dumpLV) { 
00265         out << leafDepth << spaces << "$$$ VOLUME = " << lv->GetName()
00266             << "  Solid: " << lv->GetSolid()->GetName() << "  MATERIAL: "
00267             << lv->GetMaterial()->GetName() << std::endl;
00268         if (_dumpSolid)
00269           dumpSolid(lv->GetSolid(), leafDepth, out); //----- dump solid
00270 
00271     //----- dump LV info 
00272     //--- material 
00273         if (_dumpAtts) {
00274           //--- Visualisation attributes
00275           const G4VisAttributes * fVA = lv->GetVisAttributes();
00276           if (fVA!=0) {
00277             out <<  spaces << "  VISUALISATION ATTRIBUTES: " << std::endl;
00278             out <<  spaces << "    IsVisible " << fVA->IsVisible() << std::endl;
00279             out <<  spaces << "    IsDaughtersInvisible " << fVA->IsDaughtersInvisible() << std::endl;
00280             out <<  spaces << "    Colour " << fVA->GetColour() << std::endl;
00281             out <<  spaces << "    LineStyle " << fVA->GetLineStyle() << std::endl;
00282             out <<  spaces << "    LineWidth " << fVA->GetLineWidth() << std::endl;
00283             out <<  spaces << "    IsForceDrawingStyle " << fVA->IsForceDrawingStyle() << std::endl;
00284             out <<  spaces << "    ForcedDrawingStyle " << fVA->GetForcedDrawingStyle() << std::endl;
00285           }    
00286     
00287           //--- User Limits
00288           G4UserLimits * fUL = lv->GetUserLimits();
00289           G4Track dummy;
00290           if (fUL!=0) {
00291             out <<  spaces << "    MaxAllowedStep " << fUL->GetMaxAllowedStep(dummy) << std::endl;
00292             out <<  spaces << "    UserMaxTrackLength " << fUL->GetUserMaxTrackLength(dummy) << std::endl;
00293             out <<  spaces << "    UserMaxTime " << fUL->GetUserMaxTime(dummy) << std::endl;
00294             out <<  spaces << "    UserMinEkine " << fUL->GetUserMinEkine(dummy) << std::endl;
00295             out <<  spaces << "    UserMinRange " << fUL->GetUserMinRange(dummy) << std::endl;
00296           }
00297     
00298           //--- other LV info
00299           if (lv->GetSensitiveDetector()) 
00300             out << spaces << "  IS SENSITIVE DETECTOR " << std::endl;
00301           if (lv->GetFieldManager()) 
00302             out << spaces << "  FIELD ON " << std::endl;
00303 
00304           // Pointer (possibly NULL) to optimisation info objects.
00305           out <<  spaces  
00306               << "        Quality for optimisation, average number of voxels to be spent per content " 
00307               << lv->GetSmartless() << std::endl;
00308 
00309           // Pointer (possibly NULL) to G4FastSimulationManager object.
00310           if (lv->GetFastSimulationManager()) 
00311             out << spaces << "     Logical Volume is an envelope for a FastSimulationManager " 
00312                 << std::endl;
00313           out << spaces << "     Weight used in the event biasing technique = " 
00314               << lv->GetBiasWeight() << std::endl;
00315         } 
00316     }
00317 }       

void PrintGeomInfoAction::dumpMaterialList ( std::ostream &  out = std::cout  )  [private]

Definition at line 167 of file PrintGeomInfoAction.cc.

References lat::endl().

Referenced by update().

00168 {
00169     out << " @@@@@@@@@@@@@@@@ DUMPING G4Material List ";
00170     const G4MaterialTable * matTab = G4Material::GetMaterialTable();
00171     out << " with " << matTab->size() << " materials " << std::endl;
00172     std::vector<G4Material*>::const_iterator matite;
00173     for (matite = matTab->begin(); matite != matTab->end(); matite++)
00174         out << "Material: " << (*matite) << std::endl;
00175 }

void PrintGeomInfoAction::dumpPV ( G4VPhysicalVolume *  pv,
uint  leafDepth,
std::ostream &  out = std::cout 
) [private]

Definition at line 319 of file PrintGeomInfoAction.cc.

References _dumpPV, _dumpReplica, _dumpRotation, lat::endl(), offset, spacesFromLeafDepth(), and width.

Referenced by dumpHierarchyLeafPVLV(), and dumpHierarchyTreePVLV().

00320 {
00321     std::string spaces = spacesFromLeafDepth(leafDepth);
00322 
00323     //----- PV info
00324     if (_dumpPV) 
00325     {
00326         std::string mother = "World";
00327         if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
00328         out << leafDepth << spaces << "### VOLUME = " << pv->GetName() 
00329             << " Copy No " << pv->GetCopyNo() << " in " << mother
00330             << " at " << pv->GetTranslation();
00331     }
00332     if (!pv->IsReplicated()) 
00333     {
00334         if (_dumpPV) 
00335         {
00336             if(pv->GetRotation() == 0) out << " with no rotation" << std::endl;
00337             else  if(!_dumpRotation)   out << " with rotation" << std::endl; //just rotation name
00338             else                       out << " with rotation " << *(pv->GetRotation()) << std::endl;
00339         }
00340     }  
00341     else 
00342     {
00343         if (_dumpReplica )
00344         {
00345             out << spaces << "    It is replica: " << std::endl;
00346             EAxis axis; 
00347             int nReplicas; 
00348             double width; 
00349             double offset; 
00350             bool consuming;
00351             pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
00352             out << spaces << "     axis " << axis << std::endl
00353                 << spaces << "     nReplicas " << nReplicas << std::endl;
00354             if (pv->GetParameterisation() != 0) 
00355                 out << spaces << "    It is parameterisation " << std::endl;
00356             else 
00357                 out << spaces << "     width " << width << std::endl
00358                     << spaces << "     offset " << offset << std::endl
00359                     << spaces << "     consuming" <<  consuming << std::endl;
00360             if (pv->GetParameterisation() != 0) 
00361                 out << spaces << "    It is parameterisation " << std::endl;
00362         }
00363     }
00364 }

void PrintGeomInfoAction::dumpSolid ( G4VSolid *  sol,
uint  leafDepth,
std::ostream &  out = std::cout 
) [private]

Definition at line 405 of file PrintGeomInfoAction.cc.

References lat::endl(), and spacesFromLeafDepth().

Referenced by dumpLV().

00406 {
00407     std::string spaces = spacesFromLeafDepth(leafDepth);
00408     out << spaces << *(sol) << std::endl;
00409 }

void PrintGeomInfoAction::dumpSummary ( std::ostream &  out = std::cout  )  [private]

Definition at line 126 of file PrintGeomInfoAction.cc.

References countNoTouchables(), lat::endl(), and theTopPV.

Referenced by update().

00127 {
00128     //---------- Dump number of objects of each class
00129     out << " @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << std::endl;
00130     if(theTopPV == 0) 
00131     {
00132         out << " No volume created " << std::endl;
00133         return;
00134     }
00135     out << " @@@ Geometry built inside world volume: " << theTopPV->GetName() << std::endl;
00136     // Get number of solids (< # LV if several LV share a solid)
00137     const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
00138     std::vector<G4LogicalVolume *>::const_iterator lvcite;
00139     std::set<G4VSolid *> theSolids;
00140     for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) 
00141         theSolids.insert((*lvcite)->GetSolid());
00142     out << " Number of G4VSolid's: " << theSolids.size() << std::endl;
00143     out << " Number of G4LogicalVolume's: " << lvs->size() << std::endl;
00144     const G4PhysicalVolumeStore * pvs = G4PhysicalVolumeStore::GetInstance();
00145     out << " Number of G4VPhysicalVolume's: " << pvs->size() << std::endl;
00146     out << " Number of Touchable's: " << countNoTouchables() << std::endl;
00147     const G4MaterialTable * matTab = G4Material::GetMaterialTable();
00148     out << " Number of G4Material's: " << matTab->size() << std::endl;
00149 }

void PrintGeomInfoAction::dumpTouch ( G4VPhysicalVolume *  pv,
uint  leafDepth,
std::ostream &  out = std::cout 
) [private]

Definition at line 366 of file PrintGeomInfoAction.cc.

References lat::endl(), fHistory, lv, name, nchar, PV3DBase< T, PVType, FrameType >::perp(), and spacesFromLeafDepth().

Referenced by dumpHierarchyTreePVLV().

00367 {
00368     std::string spaces = spacesFromLeafDepth(leafDepth);
00369     if (leafDepth == 0) fHistory.SetFirstEntry(pv);
00370     else fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
00371 
00372     G4ThreeVector globalpoint = fHistory.GetTopTransform().Inverse().
00373                                 TransformPoint(G4ThreeVector(0,0,0));
00374     G4LogicalVolume * lv = pv->GetLogicalVolume();
00375 
00376     std::string mother = "World";
00377     if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
00378     std::string lvname = lv->GetName();
00379     lvname.assign(lvname,0,nchar);
00380     if (lvname == name)
00381         out << leafDepth << spaces << "### VOLUME = " << lv->GetName() 
00382             << " Copy No " << pv->GetCopyNo() << " in " << mother
00383             << " global position of centre " << globalpoint << " (r = " 
00384             <<  globalpoint.perp() << ", phi = " <<  globalpoint.phi()/deg
00385             << ")" << std::endl;
00386 
00387     int NoDaughters = lv->GetNoDaughters();
00388     while ((NoDaughters--)>0) 
00389     {
00390         G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
00391         if (!pvD->IsReplicated()) dumpTouch(pvD, leafDepth+1, out);
00392     }
00393 
00394     if (leafDepth > 0) fHistory.BackLevel();
00395 }

G4LogicalVolume * PrintGeomInfoAction::getTopLV (  )  [private]

Definition at line 417 of file PrintGeomInfoAction.cc.

References theTopPV.

Referenced by countNoTouchables(), dumpG4LVTree(), and dumpHierarchyTreePVLV().

00418 { return theTopPV->GetLogicalVolume(); }

G4VPhysicalVolume * PrintGeomInfoAction::getTopPV (  )  [private]

Definition at line 411 of file PrintGeomInfoAction.cc.

Referenced by update().

00412 {
00413     return G4TransportationManager::GetTransportationManager()
00414         ->GetNavigatorForTracking()->GetWorldVolume();
00415 }

std::string PrintGeomInfoAction::spacesFromLeafDepth ( uint  leafDepth  )  [private]

Definition at line 397 of file PrintGeomInfoAction.cc.

Referenced by dumpLV(), dumpPV(), dumpSolid(), dumpTouch(), and update().

00398 {
00399     std::string spaces;
00400     uint ii;
00401     for(ii = 0; ii < leafDepth; ii++) { spaces += "  "; }
00402     return spaces;
00403 }

void PrintGeomInfoAction::update ( const BeginOfRun  )  [private, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 111 of file PrintGeomInfoAction.cc.

References _dumpLV, _dumpLVList, _dumpLVTree, _dumpMaterial, _dumpPV, _dumpSummary, _dumpTouch, GenMuonPlsPt100GeV_cfg::cout, dumpG4LVList(), dumpG4LVTree(), dumpHierarchyTreePVLV(), dumpMaterialList(), dumpSummary(), getTopPV(), and theTopPV.

00112 {
00113     theTopPV = getTopPV();
00114 
00115     if (_dumpSummary)  dumpSummary(std::cout);
00116     if (_dumpLVTree)   dumpG4LVTree(std::cout);
00117     
00118     //---------- Dump list of objects of each class with detail of parameters
00119     if (_dumpMaterial) dumpMaterialList(std::cout);
00120     if (_dumpLVList)   dumpG4LVList(std::cout);
00121 
00122     //---------- Dump LV and PV information
00123     if (_dumpLV || _dumpPV || _dumpTouch) dumpHierarchyTreePVLV(std::cout);
00124 }

void PrintGeomInfoAction::update ( const BeginOfJob  )  [private, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 71 of file PrintGeomInfoAction.cc.

References _dumpSense, DDFilteredView::addFilter(), edmNew::copy(), DDFilteredView::copyNumbers(), GenMuonPlsPt100GeV_cfg::cout, DDSplit(), lat::endl(), DDSpecificsFilter::equals, filter, first, DDFilteredView::firstChild(), i, k, funct::log(), DDFilteredView::logicalPart(), DDBase< N, C >::name(), names, DDFilteredView::next(), DDSpecificsFilter::setCriteria(), spacesFromLeafDepth(), and DDFilteredView::translation().

00072 {
00073     if (_dumpSense) {
00074         edm::ESHandle<DDCompactView> pDD;
00075         (*job)()->get<IdealGeometryRecord>().get(pDD);
00076 
00077         std::cout << "PrintGeomInfoAction::Get Printout of Sensitive Volumes " 
00078                   << "for " << names.size() << " Readout Units" << std::endl;
00079         for (unsigned int i=0; i<names.size(); i++) {
00080             std::string attribute = "ReadOutName";
00081             std::string sd        = names[i];
00082             DDSpecificsFilter filter;
00083             DDValue           ddv(attribute,sd,0);
00084             filter.setCriteria(ddv,DDSpecificsFilter::equals);
00085             DDFilteredView fv(*pDD);
00086             std::cout << "PrintGeomInfoAction:: Get Filtered view for " 
00087                       << attribute << " = " << sd << std::endl;
00088             fv.addFilter(filter);
00089             bool dodet = fv.firstChild();
00090  
00091             std::string spaces = spacesFromLeafDepth(1);
00092 
00093             while (dodet) {
00094                 const DDLogicalPart & log = fv.logicalPart();
00095                 std::string lvname = DDSplit(log.name()).first;
00096                 DDTranslation tran = fv.translation();
00097                 std::vector<int> copy = fv.copyNumbers();
00098 
00099                 unsigned int leafDepth = copy.size();
00100                 std::cout << leafDepth << spaces << "### VOLUME = " << lvname 
00101                           << " Copy No";
00102                 for (int k=leafDepth-1; k>=0; k--) std::cout << " " << copy[k];
00103                 std::cout << " Centre at " << tran << " (r = " << tran.Rho()
00104                           << ", phi = " << tran.phi()/deg << ")" << std::endl;
00105                 dodet = fv.next();
00106             }
00107         }
00108     }
00109 }


Member Data Documentation

bool PrintGeomInfoAction::_dumpAtts [private]

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpLV [private]

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpLVList [private]

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpLVTree [private]

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpMaterial [private]

Definition at line 52 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpPV [private]

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpReplica [private]

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpRotation [private]

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpSense [private]

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpSolid [private]

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpSummary [private]

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpTouch [private]

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpHierarchyTreePVLV(), PrintGeomInfoAction(), and update().

G4NavigationHistory PrintGeomInfoAction::fHistory [private]

Definition at line 60 of file PrintGeomInfoAction.h.

Referenced by dumpTouch().

std::string PrintGeomInfoAction::name [private]

Definition at line 55 of file PrintGeomInfoAction.h.

Referenced by dumpTouch(), and PrintGeomInfoAction().

std::vector<std::string> PrintGeomInfoAction::names [private]

Definition at line 57 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

int PrintGeomInfoAction::nchar [private]

Definition at line 56 of file PrintGeomInfoAction.h.

Referenced by dumpTouch(), and PrintGeomInfoAction().

mpvpv PrintGeomInfoAction::thePVTree [private]

Definition at line 58 of file PrintGeomInfoAction.h.

G4VPhysicalVolume* PrintGeomInfoAction::theTopPV [private]

Definition at line 59 of file PrintGeomInfoAction.h.

Referenced by dumpHierarchyTreePVLV(), dumpSummary(), getTopLV(), and update().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:18 2009 for CMSSW by  doxygen 1.5.4