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)
SubSystemInfochamberPVToMuonSubSystemInfo (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)
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

VP1GeometrySystemtheclass
SoSeparator * sceneroot
std::map< SoSeparator *, VolumeHandle * > sonodesep2volhandle
QList< SubSystemInfo * > subsysInfoList
DetVisAttributesdetVisAttributes
MatVisAttributesmatVisAttributes
VolVisAttributesvolVisAttributes
VP1GeoFlags::SubSystemFlags initialSubSystemsTurnedOn
GeoSysControllercontroller
PhiSectorManagerphisectormanager
VolumeTreeModelvolumetreemodel
const SoKeyboardEvent * kbEvent
std::map< PVConstLink, VolumeHandle * > muonchambers_pv2handles
std::map< QObject *, std::set< GeoPVConstLink > > sender2ChamberList
VolumeHandlepreviousAlignedChamberHandle
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 95 of file VP1GeometrySystem.cxx.

Constructor & Destructor Documentation

◆ Imp()

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

Definition at line 97 of file VP1GeometrySystem.cxx.

98 : theclass(gs), sceneroot(0),
103 #ifndef BUILDVP1LIGHT
104 ,pv2MuonStationInit(false)
105 #endif
106 {
107 const unsigned n_chamber_t0_sources=2;
108 for (unsigned i=0;i<n_chamber_t0_sources;++i)
109 chamberT0s.append(0);
110 }
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 366 of file VP1GeometrySystem.cxx.

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

◆ applyTopVolStates()

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

Definition at line 1391 of file VP1GeometrySystem.cxx.

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

◆ buildSystem()

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

Definition at line 1103 of file VP1GeometrySystem.cxx.

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

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

◆ chamberPVToMuonSubSystemInfo()

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

Definition at line 1757 of file VP1GeometrySystem.cxx.

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

◆ changeStateOfVisibleNonStandardVolumesRecursively()

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

Definition at line 2016 of file VP1GeometrySystem.cxx.

2017{
2018 assert(target!=VP1GeoFlags::CONTRACTED);
2019 if (handle->isAttached()) {
2020 //The volume is visible, so ignore daughters
2021 if (handle->isInitialisedAndHasNonStandardShape()) {
2022 if (target!=VP1GeoFlags::EXPANDED||handle->nChildren()>0)
2023 handle->setState(target);
2024 }
2025 return;
2026 } else if (handle->state()==VP1GeoFlags::ZAPPED)
2027 return;
2028 //Must be expanded: Let us call on any (initialised) children instead.
2029 if (handle->nChildren()==0||!handle->childrenAreInitialised())
2030 return;
2031 VolumeHandle::VolumeHandleListItr it(handle->childrenBegin()), itE(handle->childrenEnd());
2032 for(;it!=itE;++it)
2034
2035}
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 1411 of file VP1GeometrySystem.cxx.

1412{
1413 switch(volhandle->subsystem()){
1414 case VP1GeoFlags::Pixel: {
1415 prefix = QString("Pixel::");
1416 entries.push("IDET::IDET");
1418 entries.push("ITkPixel::ITkPixel");
1419 else
1420 entries.push("Pixel::Pixel");
1421 return;
1422 }
1423 case VP1GeoFlags::SCT:{
1424 prefix = QString("SCT::");
1425 entries.push("IDET::IDET");
1427 entries.push("ITkStrip::ITkStrip");
1428 else
1429 entries.push("SCT::SCT");
1430 return;
1431 }
1432 case VP1GeoFlags::HGTD: {
1433 prefix = QString("HGTD::");
1434 entries.push("IDET::IDET");
1435 entries.push("HGTD::HGTD");
1436 return;
1437 }
1438 case VP1GeoFlags::TRT:{
1439 prefix = QString("TRT::");
1440 entries.push("IDET::IDET");
1441 entries.push("TRT::TRT");
1442 return;
1443 }
1445 prefix = QString("InDetServMat::");
1446 entries.push("IDET::IDET");
1447 return;
1448 }
1449 case VP1GeoFlags::LAr:{
1450 prefix = QString("LArMgr::");
1451 entries.push("CALO::CALO");
1452 entries.push("LArMgr::LArMgr");
1453 return;
1454 }
1455 case VP1GeoFlags::Tile:{
1456 prefix = QString("Tile::");
1457 entries.push("CALO::CALO");
1458 entries.push("Tile::Tile");
1459 return;
1460 }
1474 prefix = QString("Muon::");
1475 entries.push("MUONQ02::MUONQ02");
1476 entries.push("Muon::MuonSys");
1477 return;
1478 }
1480 prefix = QString("BeamPipe::");
1481 entries.push("BeamPipe::BeamPipe");
1482 return;
1483 }
1484 case VP1GeoFlags::None:
1486 case VP1GeoFlags::LUCID:
1487 case VP1GeoFlags::ZDC:
1488 case VP1GeoFlags::ALFA:
1489 case VP1GeoFlags::AFP:
1492 default:{
1493 return;
1494 }
1495 }
1496}
@ 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 2200 of file VP1GeometrySystem.cxx.

