ATLAS Offline Software
Loading...
Searching...
No Matches
VP1GeometrySystem::Imp Class Reference

Classes

class  SubSystemInfo

Public Member Functions

 Imp (VP1GeometrySystem *gs, const VP1GeoFlags::SubSystemFlags &ssf)
void addSubSystem (const VP1GeoFlags::SubSystemFlag &, const QString &treetopregexp, const QString &childrenregexp="", const std::string &matname="", bool negatetreetopregexp=false, bool negatechildrenregexp=false, const QString &grandchildrenregexp="", bool negategrandchildrenregexp=false)
SubSystemInfo * chamberPVToMuonSubSystemInfo (const GeoPVConstLink &chamberPV)
void ensureInitVisAttributes ()
void buildSystem (SubSystemInfo *)
void updateTouchedMuonChamber (VolumeHandle *chamberhandle)
std::pair< SbVec3f, SbVec3f > getClosestMuonDriftTubeDirections (const SbVec3f &cameraDirection, const SbVec3f &cameraUpDirection, VolumeHandle *chamberhandle)
std::pair< SbVec3f, SbVec3f > getClosestCSCOrTGCEdgeDirections (const SbVec3f &cameraDirection, VolumeHandle *chamberhandle)
void changeStateOfVisibleNonStandardVolumesRecursively (VolumeHandle *, VP1GeoFlags::VOLSTATE)
void expandVisibleVolumesRecursively (VolumeHandle *, const QRegExp &, bool bymatname)
void iconifyVisibleVolumesRecursively (VolumeHandle *, const QRegExp &, bool bymatname)
void ensureInitPV2MuonStationMap ()
void updatePV2MuonStationMap (const MuonGM::MuonReadoutElement *elem)
QStringList stationInfo (const MuonGM::MuonStation *)
void expandAllChildren (VolumeHandle *, bool isPixel, bool brl, bool ecA, bool ecC)
void showPixelModules (VolumeHandle *)
void showITkPixelModules (VolumeHandle *, bool brl, bool ecA, bool ecC)
void showITkStripModules (VolumeHandle *, bool brl, bool ecA, bool ecC)
bool selectITkComponent (VolumeHandle *, bool isPixel, bool pixelModules, bool pixelServices, bool pixelSupports, bool stripSensors, bool stripElectronics, bool stripServices, bool stripSupports, unsigned inheritedCategory=0)
void showSCTBarrelModules (VolumeHandle *)
void showSCTEndcapModules (VolumeHandle *)
void applyTopVolStates (const QMap< quint32, QByteArray > &, bool disablenotif=false)
void createPathExtras (const VolumeHandle *, QString &, QStack< QString > &)

Static Public Member Functions

static double exclusiveMass (const PVConstLink &pv)
static double inclusiveMass (const PVConstLink &pv)
static double volume (const PVConstLink &pv)
static void catchKbdState (void *userData, SoEventCallback *CB)

Public Attributes

VP1GeometrySystem * theclass
SoSeparator * sceneroot
std::map< SoSeparator *, VolumeHandle * > sonodesep2volhandle
QList< SubSystemInfo * > subsysInfoList
DetVisAttributes * detVisAttributes
MatVisAttributes * matVisAttributes
VolVisAttributes * volVisAttributes
VP1GeoFlags::SubSystemFlags initialSubSystemsTurnedOn
GeoSysController * controller
PhiSectorManager * phisectormanager
VolumeTreeModel * volumetreemodel
const SoKeyboardEvent * kbEvent
std::map< PVConstLink, VolumeHandle * > muonchambers_pv2handles
std::map< QObject *, std::set< GeoPVConstLink > > sender2ChamberList
VolumeHandle * previousAlignedChamberHandle
int last_appropriatemdtprojections
SoSeparator * m_textSep
 Separator used to hold all visible labels.
std::map< GeoPVConstLink, const MuonGM::MuonStation * > pv2MuonStation
bool pv2MuonStationInit
QMap< quint32, QByteArray > restoredTopvolstates
QList< const std::map< GeoPVConstLink, float > * > chamberT0s

Detailed Description

Definition at line 96 of file VP1GeometrySystem.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1GeometrySystem::Imp::Imp ( VP1GeometrySystem * gs,
const VP1GeoFlags::SubSystemFlags & ssf )
inline

Definition at line 98 of file VP1GeometrySystem.cxx.

99 : theclass(gs), sceneroot(0),
104 #ifndef BUILDVP1LIGHT
105 ,pv2MuonStationInit(false)
106 #endif
107 {
108 const unsigned n_chamber_t0_sources=2;
109 for (unsigned i=0;i<n_chamber_t0_sources;++i)
110 chamberT0s.append(0);
111 }
VP1GeometrySystem * theclass
VP1GeoFlags::SubSystemFlags initialSubSystemsTurnedOn
SoSeparator * m_textSep
Separator used to hold all visible labels.
PhiSectorManager * phisectormanager
VolumeHandle * previousAlignedChamberHandle
DetVisAttributes * detVisAttributes
VolVisAttributes * volVisAttributes
GeoSysController * controller
const SoKeyboardEvent * kbEvent
QList< const std::map< GeoPVConstLink, float > * > chamberT0s
MatVisAttributes * matVisAttributes
VolumeTreeModel * volumetreemodel

Member Function Documentation

◆ addSubSystem()

void VP1GeometrySystem::Imp::addSubSystem ( const VP1GeoFlags::SubSystemFlag & f,
const QString & treetopregexp,
const QString & childrenregexp = "",
const std::string & matname = "",
bool negatetreetopregexp = false,
bool negatechildrenregexp = false,
const QString & grandchildrenregexp = "",
bool negategrandchildrenregexp = false )

Definition at line 368 of file VP1GeometrySystem.cxx.

372{
373 theclass->messageDebug("VP1GeometrySystem::Imp::addSubSystem - flag: '" + QString(f) + "' - matName: '" + str(matname.c_str()) + "'." );
374
375 QCheckBox * cb = controller->subSystemCheckBox(f);
376 if (!cb) {
377 theclass->message("Error: Problems retrieving checkbox for subsystem "+str(f));
378 return;
379 }
380 subsysInfoList << new SubSystemInfo(cb,QRegExp(treetopregexp),negatetreetopregexp,
381 QRegExp(childrenregexp),negatechildrenregexp,f,matname,
382 QRegExp(grandchildrenregexp), negategrandchildrenregexp);
383 //FIXME: DELETE!!!
384}
QList< SubSystemInfo * > subsysInfoList

◆ applyTopVolStates()

void VP1GeometrySystem::Imp::applyTopVolStates ( const QMap< quint32, QByteArray > & topvolstates,
bool disablenotif = false )

Definition at line 1396 of file VP1GeometrySystem.cxx.

1397{
1398 if (disablenotif)
1399 phisectormanager->largeChangesBegin();
1400 QMap<quint32,QByteArray>::const_iterator topvolstatesItr;
1401 for (Imp::SubSystemInfo * subsys : subsysInfoList) {
1402 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
1403 for (;it!=itE;++it) {
1404 topvolstatesItr = topvolstates.find((*it)->hashID());
1405 if (topvolstatesItr!=topvolstates.end())
1406 (*it)->applyPersistifiableState(topvolstatesItr.value());
1407 }
1408 }
1409 if (disablenotif) {
1410 phisectormanager->updateRepresentationsOfVolsAroundZAxis();
1411 phisectormanager->largeChangesEnd();
1412 }
1413}
VolumeHandleList::iterator VolumeHandleListItr

◆ buildSystem()

void VP1GeometrySystem::Imp::buildSystem ( SubSystemInfo * si)

Definition at line 1106 of file VP1GeometrySystem.cxx.

