CMS 3D CMS Logo

AttachSD.cc
Go to the documentation of this file.
4 #include <string>
5 #include <vector>
6 
8 
10 
12 
13 std::pair< std::vector<SensitiveTkDetector*>,
14  std::vector<SensitiveCaloDetector*> >
16  const DDCompactView & cpv,
17  const SensitiveDetectorCatalog & clg,
18  edm::ParameterSet const & p,
19  const SimTrackManager* man,
20  SimActivityRegistry& reg) const
21 {
22  std::pair< std::vector<SensitiveTkDetector *>,std::vector<SensitiveCaloDetector*> > detList;
23  const std::vector<std::string>& rouNames = clg.readoutNames();
24  edm::LogInfo("SimG4CoreSensitiveDetector") << " AttachSD: Initializing "
25  << rouNames.size() << " SDs";
26  std::unique_ptr<SensitiveDetectorMakerBase> temp;
27  for (auto & rname : rouNames) {
28  std::string className = clg.className(rname);
29  temp.reset(SensitiveDetectorPluginFactory::get()->create(className));
30  std::auto_ptr<SensitiveTkDetector> tkDet;
31  std::auto_ptr<SensitiveCaloDetector> caloDet;
32  temp.get()->make(rname,cpv,clg,p,man,reg,tkDet,caloDet);
33  edm::LogInfo("SimG4CoreSensitiveDetector")
34  << " AttachSD: created a " << className << " with name " << rname
35  << " TkDet <" << tkDet.get() << "> caloDet<" << caloDet.get() << ">"
36  << " temp= <" << temp.get() << ">";
37  if(tkDet.get()){
38  detList.first.push_back(tkDet.get());
39  tkDet.release();
40  }
41  if(caloDet.get()){
42  detList.second.push_back(caloDet.get());
43  caloDet.release();
44  }
45  }
46  return detList;
47 }
48 
AttachSD()
Definition: AttachSD.cc:9
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const DDDWorld &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry &reg) const
Definition: AttachSD.cc:15
const double w
Definition: UKUtility.cc:23
type of data representation of DDCompactView
Definition: DDCompactView.h:90
~AttachSD()
Definition: AttachSD.cc:11
std::string className(const std::string &readoutName) const
const std::vector< std::string > & readoutNames(const std::string &className) const
T get(const Candidate &c)
Definition: component.h:55
std::string className(const T &t)
Definition: ClassName.h:30