Skip to content

Commit

Permalink
Merge pull request #20171 from civanch/g4_sensitive_det_cleanup
Browse files Browse the repository at this point in the history
Geant4 sensitive detectors cleanup 2
  • Loading branch information
cmsbuild authored Aug 16, 2017
2 parents 3e07bf8 + 2e0cf9c commit 5506301
Show file tree
Hide file tree
Showing 30 changed files with 360 additions and 402 deletions.
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/interface/CaloG4Hit.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class CaloG4Hit : public G4VHit {
public:

CaloG4Hit();
virtual ~CaloG4Hit();
~CaloG4Hit() override;
CaloG4Hit(const CaloG4Hit &right);
const CaloG4Hit& operator=(const CaloG4Hit &right);
bool operator==(const CaloG4Hit &){return false;}
inline void * operator new(size_t);
inline void operator delete(void * CaloG4Hit);

void Draw(){}
void Print();
void Draw() override{}
void Print() override;

public:

Expand Down
37 changes: 18 additions & 19 deletions SimG4CMS/Calo/interface/CaloSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ class CaloSD : public SensitiveCaloDetector,

public:

CaloSD(G4String aSDname, const DDCompactView & cpv,
CaloSD(const std::string& aSDname, const DDCompactView & cpv,
const SensitiveDetectorCatalog & clg,
edm::ParameterSet const & p, const SimTrackManager*,
float timeSlice=1., bool ignoreTkID=false);
virtual ~CaloSD();
virtual bool ProcessHits(G4Step * step, G4TouchableHistory * tHistory);
virtual bool ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory*);
~CaloSD() override;
bool ProcessHits(G4Step * step, G4TouchableHistory * tHistory) override;
bool ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory*) override;
virtual double getEnergyDeposit(G4Step* step);
virtual uint32_t setDetUnitId(G4Step* step)=0;
//uint32_t setDetUnitId(G4Step* step) override =0;

virtual void Initialize(G4HCofThisEvent * HCE);
virtual void EndOfEvent(G4HCofThisEvent * eventHC);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
void Initialize(G4HCofThisEvent * HCE) override;
void EndOfEvent(G4HCofThisEvent * eventHC) override;
void clear() override;
void DrawAll() override;
void PrintAll() override;

void fillHits(edm::PCaloHitContainer&,std::string n);
void fillHits(edm::PCaloHitContainer&, std::string&) override ;

protected:

Expand All @@ -80,12 +80,12 @@ class CaloSD : public SensitiveCaloDetector,
double getAttenuation(G4Step* aStep, double birk1, double birk2,
double birk3);

virtual void update(const BeginOfRun *);
virtual void update(const BeginOfEvent *);
virtual void update(const BeginOfTrack * trk);
virtual void update(const EndOfTrack * trk);
virtual void update(const ::EndOfEvent *);
virtual void clearHits();
void update(const BeginOfRun *) override;
void update(const BeginOfEvent *) override;
void update(const BeginOfTrack * trk) override;
void update(const EndOfTrack * trk) override;
void update(const ::EndOfEvent *) override;
void clearHits() override ;
virtual void initRun();
virtual bool filterHit(CaloG4Hit*, double);

Expand All @@ -98,7 +98,6 @@ class CaloSD : public SensitiveCaloDetector,

void storeHit(CaloG4Hit*);
bool saveHit(CaloG4Hit*);
void summarize();
void cleanHitCollection();

protected:
Expand All @@ -116,7 +115,7 @@ class CaloSD : public SensitiveCaloDetector,

CaloHitID currentID, previousID;
G4Track* theTrack;
G4TouchableHistory* theTouchableHistory;
G4LogicalVolume* theLogicalVolume;