2201{
2202 if (pv2MuonStationInit) {
2203 VP1Msg::messageDebug("MuonStation map already initialized.");
2204 return;
2205 }
2206 pv2MuonStationInit = true;
2207 theclass->messageVerbose("Initializing physical volume link -> MuonStation map.");
2208
2209 const MuonGM::MuonDetectorManager * mgr = VP1DetInfo::muonDetMgr();
2210 if (!mgr) {
2211 VP1Msg::message("WARNING: Could not get muon detector manager to construct volume -> muon station map!");
2212 return;
2213 }
2214 if (mgr->nMdtRE()) {
2215 for (auto det_el = mgr->mdtIdHelper()->detectorElement_begin();
2216 det_el != mgr->mdtIdHelper()->detectorElement_end(); ++det_el) {
2217 updatePV2MuonStationMap(mgr->getMdtReadoutElement(*det_el));
2218 }
2219 }
2220 if (mgr->nRpcRE()) {
2221 for (auto det_el = mgr->rpcIdHelper()->detectorElement_begin();
2222 det_el != mgr->rpcIdHelper()->detectorElement_end(); ++det_el) {
2223 updatePV2MuonStationMap(mgr->getRpcReadoutElement(*det_el));
2224 }
2225 }
2226 if (mgr->nCscRE()) {
2227 for (auto det_el = mgr->cscIdHelper()->detectorElement_begin();
2228 det_el != mgr->cscIdHelper()->detectorElement_end(); ++det_el) {
2229 updatePV2MuonStationMap(mgr->getCscReadoutElement(*det_el));
2230 }
2231 }
2232 if (mgr->nTgcRE()) {
2233 for (auto det_el = mgr->tgcIdHelper()->detectorElement_begin();
2234 det_el != mgr->tgcIdHelper()->detectorElement_end(); ++det_el) {
2235 updatePV2MuonStationMap(mgr->getTgcReadoutElement(*det_el));
2236 }
2237 }
2238
2239 VP1Msg::messageDebug("Initialised physical volume link -> MuonStation map. Found "+str(pv2MuonStation.size())+" stations.");
2240
2241}
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 237 of file VP1GeometrySystem.cxx.

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

◆ exclusiveMass()

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

Definition at line 1266 of file VP1GeometrySystem.cxx.

1266 {
1267 const GeoLogVol* lv = pv->getLogVol();
1268 const GeoMaterial *material = lv->getMaterial();
1269 double density = material->getDensity();
1270 return density*volume(pv);
1271}
static double volume(const PVConstLink &pv)

◆ expandAllChildren()

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

Definition at line 2604 of file VP1GeometrySystem.cxx.

