CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
FWGeoMaterialValidator Class Reference
Inheritance diagram for FWGeoMaterialValidator:
FWValidatorBase

Public Member Functions

virtual void addDaughtersRec (TGeoVolume *v) const
 
void fillOptions (const char *iBegin, const char *iEnd, std::vector< std::pair< std::shared_ptr< std::string >, std::string > > &oOptions) const override
 
 FWGeoMaterialValidator (FWGeometryTableView *v)
 
bool isStringValid (std::string &exp)
 
 ~FWGeoMaterialValidator () override
 
- Public Member Functions inherited from FWValidatorBase
 FWValidatorBase ()
 
 FWValidatorBase (const FWValidatorBase &)=delete
 
const FWValidatorBaseoperator= (const FWValidatorBase &)=delete
 
virtual ~FWValidatorBase ()
 

Public Attributes

FWGeometryTableViewm_browser
 
std::vector< const char * > m_list
 

Detailed Description

Definition at line 54 of file FWGeometryTableView.cc.

Constructor & Destructor Documentation

◆ FWGeoMaterialValidator()

FWGeoMaterialValidator::FWGeoMaterialValidator ( FWGeometryTableView v)
inline

Definition at line 58 of file FWGeometryTableView.cc.

References m_browser, and findQualityFiles::v.

◆ ~FWGeoMaterialValidator()

FWGeoMaterialValidator::~FWGeoMaterialValidator ( )
inlineoverride

Definition at line 59 of file FWGeometryTableView.cc.

59 {}

Member Function Documentation

◆ addDaughtersRec()

virtual void FWGeoMaterialValidator::addDaughtersRec ( TGeoVolume *  v) const
inlinevirtual

Definition at line 61 of file FWGeometryTableView.cc.

References DMR_cfg::cerr, FWGeometryTableView::getFilterType(), mps_fire::i, FWGeometryTableView::kFilterMaterialName, FWGeometryTableView::kFilterMaterialTitle, FWGeometryTableView::kFilterShapeClassName, FWGeometryTableView::kFilterShapeName, m_browser, m_list, and findQualityFiles::v.

Referenced by fillOptions().

61  {
62  switch (m_browser->getFilterType()) {
64  m_list.push_back(v->GetMaterial()->GetName());
65  break;
67  m_list.push_back(v->GetMaterial()->GetTitle());
68  break;
70  m_list.push_back(v->GetShape()->GetName());
71  break;
73  m_list.push_back(v->GetShape()->ClassName());
74  break;
75  default:
76  std::cerr << "FWGeoMaterialValidator unhandeled case. \n";
77  }
78 
79  for (int i = 0; i < v->GetNdaughters(); ++i)
80  addDaughtersRec(v->GetNode(i)->GetVolume());
81  }
FWGeometryTableView * m_browser
std::vector< const char * > m_list
virtual void addDaughtersRec(TGeoVolume *v) const

◆ fillOptions()

void FWGeoMaterialValidator::fillOptions ( const char *  iBegin,
const char *  iEnd,
std::vector< std::pair< std::shared_ptr< std::string >, std::string > > &  oOptions 
) const
inlineoverridevirtual

Implements FWValidatorBase.

Definition at line 83 of file FWGeometryTableView.cc.

References addDaughtersRec(), FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableView::getTableManager(), FWGeometryTableViewBase::getTopNodeIdx(), h, mps_fire::i, m_browser, m_list, FWGeometryTableManagerBase::refEntries(), jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, interactiveExample::ui, and tier0::unique().

85  {
86  oOptions.clear();
87  m_list.clear();
88 
90  std::advance(tnit, m_browser->getTopNodeIdx());
92  addDaughtersRec(tnit->m_node->GetVolume());
93 
94  std::sort(m_list.begin(), m_list.end());
95  std::vector<const char*>::iterator ui = std::unique(m_list.begin(), m_list.end());
96  m_list.resize(ui - m_list.begin());
97 
98  std::string part(iBegin, iEnd);
99  unsigned int part_size = part.size();
100  std::string h = "";
101  // int cnt = 0;
102  oOptions.push_back(std::make_pair(std::make_shared<std::string>(*m_list.begin()), h));
103  std::vector<const char*>::iterator startIt = m_list.begin();
104  startIt++;
105  for (std::vector<const char*>::iterator i = startIt; i != m_list.end(); ++i) {
106  // std::cout << *i << " " << cnt++ << std::endl;
107  if ((strlen(*i) >= part_size) && strncmp(*i, part.c_str(), part_size) == 0) {
108  oOptions.push_back(std::make_pair(std::make_shared<std::string>((*i)), &((*i)[part_size])));
109  }
110  }
111  }
FWGeometryTableView * m_browser
std::vector< const char * > m_list
def unique(seq, keepstr=True)
Definition: tier0.py:24
virtual void addDaughtersRec(TGeoVolume *v) const
part
Definition: HCALResponse.h:20
FWGeometryTableManagerBase * getTableManager() override
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ isStringValid()

bool FWGeoMaterialValidator::isStringValid ( std::string &  exp)
inline

Definition at line 113 of file FWGeometryTableView.cc.

References DMR_cfg::cerr.

113  {
114  std::cerr << "validation not used \n";
115  return false;
116  }

Member Data Documentation

◆ m_browser

FWGeometryTableView* FWGeoMaterialValidator::m_browser

Definition at line 56 of file FWGeometryTableView.cc.

Referenced by addDaughtersRec(), fillOptions(), and FWGeoMaterialValidator().

◆ m_list

std::vector<const char*> FWGeoMaterialValidator::m_list
mutable

Definition at line 57 of file FWGeometryTableView.cc.

Referenced by addDaughtersRec(), and fillOptions().