CMS 3D CMS Logo

List of all members | Public Member Functions
AttachSD Class Reference

#include <AttachSD.h>

Public Member Functions

 AttachSD ()
 
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create (const DDDWorld &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry &reg) const
 
 ~AttachSD ()
 

Detailed Description

Definition at line 16 of file AttachSD.h.

Constructor & Destructor Documentation

AttachSD::AttachSD ( )

Definition at line 9 of file AttachSD.cc.

9 {}
AttachSD::~AttachSD ( )

Definition at line 11 of file AttachSD.cc.

11 {}

Member Function Documentation

std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > AttachSD::create ( const DDDWorld w,
const DDCompactView cpv,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager man,
SimActivityRegistry reg 
) const

Definition at line 15 of file AttachSD.cc.

References SensitiveDetectorCatalog::className(), className(), reco::get(), SensitiveDetectorCatalog::readoutNames(), AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by RunManager::initG4(), RunManagerMTWorker::initializeThread(), and GeometryProducer::produce().

21 {
22  std::pair< std::vector<SensitiveTkDetector *>,std::vector<SensitiveCaloDetector*> > detList;
23  const std::vector<std::string>& rouNames = clg.readoutNames();
24  edm::LogVerbatim("SimG4CoreSensitiveDetector")
25  << " AttachSD: Initialising " << 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::LogVerbatim("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 }
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
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