1107{
1108 VP1Msg::messageDebug("VP1GeometrySystem::Imp::buildSystem()" );
1109
1110 if (!si||si->isbuilt)
1111 return;
1112 si->isbuilt = true;
1113 int ichild(0);
1114
1116 #ifndef BUILDVP1LIGHT
1117 ensureInitPV2MuonStationMap(); // Needed for Muon Station names.
1118 #endif
1119
1120// // DEBUG
1121// for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
1122// VP1Msg::messageDebug("vol: " + QString((si->flag).str_c()) );
1123// }
1124
1125 assert(si->soswitch);
1126 SoSeparator * subsystemsep = new SoSeparator;
1127 phisectormanager->registerSubSystemSeparator(si->flag,subsystemsep);
1128 phisectormanager->largeChangesBegin();
1129
1130 SbBool save = si->soswitch->enableNotify(false);
1131
1132 if (si->geomodelchildrenregexp.isEmpty()) {
1133 //Loop over the treetop's that we previously selected:
1134 std::vector<SubSystemInfo::TreetopInfo>::const_iterator it, itE = si->treetopinfo.end();
1135 for (it=si->treetopinfo.begin();it!=itE;++it)
1136 {
1137 VP1Msg::messageDebug("toptree vol: " + QString(it->volname.c_str()) );
1138
1139 //Find material:
1140 SoMaterial*m = detVisAttributes->get(it->volname);
1141 if (!m) {
1142 theclass->message("Warning: Did not find a predefined material for volume: "+QString(it->volname.c_str()));
1143 }
1144 VolumeHandleSharedData* volhandle_subsysdata = new VolumeHandleSharedData(controller,si->flag,&sonodesep2volhandle,it->pV,phisectormanager,
1146 controller->zappedVolumeListModel(),controller->volumeTreeBrowser(), m_textSep,
1147 detVisAttributes->outlineColour(it->volname));
1148 SbMatrix matr;
1150 VolumeHandle * vh = new VolumeHandle(volhandle_subsysdata,0,it->pV,ichild++,VolumeHandle::NONMUONCHAMBER,matr);
1151 si->vollist.push_back(vh);
1152 // std::cout<<"Non muon chamber VH="<<vh<<std::endl;
1153 }
1154 } else {
1155 //Loop over the children of the physical volumes of the treetops that we previously selected:
1156 std::vector<SubSystemInfo::TreetopInfo>::const_iterator it, itE = si->treetopinfo.end();
1157 for (it=si->treetopinfo.begin();it!=itE;++it) {
1158
1159 VP1Msg::messageDebug("group name: " + QString(si->matname.c_str()) );
1160
1161 //NB: Here we use the si->matname. Above we use the si->volname. Historical reasons!
1162
1163 //Find material for top-nodes:
1164 SoMaterial*mat_top(0);
1165 if (si->matname!="")
1166 mat_top = detVisAttributes->get(si->matname);
1167
1168 VolumeHandleSharedData* volhandle_subsysdata = new VolumeHandleSharedData(controller,si->flag,&sonodesep2volhandle,it->pV,phisectormanager,
1170 controller->zappedVolumeListModel(),controller->volumeTreeBrowser(),m_textSep,
1171 detVisAttributes->outlineColour(si->matname));
1172 volhandle_subsysdata->ref();
1173
1174 const bool hasMuonChambers=si->hasMuonChambers();
1175
1176 GeoVolumeCursor av(it->pV);
1177 //unsigned int count=0;
1178 while (!av.atEnd()) {
1179
1180 // DEBUG
1181// VP1Msg::messageDebug("child vol: " + QString(av.getName().c_str()) );
1182
1183 //Use the childrenregexp to select the correct child volumes:
1184 if (si->childrenRegExpNameCompatible(av.getName().c_str())) {
1185 PVConstLink pVD = av.getVolume();
1186 SbMatrix matr;
1188 VolumeHandle * vh=0;
1189 // std::cout<<count++<<": dump SubSystemInfo\n"<<"---"<<std::endl;
1190 // si->dump();
1191 // std::cout<<"---"<<std::endl;
1192 if (hasMuonChambers){
1193 #ifndef BUILDVP1LIGHT
1194 vh = new MuonVolumeHandle(volhandle_subsysdata,0,pVD,ichild++,VolumeHandle::MUONCHAMBER_DIRTY,matr,pv2MuonStation[pVD],chamberT0s);
1195 #endif
1196 #ifdef BUILDVP1LIGHT
1197 vh = new VolumeHandle(volhandle_subsysdata,0,pVD,ichild++,VolumeHandle::MUONCHAMBER_DIRTY,matr);
1198 #endif
1199 muonchambers_pv2handles[pVD] = vh;
1200 if(VP1Msg::debug()){
1201 std::cout<<"Has muon chamber VH="<<vh<<std::endl;
1202 }
1203
1204 } else {
1205
1206 vh = new VolumeHandle(volhandle_subsysdata,0,pVD,ichild++,
1208 // std::cout<<"Does not have muon chamber (weird one) VH="<<vh<<std::endl;
1209 }
1210
1211 // DEBUG
1212// VP1Msg::messageDebug("granchild vol: " + vh->getName() + " - " + vh->getDescriptiveName() );
1213
1214 if (si->geomodelgrandchildrenregexp.isEmpty()) {
1215 // append the volume to the current list
1216 theclass->messageDebug("grandchild inserted : " + vh->getDescriptiveName() + " - " + vh->getName() );
1217 si->vollist.push_back(vh);
1218
1219 } else {
1220 VP1Msg::messageDebug("filtering at grandchild level...");
1221 if (si->grandchildrenRegExpNameCompatible(vh->getName().toStdString() ) ) {
1222 VP1Msg::messageDebug("filtered grandchild inserted : " + vh->getDescriptiveName() + " - " + vh->getName() );
1223 // append the volume to the current list
1224 si->vollist.push_back(vh);
1225 } else {
1226 theclass->message("Zapping this volumehandle because it's probably junk."+vh->getDescriptiveName() + " - " + vh->getName());
1227 vh->setState(VP1GeoFlags::ZAPPED); // FIXME - better solution for this? Maybe just don't create them?
1228
1229 // std::cout<<"Not adding "<<vh->getName().toStdString()<<"["<<vh<<"] to vollist"<<std::endl;
1230 }
1231 }
1232 }
1233 av.next(); // increment volume cursor.
1234 }
1235 volhandle_subsysdata->unref();//To ensure it is deleted if it was not used.
1236 }
1237 }
1238
1239 if (VP1Msg::debug()) si->dump();
1240
1241 VP1Msg::messageDebug("volumetreemodel->addSubSystem...");
1242 volumetreemodel->addSubSystem( si->flag, si->vollist );
1243
1244 //NB: We let the destructor of volumetreemodel take care of deleting
1245 //our (top) volume handles, since it has to keep a list of them
1246 //anyway.
1247
1248
1249 //Perform auto expansion of all ether volumes (needed for muon dead material):
1250 VP1Msg::messageDebug("Perform auto expansion of all ether volumes (needed for muon dead material)");
1251 VolumeHandle::VolumeHandleListItr it, itE(si->vollist.end());
1252 //int idx=0; // for debug
1253 for (it = si->vollist.begin(); it!=itE; ++it){
1254 //VP1Msg::messageDebug("\nexpanding idx: " + QString::number(++idx));
1255 (*it)->expandMothersRecursivelyToNonEther();
1256 //VP1Msg::messageDebug("expand DONE.");
1257 }
1258
1259
1260 VP1Msg::messageDebug("addChild...");
1261 phisectormanager->updateRepresentationsOfVolsAroundZAxis();
1262 phisectormanager->largeChangesEnd();
1263 si->soswitch->addChild(subsystemsep);
1264 si->soswitch->enableNotify(save);
1265 if (save)
1266 si->soswitch->touch();
1267 VP1Msg::messageDebug("END of VP1GeometrySystem::Imp::buildSystem() " );
1268}
std::map< PVConstLink, VolumeHandle * > muonchambers_pv2handles
std::map< GeoPVConstLink, const MuonGM::MuonStation * > pv2MuonStation
std::map< SoSeparator *, VolumeHandle * > sonodesep2volhandle
static void transformToMatrix(SoTransform *xf, SbMatrix &result)
static bool debug()
Definition VP1Msg.h:32
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
QString getName() const
virtual QString getDescriptiveName() const
void setState(const VP1GeoFlags::VOLSTATE &state, bool autoExpandEther=true)
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
save(self, fileName="./columbo.out")
Definition checkTP.py:176

◆ catchKbdState()

void VP1GeometrySystem::Imp::catchKbdState ( void * userData,
SoEventCallback * CB )
static

Definition at line 513 of file VP1GeometrySystem.cxx.

513 {
514 VP1GeometrySystem::Imp *This=static_cast<VP1GeometrySystem::Imp*>(address);
515 if (This)
516 This->kbEvent = static_cast<const SoKeyboardEvent *>(CB->getEvent());
517}

◆ chamberPVToMuonSubSystemInfo()

VP1GeometrySystem::Imp::SubSystemInfo * VP1GeometrySystem::Imp::chamberPVToMuonSubSystemInfo ( const GeoPVConstLink & chamberPV)

Definition at line 1762 of file VP1GeometrySystem.cxx.

1763{
1764 VP1Msg::messageDebug("VP1GeometrySystem::Imp::chamberPVToMuonSubSystemInfo()");
1765
1766 std::string name = chamberPV->getLogVol()->getName();
1767
1768 VP1Msg::messageDebug("name: " + QString::fromStdString(name) );
1769
1770 for (SubSystemInfo * subsys : subsysInfoList) {
1771 if (!subsys->hasMuonChambers())
1772 continue;
1773 if (subsys->childrenRegExpNameCompatible(name)) {
1774 //NB: We assume once again that all muon chambers are to be
1775 //compared with childrenRegExp.
1776 return subsys;
1777 }
1778 }
1779 return 0;
1780}
const QString & name() const

◆ changeStateOfVisibleNonStandardVolumesRecursively()

void VP1GeometrySystem::Imp::changeStateOfVisibleNonStandardVolumesRecursively ( VolumeHandle * handle,
VP1GeoFlags::VOLSTATE target )

Definition at line 2021 of file VP1GeometrySystem.cxx.

2022{
2023 assert(target!=VP1GeoFlags::CONTRACTED);
2024 if (handle->isAttached()) {
2025 //The volume is visible, so ignore daughters
2026 if (handle->isInitialisedAndHasNonStandardShape()) {
2027 if (target!=VP1GeoFlags::EXPANDED||handle->nChildren()>0)
2028 handle->setState(target);
2029 }
2030 return;
2031 } else if (handle->state()==VP1GeoFlags::ZAPPED)
2032 return;
2033 //Must be expanded: Let us call on any (initialised) children instead.
2034 if (handle->nChildren()==0||!handle->childrenAreInitialised())
2035 return;
2036 VolumeHandle::VolumeHandleListItr it(handle->childrenBegin()), itE(handle->childrenEnd());
2037 for(;it!=itE;++it)
2039
2040}
void changeStateOfVisibleNonStandardVolumesRecursively(VolumeHandle *, VP1GeoFlags::VOLSTATE)
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.

◆ createPathExtras()

void VP1GeometrySystem::Imp::createPathExtras ( const VolumeHandle * volhandle,
QString & prefix,
QStack< QString > & entries )

Definition at line 1416 of file VP1GeometrySystem.cxx.

1417{
1418 switch(volhandle->subsystem()){
1419 case VP1GeoFlags::Pixel: {
1420 prefix = QString("Pixel::");
1421 entries.push("IDET::IDET");
1423 entries.push("ITkPixel::ITkPixel");
1424 else
1425 entries.push("Pixel::Pixel");
1426 return;
1427 }
1428 case VP1GeoFlags::SCT:{
1429 prefix = QString("SCT::");
1430 entries.push("IDET::IDET");
1432 entries.push("ITkStrip::ITkStrip");
1433 else
1434 entries.push("SCT::SCT");
1435 return;
1436 }
1437 case VP1GeoFlags::HGTD: {
1438 prefix = QString("HGTD::");
1439 entries.push("IDET::IDET");
1440 entries.push("HGTD::HGTD");
1441 return;
1442 }
1443 case VP1GeoFlags::TRT:{
1444 prefix = QString("TRT::");
1445 entries.push("IDET::IDET");
1446 entries.push("TRT::TRT");
1447 return;
1448 }
1450 prefix = QString("InDetServMat::");
1451 entries.push("IDET::IDET");
1452 return;
1453 }
1454 case VP1GeoFlags::LAr:{
1455 prefix = QString("LArMgr::");
1456 entries.push("CALO::CALO");
1457 entries.push("LArMgr::LArMgr");
1458 return;
1459 }
1460 case VP1GeoFlags::Tile:{
1461 prefix = QString("Tile::");
1462 entries.push("CALO::CALO");
1463 entries.push("Tile::Tile");
1464 return;
1465 }
1479 prefix = QString("Muon::");
1480 entries.push("MUONQ02::MUONQ02");
1481 entries.push("Muon::MuonSys");
1482 return;
1483 }
1485 prefix = QString("BeamPipe::");
1486 entries.push("BeamPipe::BeamPipe");
1487 return;
1488 }
1489 case VP1GeoFlags::None:
1491 case VP1GeoFlags::LUCID:
1492 case VP1GeoFlags::ZDC:
1493 case VP1GeoFlags::ALFA:
1494 case VP1GeoFlags::AFP:
1497 default:{
1498 return;
1499 }
1500 }
1501}
@ MuonEndcapStationTGC
Definition VP1GeoFlags.h:47
@ AllUnrecognisedVolumes
Definition VP1GeoFlags.h:73
@ MuonBarrelStationInner
Definition VP1GeoFlags.h:42
@ MuonBarrelStationMiddle
Definition VP1GeoFlags.h:44
@ MuonBarrelStationOuter
Definition VP1GeoFlags.h:45
@ MuonEndcapStationCSC
Definition VP1GeoFlags.h:46
@ MuonEndcapStationMDT
Definition VP1GeoFlags.h:49
static bool hasITkGeometry()
VP1GeoFlags::SubSystemFlag subsystem() const
double entries
Definition listroot.cxx:49

