CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HcalTB06BeamSD Class Reference

#include <HcalTB06BeamSD.h>

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

Public Member Functions

 HcalTB06BeamSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *step) override
 
 ~HcalTB06BeamSD () override
 
- Public Member Functions inherited from CaloSD
 CaloSD (const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
void clear () override
 
void clearHits () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PCaloHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
bool isItFineCalo (const G4VTouchable *touch)
 
void PrintAll () override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) override
 
G4bool ProcessHits (G4Step *step, G4TouchableHistory *) override
 
void reset () override
 
 ~CaloSD () override
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
const std::vector< std::string > & getNames () const
 
void Initialize (G4HCofThisEvent *eventHC) override
 
bool isCaloSD () const
 
 SensitiveDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, bool calo)
 
 ~SensitiveDetector () override
 
- 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 ()
 

Protected Member Functions

double getEnergyDeposit (const G4Step *) override
 
- Protected Member Functions inherited from CaloSD
bool checkHit ()
 
CaloG4HitcreateNewHit (const G4Step *, const G4Track *)
 
virtual void endEvent ()
 
virtual double EnergyCorrected (const G4Step &step, const G4Track *)
 
virtual bool filterHit (CaloG4Hit *, double)
 
double getAttenuation (const G4Step *aStep, double birk1, double birk2, double birk3) const
 
virtual uint16_t getDepth (const G4Step *)
 
virtual bool getFromLibrary (const G4Step *step)
 
int getNumberOfHits ()
 
double getResponseWt (const G4Track *)
 
virtual int getTrackID (const G4Track *)
 
void hitBookkeepingFineCalo (const G4Step *step, const G4Track *currentTrack, CaloG4Hit *hit)
 
bool hitExists (const G4Step *)
 
void ignoreRejection ()
 
virtual void initEvent (const BeginOfEvent *)
 
virtual void initRun ()
 
void printDetectorLevels (const G4VTouchable *) const
 
void processHit (const G4Step *step)
 
void resetForNewPrimary (const G4Step *)
 
void setNumberCheckedHits (int val)
 
void setParameterized (bool val)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *) const
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *) const
 
virtual int setTrackID (const G4Step *)
 
void setUseMap (bool val)
 
void update (const ::EndOfEvent *) override
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void updateHit (CaloG4Hit *)
 
- Protected Member Functions inherited from SensitiveDetector
TrackInformationcmsTrackInformation (const G4Track *aTrack)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point) const
 
Local3DPoint FinalStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint InitialStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint LocalPostStepPosition (const G4Step *step) const
 
Local3DPoint LocalPreStepPosition (const G4Step *step) const
 
void NaNTrap (const G4Step *step) const
 
void setNames (const std::vector< std::string > &)
 
- 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 isItWireChamber (const std::string &)
 

Private Attributes

double birk1_
 
double birk2_
 
double birk3_
 
const HcalTB06BeamParametershcalBeamPar_
 
bool useBirk_
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Static Protected Member Functions inherited from CaloSD
static std::string printableDecayChain (const std::vector< unsigned int > &decayChain)
 
- Protected Attributes inherited from CaloSD
CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
bool forceSave
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
G4ThreeVector posGlobal
 
CaloHitID previousID
 
bool suppressHeavy
 
double tmaxHit
 

Detailed Description

Definition at line 18 of file HcalTB06BeamSD.h.

Constructor & Destructor Documentation

◆ HcalTB06BeamSD()

HcalTB06BeamSD::HcalTB06BeamSD ( const std::string &  name,
const edm::EventSetup es,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 20 of file HcalTB06BeamSD.cc.

25  : CaloSD(name, es, clg, p, manager) {
26  // Values from NIM 80 (1970) 239-244: as implemented in Geant3
27  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HcalTB06BeamSD");
28  useBirk_ = m_HC.getParameter<bool>("UseBirkLaw");
29  birk1_ = m_HC.getParameter<double>("BirkC1") * (CLHEP::g / (CLHEP::MeV * CLHEP::cm2));
30  birk2_ = m_HC.getParameter<double>("BirkC2");
31  birk3_ = m_HC.getParameter<double>("BirkC3");
32 
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("HcalTBSim") << "HcalTB06BeamSD:: Use of Birks law is set to " << useBirk_
35  << " with three constants kB = " << birk1_ << ", C1 = " << birk2_
36  << ", C2 = " << birk3_;
37 #endif
38 
39  // Get pointers to HcalTB06BeamParameters
41  es.get<IdealGeometryRecord>().get(hdc);
42  if (hdc.isValid()) {
43  hcalBeamPar_ = hdc.product();
44  } else {
45  throw cms::Exception("Unknown", "HCalTB06BeamSD") << "Cannot find HcalTB06BeamParameters";
46  }
47 }

References birk1_, birk2_, birk3_, Exception, g, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), hcalBeamPar_, edm::ESHandleBase::isValid(), MeV, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), and useBirk_.

◆ ~HcalTB06BeamSD()

HcalTB06BeamSD::~HcalTB06BeamSD ( )
override

Definition at line 49 of file HcalTB06BeamSD.cc.

49 {}

Member Function Documentation

◆ getEnergyDeposit()

double HcalTB06BeamSD::getEnergyDeposit ( const G4Step *  aStep)
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 51 of file HcalTB06BeamSD.cc.

