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 56 of file FWGeometryTableView.cc.

Constructor & Destructor Documentation

FWGeoMaterialValidator::FWGeoMaterialValidator ( FWGeometryTableView v)
inline

Definition at line 62 of file FWGeometryTableView.cc.

References findQualityFiles::v.

FWGeoMaterialValidator::~FWGeoMaterialValidator ( )
inlineoverride

Definition at line 63 of file FWGeometryTableView.cc.

63 {}

Member Function Documentation

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

Definition at line 65 of file FWGeometryTableView.cc.

References MessageLogger_cfi::cerr, FWGeometryTableView::getFilterType(), mps_fire::i, FWGeometryTableView::kFilterMaterialName, FWGeometryTableView::kFilterMaterialTitle, FWGeometryTableView::kFilterShapeClassName, and FWGeometryTableView::kFilterShapeName.

Referenced by fillOptions().

66  {
67  switch (m_browser->getFilterType())
68  {
70  m_list.push_back(v->GetMaterial()->GetName());
71  break;
73  m_list.push_back(v->GetMaterial()->GetTitle());
74  break;
76  m_list.push_back(v->GetShape()->GetName());
77  break;
79  m_list.push_back(v->GetShape()->ClassName());
80  break;
81  default:
82  std::cerr << "FWGeoMaterialValidator unhandeled case. \n";
83  }
84 
85  for (int i = 0; i < v->GetNdaughters(); ++i)
86  addDaughtersRec(v->GetNode(i)->GetVolume());
87 
88  }
FWGeometryTableView * m_browser
std::vector< const char * > m_list
virtual void addDaughtersRec(TGeoVolume *v) const
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 90 of file FWGeometryTableView.cc.

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

91  {
92  oOptions.clear();
93  m_list.clear();
94 
96  std::advance(tnit, m_browser->getTopNodeIdx());
98  addDaughtersRec(tnit->m_node->GetVolume());
99 
100  std::sort(m_list.begin(), m_list.end());
101  std::vector<const char*>::iterator ui = std::unique(m_list.begin(), m_list.end());
102  m_list.resize(ui - m_list.begin());
103 
104  std::string part(iBegin,iEnd);
105  unsigned int part_size = part.size();
106  std::string h = "";
107  // int cnt = 0;
108  oOptions.push_back(std::make_pair(std::make_shared<std::string>(*m_list.begin()), h));
109  std::vector<const char*>::iterator startIt = m_list.begin(); startIt++;
110  for (std::vector<const char*>::iterator i = startIt; i!=m_list.end(); ++i)
111  {
112  // std::cout << *i << " " << cnt++ << std::endl;
113  if ((strlen(*i) >= part_size) && strncmp(*i, part.c_str(), part_size ) == 0)
114  {
115  oOptions.push_back(std::make_pair(std::make_shared<std::string>((*i)),&((*i)[part_size]) ));
116  }
117  }
118  }
FWGeometryTableView * m_browser
std::vector< const char * > m_list
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual void addDaughtersRec(TGeoVolume *v) const
def unique(seq, keepstr=True)
Definition: tier0.py:25
part
Definition: HCALResponse.h:20
FWGeometryTableManagerBase * getTableManager() override
bool FWGeoMaterialValidator::isStringValid ( std::string &  exp)
inline

Definition at line 120 of file FWGeometryTableView.cc.

References MessageLogger_cfi::cerr.

121  {
122  std::cerr << "validation not used \n";
123  return false;
124  }

Member Data Documentation

FWGeometryTableView* FWGeoMaterialValidator::m_browser

Definition at line 60 of file FWGeometryTableView.cc.

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

Definition at line 61 of file FWGeometryTableView.cc.