Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-20 22:46:45

0001 #include "SimG4CMS/Forward/interface/BHMSD.h"
0002 #include "SimG4CMS/Forward/interface/BHMNumberingScheme.h"
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 
0007 #include "G4Step.hh"
0008 
0009 #include <iostream>
0010 
0011 //-------------------------------------------------------------------
0012 BHMSD::BHMSD(const std::string& name,
0013              const SensitiveDetectorCatalog& clg,
0014              edm::ParameterSet const& p,
0015              const SimTrackManager* manager)
0016     : TimingSD(name, clg, manager), numberingScheme(nullptr) {
0017   //Parameters
0018   edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("BHMSD");
0019   int verbn = m_p.getUntrackedParameter<int>("Verbosity");
0020 
0021   SetVerboseLevel(verbn);
0022 
0023   if (verbn > 0) {
0024     edm::LogVerbatim("BHMSim") << "name = " << name << " and new BHMNumberingScheme";
0025   }
0026   numberingScheme = new BHMNumberingScheme();
0027 }
0028 
0029 BHMSD::~BHMSD() { delete numberingScheme; }
0030 
0031 uint32_t BHMSD::setDetUnitId(const G4Step* aStep) {
0032   return (numberingScheme == nullptr ? 0 : numberingScheme->getUnitID(aStep));
0033 }