CMS 3D CMS Logo

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

#include <HGCSD.h>

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

Public Member Functions

virtual double getEnergyDeposit (G4Step *)
 
 HGCSD (G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
virtual bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual uint32_t setDetUnitId (G4Step *step)
 
virtual ~HGCSD ()
 
- 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 (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 ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob *iT)
 
virtual ~Observer ()
 

Protected Member Functions

virtual bool filterHit (CaloG4Hit *, double)
 
virtual void initRun ()
 
virtual void update (const BeginOfJob *)
 This routine will be called when the appropriate signal arrives. More...
 
- Protected Member Functions inherited from CaloSD
G4bool checkHit ()
 
virtual void clearHits ()
 
CaloG4HitcreateNewHit ()
 
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 ()
 
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...
 

Private Member Functions

bool isItinFidVolume (G4ThreeVector &)
 
uint32_t setDetUnitId (ForwardSubdetector &, int, int, int, int, G4ThreeVector &)
 
int setTrackID (G4Step *step)
 

Private Attributes

double eminHit
 
HGCalGeometryMode m_mode
 
G4int mumPDG
 
G4int mupPDG
 
ForwardSubdetector myFwdSubdet_
 
std::string nameX
 
HGCNumberingSchemenumberingScheme
 

Additional Inherited Members

- Public Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- 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 26 of file HGCSD.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file HGCSD.cc.

References eminHit, ForwardEmpty, edm::ParameterSet::getParameter(), HGCEE, HGCHEB, HGCHEF, LogDebug, MeV, myFwdSubdet_, SensitiveDetector::nameOfSD(), and nameX.

36  :
37  CaloSD(name, cpv, clg, p, manager,
38  (float)(p.getParameter<edm::ParameterSet>("HGCSD").getParameter<double>("TimeSliceUnit")),
39  p.getParameter<edm::ParameterSet>("HGCSD").getParameter<bool>("IgnoreTrackID")),
40  numberingScheme(0) {
41 
42  edm::ParameterSet m_HGC = p.getParameter<edm::ParameterSet>("HGCSD");
43  eminHit = m_HGC.getParameter<double>("EminHit")*CLHEP::MeV;
44 
45  //this is defined in the hgcsens.xml
46  G4String myName(this->nameOfSD());
48  nameX = "HGCal";
49  if (myName.find("HitsEE")!=std::string::npos) {
51  nameX = "HGCalEESensitive";
52  } else if (myName.find("HitsHEfront")!=std::string::npos) {
54  nameX = "HGCalHESiliconSensitive";
55  } else if (myName.find("HitsHEback")!=std::string::npos) {
57  nameX = "HGCalHEScintillatorSensitive";
58  }
59 
60 #ifdef DebugLog
61  LogDebug("HGCSim") << "**************************************************"
62  << "\n"
63  << "* *"
64  << "\n"
65  << "* Constructing a HGCSD with name " << name << "\n"
66  << "* *"
67  << "\n"
68  << "**************************************************";
69 #endif
70  edm::LogInfo("HGCSim") << "HGCSD:: Threshold for storing hits: " << eminHit;
71 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::string nameOfSD()
HGCNumberingScheme * numberingScheme
Definition: HGCSD.h:52
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
double eminHit
Definition: HGCSD.h:54
const double MeV
std::string nameX
Definition: HGCSD.h:49
ForwardSubdetector myFwdSubdet_
Definition: HGCSD.h:55
HGCSD::~HGCSD ( )
virtual

Definition at line 73 of file HGCSD.cc.

References numberingScheme.

73  {
74  if (numberingScheme) delete numberingScheme;
75 }
HGCNumberingScheme * numberingScheme
Definition: HGCSD.h:52

Member Function Documentation

bool HGCSD::filterHit ( CaloG4Hit aHit,
double  time 
)
protectedvirtual

Reimplemented from CaloSD.

Definition at line 162 of file HGCSD.cc.

References eminHit, CaloG4Hit::getEnergyDeposit(), and CaloSD::tmaxHit.

162  {
163  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit));
164 }
double eminHit
Definition: HGCSD.h:54
double tmaxHit
Definition: CaloSD.h:123
double getEnergyDeposit() const
Definition: CaloG4Hit.h:81
double HGCSD::getEnergyDeposit ( G4Step *  aStep)
virtual