2604 {
2605
2606 if (h->nChildren()==0) {
2607 if (isPixel and (ecA or ecC)) {
2608 float translation_x, translation_y, translation_z, rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians;
2609 VP1LinAlgUtils::decodeTransformation( h->getGlobalTransformToVolume(),
2610 translation_x, translation_y, translation_z,
2611 rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians );
2612 if ((!ecA || !ecC) && ((ecA and (translation_z<0.)) or (ecC and (translation_z>0.) ))) {
2613 h->setState(VP1GeoFlags::ZAPPED);
2614 return;
2615 }
2616 }
2617
2618 // check if you have to select it
2619 std::vector< std::string > selected_volumes = {};
2620 if (brl) {
2621 if (isPixel) {
2622 selected_volumes.push_back("InnerBarrelSingleMod_Sensor");
2623 selected_volumes.push_back("InnerBarrelQuadMod_Sensor");
2624 selected_volumes.push_back("OuterBarrelQuadMod_Sensor");
2625 selected_volumes.push_back("LongeronCoolingTube");
2626 selected_volumes.push_back("InnerPixBarrelSupport_Stave");
2627 selected_volumes.push_back("InnerPixBarrelSupport_Stave1");
2628 selected_volumes.push_back("LongeronCornerBase");
2629 selected_volumes.push_back("LongeronCornerEnd");
2630 selected_volumes.push_back("LongeronTrussWall");
2631 selected_volumes.push_back("LongeronCapBase");
2632 selected_volumes.push_back("LongeronTopCap");
2633
2634 } else {
2635 selected_volumes.push_back("BRLSensorSS");
2636 selected_volumes.push_back("BRLSensorMS");
2637 selected_volumes.push_back("B_HybridPCB");
2638 selected_volumes.push_back("DCDC_PCB");
2639 selected_volumes.push_back("DCDC_Box");
2640 selected_volumes.push_back("Bex_HybridPCB_near");
2641 selected_volumes.push_back("Bex_HybridPCB_far");
2642 }
2643 }
2644 if (ecA or ecC) {
2645 if (isPixel) {
2646 selected_volumes.push_back("InclinedQuadMod_Sensor");
2647 selected_volumes.push_back("InnerRingSingleMod_Sensor");
2648 selected_volumes.push_back("InnerEndcapQuadMod_Sensor");
2649 selected_volumes.push_back("OuterEndcapQuadMod_Sensor");
2650 selected_volumes.push_back("L2HalfRingCoolingPipe");
2651 selected_volumes.push_back("L3HalfRingCoolingPipe");
2652 selected_volumes.push_back("L4endcapcoolingpipe");
2653 selected_volumes.push_back("InclL2HalfShell");
2654 selected_volumes.push_back("InclL2Support");
2655 selected_volumes.push_back("InclL3HalfShell");
2656 selected_volumes.push_back("InclL3Support");
2657 selected_volumes.push_back("InclL4HalfShell");
2658 selected_volumes.push_back("InclL4Support");
2659 selected_volumes.push_back("InnerPixEndcap_CoupledRingSupport");
2660 selected_volumes.push_back("InnerPixEndcap_IntermediateRingSupport");
2661 selected_volumes.push_back("InnerPixEndcap_L1RingSupport");
2662 selected_volumes.push_back("L2HalfRingCarbonFoamInner");
2663 selected_volumes.push_back("L2HalfRingCarbonFoamOuter");
2664 selected_volumes.push_back("L2HalfRingFaceSheet");
2665 selected_volumes.push_back("L3HalfRingCarbonFoamInner");
2666 selected_volumes.push_back("L3HalfRingCarbonFoamOuter");
2667 selected_volumes.push_back("L3HalfRingFaceSheet");
2668 selected_volumes.push_back("L4endcapinnerCarbonFoam");
2669 selected_volumes.push_back("L4endcapouterCarbonFoam");
2670 selected_volumes.push_back("L4endcapFaceSheet");
2671 selected_volumes.push_back("L2HalfShell");
2672 selected_volumes.push_back("L3HalfShell");
2673 selected_volumes.push_back("L4HalfShell");
2674 } else {
2675 selected_volumes.push_back("ECSensor0");
2676 selected_volumes.push_back("ECSensor1");
2677 selected_volumes.push_back("ECSensor2");
2678 selected_volumes.push_back("ECSensor3");
2679 selected_volumes.push_back("ECSensor4");
2680 selected_volumes.push_back("ECSensor5");
2681 selected_volumes.push_back("ECSensorBack0");
2682 selected_volumes.push_back("ECSensorBack1");
2683 selected_volumes.push_back("ECSensorBack2");
2684 selected_volumes.push_back("ECSensorBack3");
2685 selected_volumes.push_back("ECSensorBack4");
2686 selected_volumes.push_back("ECSensorBack5");
2687 }
2688 }
2689
2690 std::string name = h->getName().toStdString();
2691
2692 if (not isPixel and (ecA or ecC)) {
2693 // check servises in the endcap
2694 if (name.starts_with("ECHybrid") or name.starts_with("DCDC_EC"))
2695 return;
2696 }
2697
2698 if (std::find(selected_volumes.begin(), selected_volumes.end(), name) == selected_volumes.end()) {
2699 h->setState(VP1GeoFlags::ZAPPED);
2700 return;
2701 }
2702 return;
2703 } else if (not isPixel and (h->getName().toStdString()=="PetalCore" or
2704 h->getName().toStdString()=="StaveCoreSS" or
2705 h->getName().toStdString() =="StaveCoreMS")) {
2706 return;
2707 }
2708 h->initialiseChildren();
2709
2710 h->setState(VP1GeoFlags::EXPANDED);
2711 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2712 for (;it!=itE;++it) {
2713 expandAllChildren(*it, isPixel, brl, ecA, ecC);
2714 }
2715}
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 2106 of file VP1GeometrySystem.cxx.

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

