Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // File: BscSD.cc
0003 // Date: 02.2006
0004 // Description: Sensitive Detector class for Bsc
0005 // Modifications:
0006 ///////////////////////////////////////////////////////////////////////////////
0007 
0008 #include "SimG4CMS/Forward/interface/BscSD.h"
0009 #include "SimG4CMS/Forward/interface/BscG4Hit.h"
0010 #include "SimG4CMS/Forward/interface/BscG4HitCollection.h"
0011 #include "SimG4CMS/Forward/interface/BscNumberingScheme.h"
0012 
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0015 
0016 #include "G4Step.hh"
0017 
0018 #include <iostream>
0019 
0020 //-------------------------------------------------------------------
0021 BscSD::BscSD(const std::string& name,
0022              const SensitiveDetectorCatalog& clg,
0023              edm::ParameterSet const& p,
0024              const SimTrackManager* manager)
0025     : TimingSD(name, clg, manager), numberingScheme(nullptr) {
0026   //Parameters
0027   edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("BscSD");
0028   int verbn = m_p.getUntrackedParameter<int>("Verbosity");
0029 
0030   SetVerboseLevel(verbn);
0031 
0032   if (name == "BSCHits") {
0033     if (verbn > 0) {
0034       edm::LogVerbatim("BscSim") << "name = BSCHits and  new BscNumberingSchem";
0035     }
0036     numberingScheme = new BscNumberingScheme();
0037   } else {
0038     edm::LogWarning("BscSim") << "BscSD: ReadoutName " << name << " not supported";
0039   }
0040 }
0041 
0042 BscSD::~BscSD() { delete numberingScheme; }
0043 
0044 uint32_t BscSD::setDetUnitId(const G4Step* aStep) {
0045   return (numberingScheme == nullptr ? 0 : numberingScheme->getUnitID(aStep));
0046 }