test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &w, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *m, SimActivityRegistry &reg) const
 
 ~AttachSD ()
 

Detailed Description

Definition at line 13 of file AttachSD.h.

Constructor & Destructor Documentation

AttachSD::AttachSD ( )

Definition at line 17 of file AttachSD.cc.

17 {}
AttachSD::~AttachSD ( )

Definition at line 19 of file AttachSD.cc.

19 {}

Member Function Documentation

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

Definition at line 23 of file AttachSD.cc.

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

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

29 {
30  std::pair< std::vector<SensitiveTkDetector *>,
31  std::vector<SensitiveCaloDetector*> > detList;
32 //#ifdef DEBUG
33  //cout << " Initializing AttachSD " << endl;
34  LogDebug("SimG4CoreSensitiveDetector") << " AttachSD: Initializing" ;
35 //#endif
36  std::vector<std::string> rouNames = clg.readoutNames();
37  for (std::vector<std::string>::iterator it = rouNames.begin();
38  it != rouNames.end(); it++) {
39  std::string className = clg.className(*it);
40  //std::cout<<" trying to find something for "<<className<<" " <<*it<<std::endl;
41  edm::LogInfo("SimG4CoreSensitiveDetector") << " AttachSD: trying to find something for " << className << " " << *it ;
42  std::auto_ptr<SensitiveDetectorMakerBase> temp(
44  std::auto_ptr<SensitiveTkDetector> tkDet;
45  std::auto_ptr<SensitiveCaloDetector> caloDet;
46  temp->make(*it,cpv,clg,p,m,reg,tkDet,caloDet);
47  if(tkDet.get()){
48  detList.first.push_back(tkDet.get());
49  tkDet.release();
50  }
51  if(caloDet.get()){
52  detList.second.push_back(caloDet.get());
53  caloDet.release();
54  }
55 //#ifdef DEBUG
56  // cout << " AttachSD: created a " << className << " with name " << *it << endl;
57  LogDebug("SimG4CoreSensitiveDetector") << " AttachSD: created a " << className << " with name " << *it ;
58  //#endif
59  }
60  return detList;
61 }
#define LogDebug(id)
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const DDDWorld &w, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *m, SimActivityRegistry &reg) const
Definition: AttachSD.cc:23
std::vector< std::string > readoutNames(std::string &className)
std::string className(std::string &readoutName)
T get(const Candidate &c)
Definition: component.h:55
std::string className(const T &t)
Definition: ClassName.h:30