CMS 3D CMS Logo

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

#include <SimG4CMS/HcalTestBeam/interface/HcalTB02SD.h>

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

Public Member Functions

 HcalTB02SD (const std::string &, const HcalTB02Parameters *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *step) override
 
void setNumberingScheme (HcalTB02NumberingScheme *scheme)
 
 ~HcalTB02SD () override
 
- Public Member Functions inherited from CaloSD
 CaloSD (const std::string &aSDname, 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 SensitiveDetectorCatalog &clg)
 
- 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 SensitiveDetectorCatalog &, 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

double crystalLength (const std::string &)
 
double curve_LY (const std::string &, const G4StepPoint *)
 

Private Attributes

double birk1_
 
double birk2_
 
double birk3_
 
const HcalTB02ParametershcalTB02Parameters_
 
std::unique_ptr< HcalTB02NumberingSchemenumberingScheme_
 
bool useBirk_
 
bool useWeight_
 

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

Description: Stores hits of Test Beam 2002 calorimeters

Usage: Activation is done using the XML file by choosing HcalTB02SensitiveDetector

Definition at line 31 of file HcalTB02SD.h.

Constructor & Destructor Documentation

◆ HcalTB02SD()

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

Definition at line 34 of file HcalTB02SD.cc.

39  : CaloSD(name, clg, p, manager), hcalTB02Parameters_(es) {
40  numberingScheme_.reset(nullptr);
41  edm::ParameterSet m_SD = p.getParameter<edm::ParameterSet>("HcalTB02SD");
42  useBirk_ = m_SD.getUntrackedParameter<bool>("UseBirkLaw", false);
43  birk1_ = m_SD.getUntrackedParameter<double>("BirkC1", 0.013) * (CLHEP::g / (CLHEP::MeV * CLHEP::cm2));
44  birk2_ = m_SD.getUntrackedParameter<double>("BirkC2", 0.0568);
45  birk3_ = m_SD.getUntrackedParameter<double>("BirkC3", 1.75);
46  useWeight_ = true;
47 
49  if (name == "EcalHitsEB") {
50  scheme = dynamic_cast<HcalTB02NumberingScheme*>(new HcalTB02XtalNumberingScheme());
51  useBirk_ = false;
52  } else if (name == "HcalHits") {
53  scheme = dynamic_cast<HcalTB02NumberingScheme*>(new HcalTB02HcalNumberingScheme());
54  useWeight_ = false;
55  } else {
56  edm::LogWarning("HcalTBSim") << "HcalTB02SD: ReadoutName " << name << " not supported\n";
57  }
58 
59  if (scheme)
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HcalTBSim") << "***************************************************\n"
63  << "* *\n"
64  << "* Constructing a HcalTB02SD with name " << GetName() << "\n"
65  << "* *\n"
66  << "***************************************************";
67  edm::LogVerbatim("HcalTBSim") << "HcalTB02SD:: Use of Birks law is set to " << useBirk_
68  << " with three constants kB = " << birk1_ << ", C1 = " << birk2_
69  << ", C2 = " << birk3_;
70 #endif
71 }

References birk1_, birk2_, birk3_, g, edm::ParameterSet::getUntrackedParameter(), MeV, Skims_PA_cff::name, numberingScheme_, AlCaHLTBitMon_ParallelJobs::p, generator_cfi::scheme, setNumberingScheme(), useBirk_, and useWeight_.

◆ ~HcalTB02SD()

HcalTB02SD::~HcalTB02SD ( )
override

Definition at line 73 of file HcalTB02SD.cc.

73 {}

Member Function Documentation

◆ crystalLength()

double HcalTB02SD::crystalLength ( const std::string &  name)
private

Definition at line 130 of file HcalTB02SD.cc.

130  {
131  double length = 230.;
132  std::map<std::string, double>::const_iterator it = hcalTB02Parameters_->lengthMap_.find(name);
133  if (it != hcalTB02Parameters_->lengthMap_.end())
134  length = it->second;
135  return length;
136 }

References hcalTB02Parameters_, HcalTB02Parameters::lengthMap_, and Skims_PA_cff::name.

Referenced by curve_LY().

◆ curve_LY()

double HcalTB02SD::curve_LY ( const std::string &  nameVolume,
const G4StepPoint *  stepPoint 
)
private

Definition at line 108 of file HcalTB02SD.cc.

108  {
109  double weight = 1.;
110  G4ThreeVector localPoint = setToLocal(stepPoint->GetPosition(), stepPoint->GetTouchable());
111  double crlength = crystalLength(nameVolume);
112  double dapd = 0.5 * crlength - localPoint.z();
113  if (dapd >= -0.1 || dapd <= crlength + 0.1) {
114  if (dapd <= 100.)
115  weight = 1.05 - dapd * 0.0005;
116  } else {
117  edm::LogWarning("HcalTBSim") << "HcalTB02SD: light coll curve : wrong "
118  << "distance to APD " << dapd << " crlength = " << crlength
119  << " crystal name = " << nameVolume << " z of localPoint = " << localPoint.z()
120  << " take weight = " << weight;
121  }
122 #ifdef EDM_ML_DEBUG
123  edm::LogVerbatim("HcalTBSim") << "HcalTB02SD, light coll curve : " << dapd << " crlength = " << crlength
124  << " crystal name = " << nameVolume << " z of localPoint = " << localPoint.z()
125  << " take weight = " << weight;
126 #endif
127  return weight;
128 }