◆ ensureInitPV2MuonStationMap()

void VP1GeometrySystem::Imp::ensureInitPV2MuonStationMap ( )

Definition at line 2205 of file VP1GeometrySystem.cxx.

2206{
2207 if (pv2MuonStationInit) {
2208 VP1Msg::messageDebug("MuonStation map already initialized.");
2209 return;
2210 }
2211 pv2MuonStationInit = true;
2212 theclass->messageVerbose("Initializing physical volume link -> MuonStation map.");
2213
2214 const MuonGM::MuonDetectorManager * mgr = VP1DetInfo::muonDetMgr();
2215 if (!mgr) {
2216 VP1Msg::message("WARNING: Could not get muon detector manager to construct volume -> muon station map!");
2217 return;
2218 }
2219 if (mgr->nMdtRE()) {
2220 for (auto det_el = mgr->mdtIdHelper()->detectorElement_begin();
2221 det_el != mgr->mdtIdHelper()->detectorElement_end(); ++det_el) {
2222 updatePV2MuonStationMap(mgr->getMdtReadoutElement(*det_el));
2223 }
2224 }
2225 if (mgr->nRpcRE()) {
2226 for (auto det_el = mgr->rpcIdHelper()->detectorElement_begin();
2227 det_el != mgr->rpcIdHelper()->detectorElement_end(); ++det_el) {
2228 updatePV2MuonStationMap(mgr->getRpcReadoutElement(*det_el));
2229 }
2230 }
2231 if (mgr->nCscRE()) {
2232 for (auto det_el = mgr->cscIdHelper()->detectorElement_begin();
2233 det_el != mgr->cscIdHelper()->detectorElement_end(); ++det_el) {
2234 updatePV2MuonStationMap(mgr->getCscReadoutElement(*det_el));
2235 }
2236 }
2237 if (mgr->nTgcRE()) {
2238 for (auto det_el = mgr->tgcIdHelper()->detectorElement_begin();
2239 det_el != mgr->tgcIdHelper()->detectorElement_end(); ++det_el) {
2240 updatePV2MuonStationMap(mgr->getTgcReadoutElement(*det_el));
2241 }
2242 }
2243
2244 VP1Msg::messageDebug("Initialised physical volume link -> MuonStation map. Found "+str(pv2MuonStation.size())+" stations.");
2245
2246}
static const MuonGM::MuonDetectorManager * muonDetMgr()
void updatePV2MuonStationMap(const MuonGM::MuonReadoutElement *elem)
static void message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30

◆ ensureInitVisAttributes()

void VP1GeometrySystem::Imp::ensureInitVisAttributes ( )
inline

Definition at line 238 of file VP1GeometrySystem.cxx.

238 {
239 if (!detVisAttributes) detVisAttributes = new DetVisAttributes();
240 if (!matVisAttributes) matVisAttributes = new MatVisAttributes();
241 if (!volVisAttributes) volVisAttributes = new VolVisAttributes();
242 }

◆ exclusiveMass()

double VP1GeometrySystem::Imp::exclusiveMass ( const PVConstLink & pv)
static

Definition at line 1271 of file VP1GeometrySystem.cxx.

