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 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 11 of file AttachSD.cc.

11 {}
AttachSD::~AttachSD ( )

Definition at line 13 of file AttachSD.cc.

13 {}

Member Function Documentation

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

Definition at line 17 of file AttachSD.cc.

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

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

22 {
23  std::pair< std::vector<SensitiveTkDetector *>,std::vector<SensitiveCaloDetector*> > detList;
24  const std::vector<std::string>& rouNames = clg.readoutNames();
25  edm::LogVerbatim("SimG4CoreSensitiveDetector")
26  << " AttachSD: Initialising " << rouNames.size() << " SDs";
27  for (auto & rname : rouNames) {
28  std::string className = clg.className(rname);
29  std::unique_ptr<SensitiveDetectorMakerBase> temp{SensitiveDetectorPluginFactory::get()->create(className)};
30 
31  std::unique_ptr<SensitiveDetector> sd{temp->make(rname,cpv,clg,p,man,reg)};
32 
33  std::stringstream ss;
34  ss << " AttachSD: created a " << className << " with name " << rname;
35 
36  if(sd->isCaloSD()) {
37  detList.second.push_back(static_cast<SensitiveCaloDetector*>(sd.release()));
38  ss << " + calo SD";
39  } else {
40  detList.first.push_back(static_cast<SensitiveTkDetector*>(sd.release()));
41  ss << " + tracking SD";
42  }
43  edm::LogVerbatim("SimG4CoreSensitiveDetector") << ss.str();
44  }
45  return detList;
46 }
std::string className(const std::string &readoutName) const
const std::vector< std::string > & readoutNames(const std::string &className) const
double sd
T get(const Candidate &c)
Definition: component.h:55
std::string className(const T &t)
Definition: ClassName.h:30