Reimplemented from CaloSD.

Definition at line 102 of file HGCSD.cc.

102  {
103  double destep = aStep->GetTotalEnergyDeposit();
104  return destep;
105 }
void HGCSD::initRun ( void  )
protectedvirtual

Reimplemented from CaloSD.

Definition at line 151 of file HGCSD.cc.

References LogDebug, mumPDG, and mupPDG.

151  {
152  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
153  G4String particleName;
154  mumPDG = theParticleTable->FindParticle(particleName="mu-")->GetPDGEncoding();
155  mupPDG = theParticleTable->FindParticle(particleName="mu+")->GetPDGEncoding();
156 #ifdef DebugLog
157  LogDebug("HGCSim") << "HGCSD: Particle code for mu- = " << mumPDG
158  << " for mu+ = " << mupPDG;
159 #endif
160 }
#define LogDebug(id)
G4int mupPDG
Definition: HGCSD.h:53
G4int mumPDG
Definition: HGCSD.h:53
bool HGCSD::isItinFidVolume ( G4ThreeVector &  )
inlineprivate

Definition at line 46 of file HGCSD.h.

46 {return true;}
bool HGCSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Reimplemented from CaloSD.

Definition at line 77 of file HGCSD.cc.

References CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::edepositEM, CaloSD::edepositHAD, CaloSD::getStepInfo(), CaloSD::hitExists(), mumPDG, mupPDG, SensitiveDetector::NaNTrap(), and NULL.

77  {
78 
79  NaNTrap( aStep ) ;
80 
81  if (aStep == NULL) {
82  return true;
83  } else {
84 #ifdef DebugLog
85  G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
86  bool notaMuon = (parCode == mupPDG || parCode == mumPDG ) ? false : true;
87  G4LogicalVolume* lv =
88  aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
89  edm::LogInfo("HGCSim") << "HGCSD: Hit from standard path from "
90  << lv->GetName() << " for Track "
91  << aStep->GetTrack()->GetTrackID() << " ("
92  << aStep->GetTrack()->GetDefinition()->GetParticleName()
93  << ":" << notaMuon << ")";
94 #endif
95  if (getStepInfo(aStep)) {
96  if (hitExists() == false && edepositEM+edepositHAD>0.) currentHit = createNewHit();
97  }
98  return true;
99  }
100 }
float edepositEM
Definition: CaloSD.h:121
#define NULL
Definition: scimark2.h:8
G4int mupPDG
Definition: HGCSD.h:53
float edepositHAD
Definition: CaloSD.h:121
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
Definition: CaloSD.cc:250
G4bool hitExists()
Definition: CaloSD.cc:310
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
G4int mumPDG
Definition: HGCSD.h:53
uint32_t HGCSD::setDetUnitId ( G4Step *  step)
virtual

Implements CaloSD.

Definition at line 107 of file HGCSD.cc.

References m_mode, python.rootplot.argparse::module, myFwdSubdet_, CaloSD::preStepPoint, and Square.

107  {
108 
109  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
110  const G4VTouchable* touch = preStepPoint->GetTouchable();
111 
112  //determine the exact position in global coordinates in the mass geometry
113  G4ThreeVector hitPoint = preStepPoint->GetPosition();
114  float globalZ=touch->GetTranslation(0).z();
115  int iz( globalZ>0 ? 1 : -1);
116 
117  //convert to local coordinates (=local to the current volume):
118  G4ThreeVector localpos = touch->GetHistory()->GetTopTransform().TransformPoint(hitPoint);
119 
120  //get the det unit id with
122 
123  int layer(0), module(0), cell(0);
125  layer = touch->GetReplicaNumber(0);
126  module = touch->GetReplicaNumber(1);
127  } else {
128  layer = touch->GetReplicaNumber(2);
129  module = touch->GetReplicaNumber(1);
130  cell = touch->GetReplicaNumber(0);
131  }
132 
133  return setDetUnitId (subdet, layer, module, cell, iz, localpos);
134 }
ForwardSubdetector
HGCalGeometryMode m_mode
Definition: HGCSD.h:51
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
ForwardSubdetector myFwdSubdet_
Definition: HGCSD.h:55
Definition: vlib.h:208
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HGCSD.cc:107
uint32_t HGCSD::setDetUnitId ( ForwardSubdetector subdet,
int  layer,
int  module,
int  cell,
int  iz,
G4ThreeVector &  pos 
)
private

