ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Mbts Class Reference

#include <VP1CaloCells.h>

Collaboration diagram for VP1Mbts:

Public Member Functions

 VP1Mbts (const TileCell *cell, const TileTBID *idhelper, SoSeparator *separator, bool run2Geo)
 ~VP1Mbts ()
bool UpdateScene (VP1CC_MbtsScinInfoMap *drawinfo, VP1CC_SoNode2MbtsMap *node2mbts, double energy, bool outline, double clipRadius)
std::vector< std::string > ToString ()

Private Attributes

const TileCellm_cell
const TileTBIDm_idhelper
SoSeparator * m_separator
bool m_run2Geo

Detailed Description

Definition at line 412 of file VP1CaloCells.h.

Constructor & Destructor Documentation

◆ VP1Mbts()

VP1Mbts::VP1Mbts ( const TileCell * cell,
const TileTBID * idhelper,
SoSeparator * separator,
bool run2Geo )

Definition at line 936 of file VP1CaloCells.cxx.

939 :
940 m_cell(cell),
941 m_idhelper(idhelper),
942 m_separator(separator),
943 m_run2Geo(run2Geo)
944{
945}
SoSeparator * m_separator
bool m_run2Geo
const TileCell * m_cell
const TileTBID * m_idhelper

◆ ~VP1Mbts()

VP1Mbts::~VP1Mbts ( )

Definition at line 947 of file VP1CaloCells.cxx.

948{
949}

Member Function Documentation

◆ ToString()

std::vector< std::string > VP1Mbts::ToString ( )

Definition at line 1046 of file VP1CaloCells.cxx.

1047{
1048 std::vector<std::string> result;
1049
1050 // Decode ID
1051 Identifier id = m_cell->ID();
1052
1053 int type = m_idhelper->type(id); // -1 neg, 1 pos
1054 int module = m_idhelper->module(id); // 0-7 scintillator copy number
1055 int channel = m_idhelper->channel(id); // 0 scin1, 1 scin2
1056
1057
1058 std::ostringstream msg, msg1, msg2, msg3;
1059 msg << " MBTS. Side = " << type << ". Scintillator Type = " << channel
1060 << ", Num = " << module;
1061 msg1 << " Energy = " << m_cell->energy();
1062 msg2 << " Time = " << m_cell->time();
1063
1064 std::string stars("***");
1065 result.push_back(stars);
1066
1067 result.push_back(msg.str());
1068 result.push_back(msg1.str());
1069 result.push_back(msg2.str());
1070
1071 result.push_back(stars);
1072 return result;
1073}
MsgStream & msg
Definition testRead.cxx:32

◆ UpdateScene()

bool VP1Mbts::UpdateScene ( VP1CC_MbtsScinInfoMap * drawinfo,
VP1CC_SoNode2MbtsMap * node2mbts,
double energy,
bool outline,
double clipRadius )

Definition at line 951 of file VP1CaloCells.cxx.