◆ getClosestCSCOrTGCEdgeDirections()

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

Definition at line 1968 of file VP1GeometrySystem.cxx.

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

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

◆ iconifyVisibleVolumesRecursively()

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

Definition at line 2127 of file VP1GeometrySystem.cxx.

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

◆ inclusiveMass()

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

Definition at line 1283 of file VP1GeometrySystem.cxx.

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

◆ showITkPixelModules()

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

Definition at line 2717 of file VP1GeometrySystem.cxx.

2718{
2719 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showITkPixelModules()");
2720 h->initialiseChildren();
2721 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2722 // std::cout << "Processing volume with name = " << h->getName().toStdString() << " and " << h->nChildren() << " children..." << std::endl;
2723 for (;it!=itE;++it) {
2724 expandAllChildren(*it, true, brl, ecA, ecC);
2725 }
2726}

◆ showITkStripModules()

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

Definition at line 2729 of file VP1GeometrySystem.cxx.

2730{
2731 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showITkStripModules()");
2732 h->initialiseChildren();
2733 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2734 // std::cout << "Processing volume with name = " << h->getName().toStdString() << " and " << h->nChildren() << " children..." << std::endl;
2735 for (;it!=itE;++it) {
2736 if (brl and (*it)->hasName("ITkStrip_Barrel")) {
2737 expandAllChildren(*it, false, brl, ecA, ecC);
2738 }
2739 else if (ecA and (*it)->hasName("ITkStrip_ForwardPlus")) {
2740 expandAllChildren(*it, false, brl, ecA, ecC);
2741 }
2742 else if (ecC and (*it)->hasName("ITkStrip_ForwardMinus")) {
2743 expandAllChildren(*it, false, brl, ecA, ecC);
2744 } else
2745 (*it)->setState(VP1GeoFlags::ZAPPED);
2746 }
2747}

◆ showPixelModules()

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

Definition at line 2569 of file VP1GeometrySystem.cxx.

