CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HGCalTB16SD01 Class Reference

#include <HGCalTB16SD01.h>

Inheritance diagram for HGCalTB16SD01:
CaloSD SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

virtual double getEnergyDeposit (G4Step *)
 
 HGCalTB16SD01 (G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
virtual uint32_t setDetUnitId (G4Step *step)
 
virtual ~HGCalTB16SD01 ()
 
- Public Member Functions inherited from CaloSD
 CaloSD (G4String aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void EndOfEvent (G4HCofThisEvent *eventHC)
 
void fillHits (edm::PCaloHitContainer &, std::string n)
 
virtual void Initialize (G4HCofThisEvent *HCE)
 
virtual void PrintAll ()
 
virtual bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory)
 
virtual bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *)
 
virtual ~CaloSD ()
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (const std::string &vname)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point)
 
Local3DPoint FinalStepPosition (G4Step *s, coordinates)
 
virtual std::vector< std::string > getNames ()
 
Local3DPoint InitialStepPosition (G4Step *s, coordinates)
 
std::string nameOfSD ()
 
void NaNTrap (G4Step *step)
 
void Register ()
 
 SensitiveDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
virtual ~SensitiveDetector ()
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 

Static Public Member Functions

static uint32_t packIndex (int det, int lay, int x, int y)
 
static void unpackIndex (const uint32_t &idx, int &det, int &lay, int &x, int &y)
 

Private Member Functions

void initialize (G4StepPoint *point)
 

Private Attributes

double birk1_
 
double birk2_
 
double birk3_
 
bool initialize_
 
std::string matName_
 
G4Material * matScin_
 
bool useBirk_
 

Additional Inherited Members

- Public Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Member Functions inherited from CaloSD
G4bool checkHit ()
 
virtual void clearHits ()
 
CaloG4HitcreateNewHit ()
 
virtual bool filterHit (CaloG4Hit *, double)
 
double getAttenuation (G4Step *aStep, double birk1, double birk2, double birk3)
 
virtual uint16_t getDepth (G4Step *)
 
int getNumberOfHits ()
 
double getResponseWt (G4Track *)
 
virtual G4bool getStepInfo (G4Step *aStep)
 
virtual int getTrackID (G4Track *)
 
G4bool hitExists ()
 
virtual void initRun ()
 
void resetForNewPrimary (const G4ThreeVector &, double)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *)
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *)
 
virtual void update (const BeginOfRun *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const BeginOfEvent *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const EndOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const ::EndOfEvent *)
 
void updateHit (CaloG4Hit *)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 
- Protected Attributes inherited from CaloSD
int checkHits
 
double correctT
 
bool corrTOFBeam
 
CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double eminHitD
 
G4int emPDG
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
G4int epPDG
 
bool forceSave
 
G4int gammaPDG
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
const SimTrackManagerm_trackManager
 
G4ThreeVector posGlobal
 
G4StepPoint * preStepPoint
 
CaloHitID previousID
 
int primIDSaved
 
bool runInit
 
bool suppressHeavy
 
G4Track * theTrack
 
double tmaxHit
 
bool useMap
 

Detailed Description

Definition at line 19 of file HGCalTB16SD01.h.

Constructor & Destructor Documentation

