Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code checks #34536

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class G4Step;
class G4HCofThisEvent;

class FiberSensitiveDetector : public SensitiveCaloDetector,
public Observer<const BeginOfJob *>,
public Observer<const BeginOfRun *>,
public Observer<const BeginOfEvent *>,
public Observer<const EndOfEvent *> {
public Observer<const BeginOfJob *>,
public Observer<const BeginOfRun *>,
public Observer<const BeginOfEvent *>,
public Observer<const EndOfEvent *> {
public:
explicit FiberSensitiveDetector(const std::string &,
const HcalSimulationConstants*,
const HcalDDDSimConstants*,
const SensitiveDetectorCatalog &,
edm::ParameterSet const &,
const SimTrackManager *);
const HcalSimulationConstants *,
const HcalDDDSimConstants *,
const SensitiveDetectorCatalog &,
edm::ParameterSet const &,
const SimTrackManager *);
~FiberSensitiveDetector() override;

void Initialize(G4HCofThisEvent *HCE) override;
Expand Down
31 changes: 16 additions & 15 deletions SimG4CMS/ShowerLibraryProducer/src/FiberSensitiveDetector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include "G4ios.hh"

FiberSensitiveDetector::FiberSensitiveDetector(const std::string& iname,
const HcalSimulationConstants* hsps,
const HcalDDDSimConstants* hdc,
const SensitiveDetectorCatalog& clg,
edm::ParameterSet const& p,
const SimTrackManager* manager)
: SensitiveCaloDetector(iname, clg), m_trackManager(manager), theShower(nullptr), theHCID(-1), theHC(nullptr) {
const HcalSimulationConstants* hsps,
const HcalDDDSimConstants* hdc,
const SensitiveDetectorCatalog& clg,
edm::ParameterSet const& p,
const SimTrackManager* manager)
: SensitiveCaloDetector(iname, clg), m_trackManager(manager), theShower(nullptr), theHCID(-1), theHC(nullptr) {
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector : Instantiating for " << iname;
// Get pointer to HcalDDDConstants and HcalSimulationConstants
theShower = new HFShower(iname, hdc, hsps->hcalsimpar(), p, 1);
Expand All @@ -35,13 +35,14 @@ FiberSensitiveDetector::~FiberSensitiveDetector() {
}

void FiberSensitiveDetector::Initialize(G4HCofThisEvent* HCE) {
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector : Initialize called for " << GetName() << " in collection " << HCE;
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector : Initialize called for " << GetName() << " in collection "
<< HCE;
theHC = new FiberG4HitsCollection(GetName(), collectionName[0]);
if (theHCID < 0)
theHCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
HCE->AddHitsCollection(theHCID, theHC);
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector : Add hit collectrion for " << collectionName[0] << ":" << theHCID << ":"
<< theHC;
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector : Add hit collectrion for " << collectionName[0] << ":"
<< theHCID << ":" << theHC;
}

G4bool FiberSensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
Expand Down Expand Up @@ -74,13 +75,13 @@ G4bool FiberSensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
aHit->setPos(theHitPos);
aHit->setTime(preStepPoint->GetGlobalTime());
aHit->setPhoton(thePE);
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector :ShowerPhoton position " << thePE[0].x() << " " << thePE[0].y() << " "
<< thePE[0].z();
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector :ShowerPhoton position " << thePE[0].x() << " "
<< thePE[0].y() << " " << thePE[0].z();

edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector: Hit created at " << lv->GetName() << " DetID: " << aHit->towerId()
<< " Depth: " << aHit->depth() << " Track ID: " << aHit->trackId()
<< " Nb. of Cerenkov Photons: " << aHit->npe() << " Time: " << aHit->time() << " at "
<< aHit->hitPos();
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector: Hit created at " << lv->GetName()
<< " DetID: " << aHit->towerId() << " Depth: " << aHit->depth()
<< " Track ID: " << aHit->trackId() << " Nb. of Cerenkov Photons: " << aHit->npe()
<< " Time: " << aHit->time() << " at " << aHit->hitPos();
for (unsigned int i = 0; i < thePE.size(); i++)
edm::LogVerbatim("FiberSim") << "FiberSensitiveDetector: PE[" << i << "] " << thePE[i];

Expand Down