File indexing completed on 2025-01-18 09:13:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef DD4HEP_DETNOMINALCREATOR_H
0018 #define DD4HEP_DETNOMINALCREATOR_H
0019
0020
0021 #include <DD4hep/DetElement.h>
0022
0023 namespace dd4hep {
0024
0025
0026
0027
0028
0029
0030
0031
0032 class DetNominalCreator {
0033 Detector& description;
0034 public:
0035 DetNominalCreator(Detector& d) : description(d) {}
0036 DetNominalCreator(const DetNominalCreator& c) : description(c.description) {}
0037 virtual ~DetNominalCreator() = default;
0038 int operator()(DetElement de, int ) const {
0039 if ( de.nominal().isValid() ) return 1;
0040 return 0;
0041 }
0042 };
0043 }
0044 #endif
0045
0046
0047 #include <DD4hep/DetectorProcessor.h>
0048 #include <DD4hep/DetFactoryHelper.h>
0049
0050
0051
0052
0053 using namespace std;
0054 using namespace dd4hep;
0055
0056 static void* create_object(Detector& description, int argc, char** argv) {
0057 for(int i = 0; i < argc && argv[i]; ++i) { }
0058 shared_ptr<DetNominalCreator> obj(new DetNominalCreator(description));
0059 DetectorProcessorShared<DetNominalCreator>* proc =
0060 new DetectorProcessorShared<DetNominalCreator>(obj);
0061 return (void*)proc;
0062 }
0063
0064
0065 DECLARE_DD4HEP_CONSTRUCTOR(DD4hep_DetNominalCreator,create_object)