1271 {
1272 const GeoLogVol* lv = pv->getLogVol();
1273 const GeoMaterial *material = lv->getMaterial();
1274 double density = material->getDensity();
1275 return density*volume(pv);
1276}
static double volume(const PVConstLink &pv)

◆ expandAllChildren()

void VP1GeometrySystem::Imp::expandAllChildren ( VolumeHandle * h,
bool isPixel,
bool brl,
bool ecA,
bool ecC )

Definition at line 2662 of file VP1GeometrySystem.cxx.

2662 {
2663
2664 if (h->nChildren()==0) {
2665 if (isPixel and (ecA or ecC)) {
2666 float translation_x, translation_y, translation_z, rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians;
2667 VP1LinAlgUtils::decodeTransformation( h->getGlobalTransformToVolume(),
2668 translation_x, translation_y, translation_z,
2669 rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians );
2670 if ((!ecA || !ecC) && ((ecA and (translation_z<0.)) or (ecC and (translation_z>0.) ))) {
2671 h->setState(VP1GeoFlags::ZAPPED);
2672 return;
2673 }
2674 }
2675
2676 // check if you have to select it
2677 std::vector< std::string > selected_volumes = {};
2678 if (brl) {
2679 if (isPixel) {
2680 selected_volumes.push_back("InnerBarrelSingleMod_Sensor");
2681 selected_volumes.push_back("InnerBarrelQuadMod_Sensor");
2682 selected_volumes.push_back("OuterBarrelQuadMod_Sensor");
2683 selected_volumes.push_back("LongeronCoolingTube");
2684 selected_volumes.push_back("InnerPixBarrelSupport_Stave");
2685 selected_volumes.push_back("InnerPixBarrelSupport_Stave1");
2686 selected_volumes.push_back("LongeronCornerBase");
2687 selected_volumes.push_back("LongeronCornerEnd");
2688 selected_volumes.push_back("LongeronTrussWall");
2689 selected_volumes.push_back("LongeronCapBase");
2690 selected_volumes.push_back("LongeronTopCap");
2691
2692 } else {
2693 selected_volumes.push_back("BRLSensorSS");
2694 selected_volumes.push_back("BRLSensorMS");
2695 selected_volumes.push_back("B_HybridPCB");
2696 selected_volumes.push_back("DCDC_PCB");
2697 selected_volumes.push_back("DCDC_Box");
2698 selected_volumes.push_back("Bex_HybridPCB_near");
2699 selected_volumes.push_back("Bex_HybridPCB_far");
2700 }
2701 }
2702 if (ecA or ecC) {
2703 if (isPixel) {
2704 selected_volumes.push_back("InclinedQuadMod_Sensor");
2705 selected_volumes.push_back("InnerRingSingleMod_Sensor");
2706 selected_volumes.push_back("InnerEndcapQuadMod_Sensor");
2707 selected_volumes.push_back("OuterEndcapQuadMod_Sensor");
2708 selected_volumes.push_back("L2HalfRingCoolingPipe");
2709 selected_volumes.push_back("L3HalfRingCoolingPipe");
2710 selected_volumes.push_back("L4endcapcoolingpipe");
2711 selected_volumes.push_back("InclL2HalfShell");
2712 selected_volumes.push_back("InclL2Support");
2713 selected_volumes.push_back("InclL3HalfShell");
2714 selected_volumes.push_back("InclL3Support");
2715 selected_volumes.push_back("InclL4HalfShell");
2716 selected_volumes.push_back("InclL4Support");
2717 selected_volumes.push_back("InnerPixEndcap_CoupledRingSupport");
2718 selected_volumes.push_back("InnerPixEndcap_IntermediateRingSupport");
2719 selected_volumes.push_back("InnerPixEndcap_L1RingSupport");
2720 selected_volumes.push_back("L2HalfRingCarbonFoamInner");
2721 selected_volumes.push_back("L2HalfRingCarbonFoamOuter");
2722 selected_volumes.push_back("L2HalfRingFaceSheet");
2723 selected_volumes.push_back("L3HalfRingCarbonFoamInner");
2724 selected_volumes.push_back("L3HalfRingCarbonFoamOuter");
2725 selected_volumes.push_back("L3HalfRingFaceSheet");
2726 selected_volumes.push_back("L4endcapinnerCarbonFoam");
2727 selected_volumes.push_back("L4endcapouterCarbonFoam");
2728 selected_volumes.push_back("L4endcapFaceSheet");
2729 selected_volumes.push_back("L2HalfShell");
2730 selected_volumes.push_back("L3HalfShell");
2731 selected_volumes.push_back("L4HalfShell");
2732 } else {
2733 selected_volumes.push_back("ECSensor0");
2734 selected_volumes.push_back("ECSensor1");
2735 selected_volumes.push_back("ECSensor2");
2736 selected_volumes.push_back("ECSensor3");
2737 selected_volumes.push_back("ECSensor4");
2738 selected_volumes.push_back("ECSensor5");
2739 selected_volumes.push_back("ECSensorBack0");
2740 selected_volumes.push_back("ECSensorBack1");
2741 selected_volumes.push_back("ECSensorBack2");
2742 selected_volumes.push_back("ECSensorBack3");
2743 selected_volumes.push_back("ECSensorBack4");
2744 selected_volumes.push_back("ECSensorBack5");
2745 }
2746 }
2747
2748 std::string name = h->getName().toStdString();
2749
2750 if (not isPixel and (ecA or ecC)) {
2751 // check servises in the endcap
2752 if (name.starts_with("ECHybrid") or name.starts_with("DCDC_EC"))
2753 return;
2754 }
2755
2756 if (std::find(selected_volumes.begin(), selected_volumes.end(), name) == selected_volumes.end()) {
2757 h->setState(VP1GeoFlags::ZAPPED);
2758 return;
2759 }
2760 return;
2761 } else if (not isPixel and (h->getName().toStdString()=="PetalCore" or
2762 h->getName().toStdString()=="StaveCoreSS" or
2763 h->getName().toStdString() =="StaveCoreMS")) {
2764 return;
2765 }
2766 h->initialiseChildren();
2767
2768 h->setState(VP1GeoFlags::EXPANDED);
2769 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2770 for (;it!=itE;++it) {
2771 expandAllChildren(*it, isPixel, brl, ecA, ecC);
2772 }
2773}
void expandAllChildren(VolumeHandle *, bool isPixel, bool brl, bool ecA, bool ecC)
static void decodeTransformation(const SbMatrix &, float &translation_x, float &translation_y, float &translation_z, float &rotaxis_x, float &rotaxis_y, float &rotaxis_z, float &rotangle_radians)

◆ expandVisibleVolumesRecursively()

void VP1GeometrySystem::Imp::expandVisibleVolumesRecursively ( VolumeHandle * handle,
const QRegExp & selregexp,
bool bymatname )

Definition at line 2111 of file VP1GeometrySystem.cxx.

2112{
2113 if (handle->state()==VP1GeoFlags::ZAPPED)
2114 return;
2115 if (handle->state()==VP1GeoFlags::CONTRACTED) {
2116 //See if we match (and have children) - if so, update state.
2117 if (handle->nChildren()>0
2118 && selregexp.exactMatch(bymatname?QString(handle->geoMaterial()->getName().c_str()):handle->getName())) {
2119 handle->setState(VP1GeoFlags::EXPANDED);
2120 }
2121 return;
2122 }
2123 //Must be expanded: Let us call on any (initialised) children instead.
2124 if (handle->nChildren()==0||!handle->childrenAreInitialised())
2125 return;
2126 VolumeHandle::VolumeHandleListItr it(handle->childrenBegin()), itE(handle->childrenEnd());
2127 for(;it!=itE;++it)
2128 expandVisibleVolumesRecursively(*it,selregexp,bymatname);
2129}
void expandVisibleVolumesRecursively(VolumeHandle *, const QRegExp &, bool bymatname)

◆ getClosestCSCOrTGCEdgeDirections()

std::pair< SbVec3f, SbVec3f > VP1GeometrySystem::Imp::getClosestCSCOrTGCEdgeDirections ( const SbVec3f & cameraDirection,
VolumeHandle * chamberhandle )

Definition at line 1973 of file VP1GeometrySystem.cxx.