References crystalLength(), CaloSD::setToLocal(), and mps_merge::weight.

Referenced by getEnergyDeposit().

◆ getEnergyDeposit()

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

Reimplemented from CaloSD.

Definition at line 79 of file HcalTB02SD.cc.

79  {
80  auto const preStepPoint = aStep->GetPreStepPoint();
81  std::string nameVolume = static_cast<std::string>(preStepPoint->GetPhysicalVolume()->GetName());
82 
83  // take into account light collection curve for crystals
84  double weight = 1.;
85  if (useWeight_)
86  weight *= curve_LY(nameVolume, preStepPoint);
87  if (useBirk_)
89  double edep = aStep->GetTotalEnergyDeposit() * weight;
90 #ifdef EDM_ML_DEBUG
91  edm::LogVerbatim("HcalTBSim") << "HcalTB02SD:: " << nameVolume << " Light Collection Efficiency " << weight
92  << " Weighted Energy Deposit " << edep / CLHEP::MeV << " MeV";
93 #endif
94  return edep;
95 }

References birk1_, birk2_, birk3_, curve_LY(), CaloSD::getAttenuation(), MeV, AlCaHLTBitMon_QueryRunRegistry::string, useBirk_, useWeight_, and mps_merge::weight.

◆ setDetUnitId()

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

Implements CaloSD.

Definition at line 97 of file HcalTB02SD.cc.

97  {
98  return (numberingScheme_ == nullptr ? 0 : (uint32_t)(numberingScheme_->getUnitID(aStep)));
99 }

References numberingScheme_.

◆ setNumberingScheme()

void HcalTB02SD::setNumberingScheme ( HcalTB02NumberingScheme scheme)

Definition at line 101 of file HcalTB02SD.cc.

101  {
102  if (scheme != nullptr) {
103  edm::LogVerbatim("HcalTBSim") << "HcalTB02SD: updates numbering scheme for " << GetName();
104  numberingScheme_.reset(scheme);
105  }
106 }

References numberingScheme_, and generator_cfi::scheme.

Referenced by HcalTB02SD().

Member Data Documentation

◆ birk1_

double HcalTB02SD::birk1_
private

Definition at line 51 of file HcalTB02SD.h.

Referenced by getEnergyDeposit(), and HcalTB02SD().

◆ birk2_

double HcalTB02SD::birk2_
private

Definition at line 51 of file HcalTB02SD.h.

Referenced by getEnergyDeposit(), and HcalTB02SD().

◆ birk3_

double HcalTB02SD::birk3_
private

Definition at line 51 of file HcalTB02SD.h.

Referenced by getEnergyDeposit(), and HcalTB02SD().

◆ hcalTB02Parameters_

const HcalTB02Parameters* HcalTB02SD::hcalTB02Parameters_
private

Definition at line 52 of file HcalTB02SD.h.

Referenced by crystalLength().

◆ numberingScheme_

std::unique_ptr<HcalTB02NumberingScheme> HcalTB02SD::numberingScheme_
private

Definition at line 49 of file HcalTB02SD.h.

Referenced by HcalTB02SD(), setDetUnitId(), and setNumberingScheme().

◆ useBirk_

bool HcalTB02SD::useBirk_
private

Definition at line 50 of file HcalTB02SD.h.

Referenced by getEnergyDeposit(), and HcalTB02SD().

◆ useWeight_

bool HcalTB02SD::useWeight_
private

Definition at line 50 of file HcalTB02SD.h.

Referenced by getEnergyDeposit(), and HcalTB02SD().

HcalTB02SD::numberingScheme_
std::unique_ptr< HcalTB02NumberingScheme > numberingScheme_
Definition: HcalTB02SD.h:49
HcalTB02XtalNumberingScheme
Definition: HcalTB02XtalNumberingScheme.h:24
mps_merge.weight
weight
Definition: mps_merge.py:88
HcalTB02SD::birk1_
double birk1_
Definition: HcalTB02SD.h:51
CaloSD::getAttenuation
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:683
MeV
const double MeV
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HcalTB02SD::setNumberingScheme
void setNumberingScheme(HcalTB02NumberingScheme *scheme)
Definition: HcalTB02SD.cc:101
HcalTB02SD::birk2_
double birk2_
Definition: HcalTB02SD.h:51
CaloSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
Definition: CaloSD.cc:385
HcalTB02SD::birk3_
double birk3_
Definition: HcalTB02SD.h:51
HcalTB02SD::hcalTB02Parameters_
const HcalTB02Parameters * hcalTB02Parameters_
Definition: HcalTB02SD.h:52
HcalTB02SD::useBirk_
bool useBirk_
Definition: HcalTB02SD.h:50
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloSD::CaloSD
CaloSD(const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:34
HcalTB02SD::useWeight_
bool useWeight_
Definition: HcalTB02SD.h:50
HcalTB02Parameters::lengthMap_
std::map< std::string, double > lengthMap_
Definition: HcalTB02Parameters.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
HcalTB02HcalNumberingScheme
Definition: HcalTB02HcalNumberingScheme.h:24
HcalTB02NumberingScheme
Definition: HcalTB02NumberingScheme.h:24
HcalTB02SD::curve_LY
double curve_LY(const std::string &, const G4StepPoint *)
Definition: HcalTB02SD.cc:108
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HcalTB02SD::crystalLength
double crystalLength(const std::string &)
Definition: HcalTB02SD.cc:130
weight
Definition: weight.py:1
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