51  {
52  double destep = aStep->GetTotalEnergyDeposit();
53  double weight = 1;
54  if (useBirk_ && aStep->GetPreStepPoint()->GetMaterial()->GetName() == static_cast<G4String>(hcalBeamPar_->material_))
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("HcalTBSim") << "HcalTB06BeamSD: Detector "
58  << aStep->GetPreStepPoint()->GetTouchable()->GetVolume()->GetName() << " weight "
59  << weight;
60 #endif
61  return weight * destep;
62 }

References birk1_, birk2_, birk3_, CaloSD::getAttenuation(), hcalBeamPar_, HcalTB06BeamParameters::material_, useBirk_, and mps_merge::weight.

◆ isItWireChamber()

bool HcalTB06BeamSD::isItWireChamber ( const std::string &  name)
private

Definition at line 84 of file HcalTB06BeamSD.cc.

84  {
85  std::vector<std::string>::const_iterator it = hcalBeamPar_->wchambers_.begin();
86  for (; it != hcalBeamPar_->wchambers_.end(); it++)
87  if (name == *it)
88  return true;
89  return false;
90 }

References hcalBeamPar_, Skims_PA_cff::name, and HcalTB06BeamParameters::wchambers_.

Referenced by setDetUnitId().

◆ setDetUnitId()

uint32_t HcalTB06BeamSD::setDetUnitId ( const G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 64 of file HcalTB06BeamSD.cc.

64  {
65  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
66  const G4VTouchable* touch = preStepPoint->GetTouchable();
67  std::string name = static_cast<std::string>(preStepPoint->GetPhysicalVolume()->GetName());
68 
69  int det = 1;
70  int lay = 0, x = 0, y = 0;
71  if (!isItWireChamber(name)) {
72  lay = (touch->GetReplicaNumber(0));
73  } else {
74  det = 2;
75  lay = (touch->GetReplicaNumber(1));
76  G4ThreeVector localPoint = setToLocal(preStepPoint->GetPosition(), touch);
77  x = (int)(localPoint.x() / (0.2 * mm));
78  y = (int)(localPoint.y() / (0.2 * mm));
79  }
80 
81  return HcalTestBeamNumbering::packIndex(det, lay, x, y);
82 }

References createfilelist::int, isItWireChamber(), Skims_PA_cff::name, HcalTestBeamNumbering::packIndex(), CaloSD::setToLocal(), AlCaHLTBitMon_QueryRunRegistry::string, x, and y.

Member Data Documentation

◆ birk1_

double HcalTB06BeamSD::birk1_
private

Definition at line 35 of file HcalTB06BeamSD.h.

Referenced by getEnergyDeposit(), and HcalTB06BeamSD().

◆ birk2_

double HcalTB06BeamSD::birk2_
private

Definition at line 35 of file HcalTB06BeamSD.h.

Referenced by getEnergyDeposit(), and HcalTB06BeamSD().

◆ birk3_

double HcalTB06BeamSD::birk3_
private

Definition at line 35 of file HcalTB06BeamSD.h.

Referenced by getEnergyDeposit(), and HcalTB06BeamSD().

◆ hcalBeamPar_

const HcalTB06BeamParameters* HcalTB06BeamSD::hcalBeamPar_
private

Definition at line 36 of file HcalTB06BeamSD.h.

Referenced by getEnergyDeposit(), HcalTB06BeamSD(), and isItWireChamber().

◆ useBirk_

bool HcalTB06BeamSD::useBirk_
private

Definition at line 34 of file HcalTB06BeamSD.h.

Referenced by getEnergyDeposit(), and HcalTB06BeamSD().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HcalTB06BeamSD::hcalBeamPar_
const HcalTB06BeamParameters * hcalBeamPar_
Definition: HcalTB06BeamSD.h:36
DDAxes::y
HcalTestBeamNumbering::packIndex
static uint32_t packIndex(int det, int lay, int x, int y)
Definition: HcalTestBeamNumbering.cc:6
HcalTB06BeamParameters::wchambers_
std::vector< std::string > wchambers_
Definition: HcalTB06BeamParameters.h:13
mps_merge.weight
weight
Definition: mps_merge.py:88
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HcalTB06BeamSD::isItWireChamber
bool isItWireChamber(const std::string &)
Definition: HcalTB06BeamSD.cc:84
CaloSD::getAttenuation
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:685
HcalTB06BeamSD::birk3_
double birk3_
Definition: HcalTB06BeamSD.h:35
MeV
const double MeV
DDAxes::x
HcalTB06BeamParameters::material_
std::string material_
Definition: HcalTB06BeamParameters.h:14
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
CaloSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
Definition: CaloSD.cc:387
edm::ESHandle
Definition: DTSurvey.h:22
HcalTB06BeamSD::useBirk_
bool useBirk_
Definition: HcalTB06BeamSD.h:34
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalTB06BeamSD::birk1_
double birk1_
Definition: HcalTB06BeamSD.h:35
edm::ParameterSet
Definition: ParameterSet.h:47
createfilelist.int
int
Definition: createfilelist.py:10
CaloSD::CaloSD
CaloSD(const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:35
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
HcalTB06BeamSD::birk2_
double birk2_
Definition: HcalTB06BeamSD.h:35
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
weight
Definition: weight.py:1
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
g
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