Definition at line 168 of file HGCSD.cc.

References HGCNumberingScheme::getUnitID(), and numberingScheme.

169  {
170  return (numberingScheme ? numberingScheme->getUnitID(subdet, layer, module, cell, iz, pos) : 0);
171 }
HGCNumberingScheme * numberingScheme
Definition: HGCSD.h:52
uint32_t getUnitID(ForwardSubdetector subdet, int layer, int module, int cell, int iz, const G4ThreeVector &pos)
assigns the det id to a hit
Definition: vlib.h:208
int HGCSD::setTrackID ( G4Step *  step)
private

Definition at line 174 of file HGCSD.cc.

References TrackInformation::getIDonCaloSurface(), CaloSD::preStepPoint, CaloSD::previousID, CaloSD::resetForNewPrimary(), CaloSD::theTrack, and CaloHitID::trackID().

174  {
175  theTrack = aStep->GetTrack();
176 
177  double etrack = preStepPoint->GetKineticEnergy();
178  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
179  int primaryID = trkInfo->getIDonCaloSurface();
180  if (primaryID == 0) {
181 #ifdef DebugLog
182  edm::LogInfo("HGCSim") << "HGCSD: Problem with primaryID **** set by "
183  << "force to TkID **** " <<theTrack->GetTrackID();
184 #endif
185  primaryID = theTrack->GetTrackID();
186  }
187 
188  if (primaryID != previousID.trackID())
189  resetForNewPrimary(preStepPoint->GetPosition(), etrack);
190 
191  return primaryID;
192 }
int getIDonCaloSurface() const
void resetForNewPrimary(const G4ThreeVector &, double)
Definition: CaloSD.cc:454
int trackID() const
Definition: CaloHitID.h:25
CaloHitID previousID
Definition: CaloSD.h:117
G4Track * theTrack
Definition: CaloSD.h:118
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
void HGCSD::update ( const BeginOfJob )
protectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 136 of file HGCSD.cc.

References Exception, edm::EventSetup::get(), m_mode, nameX, and numberingScheme.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

136  {
137 
138  const edm::EventSetup* es = (*job)();
140  es->get<IdealGeometryRecord>().get(nameX,hdc);
141  if (hdc.isValid()) {
142  m_mode = hdc->geomMode();
144  } else {
145  edm::LogError("HGCSim") << "HCalSD : Cannot find HGCalDDDConstants for "
146  << nameX;
147  throw cms::Exception("Unknown", "HGCSD") << "Cannot find HGCalDDDConstants for " << nameX << "\n";
148  }
149 }
HGCNumberingScheme * numberingScheme
Definition: HGCSD.h:52
HGCalGeometryMode m_mode
Definition: HGCSD.h:51
std::string nameX
Definition: HGCSD.h:49
const T & get() const
Definition: EventSetup.h:56

Member Data Documentation

double HGCSD::eminHit
private

Definition at line 54 of file HGCSD.h.

Referenced by filterHit(), and HGCSD().

HGCalGeometryMode HGCSD::m_mode
private

Definition at line 51 of file HGCSD.h.

Referenced by setDetUnitId(), and update().

G4int HGCSD::mumPDG
private

Definition at line 53 of file HGCSD.h.

Referenced by initRun(), and ProcessHits().

G4int HGCSD::mupPDG
private

Definition at line 53 of file HGCSD.h.

Referenced by initRun(), and ProcessHits().

ForwardSubdetector HGCSD::myFwdSubdet_
private

Definition at line 55 of file HGCSD.h.

Referenced by HGCSD(), and setDetUnitId().

std::string HGCSD::nameX
private

Definition at line 49 of file HGCSD.h.

Referenced by HGCSD(), and update().

HGCNumberingScheme* HGCSD::numberingScheme
private

Definition at line 52 of file HGCSD.h.

Referenced by setDetUnitId(), update(), and ~HGCSD().