956{
957 // Draw object only when cell energy is above threshold
958 if(m_cell->energy() < energy)
959 return false;
960
961 // FIXME!
962 // std::cout<<"clipRadius "<<clipRadius<<std::endl;
963 if (clipRadius < 350 )
964 return false;
965
966 // Decode cell identifier in order to find draw info - shape and transformation
967 Identifier id = m_cell->ID();
968
969 int type = m_idhelper->type(id); // -1 neg, 1 pos
970 int module = m_idhelper->module(id); // 0-7 scintillator copy number
971 int channel = m_idhelper->channel(id); // 0 scin1, 1 scin2
972
973 if(drawinfo->find(channel) ==drawinfo->end())
974 throw std::runtime_error("Unable to find scintillator global info");
975
976 VP1CC_MbtsScinInfo* scinInfo = (*drawinfo)[channel];
977
978 // Get the transform
979 SoTransform* scinXF = 0;
980 if(type == -1) {
981 if(scinInfo->cTransforms.find(module)==scinInfo->cTransforms.end())
982 throw std::runtime_error("Unable to find global transform for the scintillator");
983 scinXF = VP1LinAlgUtils::toSoTransform(scinInfo->cTransforms[module]);
984 }
985 else if( type == 1) {
986 if(scinInfo->aTransforms.find(module)==scinInfo->aTransforms.end())
987 throw std::runtime_error("Unable to find global transform for the scintillator");
988 scinXF = VP1LinAlgUtils::toSoTransform(scinInfo->aTransforms[module]);
989 } else
990 return false;
991
992 // 3D object - Trd
993 SoGenericBox* scinTrd = new SoGenericBox();
994 scinTrd->setParametersForTrd(scinInfo->dx1 + MBTS_EPS,
995 scinInfo->dx2 + MBTS_EPS,
996 scinInfo->dy1 - MBTS_EPS,
997 scinInfo->dy2 - MBTS_EPS,
998 scinInfo->dz - MBTS_EPS);
999 scinTrd->drawEdgeLines = outline;
1000
1001 // Now add the object to the scene
1002 SoSeparator* scinSep = new SoSeparator;
1003 scinSep->addChild(scinXF);
1004 scinSep->addChild(scinTrd);
1005 m_separator->addChild(scinSep);
1006
1007 // Keep the pointer to the 3D object in the map
1008 (*node2mbts)[scinTrd] = this;
1009
1010 // ________________________________________________________________________________________
1011 // RUN2: if channel=1 draw two scintillators instead of one
1012 if(m_run2Geo && channel==1) {
1013 SoTransform* scinXF1 = 0;
1014 if(type == -1) {
1015 if(scinInfo->cTransforms.find(module+1)==scinInfo->cTransforms.end())
1016 throw std::runtime_error("Unable to find global transform for the scintillator");
1017 scinXF1 = VP1LinAlgUtils::toSoTransform(scinInfo->cTransforms[module+1]);
1018 }
1019 else if( type == 1) {
1020 if(scinInfo->aTransforms.find(module+1)==scinInfo->aTransforms.end())
1021 throw std::runtime_error("Unable to find global transform for the scintillator");
1022 scinXF1 = VP1LinAlgUtils::toSoTransform(scinInfo->aTransforms[module+1]);
1023 }
1024 SoGenericBox* scinTrd1 = new SoGenericBox();
1025 scinTrd1->setParametersForTrd(scinInfo->dx1 + MBTS_EPS,
1026 scinInfo->dx2 + MBTS_EPS,
1027 scinInfo->dy1 - MBTS_EPS,
1028 scinInfo->dy2 - MBTS_EPS,
1029 scinInfo->dz - MBTS_EPS);
1030 scinTrd1->drawEdgeLines = outline;
1031 // Now add the object to the scene
1032 SoSeparator* scinSep1 = new SoSeparator();
1033 scinSep1->addChild(scinXF1);
1034 scinSep1->addChild(scinTrd1);
1035 m_separator->addChild(scinSep1);
1036
1037 // Keep the pointer to the 3D object in the map
1038 (*node2mbts)[scinTrd1] = this;
1039 }
1040 // ________________________________________________________________________________________
1041 // RUN2: if channel=1 draw two scintillators instead of one
1042
1043 return true;
1044}
#define MBTS_EPS
void setParametersForTrd(float dx1, float dx2, float dy1, float dy2, float dz)
SoSFBool drawEdgeLines
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
VP1CC_MbtsXfMap cTransforms
VP1CC_MbtsXfMap aTransforms

Member Data Documentation

◆ m_cell

const TileCell* VP1Mbts::m_cell
private

Definition at line 434 of file VP1CaloCells.h.

◆ m_idhelper

const TileTBID* VP1Mbts::m_idhelper
private

Definition at line 435 of file VP1CaloCells.h.

◆ m_run2Geo

bool VP1Mbts::m_run2Geo
private

Definition at line 437 of file VP1CaloCells.h.

◆ m_separator

SoSeparator* VP1Mbts::m_separator
private

Definition at line 436 of file VP1CaloCells.h.


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