HGCalTB16SD01::HGCalTB16SD01 ( G4String  name,
const DDCompactView cpv,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 24 of file HGCalTB16SD01.cc.

References birk1_, birk2_, birk3_, g, edm::ParameterSet::getParameter(), matName_, matScin_, MeV, AlCaHLTBitMon_QueryRunRegistry::string, and useBirk_.

27  :
28  CaloSD(name, cpv, clg, p, manager), initialize_(true) {
29 
30  // Values from NIM 80 (1970) 239-244: as implemented in Geant3
31  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HGCalTestBeamSD");
32  matName_ = m_HC.getParameter<std::string>("Material");
33  useBirk_ = m_HC.getParameter<bool>("UseBirkLaw");
34  birk1_ = m_HC.getParameter<double>("BirkC1")*(g/(MeV*cm2));
35  birk2_ = m_HC.getParameter<double>("BirkC2");
36  birk3_ = m_HC.getParameter<double>("BirkC3");
37  matScin_ = nullptr;
38 
39  edm::LogInfo("HGCSim") << "HGCalTB16SD01:: Use of Birks law is set to "
40  << useBirk_ << " for " << matName_
41  << " with three constants kB = " << birk1_
42  << ", C1 = " << birk2_ << ", C2 = " << birk3_;
43 }
T getParameter(std::string const &) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
CaloSD(G4String aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:24
std::string matName_
Definition: HGCalTB16SD01.h:36
const double MeV
G4Material * matScin_
Definition: HGCalTB16SD01.h:40
HGCalTB16SD01::~HGCalTB16SD01 ( )
virtual

Definition at line 45 of file HGCalTB16SD01.cc.

45 {}

Member Function Documentation

double HGCalTB16SD01::getEnergyDeposit ( G4Step *  aStep)
virtual

Reimplemented from CaloSD.

Definition at line 47 of file HGCalTB16SD01.cc.

References birk1_, birk2_, birk3_, gather_cfg::cout, CaloSD::getAttenuation(), initialize(), initialize_, matScin_, point, and useBirk_.

47  {
48 
49  G4StepPoint* point = aStep->GetPreStepPoint();
50  if (initialize_) initialize(point);
51  double destep = aStep->GetTotalEnergyDeposit();
52  double wt2 = aStep->GetTrack()->GetWeight();
53  double weight = (wt2 > 0.0) ? wt2 : 1.0;
54  if (useBirk_ && matScin_ == point->GetMaterial()) {
55  weight *= getAttenuation(aStep, birk1_, birk2_, birk3_);
56  }
57 #ifdef EDM_ML_DEBUG
58  std::cout << "HGCalTB16SD01: Detector "
59  << point->GetTouchable()->GetVolume()->GetName() << " with "
60  << point->GetMaterial()->GetName() << " weight " << weight
61  << ":" << wt2 << std::endl;
62 #endif
63  return weight*destep;
64 }
Definition: weight.py:1
void initialize(G4StepPoint *point)
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
Definition: CaloSD.cc:465
G4Material * matScin_
Definition: HGCalTB16SD01.h:40
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void HGCalTB16SD01::initialize ( G4StepPoint *  point)
private

Definition at line 109 of file HGCalTB16SD01.cc.

References gather_cfg::cout, initialize_, matName_, and matScin_.

Referenced by getEnergyDeposit().

109  {
110  if (matName_ == point->GetMaterial()->GetName()) {
111  matScin_ = point->GetMaterial();
112  initialize_ = false;
113  }
114 #ifdef EDM_ML_DEBUG
115  std::cout << "HGCalTB16SD01: Material pointer for " << matName_
116  << " is initialized to : " << matScin_ << std::endl;
117 #endif
118 }
std::string matName_
Definition: HGCalTB16SD01.h:36
G4Material * matScin_
Definition: HGCalTB16SD01.h:40
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
uint32_t HGCalTB16SD01::packIndex ( int  det,
int  lay,
int  x,
int  y 
)
static

Definition at line 78 of file HGCalTB16SD01.cc.

References gather_cfg::cout, TauDecayModes::dec, training_settings::idx, ixx, iyy, x, and y.

Referenced by setDetUnitId().

78  {
79 
80  int ix = 0, ixx = x;
81  if (x < 0) { ix = 1; ixx =-x;}
82  int iy = 0, iyy = y;
83  if (y < 0) { iy = 1; iyy =-y;}
84  uint32_t idx = (det&15)<<28; //bits 28-31
85  idx += (lay&127)<<21; //bits 21-27
86  idx += (iy&1)<<19; //bit 19
87  idx += (iyy&511)<<10; //bits 10-18
88  idx += (ix&1)<<9; //bit 9
89  idx += (ixx&511); //bits 0-8
90 
91 #ifdef EDM_ML_DEBUG
92  std::cout << "HGCalTB16SD01: Detector " << det << " Layer " << lay << " x "
93  << x << " " << ix << " " << ixx << " y " << y << " " << iy << " "
94  << iyy << " ID " << std::hex << idx << std::dec << std::endl;
95 #endif
96  return idx;
97 }
int iyy[18][41][3]
int ixx[18][41][3]
uint32_t HGCalTB16SD01::setDetUnitId ( G4Step *  step)
virtual

Implements CaloSD.

Definition at line 66 of file HGCalTB16SD01.cc.

References SensitiveDetector::name, packIndex(), CaloSD::preStepPoint, x, and y.

66  {
67 
68  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
69  const G4VTouchable* touch = preStepPoint->GetTouchable();
70  G4String name = preStepPoint->GetPhysicalVolume()->GetName();
71 
72  int det(1), x(0), y(0);
73  int lay = (touch->GetReplicaNumber(0));
74 
75  return packIndex (det, lay, x, y);
76 }
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
static uint32_t packIndex(int det, int lay, int x, int y)
void HGCalTB16SD01::unpackIndex ( const uint32_t &  idx,
int &  det,
int &  lay,
int &  x,
int &  y 
)
static

Definition at line 99 of file HGCalTB16SD01.cc.

References training_settings::idx, x, and y.

100  {
101 
102  det = (idx>>28)&15;
103  lay = (idx>>21)&127;
104  y = (idx>>10)&511; if (((idx>>19)&1) == 1) y = -y;
105  x = (idx)&511; if (((idx>>9)&1) == 1) x = -x;
106 
107 }

Member Data Documentation

double HGCalTB16SD01::birk1_
private

Definition at line 38 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

double HGCalTB16SD01::birk2_
private

Definition at line 38 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

double HGCalTB16SD01::birk3_
private

Definition at line 38 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().

bool HGCalTB16SD01::initialize_
private

Definition at line 39 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and initialize().

std::string HGCalTB16SD01::matName_
private

Definition at line 36 of file HGCalTB16SD01.h.

Referenced by HGCalTB16SD01(), and initialize().

G4Material* HGCalTB16SD01::matScin_
private

Definition at line 40 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), HGCalTB16SD01(), and initialize().

bool HGCalTB16SD01::useBirk_
private

Definition at line 37 of file HGCalTB16SD01.h.

Referenced by getEnergyDeposit(), and HGCalTB16SD01().