|
ATLAS Offline Software
|
#include <EnergyDepositionTool.h>
|
| EnergyDepositionTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual StatusCode | initialize () |
|
virtual StatusCode | finalize () |
|
virtual | ~EnergyDepositionTool () |
|
StatusCode | initTools () |
|
std::vector< std::pair< double, double > > | bichselSim (double BetaGamma, int ParticleType, double TotalLength, double InciEnergy, CLHEP::HepRandomEngine *rndmEngine) const |
|
std::vector< std::pair< double, double > > | clusterHits (std::vector< std::pair< double, double > > &rawHitRecord, int n_pieces) const |
|
virtual StatusCode | depositEnergy (const TimedHitPtr< SiHit > &phit, const InDetDD::SiDetectorElement &Module, std::vector< std::pair< double, double > > &trfHitRecord, std::vector< double > &initialConditions, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx) |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
| EnergyDepositionTool () |
|
void | simulateBow (const InDetDD::SiDetectorElement *element, double &xi, double &yi, const double zi, double &xf, double &yf, const double zf) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 43 of file EnergyDepositionTool.h.
◆ StoreGateSvc_t
◆ EnergyDepositionTool() [1/2]
EnergyDepositionTool::EnergyDepositionTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~EnergyDepositionTool()
EnergyDepositionTool::~EnergyDepositionTool |
( |
| ) |
|
|
virtualdefault |
◆ EnergyDepositionTool() [2/2]
EnergyDepositionTool::EnergyDepositionTool |
( |
| ) |
|
|
private |
◆ bichselSim()
std::vector< std::pair< double, double > > EnergyDepositionTool::bichselSim |
( |
double |
BetaGamma, |
|
|
int |
ParticleType, |
|
|
double |
TotalLength, |
|
|
double |
InciEnergy, |
|
|
CLHEP::HepRandomEngine * |
rndmEngine |
|
) |
| const |
Definition at line 308 of file EnergyDepositionTool.cxx.
313 std::vector<std::pair<double, double> > rawHitRecord;
314 double TotalEnergyLoss = 0.;
315 double accumLength = 0.;
318 setFailureFlag(rawHitRecord);
324 double BetaGammaLog10 = std::log10(BetaGamma);
329 if (IntXUpperBound <= 0.) {
330 ATH_MSG_WARNING(
"Negative IntXUpperBound in EnergyDepositionTool::bichselSim! (-1,-1) will be returned for log(betaGamma) = "<<BetaGammaLog10);
331 setFailureFlag(rawHitRecord);
336 setFailureFlag(rawHitRecord);
341 double lambda = (1. / IntXUpperBound) * 1.E4;
346 if (std::abs(1.0 * TotalLength / lambda) > LoopLimit) {
347 setFailureFlag(rawHitRecord);
357 "Potential infinite loop in bichselSim. Exit Loop. A special flag "
358 "will be returned (-1,-1). The total length is "
359 << TotalLength <<
". The lambda is " << lambda <<
".");
360 setFailureFlag(rawHitRecord);
365 double HitPosition = 0.;
366 for (
int iHit = 0; iHit <
m_nCols; iHit++) {
367 HitPosition += CLHEP::RandExpZiggurat::shoot(rndmEngine, lambda);
371 if (accumLength + HitPosition >= TotalLength)
break;
374 double TossEnergyLoss = -1.;
375 while (TossEnergyLoss <= 0.) {
377 double TossIntX = CLHEP::RandFlat::shoot(rndmEngine, 0., IntXUpperBound);
389 bool fLastStep =
false;
391 if (((TotalEnergyLoss + TossEnergyLoss) / 1.
E+6) > InciEnergy) {
393 "Energy loss is larger than incident energy in EnergyDepositionTool::bichselSim! This is usually delta-ray.");
394 TossEnergyLoss = InciEnergy * 1.E+6 - TotalEnergyLoss;
399 accumLength += HitPosition;
400 TotalEnergyLoss += TossEnergyLoss;
403 std::pair<double, double> oneHit;
404 if (
m_nCols == 1) oneHit.first = accumLength;
405 else oneHit.first = (accumLength - 1.0 * HitPosition / 2);
406 oneHit.second = TossEnergyLoss;
407 rawHitRecord.push_back(oneHit);
411 if (fLastStep)
break;
◆ clusterHits()
std::vector< std::pair< double, double > > EnergyDepositionTool::clusterHits |
( |
std::vector< std::pair< double, double > > & |
rawHitRecord, |
|
|
int |
n_pieces |
|
) |
| const |
Definition at line 422 of file EnergyDepositionTool.cxx.
426 std::vector<std::pair<double, double> > trfHitRecord;
428 if ((
int) (rawHitRecord.size()) < n_pieces) {
429 n_pieces = rawHitRecord.size();
432 int unitlength =
int(1.0 * rawHitRecord.size() / n_pieces);
434 int index_end = unitlength - 1;
437 double position = 0.;
438 double energyloss = 0.;
441 position += (rawHitRecord[
index].first * rawHitRecord[
index].second);
442 energyloss += rawHitRecord[
index].second;
444 position = (energyloss == 0. ? 0. : position / energyloss);
447 std::pair<double, double> oneHit;
448 oneHit.first = position;
449 oneHit.second = energyloss;
450 trfHitRecord.push_back(oneHit);
453 index_start = index_end + 1;
454 index_end = index_start + unitlength - 1;
456 if (index_start > (
int) (rawHitRecord.size() - 1)) {
460 if (index_end > (
int) (rawHitRecord.size() - 1)) {
461 index_end = rawHitRecord.size() - 1;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ depositEnergy()
StatusCode EnergyDepositionTool::depositEnergy |
( |
const TimedHitPtr< SiHit > & |
phit, |
|
|
const InDetDD::SiDetectorElement & |
Module, |
|
|
std::vector< std::pair< double, double > > & |
trfHitRecord, |
|
|
std::vector< double > & |
initialConditions, |
|
|
CLHEP::HepRandomEngine * |
rndmEngine, |
|
|
const EventContext & |
ctx |
|
) |
| |
|
virtual |
Definition at line 135 of file EnergyDepositionTool.cxx.
145 bool delta_hit =
true;
146 if (genPart) delta_hit =
false;
152 const CLHEP::Hep3Vector startPosition = phit->localStartPosition();
153 const CLHEP::Hep3Vector endPosition = phit->localEndPosition();
167 double dEta = eta_f - eta_0;
168 double dPhi = phi_f - phi_0;
169 const double dDepth = depth_f - depth_0;
173 const int nsteps =
int(pathLength / stepsize) + 1;
177 initialConditions.clear();
178 initialConditions = {eta_0, phi_0, depth_0,
dEta,
dPhi, dDepth,
static_cast<double>(ncharges)};
183 double iTotalLength = pathLength * 1000.;
184 initialConditions.push_back(iTotalLength);
191 TLorentzVector genPart_4V;
194 genPart_4V.SetPtEtaPhiM(genPart->momentum().perp(), genPart->momentum().eta(),
195 genPart->momentum().phi(), genPart->momentum().m());
218 TLorentzVector genPart_4V;
219 double iBetaGamma=0.;
221 genPart_4V.SetPtEtaPhiM(genPart->momentum().perp(), genPart->momentum().eta(),
222 genPart->momentum().phi(), genPart->momentum().m());
223 iBetaGamma = iBetaGammaFn(genPart_4V);
226 iBetaGamma = iBetaGammaFn(
k);
231 std::vector<std::pair<double, double> > rawHitRecord =
bichselSim(iBetaGamma, iParticleType, iTotalLength,
232 genPart ? (genPart->momentum().e() /
238 if (rawHitRecord.empty()) {
239 std::pair<double, double> specialHit;
240 specialHit.first = 0.;
241 specialHit.second = 0.;
242 trfHitRecord.push_back(specialHit);
243 }
else if ((rawHitRecord.size() == 1) && (rawHitRecord[0].first == -1.) && (rawHitRecord[0].second == -1.)) {
244 for (
int j = 0; j < nsteps; j++) {
245 std::pair<double, double> specialHit;
246 specialHit.first = 1.0 * iTotalLength / nsteps * (j + 0.5);
247 specialHit.second = phit->energyLoss() * 1.E+6 / nsteps;
248 trfHitRecord.push_back(specialHit);
258 for (
int j = 0; j < nsteps; j++) {
259 std::pair<double, double> specialHit;
260 specialHit.first = 1.0 * iTotalLength / nsteps * (j + 0.5);
261 specialHit.second = phit->energyLoss() * 1.E+6 / nsteps;
262 trfHitRecord.push_back(specialHit);
267 return StatusCode::SUCCESS;
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode EnergyDepositionTool::finalize |
( |
| ) |
|
|
virtual |
◆ initialize()
StatusCode EnergyDepositionTool::initialize |
( |
| ) |
|
|
virtual |
Definition at line 91 of file EnergyDepositionTool.cxx.
92 ATH_MSG_INFO(
"You are using EnergyDepositionTool for solid-state silicon detectors.");
107 int n_ParticleType = 6;
108 for (
int iParticleType = 1; iParticleType <= n_ParticleType; iParticleType++) {
121 return StatusCode::SUCCESS;
◆ initTools()
StatusCode EnergyDepositionTool::initTools |
( |
| ) |
|
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& EnergyDepositionTool::interfaceID |
( |
| ) |
|
|
static |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ simulateBow()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_bichselData
std::vector<BichselData> EnergyDepositionTool::m_bichselData |
|
private |
◆ m_DeltaRayCut
Gaudi::Property<double> EnergyDepositionTool::m_DeltaRayCut |
|
private |
Initial value:{
this, "DeltaRayCut", 80.7687, "Cut of delta ray [keV] - Value should be consistent with range cut in simulation"
}
Definition at line 105 of file EnergyDepositionTool.h.
◆ m_detStore
◆ m_disableDistortions
Gaudi::Property<bool> EnergyDepositionTool::m_disableDistortions |
|
private |
Initial value:{
this, "DisableDistortions", false, "Disable simulation of module distortions"
}
Definition at line 85 of file EnergyDepositionTool.h.
◆ m_distortionKey
Initial value:{
this, "PixelDistortionData", "PixelDistortionData", "Output readout distortion data"
}
Definition at line 125 of file EnergyDepositionTool.h.
◆ m_doBichsel
Gaudi::Property<bool> EnergyDepositionTool::m_doBichsel |
|
private |
Initial value:{
this, "doBichsel", true, "re-do charge deposition following Bichsel model"
}
Definition at line 90 of file EnergyDepositionTool.h.
◆ m_doBichselBetaGammaCut
Gaudi::Property<double> EnergyDepositionTool::m_doBichselBetaGammaCut |
|
private |
Initial value:{
this, "doBichselBetaGammaCut", 0.1, "minimum beta-gamma for particle to be re-simulated through Bichsel Model"
}
Definition at line 95 of file EnergyDepositionTool.h.
◆ m_doDeltaRay
Gaudi::Property<bool> EnergyDepositionTool::m_doDeltaRay |
|
private |
Initial value:{
this, "doDeltaRay", false, "whether we simulate delta-ray using Bichsel model"
}
Definition at line 100 of file EnergyDepositionTool.h.
◆ m_doPU
Gaudi::Property<bool> EnergyDepositionTool::m_doPU |
|
private |
Initial value:{
this, "doPU", true, "Whether we apply Bichsel model on PU"
}
Definition at line 110 of file EnergyDepositionTool.h.
◆ m_evtStore
◆ m_LoopLimit
Gaudi::Property<int> EnergyDepositionTool::m_LoopLimit |
|
private |
Initial value:{
this, "LoopLimit", 100000, "Limit assuming 1 collision per sampling"
}
Definition at line 120 of file EnergyDepositionTool.h.
◆ m_nCols
Gaudi::Property<int> EnergyDepositionTool::m_nCols |
|
private |
Initial value:{
this, "nCols", 1, "Number of collision for each sampling"
}
Definition at line 115 of file EnergyDepositionTool.h.
◆ m_numberOfCharges
Gaudi::Property<int> EnergyDepositionTool::m_numberOfCharges |
|
private |
Initial value:{
this, "numberOfCharges", 10, "Geant4:number of charges for PixelPlanar"
}
Definition at line 80 of file EnergyDepositionTool.h.
◆ m_numberOfSteps
Gaudi::Property<int> EnergyDepositionTool::m_numberOfSteps |
|
private |
Initial value:{
this, "numberOfSteps", 50, "Geant4:number of steps for PixelPlanar"
}
Definition at line 75 of file EnergyDepositionTool.h.
◆ m_pixelID
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
double interpolateCrossSection(std::pair< int, int > indices_BetaGammaLog10, double BetaGammaLog10) const
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
double thickness() const
Method which returns thickness of the silicon wafer.
double hitEtaDirection() const
See previous method.
std::pair< int, int > getBetaGammaIndices(double BetaGammaLog10) const
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double hitPhiDirection() const
See previous method.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
double hitDepthDirection() const
Directions of hit depth,phi,eta axes relative to reconstruction local position axes (LocalPosition).
HepMC::ConstGenParticlePtr cptr() const
Dereference.
a link optimized in size for a GenParticle in a McEventCollection
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
BichselData getBichselDataFromFile(const std::string &fullFilename)
Amg::Vector2D hitLocalToLocal(double xEta, double xPhi) const
Simulation/Hit local frame to reconstruction local frame.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const GenParticle * ConstGenParticlePtr
double interpolateCollisionEnergy(std::pair< int, int > indices_BetaGammaLog10, double IntXLog10) const
static HepMcParticleLink getRedirectedLink(const HepMcParticleLink &particleLink, uint32_t eventIndex, const EventContext &ctx)
Return a HepMcParticleLink pointing at the same particle, but in a different GenEvent.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
#define ATH_MSG_WARNING(x)
std::string formBichselDataFileName(int particleType, unsigned int nCols)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>