CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTBH4BeamSD Class Reference

#include <EcalTBH4BeamSD.h>

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

Public Member Functions

 EcalTBH4BeamSD (G4String, const DDCompactView &, SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
virtual double getEnergyDeposit (G4Step *)
 
virtual uint32_t setDetUnitId (G4Step *step)
 
void setNumberingScheme (EcalNumberingScheme *scheme)
 
virtual ~EcalTBH4BeamSD ()
 
- Public Member Functions inherited from CaloSD
 CaloSD (G4String aSDname, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, int tSlice=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, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (std::string &vname)
 
Local3DPoint ConvertToLocal3DPoint (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, 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 ()
 

Private Member Functions

void getBaseNumber (const G4Step *aStep)
 

Private Attributes

double birk1
 
double birk2
 
double birk3
 
EcalNumberingSchemenumberingScheme
 
EcalBaseNumber theBaseNumber
 
bool useBirk
 
bool useWeight
 

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 (G4ThreeVector, double)
 
G4ThreeVector setToLocal (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 21 of file EcalTBH4BeamSD.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file EcalTBH4BeamSD.cc.

References birk1, birk2, birk3, g, edm::ParameterSet::getParameter(), setNumberingScheme(), and useBirk.

23  :
24  CaloSD(name, cpv, clg, p, manager), numberingScheme(0) {
25 
26  edm::ParameterSet m_EcalTBH4BeamSD = p.getParameter<edm::ParameterSet>("EcalTBH4BeamSD");
27  useBirk= m_EcalTBH4BeamSD.getParameter<bool>("UseBirkLaw");
28  birk1 = m_EcalTBH4BeamSD.getParameter<double>("BirkC1")*(g/(MeV*cm2));
29  birk2 = m_EcalTBH4BeamSD.getParameter<double>("BirkC2");
30  birk3 = m_EcalTBH4BeamSD.getParameter<double>("BirkC3");
31 
32  EcalNumberingScheme* scheme=0;
33  if (name == "EcalTBH4BeamHits") {
34  scheme = dynamic_cast<EcalNumberingScheme*>(new EcalHodoscopeNumberingScheme());
35  }
36  else {edm::LogWarning("EcalTBSim") << "EcalTBH4BeamSD: ReadoutName not supported\n";}
37 
38  if (scheme) setNumberingScheme(scheme);
39  edm::LogInfo("EcalTBSim") << "Constructing a EcalTBH4BeamSD with name "
40  << GetName();
41  edm::LogInfo("EcalTBSim") << "EcalTBH4BeamSD:: Use of Birks law is set to "
42  << useBirk << " with three constants kB = "
43  << birk1 << ", C1 = " << birk2 << ", C2 = "
44  << birk3;
45 }
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, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, int tSlice=1, bool ignoreTkID=false)
Definition: CaloSD.cc:21
void setNumberingScheme(EcalNumberingScheme *scheme)
EcalNumberingScheme * numberingScheme
EcalTBH4BeamSD::~EcalTBH4BeamSD ( )
virtual

Definition at line 47 of file EcalTBH4BeamSD.cc.

References numberingScheme.

47  {
48  if (numberingScheme) delete numberingScheme;
49 }
EcalNumberingScheme * numberingScheme

Member Function Documentation

void EcalTBH4BeamSD::getBaseNumber ( const G4Step *  aStep)
private

Definition at line 85 of file EcalTBH4BeamSD.cc.

References EcalBaseNumber::addLevel(), EcalBaseNumber::getCapacity(), LogDebug, EcalBaseNumber::reset(), EcalBaseNumber::setSize(), and theBaseNumber.

Referenced by setDetUnitId().

85  {
86 
88  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
89  int theSize = touch->GetHistoryDepth()+1;
90  if ( theBaseNumber.getCapacity() < theSize ) theBaseNumber.setSize(theSize);
91  //Get name and copy numbers
92  if ( theSize > 1 ) {
93  for (int ii = 0; ii < theSize ; ii++) {
94  theBaseNumber.addLevel(touch->GetVolume(ii)->GetName(),touch->GetReplicaNumber(ii));
95  LogDebug("EcalTBSim") << "EcalTBH4BeamSD::getBaseNumber(): Adding level " << ii
96  << ": " << touch->GetVolume(ii)->GetName() << "["
97  << touch->GetReplicaNumber(ii) << "]";
98  }
99  }
100 }
#define LogDebug(id)
void addLevel(const std::string &name, const int &copyNumber)
EcalBaseNumber theBaseNumber
void setSize(const int &size)
double EcalTBH4BeamSD::getEnergyDeposit ( G4Step *  aStep)
virtual

Reimplemented from CaloSD.

Definition at line 51 of file EcalTBH4BeamSD.cc.

References birk1, birk2, birk3, CaloSD::getAttenuation(), LogDebug, NULL, CaloSD::preStepPoint, useBirk, and CommonMethods::weight().

51  {
52 
53  if (aStep == NULL) {
54  return 0;
55  } else {
56  preStepPoint = aStep->GetPreStepPoint();
57  G4String nameVolume = preStepPoint->GetPhysicalVolume()->GetName();
58 
59  // take into account light collection curve for crystals
60  double weight = 1.;
61  if (useBirk) weight *= getAttenuation(aStep, birk1, birk2, birk3);
62  double edep = aStep->GetTotalEnergyDeposit() * weight;
63  LogDebug("EcalTBSim") << "EcalTBH4BeamSD:: " << nameVolume
64  <<" Light Collection Efficiency " << weight
65  << " Weighted Energy Deposit " << edep/MeV << " MeV";
66  return edep;
67  }
68 }
#define LogDebug(id)
#define NULL
Definition: scimark2.h:8
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
Definition: CaloSD.cc:454
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
uint32_t EcalTBH4BeamSD::setDetUnitId ( G4Step *  step)
virtual

Implements CaloSD.

Definition at line 70 of file EcalTBH4BeamSD.cc.

References getBaseNumber(), EcalNumberingScheme::getUnitID(), numberingScheme, and theBaseNumber.

70  {
71  getBaseNumber(aStep);
73 }
EcalNumberingScheme * numberingScheme
EcalBaseNumber theBaseNumber
void getBaseNumber(const G4Step *aStep)
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const =0
void EcalTBH4BeamSD::setNumberingScheme ( EcalNumberingScheme scheme)

Definition at line 75 of file EcalTBH4BeamSD.cc.

References numberingScheme.

Referenced by EcalTBH4BeamSD().

75  {
76  if (scheme != 0) {
77  edm::LogInfo("EcalTBSim") << "EcalTBH4BeamSD: updates numbering scheme for "
78  << GetName() << "\n";
79  if (numberingScheme) delete numberingScheme;
80  numberingScheme = scheme;
81  }
82 }
EcalNumberingScheme * numberingScheme

Member Data Documentation

double EcalTBH4BeamSD::birk1
private

Definition at line 38 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

double EcalTBH4BeamSD::birk2
private

Definition at line 38 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

double EcalTBH4BeamSD::birk3
private

Definition at line 38 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

EcalNumberingScheme* EcalTBH4BeamSD::numberingScheme
private

Definition at line 35 of file EcalTBH4BeamSD.h.

Referenced by setDetUnitId(), setNumberingScheme(), and ~EcalTBH4BeamSD().

EcalBaseNumber EcalTBH4BeamSD::theBaseNumber
private

Definition at line 39 of file EcalTBH4BeamSD.h.

Referenced by getBaseNumber(), and setDetUnitId().

bool EcalTBH4BeamSD::useBirk
private

Definition at line 37 of file EcalTBH4BeamSD.h.

Referenced by EcalTBH4BeamSD(), and getEnergyDeposit().

bool EcalTBH4BeamSD::useWeight
private

Definition at line 36 of file EcalTBH4BeamSD.h.