2570{
2571 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showPixelModules()");
2572 h->initialiseChildren();
2573 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2574 for (;it!=itE;++it) {
2575 if ((*it)->hasName("moduleLog")) {
2576 (*it)->setState(VP1GeoFlags::ZAPPED);
2577 (*it)->contractDaughtersRecursively();
2578 (*it)->initialiseChildren();
2579 VolumeHandle::VolumeHandleListItr itMod((*it)->childrenBegin()),itModE((*it)->childrenEnd());
2580 for (;itMod!=itModE;++itMod) {
2581 if ((*itMod)->getName().startsWith("si"))
2582 (*itMod)->setState(VP1GeoFlags::CONTRACTED);
2583 else
2584 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2585 }
2586 (*it)->setState(VP1GeoFlags::EXPANDED);
2587 continue;
2588 }
2589 if ((*it)->hasName("pigtailLog")||(*it)->hasName("omegaLog")) {
2590 (*it)->setState(VP1GeoFlags::ZAPPED);
2591 (*it)->contractDaughtersRecursively();
2592 continue;
2593 }
2594 if ((*it)->nChildren()<1) {
2595 (*it)->setState(VP1GeoFlags::ZAPPED);
2596 continue;
2597 }
2598 (*it)->setState(VP1GeoFlags::ZAPPED);
2599 showPixelModules(*it);
2600 (*it)->setState(VP1GeoFlags::EXPANDED);
2601 }
2602}
void showPixelModules(VolumeHandle *)

◆ showSCTBarrelModules()

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

Definition at line 2750 of file VP1GeometrySystem.cxx.

2751{
2752 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showSCTBarrelModules()");
2753 h->initialiseChildren();
2754 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2755 for (;it!=itE;++it) {
2756 if ((*it)->getName().startsWith("Layer")) {
2757 (*it)->setState(VP1GeoFlags::ZAPPED);
2758 (*it)->initialiseChildren();
2759 VolumeHandle::VolumeHandleListItr itLay((*it)->childrenBegin()),itLayE((*it)->childrenEnd());
2760 for (;itLay!=itLayE;++itLay) {
2761 if ((*itLay)->getName().endsWith("Active")&&(*itLay)->getName().startsWith("Layer")) {
2762 (*itLay)->setState(VP1GeoFlags::ZAPPED);
2763 (*itLay)->initialiseChildren();
2764 VolumeHandle::VolumeHandleListItr itActLay((*itLay)->childrenBegin()),itActLayE((*itLay)->childrenEnd());
2765 for (;itActLay!=itActLayE;++itActLay) {
2766 if ((*itActLay)->getName().startsWith("Ski")) {
2767 (*itActLay)->setState(VP1GeoFlags::ZAPPED);
2768 (*itActLay)->initialiseChildren();
2769 VolumeHandle::VolumeHandleListItr itSki((*itActLay)->childrenBegin()),itSkiE((*itActLay)->childrenEnd());
2770 for (;itSki!=itSkiE;++itSki) {
2771 //Ends with "Envelope": open, otherwise zap. Of those, zap all without "Sensor" in the name.
2772 if ((*itSki)->hasName("Module")) {
2773 //Open and zap those without "Sensor" in the name:
2774 (*itSki)->setState(VP1GeoFlags::ZAPPED);
2775 (*itSki)->initialiseChildren();
2776 VolumeHandle::VolumeHandleListItr itMod((*itSki)->childrenBegin()),itModE((*itSki)->childrenEnd());
2777 for (;itMod!=itModE;++itMod) {
2778 if ((*itMod)->getName().contains("Envelope")) {
2779 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2780 (*itMod)->initialiseChildren();
2781 VolumeHandle::VolumeHandleListItr itEnv((*itMod)->childrenBegin()),itEnvE((*itMod)->childrenEnd());
2782 for(;itEnv!=itEnvE;++itEnv) {
2783 if ((*itEnv)->getName().contains("Sensor"))
2784 (*itEnv)->reset();
2785 else
2786 (*itEnv)->setState(VP1GeoFlags::ZAPPED);
2787 }
2788 (*itMod)->setState(VP1GeoFlags::EXPANDED);
2789 } else {
2790 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2791 }
2792 }
2793 (*itSki)->setState(VP1GeoFlags::EXPANDED);
2794 } else {
2795 (*itSki)->setState(VP1GeoFlags::ZAPPED);
2796 }//end if-elsi "Envelope"
2797 }//endfor itSki
2798 (*itActLay)->setState(VP1GeoFlags::EXPANDED);
2799 } else {
2800 (*itActLay)->setState(VP1GeoFlags::ZAPPED);
2801 }//end if-else "Ski"
2802 }
2803 (*itLay)->setState(VP1GeoFlags::EXPANDED);
2804 } else {
2805 (*itLay)->setState(VP1GeoFlags::ZAPPED);
2806 (*itLay)->contractDaughtersRecursively();
2807 }
2808 }
2809 (*it)->setState(VP1GeoFlags::EXPANDED);
2810 } else {
2811 (*it)->setState(VP1GeoFlags::ZAPPED);
2812 (*it)->contractDaughtersRecursively();
2813 }
2814 }
2815}