1975{
1976 // It turns out that the correct chamber directions for CSC/TGC chambers is the y and z axes.
1977 std::vector<SbVec3f> directions;
1978 directions.push_back(SbVec3f(0.0f,1.0f,0.0f));
1979 directions.push_back(SbVec3f(0.0f,-1.0f,0.0f));
1980 directions.push_back(SbVec3f(0.0f,0.0f,1.0f));
1981 directions.push_back(SbVec3f(0.0f,0.0f,-1.0f));
1982
1983 directions.push_back(SbVec3f(1.0f,0.0f,0.0f));
1984 directions.push_back(SbVec3f(-1.0f,0.0f,0.0f));
1985
1986 //Get local->global transformation for chamber:
1987 SbVec3f translation, scale;
1988 SbRotation rotation, scalerotation;
1989 chamberhandle->getGlobalTransformToVolume().getTransform(translation,rotation,scale,scalerotation);
1990
1991 //Put directions into global coordinates:
1992 for (unsigned i = 0; i<directions.size();++i)
1993 rotation.multVec(directions[i],directions[i]);
1994
1995 //Find the one closest to the camera:
1996 SbVec3f chamberDir(-cameraDirection);
1997 float smallestcosangle(1.1);
1998 for (unsigned i = 0; i<directions.size();++i) {
1999 if (directions.at(i).dot(cameraDirection)<smallestcosangle) {
2000 smallestcosangle = directions.at(i).dot(cameraDirection);
2001 chamberDir = directions.at(i);
2002 }
2003 }
2004
2005 //cameraUpDirection should always (0,1,0) transformed to global
2006 //coordinates:
2007 SbVec3f chamberUp;
2008 float x,y,z;
2009 chamberDir.getValue(x,y,z);
2010 if (x!=0.0f) {
2011 rotation.multVec(SbVec3f(0.0f,1.0f,0.0f),chamberUp);
2012 } else {
2013 rotation.multVec(SbVec3f(1.0f,0.0f,0.0f),chamberUp);
2014 }
2015
2016 //Done:
2017 return std::pair<SbVec3f,SbVec3f>(chamberDir,chamberUp);
2018}
#define y
#define x
#define z
const SbMatrix & getGlobalTransformToVolume() const

◆ getClosestMuonDriftTubeDirections()

std::pair< SbVec3f, SbVec3f > VP1GeometrySystem::Imp::getClosestMuonDriftTubeDirections ( const SbVec3f & cameraDirection,
const SbVec3f & cameraUpDirection,
VolumeHandle * chamberhandle )

Definition at line 1922 of file VP1GeometrySystem.cxx.

1925{
1926 //We assume chamberhandle is to an MDT station (barrel or endcap).
1927 SbVec3f closesttubedir(cameraDirection);
1928 SbVec3f closesttubeupvec(cameraUpDirection);
1929 float smallestcosangle(1.1);
1930
1931 //Barrel/Endcap MDT. Expand two levels and then check the individual tubes.
1932 chamberhandle->initialiseChildren();
1933 VolumeHandle::VolumeHandleListItr itch(chamberhandle->childrenBegin()), itchE(chamberhandle->childrenEnd());
1934 for (;itch!=itchE;++itch) {
1935 //Any daughter with the name "Ded..." should be ignored
1936 std::string name1 = (*itch)->getNameStdString();
1937 if (name1.size()>2&&name1[0]=='D'&&name1[1]=='e'&&name1[2]=='d')
1938 continue;
1939
1940 (*itch)->initialiseChildren();
1941 VolumeHandle::VolumeHandleListItr itch2((*itch)->childrenBegin()), itch2E((*itch)->childrenEnd());
1942 //Various variables needed to deal with each tube:
1943 const SbVec3f unitz(0.0f,0.0f,1.0f);
1944 const SbVec3f unity(0.0f,1.0f,0.0f);
1945 SbVec3f tubeglob;
1946 SbVec3f translation, scale;
1947 SbRotation rotation, scalerotation;
1948
1949 for (;itch2!=itch2E;++itch2) {
1950 if ((*itch2)->getNameStdString()=="MDTDriftWall") {
1951 //OK, we got the handle of a tube (wall). Lets find its direction!
1952 //->We assume that the tube, in its local coordinate system, is aligned with the z axis.
1953 //Get global rotation of tube:
1954 (*itch2)->getGlobalTransformToVolume().getTransform(translation,rotation,scale,scalerotation);
1955 rotation.multVec (unitz, tubeglob);
1956 if (tubeglob.dot(cameraDirection)<smallestcosangle) {
1957 smallestcosangle = tubeglob.dot(cameraDirection);
1958 closesttubedir = tubeglob;
1959 rotation.multVec(unity, closesttubeupvec);
1960 }
1961 if (tubeglob.dot(-cameraDirection)<smallestcosangle) {
1962 smallestcosangle = tubeglob.dot(-cameraDirection);
1963 closesttubedir = -tubeglob;
1964 rotation.multVec(unity, closesttubeupvec);
1965 }
1966 }
1967 }
1968 }
1969 return std::pair<SbVec3f,SbVec3f>(closesttubedir,closesttubeupvec);
1970}
void initialiseChildren()
VolumeHandleListItr childrenBegin()
VolumeHandleListItr childrenEnd()

◆ iconifyVisibleVolumesRecursively()

void VP1GeometrySystem::Imp::iconifyVisibleVolumesRecursively ( VolumeHandle * handle,
const QRegExp & selregexp,
bool bymatname )

Definition at line 2132 of file VP1GeometrySystem.cxx.

2133{
2134 if (handle->state()==VP1GeoFlags::ZAPPED)
2135 return;
2136
2137 if (handle->state()==VP1GeoFlags::CONTRACTED) {
2138 //See if we match -- if so, update state.
2139 if( selregexp.exactMatch(bymatname?QString(handle->geoMaterial()->getName().c_str()):handle->getName())) {
2140 handle->setState(VP1GeoFlags::ZAPPED);
2141 }
2142 return;
2143 }
2144 //Must be expanded: Let us call on any (initialised) children instead.
2145 if (handle->nChildren()==0||!handle->childrenAreInitialised())
2146 return;
2147 VolumeHandle::VolumeHandleListItr it(handle->childrenBegin()), itE(handle->childrenEnd());
2148 for(;it!=itE;++it)
2149 iconifyVisibleVolumesRecursively(*it,selregexp,bymatname);
2150}
void iconifyVisibleVolumesRecursively(VolumeHandle *, const QRegExp &, bool bymatname)

◆ inclusiveMass()

double VP1GeometrySystem::Imp::inclusiveMass ( const PVConstLink & pv)
static

Definition at line 1288 of file VP1GeometrySystem.cxx.

1288 {
1289
1290 const GeoLogVol* lv = pv->getLogVol();
1291 const GeoMaterial *material = lv->getMaterial();
1292 double density = material->getDensity();
1293
1294 double mass = exclusiveMass(pv);
1295
1296 GeoVolumeCursor av(pv);
1297 while (!av.atEnd()) {
1298 mass += inclusiveMass(av.getVolume());
1299 mass -= volume(av.getVolume())*density;
1300 av.next();
1301 }
1302
1303 return mass;
1304}
static double inclusiveMass(const PVConstLink &pv)
static double exclusiveMass(const PVConstLink &pv)

◆ selectITkComponent()

bool VP1GeometrySystem::Imp::selectITkComponent ( VolumeHandle * h,
bool isPixel,
bool pixelModules,
bool pixelServices,
bool pixelSupports,
bool stripSensors,
bool stripElectronics,
bool stripServices,
bool stripSupports,
unsigned inheritedCategory = 0 )

Definition at line 2827 of file VP1GeometrySystem.cxx.

