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

58 { m_browser = v; }

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.

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  }

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

Referenced by fillOptions().

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

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  }

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

◆ isStringValid()

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

Definition at line 113 of file FWGeometryTableView.cc.

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

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

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

interactiveExample.ui
ui
Definition: interactiveExample.py:13
mps_fire.i
i
Definition: mps_fire.py:428
FWGeometryTableViewManager::getGeoMangeur
static TGeoManager * getGeoMangeur()
Definition: FWGeometryTableViewManager.cc:78
FWGeometryTableView::kFilterMaterialTitle
Definition: FWGeometryTableView.h:32
FWGeometryTableView::getFilterType
int getFilterType() const
Definition: FWGeometryTableView.h:50
FWGeometryTableView::kFilterShapeClassName
Definition: FWGeometryTableView.h:32
FWGeoMaterialValidator::addDaughtersRec
virtual void addDaughtersRec(TGeoVolume *v) const
Definition: FWGeometryTableView.cc:61
findQualityFiles.v
v
Definition: findQualityFiles.py:179
part
part
Definition: HCALResponse.h:20
FWGeometryTableView::getTableManager
FWGeometryTableManagerBase * getTableManager() override
Definition: FWGeometryTableView.cc:242
h
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
FWGeoMaterialValidator::m_list
std::vector< const char * > m_list
Definition: FWGeometryTableView.cc:57
FWGeometryTableManagerBase::refEntries
Entries_v & refEntries()
Definition: FWGeometryTableManagerBase.h:143
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWGeometryTableViewBase::getTopNodeIdx
int getTopNodeIdx() const
Definition: FWGeometryTableViewBase.h:97
tier0.unique
def unique(seq, keepstr=True)
Definition: tier0.py:24
FWGeometryTableView::kFilterMaterialName
Definition: FWGeometryTableView.h:32
FWGeometryTableManagerBase::Entries_i
Entries_v::iterator Entries_i
Definition: FWGeometryTableManagerBase.h:88
FWGeoMaterialValidator::m_browser
FWGeometryTableView * m_browser
Definition: FWGeometryTableView.cc:56
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
FWGeometryTableView::kFilterShapeName
Definition: FWGeometryTableView.h:32