G4StepPoint* preStepPoint;
float edepositEM, edepositHAD;
Expand Down
23 changes: 12 additions & 11 deletions SimG4CMS/Calo/interface/ECalSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ class ECalSD : public CaloSD {

public:

ECalSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &,
ECalSD(const std::string&, const DDCompactView &, const SensitiveDetectorCatalog &,
edm::ParameterSet const & p, const SimTrackManager*);
virtual ~ECalSD();
virtual double getEnergyDeposit(G4Step*);
~ECalSD() override;
double getEnergyDeposit(G4Step*) override;
virtual uint16_t getRadiationLength(G4Step *);
virtual uint16_t getLayerIDForTimeSim(G4Step *);
virtual uint32_t setDetUnitId(G4Step*);
uint32_t setDetUnitId(G4Step*) override ;
void setNumberingScheme(EcalNumberingScheme*);
virtual int getTrackID(G4Track*);
virtual uint16_t getDepth(G4Step*);
int getTrackID(G4Track*) override;
uint16_t getDepth(G4Step*) override;

private:
void initMap(G4String, const DDCompactView &);
double curve_LY(G4Step*);
double crystalLength(G4LogicalVolume*);
double crystalDepth(G4LogicalVolume*, const G4ThreeVector&);
void initMap(const G4String&, const DDCompactView &);
double curve_LY();
double crystalLength();
double crystalDepth();
void getBaseNumber(const G4Step*);
double getBirkL3(G4Step*);
double getBirkL3(const G4Step*);
std::vector<double> getDDDArray(const std::string&,
const DDsvalues_type&);
std::vector<std::string> getStringArray(const std::string&,
Expand All @@ -66,6 +66,7 @@ class ECalSD : public CaloSD {
EcalBaseNumber theBaseNumber;
EnergyResolutionVsLumi ageing;
bool ageingWithSlopeLY;
G4ThreeVector localPoint;
#ifdef plotDebug
TH2F *g2L_[4];
#endif
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/interface/EnergyResolutionVsLumi.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <string>
#include <map>

#include <time.h>
#include <stdio.h>
#include <ctime>
#include <cstdio>

#include <math.h>
#include <cmath>

#include "SimG4CMS/Calo/interface/EvolutionECAL.h"
#include "DataFormats/DetId/interface/DetId.h"
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/interface/EvolutionECAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <string>
#include <map>

#include <time.h>
#include <stdio.h>
#include <ctime>
#include <cstdio>

#include <math.h>
#include <cmath>
#include "TF1.h"
#include "TH1F.h"
#include "TMath.h"
Expand Down
32 changes: 16 additions & 16 deletions SimG4CMS/Calo/interface/HCalSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ class HCalSD : public CaloSD, public Observer<const BeginOfJob *> {

public:

HCalSD(G4String , const DDCompactView &, const SensitiveDetectorCatalog &,
HCalSD(const std::string& , const DDCompactView &, const SensitiveDetectorCatalog &,
edm::ParameterSet const &, const SimTrackManager*);
virtual ~HCalSD();
virtual bool ProcessHits(G4Step * , G4TouchableHistory * );
virtual double getEnergyDeposit(G4Step* );
virtual uint32_t setDetUnitId(G4Step* step);
~HCalSD() override;
bool ProcessHits(G4Step * , G4TouchableHistory * ) override;
double getEnergyDeposit(G4Step* ) override;
uint32_t setDetUnitId(G4Step* step) override ;
void setNumberingScheme(HcalNumberingScheme* );

protected:

virtual void update(const BeginOfJob *);
virtual void initRun();
virtual bool filterHit(CaloG4Hit*, double);
void update(const BeginOfJob *) override;
void initRun() override;
bool filterHit(CaloG4Hit*, double) override;

private:

Expand All @@ -58,26 +58,26 @@ class HCalSD : public CaloSD, public Observer<const BeginOfJob *> {
std::vector<double> getDDDArray(const std::string&,
const DDsvalues_type&);
std::vector<G4String> getNames(DDFilteredView&);
bool isItHF(G4Step *);
bool isItHF(G4String);
bool isItHF(const G4Step *);
bool isItHF(const G4String&);
bool isItFibre(G4LogicalVolume*);
bool isItFibre(G4String);
bool isItFibre(const G4String&);
bool isItPMT(G4LogicalVolume*);
bool isItStraightBundle(G4LogicalVolume*);
bool isItConicalBundle(G4LogicalVolume*);
bool isItScintillator(G4Material*);
bool isItinFidVolume (G4ThreeVector&);
bool isItinFidVolume (const G4ThreeVector&);
void getFromLibrary(G4Step * step, double weight);
void hitForFibre(G4Step * step, double weight);
void getFromParam(G4Step * step, double weight);
void getHitPMT(G4Step * step);
void getHitFibreBundle(G4Step * step, bool type);
int setTrackID(G4Step * step);
void readWeightFromFile(std::string);
int setTrackID(const G4Step * step);
void readWeightFromFile(const std::string&);
double layerWeight(int, const G4ThreeVector&, int, int);
void plotProfile(G4Step* step, const G4ThreeVector& pos,
void plotProfile(const G4Step* step, const G4ThreeVector& pos,
double edep, double time, int id);
void plotHF(G4ThreeVector& pos, bool emType);
void plotHF(const G4ThreeVector& pos, bool emType);
void modifyDepth(HcalNumberingFromDDD::HcalID& id);

HcalDDDSimConstants* hcalConstants;
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFFibre.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class HFFibre {
public:

//Constructor and Destructor
HFFibre(std::string & name, const DDCompactView & cpv,
HFFibre(const std::string & name, const DDCompactView & cpv,
edm::ParameterSet const & p);
~HFFibre();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFShower.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HFShower {

public:

HFShower(std::string & name, const DDCompactView & cpv,
HFShower(const std::string & name, const DDCompactView & cpv,
edm::ParameterSet const & p, int chk=0);
virtual ~HFShower();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFShowerFibreBundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HFShowerFibreBundle {

public:

HFShowerFibreBundle(std::string & name, const DDCompactView & cpv,
HFShowerFibreBundle(const std::string & name, const DDCompactView & cpv,
edm::ParameterSet const & p);
virtual ~HFShowerFibreBundle();
double getHits(G4Step * aStep, bool type);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFShowerLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class HFShowerLibrary {
public:

//Constructor and Destructor
HFShowerLibrary(std::string & name, const DDCompactView & cpv,
HFShowerLibrary(const std::string & name, const DDCompactView & cpv,
edm::ParameterSet const & p);
~HFShowerLibrary();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFShowerPMT.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HFShowerPMT {

public:

HFShowerPMT(std::string & name, const DDCompactView & cpv,
HFShowerPMT(const std::string & name, const DDCompactView & cpv,
edm::ParameterSet const & p);
virtual ~HFShowerPMT();
double getHits(G4Step * aStep);
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFShowerParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class HFShowerParam {

public:

HFShowerParam(std::string & name, const DDCompactView & cpv,
HFShowerParam(const std::string & name, const DDCompactView & cpv,
edm::ParameterSet const & p);
virtual ~HFShowerParam();

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HcalNumberingScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HcalNumberingScheme : public CaloNumberingScheme {

public:
HcalNumberingScheme();
virtual ~HcalNumberingScheme();
~HcalNumberingScheme() override;
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID& id);

};
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/interface/HcalTestNumberingScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class HcalTestNumberingScheme : public HcalNumberingScheme {

public:
HcalTestNumberingScheme(bool forTB);
virtual ~HcalTestNumberingScheme();
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID& id);
~HcalTestNumberingScheme() override;
uint32_t getUnitID(const HcalNumberingFromDDD::HcalID& id) override;
static uint32_t packHcalIndex(int det, int z, int depth, int eta,
int phi, int lay);
static void unpackHcalIndex(const uint32_t & idx, int& det, int& z,
Expand Down
Loading

0 comments on commit 5506301

Please sign in to comment.