2828{
2829 // Classify both logical volumes and named XML assembly placements.
2830 // Bits: Pixel modules/services/supports; Strip sensors/electronics/services/supports.
2831 unsigned category = 0;
2832 const QString names[] = {h->getName(), h->getNameTag()};
2833 for (const QString& name : names) {
2834 if (isPixel) {
2835 if (name.endsWith("_Sensor") || name.endsWith("_Chip") || name.endsWith("_Bonding") || name.endsWith("_DeadVolume"))
2836 category |= 1;
2837 if (name.contains("Svc") || name.contains("Service") || name.contains("Cooling") || name.contains("Pigtail") || name.contains("Flex") || name.contains("BusTape") || name.endsWith("_Cell") || name.startsWith("Pixel__ModuleSvc"))
2838 category |= 2;
2839 if (name.contains("Support") || name.contains("HalfShell") || name.contains("HalfRing") || name.contains("CarbonFoam") || name.contains("FaceSheet") || name.contains("Longeron") || name.contains("QuarterShell") || name.contains("Stave") || itkNameIsOneOf(name, {"IPTvol", "ISTvol", "FrontSupportFacing", "FrontSupportCore", "RearSupport"}))
2840 category |= 4;
2841 } else {
2842 if (name.startsWith("BRLSensor") || name.startsWith("ECSensor"))
2843 category |= 1;
2844 if (name.contains("Hybrid") || name.contains("DCDC") || name.contains("Bus") || itkNameIsOneOf(name, {"StaveSignalSS", "StaveGround"}))
2845 category |= 2;
2846 if (name.startsWith("SV") || name.contains("Service"))
2847 category |= 4;
2848 if (name.contains("Support") || name.contains("Stave") || name.contains("Petal") || name.contains("Core") || name.contains("Flange") || name.contains("Interlink") || name.contains("Wheel") || name.contains("Shell") || name.contains("Brace") || name.contains("Tube") || name.contains("Cyl") || name.contains("Hat") || name.contains("Bulkhead") || name.contains("Rail") || name.contains("Blade") || name.contains("Lock") || name.contains("Mount") || name.contains("Face") || name.contains("EOS") || itkNameStartsWithOneOf(name, {"StripB_", "OC", "EC_", "Ztube", "StiffDisc"}))
2849 category |= 8;
2850 }
2851
2852 }
2853 // Specific sensor/electronics categories take precedence over broad supports.
2854 if (isPixel) {
2855 if (category & 1) category = 1;
2856 else if (category & 2) category = 2;
2857 } else {
2858 if (category & 1) category = 1;
2859 else if (category & 2) category = 2;
2860 else if (category & 4) category = 4;
2861 }
2862 if (!category)
2863 category = inheritedCategory;
2864 const unsigned selected = isPixel
2865 ? (pixelModules ? 1u : 0u) | (pixelServices ? 2u : 0u) | (pixelSupports ? 4u : 0u)
2866 : (stripSensors ? 1u : 0u) | (stripElectronics ? 2u : 0u) |
2867 (stripServices ? 4u : 0u) | (stripSupports ? 8u : 0u);
2868
2869 // Hide the old representation before assigning child states bottom-up.
2870 h->setState(VP1GeoFlags::ZAPPED, false);
2871 if (h->nChildren() && !h->childrenAreInitialised())
2872 h->initialiseChildren();
2873 bool showChildren = false;
2874 for (auto it=h->childrenBegin(); it!=h->childrenEnd(); ++it) {
2875 if (selectITkComponent(*it, isPixel, pixelModules, pixelServices, pixelSupports,
2876 stripSensors, stripElectronics, stripServices, stripSupports, category))
2877 showChildren = true;
2878 }
2879 const bool showThis = !h->isEther() && (category & selected);
2880 h->setState(showChildren ? VP1GeoFlags::EXPANDED :
2881 showThis ? VP1GeoFlags::CONTRACTED : VP1GeoFlags::ZAPPED, false);
2882 return showChildren || showThis;
2883}
for(size_t i=0;i< m_blockFillers.size();i++)
Fill one block.
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ showITkPixelModules()

void VP1GeometrySystem::Imp::showITkPixelModules ( VolumeHandle * h,
bool brl,
bool ecA,
bool ecC )

Definition at line 2775 of file VP1GeometrySystem.cxx.

2776{
2777 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showITkPixelModules()");
2778 h->initialiseChildren();
2779 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2780 // std::cout << "Processing volume with name = " << h->getName().toStdString() << " and " << h->nChildren() << " children..." << std::endl;
2781 for (;it!=itE;++it) {
2782 expandAllChildren(*it, true, brl, ecA, ecC);
2783 }
2784}

◆ showITkStripModules()

void VP1GeometrySystem::Imp::showITkStripModules ( VolumeHandle * h,
bool brl,
bool ecA,
bool ecC )

Definition at line 2787 of file VP1GeometrySystem.cxx.

2788{
2789 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showITkStripModules()");
2790 h->initialiseChildren();
2791 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2792 // std::cout << "Processing volume with name = " << h->getName().toStdString() << " and " << h->nChildren() << " children..." << std::endl;
2793 for (;it!=itE;++it) {
2794 if (brl and (*it)->hasName("ITkStrip_Barrel")) {
2795 expandAllChildren(*it, false, brl, ecA, ecC);
2796 }
2797 else if (ecA and (*it)->hasName("ITkStrip_ForwardPlus")) {
2798 expandAllChildren(*it, false, brl, ecA, ecC);
2799 }
2800 else if (ecC and (*it)->hasName("ITkStrip_ForwardMinus")) {
2801 expandAllChildren(*it, false, brl, ecA, ecC);
2802 } else
2803 (*it)->setState(VP1GeoFlags::ZAPPED);
2804 }
2805}

◆ showPixelModules()

void VP1GeometrySystem::Imp::showPixelModules ( VolumeHandle * h)

Definition at line 2627 of file VP1GeometrySystem.cxx.

2628{
2629 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showPixelModules()");
2630 h->initialiseChildren();
2631 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2632 for (;it!=itE;++it) {
2633 if ((*it)->hasName("moduleLog")) {
2634 (*it)->setState(VP1GeoFlags::ZAPPED);
2635 (*it)->contractDaughtersRecursively();
2636 (*it)->initialiseChildren();
2637 VolumeHandle::VolumeHandleListItr itMod((*it)->childrenBegin()),itModE((*it)->childrenEnd());
2638 for (;itMod!=itModE;++itMod) {
2639 if ((*itMod)->getName().startsWith("si"))
2640 (*itMod)->setState(VP1GeoFlags::CONTRACTED);
2641 else
2642 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2643 }
2644 (*it)->setState(VP1GeoFlags::EXPANDED);
2645 continue;
2646 }
2647 if ((*it)->hasName("pigtailLog")||(*it)->hasName("omegaLog")) {
2648 (*it)->setState(VP1GeoFlags::ZAPPED);
2649 (*it)->contractDaughtersRecursively();
2650 continue;
2651 }
2652 if ((*it)->nChildren()<1) {
2653 (*it)->setState(VP1GeoFlags::ZAPPED);
2654 continue;
2655 }
2656 (*it)->setState(VP1GeoFlags::ZAPPED);
2657 showPixelModules(*it);
2658 (*it)->setState(VP1GeoFlags::EXPANDED);
2659 }
2660}
void showPixelModules(VolumeHandle *)

◆ showSCTBarrelModules()

void VP1GeometrySystem::Imp::showSCTBarrelModules ( VolumeHandle * h)

Definition at line 2886 of file VP1GeometrySystem.cxx.

2887{
2888 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showSCTBarrelModules()");
2889 h->initialiseChildren();
2890 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2891 for (;it!=itE;++it) {
2892 if ((*it)->getName().startsWith("Layer")) {
2893 (*it)->setState(VP1GeoFlags::ZAPPED);
2894 (*it)->initialiseChildren();
2895 VolumeHandle::VolumeHandleListItr itLay((*it)->childrenBegin()),itLayE((*it)->childrenEnd());
2896 for (;itLay!=itLayE;++itLay) {
2897 if ((*itLay)->getName().endsWith("Active")&&(*itLay)->getName().startsWith("Layer")) {
2898 (*itLay)->setState(VP1GeoFlags::ZAPPED);
2899 (*itLay)->initialiseChildren();
2900 VolumeHandle::VolumeHandleListItr itActLay((*itLay)->childrenBegin()),itActLayE((*itLay)->childrenEnd());
2901 for (;itActLay!=itActLayE;++itActLay) {
2902 if ((*itActLay)->getName().startsWith("Ski")) {
2903 (*itActLay)->setState(VP1GeoFlags::ZAPPED);
2904 (*itActLay)->initialiseChildren();
2905 VolumeHandle::VolumeHandleListItr itSki((*itActLay)->childrenBegin()),itSkiE((*itActLay)->childrenEnd());
2906 for (;itSki!=itSkiE;++itSki) {
2907 //Ends with "Envelope": open, otherwise zap. Of those, zap all without "Sensor" in the name.
2908 if ((*itSki)->hasName("Module")) {
2909 //Open and zap those without "Sensor" in the name:
2910 (*itSki)->setState(VP1GeoFlags::ZAPPED);
2911 (*itSki)->initialiseChildren();
2912 VolumeHandle::VolumeHandleListItr itMod((*itSki)->childrenBegin()),itModE((*itSki)->childrenEnd());
2913 for (;itMod!=itModE;++itMod) {
2914 if ((*itMod)->getName().contains("Envelope")) {
2915 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2916 (*itMod)->initialiseChildren();
2917 VolumeHandle::VolumeHandleListItr itEnv((*itMod)->childrenBegin()),itEnvE((*itMod)->childrenEnd());
2918 for(;itEnv!=itEnvE;++itEnv) {
2919 if ((*itEnv)->getName().contains("Sensor"))
2920 (*itEnv)->reset();
2921 else
2922 (*itEnv)->setState(VP1GeoFlags::ZAPPED);
2923 }
2924 (*itMod)->setState(VP1GeoFlags::EXPANDED);
2925 } else {
2926 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2927 }
2928 }
2929 (*itSki)->setState(VP1GeoFlags::EXPANDED);
2930 } else {
2931 (*itSki)->setState(VP1GeoFlags::ZAPPED);
2932 }//end if-elsi "Envelope"
2933 }//endfor itSki
2934 (*itActLay)->setState(VP1GeoFlags::EXPANDED);
2935 } else {
2936 (*itActLay)->setState(VP1GeoFlags::ZAPPED);
2937 }//end if-else "Ski"
2938 }
2939 (*itLay)->setState(VP1GeoFlags::EXPANDED);
2940 } else {
2941 (*itLay)->setState(VP1GeoFlags::ZAPPED);
2942 (*itLay)->contractDaughtersRecursively();
2943 }
2944 }
2945 (*it)->setState(VP1GeoFlags::EXPANDED);
2946 } else {
2947 (*it)->setState(VP1GeoFlags::ZAPPED);
2948 (*it)->contractDaughtersRecursively();
2949 }
2950 }
2951}

