ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 }

◆ ~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 }

◆ 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 }

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:
get_generator_info.result
result
Definition: get_generator_info.py:21
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
VP1CC_MbtsScinInfo::dx2
double dx2
Definition: VP1CaloCells.h:396
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
TileTBID::module
int module(const Identifier &id) const
extract module field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:150
VP1CC_MbtsScinInfo
Definition: VP1CaloCells.h:394
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
VP1Mbts::m_separator
SoSeparator * m_separator
Definition: VP1CaloCells.h:436
VP1CC_MbtsScinInfo::dx1
double dx1
Definition: VP1CaloCells.h:395
MBTS_EPS
#define MBTS_EPS
Definition: VP1CaloCells.cxx:32
python.PyAthena.module
module
Definition: PyAthena.py:131
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
VP1CC_MbtsScinInfo::dz
double dz
Definition: VP1CaloCells.h:399
VP1Mbts::m_run2Geo
bool m_run2Geo
Definition: VP1CaloCells.h:437
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
VP1CC_MbtsScinInfo::cTransforms
VP1CC_MbtsXfMap cTransforms
Definition: VP1CaloCells.h:401
VP1Mbts::m_idhelper
const TileTBID * m_idhelper
Definition: VP1CaloCells.h:435
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
VP1CC_MbtsScinInfo::aTransforms
VP1CC_MbtsXfMap aTransforms
Definition: VP1CaloCells.h:400
SoGenericBox::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoGenericBox.h:33
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SoGenericBox
Definition: SoGenericBox.h:26
VP1CC_MbtsScinInfo::dy2
double dy2
Definition: VP1CaloCells.h:398
VP1CC_MbtsScinInfo::dy1
double dy1
Definition: VP1CaloCells.h:397
VP1Mbts::m_cell
const TileCell * m_cell
Definition: VP1CaloCells.h:434
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition: VP1LinAlgUtils.cxx:40
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
SoGenericBox::setParametersForTrd
void setParametersForTrd(float dx1, float dx2, float dy1, float dy2, float dz)
Definition: SoGenericBox.cxx:276
Identifier
Definition: IdentifierFieldParser.cxx:14