◆ showSCTEndcapModules()

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

Definition at line 2818 of file VP1GeometrySystem.cxx.

2819{
2820 VP1Msg::messageDebug("VP1GeometrySystem::Imp::showSCTEndcapModules()");
2821 h->initialiseChildren();
2822 VolumeHandle::VolumeHandleListItr it(h->childrenBegin()),itE(h->childrenEnd());
2823 for (;it!=itE;++it) {
2824 if ((*it)->getName().startsWith("Wheel")) {
2825 (*it)->setState(VP1GeoFlags::ZAPPED);
2826 (*it)->initialiseChildren();
2827 VolumeHandle::VolumeHandleListItr itWhl((*it)->childrenBegin()),itWhlE((*it)->childrenEnd());
2828 for (;itWhl!=itWhlE;++itWhl) {
2829 if ((*itWhl)->getName().startsWith("Ring")) {
2830 (*itWhl)->setState(VP1GeoFlags::ZAPPED);
2831 (*itWhl)->initialiseChildren();
2832 VolumeHandle::VolumeHandleListItr itRng((*itWhl)->childrenBegin()),itRngE((*itWhl)->childrenEnd());
2833 for (;itRng!=itRngE;++itRng) {
2834 if ((*itRng)->getName().startsWith("FwdModule")) {
2835 (*itRng)->setState(VP1GeoFlags::ZAPPED);
2836 (*itRng)->initialiseChildren();
2837 VolumeHandle::VolumeHandleListItr itMod((*itRng)->childrenBegin()),itModE((*itRng)->childrenEnd());
2838 for(;itMod!=itModE;++itMod) {
2839 if ((*itMod)->getName().startsWith("ECSensor")) {
2840 (*itMod)->reset();
2841 } else {
2842 (*itMod)->setState(VP1GeoFlags::ZAPPED);
2843 }
2844 }
2845 (*itRng)->setState(VP1GeoFlags::EXPANDED);
2846 } else {
2847 (*itRng)->setState(VP1GeoFlags::ZAPPED);
2848 }
2849 }
2850 (*itWhl)->setState(VP1GeoFlags::EXPANDED);
2851 } else {
2852 (*itWhl)->setState(VP1GeoFlags::ZAPPED);
2853 (*itWhl)->contractDaughtersRecursively();
2854 }
2855 }
2856 (*it)->setState(VP1GeoFlags::EXPANDED);
2857 } else {
2858 (*it)->setState(VP1GeoFlags::ZAPPED);
2859 (*it)->contractDaughtersRecursively();
2860 }
2861 }
2862}

◆ stationInfo()

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

Definition at line 2244 of file VP1GeometrySystem.cxx.

2245{
2246 QStringList l;
2247 if (!station) {
2248 l <<"Null ptr!";
2249 return l;
2250 }
2251 l << "Name: "+str(station->getStationName().c_str());
2252 l << "(Eta,Phi) index: ("+str(station->getEtaIndex())+", "+str(station->getPhiIndex())+")";
2253 return l;
2254}
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 2186 of file VP1GeometrySystem.cxx.