◆ showSCTEndcapModules()

void VP1GeometrySystem::Imp::showSCTEndcapModules ( VolumeHandle * h)

Definition at line 2954 of file VP1GeometrySystem.cxx.

2955{
2956 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showSCTEndcapModules()");
2957 h->initialiseChildren();
2958 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2959 for (;it!=itE;++it) {
2960 if ((*it)->getName().startsWith("Wheel")) {
2961 (*it)->setState(VP1GeoFlags::ZAPPED);
2962 (*it)->initialiseChildren();
2963 VolumeHandle::VolumeHandleListItr itWhl((*it)->childrenBegin()),itWhlE((*it)->childrenEnd());
2964 for (;itWhl!=itWhlE;++itWhl) {
2965 if ((*itWhl)->getName().startsWith("Ring")) {
2966 (*itWhl)->setState(VP1GeoFlags::ZAPPED);
2967 (*itWhl)->initialiseChildren();
2968 VolumeHandle::VolumeHandleListItr itRng((*itWhl)->childrenBegin()),itRngE((*itWhl)->childrenEnd());
2969 for (;itRng!=itRngE;++itRng) {
2970 if ((*itRng)->getName().startsWith("FwdModule")) {
2971 (*itRng)->setState(VP1GeoFlags::ZAPPED);
2972 (*itRng)->initialiseChildren();
2973 VolumeHandle::VolumeHandleListItr itMod((*itRng)->childrenBegin()),itModE((*itRng)->childrenEnd());
2974 for(;itMod!=itModE;++itMod) {
2975 if ((*itMod)->getName().startsWith("ECSensor")) {
2976 (*itMod)->reset();
2977 } else {
2978 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2979 }
2980 }
2981 (*itRng)->setState(VP1GeoFlags::EXPANDED);
2982 } else {
2983 (*itRng)->setState(VP1GeoFlags::ZAPPED);
2984 }
2985 }
2986 (*itWhl)->setState(VP1GeoFlags::EXPANDED);
2987 } else {
2988 (*itWhl)->setState(VP1GeoFlags::ZAPPED);
2989 (*itWhl)->contractDaughtersRecursively();
2990 }
2991 }
2992 (*it)->setState(VP1GeoFlags::EXPANDED);
2993 } else {
2994 (*it)->setState(VP1GeoFlags::ZAPPED);
2995 (*it)->contractDaughtersRecursively();
2996 }
2997 }
2998}

◆ stationInfo()

QStringList VP1GeometrySystem::Imp::stationInfo ( const MuonGM::MuonStation * station)

Definition at line 2249 of file VP1GeometrySystem.cxx.

2250{
2251 QStringList l;
2252 if (!station) {
2253 l <<"Null ptr!";
2254 return l;
2255 }
2256 l << "Name: "+str(station->getStationName().c_str());
2257 l << "(Eta,Phi) index: ("+str(station->getEtaIndex())+", "+str(station->getPhiIndex())+")";
2258 return l;
2259}
int getEtaIndex() const
a la AMDB
int getPhiIndex() const
a la AMDB
const std::string & getStationName() const
like BMS5, T1F1, CSL1
l
Printing final latex table to .tex output file.

◆ updatePV2MuonStationMap()

void VP1GeometrySystem::Imp::updatePV2MuonStationMap ( const MuonGM::MuonReadoutElement * elem)

Definition at line 2191 of file VP1GeometrySystem.cxx.

2192{
2193 if (!elem)
2194 return;
2195 GeoPVConstLink pvlink = elem->getMaterialGeom()->getParent();
2196 const MuonGM::MuonStation * station = elem->parentMuonStation();
2197 if (!station) {
2198 theclass->message("WARNING: Ignored null station pointer");
2199 return;
2200 }
2201 pv2MuonStation[pvlink] = station;
2202}

◆ updateTouchedMuonChamber()

void VP1GeometrySystem::Imp::updateTouchedMuonChamber ( VolumeHandle * chamberhandle)

Definition at line 1637 of file VP1GeometrySystem.cxx.

