Skip to content
Snippets Groups Projects
Commit 068474f7 authored by Nicholas Styles's avatar Nicholas Styles Committed by Walter Lampl
Browse files

Adapt SiDigitization to be a common base for Inner Detector, ITk, and HGTD

parent 2acb71cf
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
*/
#include "FEI3SimTool.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
FEI3SimTool::FEI3SimTool(const std::string& type, const std::string& name, const IInterface* parent) :
FrontEndSimTool(type, name, parent) {
......@@ -64,7 +65,8 @@ void FEI3SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
// Merge ganged pixel
InDetDD::SiCellId cellID = chargedDiodes.element()->cellIdFromIdentifier(chargedDiodes.getId(
(*i_chargedDiode).first));
InDetDD::SiCellId gangedCell = chargedDiodes.element()->gangedCell(cellID);
const InDetDD::SiDetectorElement * siDetEl = static_cast<const InDetDD::SiDetectorElement *>(chargedDiodes.element());
InDetDD::SiCellId gangedCell = siDetEl->gangedCell(cellID);
Identifier gangedID = chargedDiodes.element()->identifierFromCellId(gangedCell);
if (gangedCell.isValid()) {
SiChargedDiode* gangedChargeDiode = chargedDiodes.find(gangedID);
......
......@@ -639,8 +639,7 @@ std::unique_ptr<SCT_RDO_Collection> SCT_DigitizationTool::createRDO(SiChargedDio
// create new SCT RDO
InDetDD::SiReadoutCellId roCell{(*i_chargedDiode).second.getReadoutCell()};
int strip{roCell.strip()};
const InDetDD::SiDetectorDesign& detDesign{collection->design()};
const InDetDD::SCT_ModuleSideDesign& sctDesign{dynamic_cast<const InDetDD::SCT_ModuleSideDesign&>(detDesign)};
const InDetDD::SCT_ModuleSideDesign& sctDesign{static_cast<const InDetDD::SCT_ModuleSideDesign&>(collection->design())};
int row2D{sctDesign.row(strip)};
Identifier id_readout;
if (row2D < 0) { // SCT sensors
......@@ -816,8 +815,7 @@ void SCT_DigitizationTool::addSDO(SiChargedDiodeCollection* collection, SG::Writ
if (real_particle_hit or m_createNoiseSDO) {
InDetDD::SiReadoutCellId roCell{(*i_chargedDiode).second.getReadoutCell()};
int strip{roCell.strip()};
const InDetDD::SiDetectorDesign& detDesign{collection->design()};
const InDetDD::SCT_ModuleSideDesign& sctDesign{dynamic_cast<const InDetDD::SCT_ModuleSideDesign&>(detDesign)};
const InDetDD::SCT_ModuleSideDesign& sctDesign{dynamic_cast<const InDetDD::SCT_ModuleSideDesign&>(collection->design())};
int row2D{sctDesign.row(strip)};
Identifier id_readout;
......
......@@ -9,5 +9,5 @@ atlas_add_library( SiDigitization
src/SiChargedDiodeCollection.cxx
src/SiSurfaceCharge.cxx
PUBLIC_HEADERS SiDigitization
LINK_LIBRARIES AthenaKernel AthAllocators Identifier GaudiKernel InDetReadoutGeometry ReadoutGeometryBase InDetSimEvent )
LINK_LIBRARIES AthenaKernel AthAllocators Identifier GaudiKernel ReadoutGeometryBase InDetSimEvent )
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
* IAmplifier.h
* Header file for abstract base class IAmplier
*/
#ifndef SIDIGITIZATION_IAMPLIFIER_H
#define SIDIGITIZATION_IAMPLIFIER_H
#include "GaudiKernel/IAlgTool.h"
#include "InDetSimEvent/SiTotalCharge.h"
#include <vector>
static const InterfaceID IID_IAmplifier("IAmplifier", 1, 0);
class IAmplifier : virtual public IAlgTool {
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
typedef SiTotalCharge::list_t list_t;
//Retrieve interface ID
static const InterfaceID& interfaceID() { return IID_IAmplifier; }
// Destructor:
virtual ~IAmplifier() {}
///////////////////////////////////////////////////////////////////
// Pure virtual methods:
///////////////////////////////////////////////////////////////////
// process the collection of charged diodes
/** main purpose: CR-RC^3 response to a list of charges with times */
virtual float response(const list_t& Charges, const float timeOverThreshold) const =0;
virtual void response(const list_t& Charges, const float timeOverThreshold, std::vector<float>& resp) const =0;
/** Neighbour strip cross talk response strip to a list of charges with times */
virtual float crosstalk(const list_t& Charges, const float timeOverThreshold) const =0;
virtual void crosstalk(const list_t& Charges, const float timeOverThreshold, std::vector<float> &resp) const =0;
};
#endif // SIDIGITIZATION_IAMPLIFIER_H
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
* IFrontEnd.h
* Header file for interface class for FrontEnd
* (c) ATLAS Detector software
*/
#ifndef SIDIGITIZATION_IFRONTEND_H
#define SIDIGITIZATION_IFRONTEND_H
//Inheritance
#include "SiDigitization/ISiChargedDiodesProcessorTool.h"
#include "SiDigitization/SiChargedDiode.h"
//methods
#include "Identifier/Identifier.h"
class SiChargedDiodeCollection;
namespace CLHEP {
class HepRandomEngine;
}
static const InterfaceID IID_IFrontEnd("IFrontEnd", 1, 0);
class IFrontEnd : virtual public ISiChargedDiodesProcessorTool {
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
//** Retrieve interface ID */
static const InterfaceID& interfaceID() { return IID_IFrontEnd; }
//** Destructor: */
virtual ~IFrontEnd() {}
};
#endif // SIDIGITIZATION_IFRONTEND_H
// -*- C++ -*-
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
* IRandomDisabledCellGenerator.h
* Header file for interface class for RandomDisabledCellGenerator
* (c) ATLAS Detector software
*/
#ifndef SIDIGITIZATION_IRANDOMDISABLEDCELLGENERATOR_H
#define SIDIGITIZATION_IRANDOMDISABLEDCELLGENERATOR_H
//Inheritance
#include "SiDigitization/ISiChargedDiodesProcessorTool.h"
//methods
class SiChargedDiodeCollection;
namespace CLHEP {
class HepRandomEngine;
}
static const InterfaceID IID_IRandomDisabledCellGenerator("IRandomDisabledCellGenerator",1,0);
class IRandomDisabledCellGenerator : virtual public ISiChargedDiodesProcessorTool {
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
public:
//Retrieve interface ID
static const InterfaceID& interfaceID() { return IID_IRandomDisabledCellGenerator; }
// Destructor:
virtual ~IRandomDisabledCellGenerator() {}
};
#endif // SIDIGITIZATION_IRANDOMDISABLEDCELLGENERATOR_H
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -30,7 +30,7 @@
#include <unordered_map>
#include "SiDigitization/SiChargedDiode.h"
#include "Identifier/Identifier.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "ReadoutGeometryBase/SolidStateDetectorElementBase.h"
// Input/output classes
#include "InDetSimEvent/SiHit.h"
......@@ -42,8 +42,7 @@
class AtlasDetectorID;
namespace InDetDD{
class SiDetectorElement;
class SiDetectorDesign;
class DetectorDesign;
class SiCellId;
}
......@@ -117,7 +116,7 @@ class SiChargedDiodeCollection : Identifiable {
// ref. to the detector element for this collection
SiChargedDiodeCollection( );
SiChargedDiodeCollection(const InDetDD::SiDetectorElement* );
SiChargedDiodeCollection(const InDetDD::SolidStateDetectorElementBase* );
// Destructor:
......@@ -128,7 +127,7 @@ class SiChargedDiodeCollection : Identifiable {
///////////////////////////////////////////////////////////////////
// detector element:
const InDetDD::SiDetectorElement * element() const;
const InDetDD::SolidStateDetectorElementBase * element() const;
// wafer identifier for this collection
virtual Identifier identify() const override final;
......@@ -138,7 +137,7 @@ class SiChargedDiodeCollection : Identifiable {
const AtlasDetectorID* id_helper();
// detector design:
const InDetDD::SiDetectorDesign &design() const;
const InDetDD::DetectorDesign &design() const;
// translation from SiReadoutCellId to Identifier
Identifier getId(const InDetDD::SiCellId& id) const
......@@ -157,7 +156,7 @@ class SiChargedDiodeCollection : Identifiable {
SiChargedDiodeMap &chargedDiodes();
// Set the SiDetectorElement
void setDetectorElement(const InDetDD::SiDetectorElement *SiElement);
void setDetectorElement(const InDetDD::SolidStateDetectorElementBase *SiElement);
// Add a new SiCharge to the collection
// (add or merge in an existing SiChargedDiode):
......@@ -200,7 +199,7 @@ class SiChargedDiodeCollection : Identifiable {
SiTotalCharge::alloc_t m_allocator;
SiChargedDiodeMap m_chargedDiodes; // list of SiChargedDiodes
SiChargedDiodeOrderedSet m_orderedChargedDiodes; // list of SiChargedDiodes
const InDetDD::SiDetectorElement* m_sielement; // detector element
const InDetDD::SolidStateDetectorElementBase* m_sielement; // detector element
};
///////////////////////////////////////////////////////////////////
......@@ -208,7 +207,7 @@ class SiChargedDiodeCollection : Identifiable {
///////////////////////////////////////////////////////////////////
// Set the DetectorElement
inline void SiChargedDiodeCollection::setDetectorElement(const InDetDD::SiDetectorElement *SiElement)
inline void SiChargedDiodeCollection::setDetectorElement(const InDetDD::SolidStateDetectorElementBase *SiElement)
{
m_sielement=SiElement;
}
......@@ -219,13 +218,13 @@ inline SiChargedDiodeMap &SiChargedDiodeCollection::chargedDiodes()
}
// access to the element
inline const InDetDD::SiDetectorElement *SiChargedDiodeCollection::element() const
inline const InDetDD::SolidStateDetectorElementBase *SiChargedDiodeCollection::element() const
{
return m_sielement;
}
// access to the design
inline const InDetDD::SiDetectorDesign &SiChargedDiodeCollection::design() const
inline const InDetDD::DetectorDesign &SiChargedDiodeCollection::design() const
{
return m_sielement->design();
}
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -15,7 +15,7 @@
#include "SiDigitization/SiChargedDiodeCollection.h"
// member classes
#include "SiDigitization/SiHelper.h"
#include "InDetReadoutGeometry/SiDetectorDesign.h"
#include "ReadoutGeometryBase/DetectorDesign.h"
#include "ReadoutGeometryBase/SiReadoutCellId.h"
#include "ReadoutGeometryBase/SiCellId.h"
#include "GaudiKernel/MsgStream.h"
......@@ -31,7 +31,7 @@ SiChargedDiodeCollection::SiChargedDiodeCollection( ) :
{
}
SiChargedDiodeCollection::SiChargedDiodeCollection(const InDetDD::SiDetectorElement* sielement ) :
SiChargedDiodeCollection::SiChargedDiodeCollection(const InDetDD::SolidStateDetectorElementBase* sielement ) :
m_chargedDiodes(),
m_sielement(sielement)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment