CMS 3D CMS Logo

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

#include <HFShowerPMT.h>

Public Member Functions

double getHits (const G4Step *aStep)
 
double getRadius ()
 
 HFShowerPMT (const std::string &name, const HcalDDDSimConstants *hcons, const HcalSimulationParameters *hps, edm::ParameterSet const &p)
 
virtual ~HFShowerPMT ()
 

Private Attributes

std::unique_ptr< HFCherenkovcherenkov_
 
const HcalDDDSimConstantshcalConstant_
 
const HcalSimulationParametershcalsimpar_
 
int indexF
 
int indexR
 
double pePerGeV
 
std::vector< int > pmtFib1
 
std::vector< int > pmtFib2
 
std::vector< int > pmtR1
 
std::vector< int > pmtR2
 
std::vector< double > rTable
 

Detailed Description

Definition at line 19 of file HFShowerPMT.h.

Constructor & Destructor Documentation

◆ HFShowerPMT()

HFShowerPMT::HFShowerPMT ( const std::string &  name,
const HcalDDDSimConstants hcons,
const HcalSimulationParameters hps,
edm::ParameterSet const &  p 
)

Definition at line 19 of file HFShowerPMT.cc.

23  : hcalConstant_(hcons), hcalsimpar_(hps) {
24  edm::ParameterSet m_HF = p.getParameter<edm::ParameterSet>("HFShowerPMT");
25  pePerGeV = m_HF.getParameter<double>("PEPerGeVPMT");
26 
27  //Special Geometry parameters
32 #ifdef EDM_ML_DEBUG
33  edm::LogVerbatim("HFShower") << "HFShowerPMT: gets the Index matches for " << pmtR1.size() << " PMTs";
34  for (unsigned int ii = 0; ii < pmtR1.size(); ii++) {
35  edm::LogVerbatim("HFShower") << "HFShowerPMT: rIndexR[" << ii << "] = " << pmtR1[ii] << " fibreR[" << ii
36  << "] = " << pmtFib1[ii] << " rIndexL[" << ii << "] = " << pmtR2[ii] << " fibreL["
37  << ii << "] = " << pmtFib2[ii];
38  }
39 #endif
40  cherenkov_ = std::make_unique<HFCherenkov>(m_HF);
41 
42  // Special Geometry parameters
44 #ifdef EDM_ML_DEBUG
45  std::stringstream sss;
46  for (unsigned int ig = 0; ig < rTable.size(); ++ig) {
47  if (ig / 10 * 10 == ig) {
48  sss << "\n";
49  }
50  sss << " " << rTable[ig] / cm;
51  }
52  edm::LogVerbatim("HFShowerPMT") << "HFShowerPMT: " << rTable.size() << " rTable(cm):" << sss.str();
53 #endif
54 }

References cherenkov_, edm::ParameterSet::getParameter(), HcalDDDSimConstants::getRTableHF(), hcalConstant_, hcalsimpar_, cuy::ii, AlCaHLTBitMon_ParallelJobs::p, pePerGeV, pmtFib1, pmtFib2, HcalSimulationParameters::pmtFiberLeft_, HcalSimulationParameters::pmtFiberRight_, HcalSimulationParameters::pmtLeft_, pmtR1, pmtR2, HcalSimulationParameters::pmtRight_, and rTable.

◆ ~HFShowerPMT()

HFShowerPMT::~HFShowerPMT ( )
virtual

Definition at line 56 of file HFShowerPMT.cc.

56 {}

Member Function Documentation

◆ getHits()

double HFShowerPMT::getHits ( const G4Step *  aStep)

Definition at line 58 of file HFShowerPMT.cc.

58  {
59  indexR = indexF = -1;
60 
61  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
62  const G4VTouchable* touch = preStepPoint->GetTouchable();
63  int boxNo = touch->GetReplicaNumber(2);
64  int pmtNo = touch->GetReplicaNumber(1);
65  if (boxNo <= 1) {
66  indexR = pmtR1[pmtNo - 1];
67  indexF = pmtFib1[pmtNo - 1];
68  } else {
69  indexR = pmtR2[pmtNo - 1];
70  indexF = pmtFib2[pmtNo - 1];
71  }
72 
73 #ifdef EDM_ML_DEBUG
74  double edep = aStep->GetTotalEnergyDeposit();
75  edm::LogVerbatim("HFShower") << "HFShowerPMT: Box " << boxNo << " PMT " << pmtNo << " Mapped Indices " << indexR
76  << ", " << indexF << " Edeposit " << edep / MeV << " MeV; PE " << edep * pePerGeV / GeV;
77 #endif
78 
79  double photons = 0;
80  if (indexR >= 0 && indexF > 0) {
81  G4Track* aTrack = aStep->GetTrack();
82  G4ParticleDefinition* particleDef = aTrack->GetDefinition();
83  double stepl = aStep->GetStepLength();
84  double beta = preStepPoint->GetBeta();
85  G4ThreeVector pDir = aTrack->GetDynamicParticle()->GetMomentumDirection();
86  G4ThreeVector localMom = preStepPoint->GetTouchable()->GetHistory()->GetTopTransform().TransformAxis(pDir);
87  photons = cherenkov_->computeNPEinPMT(particleDef, beta, localMom.x(), localMom.y(), localMom.z(), stepl);
88 #ifdef EDM_ML_DEBUG
89  edm::LogVerbatim("HFShower") << "HFShowerPMT::getHits: for particle " << particleDef->GetParticleName() << " Step "
90  << stepl << " Beta " << beta << " Direction " << pDir << " Local " << localMom
91  << " p.e. " << photons;
92 #endif
93  }
94  return photons;
95 }

References zMuMuMuonUserData::beta, cherenkov_, GeV, indexF, indexR, MeV, pePerGeV, BPHMonitor_cfi::photons, pmtFib1, pmtFib2, pmtR1, and pmtR2.

◆ getRadius()

double HFShowerPMT::getRadius ( )

Definition at line 97 of file HFShowerPMT.cc.

97  {
98  double r = 0.;
99  if (indexR >= 0 && indexR + 1 < (int)(rTable.size()))
100  r = 0.5 * (rTable[indexR] + rTable[indexR + 1]);
101 #ifdef EDM_ML_DEBUG
102  else
103  edm::LogVerbatim("HFShower") << "HFShowerPMT::getRadius: R " << indexR << " F " << indexF;
104 #endif
105  if (indexF == 2)
106  r = -r;
107 #ifdef EDM_ML_DEBUG
108  edm::LogVerbatim("HFShower") << "HFShowerPMT: Radius (" << indexR << "/" << indexF << ") " << r;
109 #endif
110  return r;
111 }

References indexF, indexR, alignCSCRings::r, and rTable.

Member Data Documentation

◆ cherenkov_

std::unique_ptr<HFCherenkov> HFShowerPMT::cherenkov_
private

Definition at line 32 of file HFShowerPMT.h.

Referenced by getHits(), and HFShowerPMT().

◆ hcalConstant_

const HcalDDDSimConstants* HFShowerPMT::hcalConstant_
private

Definition at line 30 of file HFShowerPMT.h.

Referenced by HFShowerPMT().

◆ hcalsimpar_

const HcalSimulationParameters* HFShowerPMT::hcalsimpar_
private

Definition at line 31 of file HFShowerPMT.h.

Referenced by HFShowerPMT().

◆ indexF

int HFShowerPMT::indexF
private

Definition at line 34 of file HFShowerPMT.h.

Referenced by getHits(), and getRadius().

◆ indexR

int HFShowerPMT::indexR
private

Definition at line 34 of file HFShowerPMT.h.

Referenced by getHits(), and getRadius().

◆ pePerGeV

double HFShowerPMT::pePerGeV
private

Definition at line 33 of file HFShowerPMT.h.

Referenced by getHits(), and HFShowerPMT().

◆ pmtFib1

std::vector<int> HFShowerPMT::pmtFib1
private

Definition at line 36 of file HFShowerPMT.h.

Referenced by getHits(), and HFShowerPMT().

◆ pmtFib2

std::vector<int> HFShowerPMT::pmtFib2
private

Definition at line 37 of file HFShowerPMT.h.

Referenced by getHits(), and HFShowerPMT().

◆ pmtR1

std::vector<int> HFShowerPMT::pmtR1
private

Definition at line 36 of file HFShowerPMT.h.

Referenced by getHits(), and HFShowerPMT().

◆ pmtR2

std::vector<int> HFShowerPMT::pmtR2
private

Definition at line 37 of file HFShowerPMT.h.

Referenced by getHits(), and HFShowerPMT().

◆ rTable

std::vector<double> HFShowerPMT::rTable
private

Definition at line 35 of file HFShowerPMT.h.

Referenced by getRadius(), and HFShowerPMT().

HFShowerPMT::indexF
int indexF
Definition: HFShowerPMT.h:34
HFShowerPMT::pmtFib1
std::vector< int > pmtFib1
Definition: HFShowerPMT.h:36
HcalDDDSimConstants::getRTableHF
const std::vector< double > & getRTableHF() const
Definition: HcalDDDSimConstants.h:61
zMuMuMuonUserData.beta
beta
Definition: zMuMuMuonUserData.py:10
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HcalSimulationParameters::pmtLeft_
std::vector< int > pmtLeft_
Definition: HcalSimulationParameters.h:18
HFShowerPMT::rTable
std::vector< double > rTable
Definition: HFShowerPMT.h:35
MeV
const double MeV
HcalSimulationParameters::pmtFiberRight_
std::vector< int > pmtFiberRight_
Definition: HcalSimulationParameters.h:17
HFShowerPMT::pePerGeV
double pePerGeV
Definition: HFShowerPMT.h:33
HFShowerPMT::cherenkov_
std::unique_ptr< HFCherenkov > cherenkov_
Definition: HFShowerPMT.h:32
HcalSimulationParameters::pmtFiberLeft_
std::vector< int > pmtFiberLeft_
Definition: HcalSimulationParameters.h:19
HcalSimulationParameters::pmtRight_
std::vector< int > pmtRight_
Definition: HcalSimulationParameters.h:16
edm::ParameterSet
Definition: ParameterSet.h:36
HFShowerPMT::hcalConstant_
const HcalDDDSimConstants * hcalConstant_
Definition: HFShowerPMT.h:30
GeV
const double GeV
Definition: MathUtil.h:16
HFShowerPMT::pmtR2
std::vector< int > pmtR2
Definition: HFShowerPMT.h:37
edm::LogVerbatim
Definition: MessageLogger.h:297
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
HFShowerPMT::hcalsimpar_
const HcalSimulationParameters * hcalsimpar_
Definition: HFShowerPMT.h:31
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HFShowerPMT::pmtFib2
std::vector< int > pmtFib2
Definition: HFShowerPMT.h:37
HFShowerPMT::indexR
int indexR
Definition: HFShowerPMT.h:34
cuy.ii
ii
Definition: cuy.py:590
HFShowerPMT::pmtR1
std::vector< int > pmtR1
Definition: HFShowerPMT.h:36