2187{
2188 if (!elem)
2189 return;
2190 GeoPVConstLink pvlink = elem->getMaterialGeom()->getParent();
2191 const MuonGM::MuonStation * station = elem->parentMuonStation();
2192 if (!station) {
2193 theclass->message("WARNING: Ignored null station pointer");
2194 return;
2195 }
2196 pv2MuonStation[pvlink] = station;
2197}

◆ updateTouchedMuonChamber()

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

Definition at line 1632 of file VP1GeometrySystem.cxx.

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

◆ volume()

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

Definition at line 1275 of file VP1GeometrySystem.cxx.

1275 {
1276 const GeoLogVol * lv = pv->getLogVol();
1277 const GeoShape *shape = lv->getShape();
1278 return shape->volume();
1279}

Member Data Documentation

◆ chamberT0s

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

Definition at line 300 of file VP1GeometrySystem.cxx.

◆ controller

GeoSysController* VP1GeometrySystem::Imp::controller

Definition at line 245 of file VP1GeometrySystem.cxx.

◆ detVisAttributes

DetVisAttributes* VP1GeometrySystem::Imp::detVisAttributes

Definition at line 234 of file VP1GeometrySystem.cxx.

◆ initialSubSystemsTurnedOn

VP1GeoFlags::SubSystemFlags VP1GeometrySystem::Imp::initialSubSystemsTurnedOn

Definition at line 243 of file VP1GeometrySystem.cxx.

◆ kbEvent

const SoKeyboardEvent* VP1GeometrySystem::Imp::kbEvent

Definition at line 256 of file VP1GeometrySystem.cxx.

◆ last_appropriatemdtprojections

int VP1GeometrySystem::Imp::last_appropriatemdtprojections

Definition at line 269 of file VP1GeometrySystem.cxx.

◆ m_textSep

SoSeparator* VP1GeometrySystem::Imp::m_textSep

Separator used to hold all visible labels.

Definition at line 275 of file VP1GeometrySystem.cxx.

◆ matVisAttributes

MatVisAttributes* VP1GeometrySystem::Imp::matVisAttributes

Definition at line 235 of file VP1GeometrySystem.cxx.

◆ muonchambers_pv2handles

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

Definition at line 259 of file VP1GeometrySystem.cxx.

◆ phisectormanager

PhiSectorManager* VP1GeometrySystem::Imp::phisectormanager

Definition at line 246 of file VP1GeometrySystem.cxx.

◆ previousAlignedChamberHandle

VolumeHandle* VP1GeometrySystem::Imp::previousAlignedChamberHandle

Definition at line 266 of file VP1GeometrySystem.cxx.

◆ pv2MuonStation

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

Definition at line 278 of file VP1GeometrySystem.cxx.

◆ pv2MuonStationInit

bool VP1GeometrySystem::Imp::pv2MuonStationInit

Definition at line 279 of file VP1GeometrySystem.cxx.

◆ restoredTopvolstates

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

Definition at line 292 of file VP1GeometrySystem.cxx.

◆ sceneroot

SoSeparator* VP1GeometrySystem::Imp::sceneroot

Definition at line 113 of file VP1GeometrySystem.cxx.

◆ sender2ChamberList

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

Definition at line 261 of file VP1GeometrySystem.cxx.

◆ sonodesep2volhandle

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

Definition at line 115 of file VP1GeometrySystem.cxx.

◆ subsysInfoList

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

Definition at line 226 of file VP1GeometrySystem.cxx.

◆ theclass

VP1GeometrySystem* VP1GeometrySystem::Imp::theclass

Definition at line 112 of file VP1GeometrySystem.cxx.

◆ volumetreemodel

VolumeTreeModel* VP1GeometrySystem::Imp::volumetreemodel

Definition at line 247 of file VP1GeometrySystem.cxx.

◆ volVisAttributes

VolVisAttributes* VP1GeometrySystem::Imp::volVisAttributes

Definition at line 236 of file VP1GeometrySystem.cxx.


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