1638{
1639 std::string stationname = chamberhandle->getNameStdString();
1640 if (stationname.empty()) {
1641 theclass->message("Warning: Asked to handle muon chamber (station) with empty name!");
1642 return;
1643 }
1644 //NB: For efficiency we make sure that mothers are ZAPPED while
1645 //changing state of their children.
1646
1647 //options:
1648
1649 VP1GeoFlags::MuonChamberAdaptionStyleFlags f(controller->muonChamberAdaptionStyle());
1650 bool option_openmdtchambers = f & VP1GeoFlags::OpenMDTChambers;
1651 bool option_hidetubes = f & VP1GeoFlags::HideMDTTubes;
1652 bool option_hiderpcvolumes = f & VP1GeoFlags::HideRPCVolumes;
1653 bool option_opencscchambers = f & VP1GeoFlags::OpenCSCChambers;
1654 bool option_opentgcchambers = f & VP1GeoFlags::OpenTGCChambers;
1655
1656 char firstletter = stationname[0];
1657 std::string name1,name2;
1658 if (firstletter=='E' || firstletter =='B') {
1659 //Barrel/Endcap MDT.
1660 // If we are to open it, we expand two levels.
1661 // -> and possibly zap the tubes/rpc volumes also according to options.
1662 if (option_openmdtchambers) {
1663 chamberhandle->setState(VP1GeoFlags::ZAPPED);
1664 chamberhandle->contractDaughtersRecursively();
1665 chamberhandle->initialiseChildren();
1666 VolumeHandle::VolumeHandleListItr itch(chamberhandle->childrenBegin()), itchE(chamberhandle->childrenEnd());
1667 for (;itch!=itchE;++itch) {
1668 //Any daughter with the name "Ded..." should be zapped,
1669 //otherwise we loop over the children to zap tubes/rpc vols.
1670 (*itch)->setState(VP1GeoFlags::ZAPPED);
1671 name1 = (*itch)->getNameStdString();
1672 if (name1.size()>2&&name1[0]=='D'&&name1[1]=='e'&&name1[2]=='d')
1673 continue;
1674
1675 (*itch)->initialiseChildren();
1676 VolumeHandle::VolumeHandleListItr itch2((*itch)->childrenBegin()), itch2E((*itch)->childrenEnd());
1677 for (;itch2!=itch2E;++itch2) {
1678 //Any of these daughters with the name
1679 //"MDTDriftWall"/"Rpc..."/"RPC..."/"Ded..." should be
1680 //zapped (according to options). Others should be contracted.
1681 name2 = (*itch2)->getNameStdString();
1682 bool zap = false;
1683 if (option_hidetubes&&name2=="MDTDriftWall") {
1684 zap = true;
1685 } else if (name2.size()>2&&name2[0]=='R'&&((name2[1]=='p'&&name2[2]=='c')||(name2[1]=='P'&&name2[2]=='C'))) {
1686 zap = (option_hiderpcvolumes||name2!="Rpclayer");
1687 } else if (name2.size()>2&&name2[0]=='D'&&name2[1]=='e'&&name2[2]=='d') {
1688 zap = true;
1689 }
1690 (*itch2)->setState(zap?VP1GeoFlags::ZAPPED:VP1GeoFlags::CONTRACTED);
1691 }
1692 (*itch)->setState(VP1GeoFlags::EXPANDED);
1693 }
1694 chamberhandle->setState(VP1GeoFlags::EXPANDED);
1695 } else {
1696 chamberhandle->reset();
1697 }
1698 } else {
1699 if (firstletter=='C') {
1700 //CSC: We either contract completely or expand once + zap "CscArCO2" + zap spacers
1701 chamberhandle->setState(VP1GeoFlags::ZAPPED);
1702 chamberhandle->contractDaughtersRecursively();//To put into default state
1703 if (option_opencscchambers) {
1704 //We must zap spacers, and otherwise expand down three levels and zap all "CscArCO2":
1705 chamberhandle->initialiseChildren();
1706 VolumeHandle::VolumeHandleListItr itch(chamberhandle->childrenBegin()), itchE(chamberhandle->childrenEnd());
1707 for (;itch!=itchE;++itch) {
1708 if ((*itch)->hasName("CSCspacer")) {
1709 (*itch)->setState(VP1GeoFlags::ZAPPED);
1710 continue;
1711 }
1712 if ((*itch)->nChildren()<1)
1713 continue;
1714 (*itch)->initialiseChildren();
1715 VolumeHandle::VolumeHandleListItr itch2((*itch)->childrenBegin()), itch2E((*itch)->childrenEnd());
1716 for (;itch2!=itch2E;++itch2) {
1717 if ((*itch2)->nChildren()<1)
1718 continue;
1719 (*itch2)->initialiseChildren();
1720 VolumeHandle::VolumeHandleListItr itch3((*itch2)->childrenBegin()), itch3E((*itch2)->childrenEnd());
1721 for (;itch3!=itch3E;++itch3) {
1722 if ((*itch3)->getNameStdString()=="CscArCO2")
1723 (*itch3)->setState(VP1GeoFlags::ZAPPED);
1724 }
1725 (*itch2)->setState(VP1GeoFlags::EXPANDED);
1726 }
1727 (*itch)->setState(VP1GeoFlags::EXPANDED);
1728 }
1729 chamberhandle->setState(VP1GeoFlags::EXPANDED);
1730 } else {
1731 chamberhandle->setState(VP1GeoFlags::CONTRACTED);
1732 }
1733 } else {
1734 //TGC: If 'open' we expand two levels and zap all gas volumes.
1735 chamberhandle->setState(VP1GeoFlags::ZAPPED);
1736 chamberhandle->contractDaughtersRecursively();//To put into default state
1737 if (option_opentgcchambers) {
1738 //Expand once more and then zap daughters called "muo::TGCGas"
1739 chamberhandle->initialiseChildren();
1740 VolumeHandle::VolumeHandleListItr itch(chamberhandle->childrenBegin()), itchE(chamberhandle->childrenEnd());
1741 for (;itch!=itchE;++itch) {
1742 if ((*itch)->nChildren()<1)
1743 continue;
1744 (*itch)->initialiseChildren();
1745 VolumeHandle::VolumeHandleListItr itch2((*itch)->childrenBegin()), itch2E((*itch)->childrenEnd());
1746 for (;itch2!=itch2E;++itch2) {
1747 if ((*itch2)->getNameStdString()=="muo::TGCGas")
1748 (*itch2)->setState(VP1GeoFlags::ZAPPED);
1749 }
1750 (*itch)->setState(VP1GeoFlags::EXPANDED);
1751 }
1752 chamberhandle->setState(VP1GeoFlags::EXPANDED);
1753 } else {
1754 chamberhandle->setState(VP1GeoFlags::CONTRACTED);
1755 }
1756 }
1757 }
1758 chamberhandle->setMuonChamberDirty(false);
1759}
std::string getNameStdString() const
void contractDaughtersRecursively()
void setMuonChamberDirty(bool)

◆ volume()

double VP1GeometrySystem::Imp::volume ( const PVConstLink & pv)
static

Definition at line 1280 of file VP1GeometrySystem.cxx.

1280 {
1281 const GeoLogVol * lv = pv->getLogVol();
1282 const GeoShape *shape = lv->getShape();
1283 return shape->volume();
1284}

Member Data Documentation

◆ chamberT0s

QList<const std::map<GeoPVConstLink, float>*> VP1GeometrySystem::Imp::chamberT0s

Definition at line 302 of file VP1GeometrySystem.cxx.

◆ controller

GeoSysController* VP1GeometrySystem::Imp::controller

Definition at line 246 of file VP1GeometrySystem.cxx.

◆ detVisAttributes

DetVisAttributes* VP1GeometrySystem::Imp::detVisAttributes

Definition at line 235 of file VP1GeometrySystem.cxx.

◆ initialSubSystemsTurnedOn

VP1GeoFlags::SubSystemFlags VP1GeometrySystem::Imp::initialSubSystemsTurnedOn

Definition at line 244 of file VP1GeometrySystem.cxx.

◆ kbEvent

const SoKeyboardEvent* VP1GeometrySystem::Imp::kbEvent

Definition at line 257 of file VP1GeometrySystem.cxx.

◆ last_appropriatemdtprojections

int VP1GeometrySystem::Imp::last_appropriatemdtprojections

Definition at line 270 of file VP1GeometrySystem.cxx.

◆ m_textSep

SoSeparator* VP1GeometrySystem::Imp::m_textSep

Separator used to hold all visible labels.

Definition at line 276 of file VP1GeometrySystem.cxx.

◆ matVisAttributes

MatVisAttributes* VP1GeometrySystem::Imp::matVisAttributes

Definition at line 236 of file VP1GeometrySystem.cxx.

◆ muonchambers_pv2handles

std::map<PVConstLink,VolumeHandle*> VP1GeometrySystem::Imp::muonchambers_pv2handles

Definition at line 260 of file VP1GeometrySystem.cxx.

◆ phisectormanager

PhiSectorManager* VP1GeometrySystem::Imp::phisectormanager

Definition at line 247 of file VP1GeometrySystem.cxx.

◆ previousAlignedChamberHandle

VolumeHandle* VP1GeometrySystem::Imp::previousAlignedChamberHandle

Definition at line 267 of file VP1GeometrySystem.cxx.

◆ pv2MuonStation

std::map<GeoPVConstLink,const MuonGM::MuonStation*> VP1GeometrySystem::Imp::pv2MuonStation

Definition at line 279 of file VP1GeometrySystem.cxx.

◆ pv2MuonStationInit

bool VP1GeometrySystem::Imp::pv2MuonStationInit

Definition at line 280 of file VP1GeometrySystem.cxx.

◆ restoredTopvolstates

QMap<quint32,QByteArray> VP1GeometrySystem::Imp::restoredTopvolstates

Definition at line 294 of file VP1GeometrySystem.cxx.

◆ sceneroot

SoSeparator* VP1GeometrySystem::Imp::sceneroot

Definition at line 114 of file VP1GeometrySystem.cxx.

◆ sender2ChamberList

std::map<QObject*,std::set<GeoPVConstLink> > VP1GeometrySystem::Imp::sender2ChamberList

Definition at line 262 of file VP1GeometrySystem.cxx.

◆ sonodesep2volhandle

std::map<SoSeparator*,VolumeHandle*> VP1GeometrySystem::Imp::sonodesep2volhandle

Definition at line 116 of file VP1GeometrySystem.cxx.

◆ subsysInfoList

QList<SubSystemInfo*> VP1GeometrySystem::Imp::subsysInfoList

Definition at line 227 of file VP1GeometrySystem.cxx.

◆ theclass

VP1GeometrySystem* VP1GeometrySystem::Imp::theclass

Definition at line 113 of file VP1GeometrySystem.cxx.

◆ volumetreemodel

VolumeTreeModel* VP1GeometrySystem::Imp::volumetreemodel

Definition at line 248 of file VP1GeometrySystem.cxx.

◆ volVisAttributes

VolVisAttributes* VP1GeometrySystem::Imp::volVisAttributes

Definition at line 237 of file VP1GeometrySystem.cxx.


The documentation for this class was generated from the following file: