|
ATLAS Offline Software
|
#include <SCT_DigitizationTool.h>
|
StatusCode | initServices () |
| initialize the required services More...
|
|
StatusCode | initFrontEndTool () |
| Initialize the SCT_FrontEnd AlgTool. More...
|
|
StatusCode | initDisabledCells () |
| Initialize the SCT_RandomDisabledCellGenerator AlgTool. More...
|
|
StatusCode | initSurfaceChargesGeneratorTool () |
| Initialize the SCT_SurfaceChargesGenerator AlgTool. More...
|
|
StatusCode | createAndStoreRDO (SiChargedDiodeCollection *chDiodeCollection, SG::WriteHandle< SCT_RDO_Container > *rdoContainer) const |
| RDO and SDO methods. More...
|
|
std::unique_ptr< SCT_RDO_Collection > | createRDO (SiChargedDiodeCollection *collection) const |
| Create RDOs from the SiChargedDiodeCollection for the current wafer. More...
|
|
StatusCode | getNextEvent (const EventContext &ctx) |
|
void | digitizeAllHits (const EventContext &ctx, SG::WriteHandle< SCT_RDO_Container > *rdoContainer, SG::WriteHandle< InDetSimDataCollection > *simDataCollMap, std::vector< bool > *processedElements, TimedHitCollection< SiHit > *thpcsi, CLHEP::HepRandomEngine *rndmEngine) |
| digitize all hits More...
|
|
void | digitizeNonHits (const EventContext &ctx, SG::WriteHandle< SCT_RDO_Container > *rdoContainer, SG::WriteHandle< InDetSimDataCollection > *simDataCollMap, const std::vector< bool > *processedElements, CLHEP::HepRandomEngine *rndmEngine) const |
| digitize SCT without hits More...
|
|
void | SetupRdoOutputType (Gaudi::Details::PropertyBase &) |
| Called when m_WriteSCT1_RawData is altered. More...
|
|
|
FloatProperty | m_tfix {this, "FixedTime", -999., "Fixed time for Cosmics run selection"} |
|
BooleanProperty | m_enableHits {this, "EnableHits", true, "Enable hits"} |
|
BooleanProperty | m_onlyHitElements {this, "OnlyHitElements", false, "Process only elements with hits"} |
|
BooleanProperty | m_cosmicsRun {this, "CosmicsRun", false, "Cosmics run selection"} |
|
BooleanProperty | m_barrelonly {this, "BarrelOnly", false, "Only Barrel layers"} |
|
BooleanProperty | m_randomDisabledCells {this, "RandomDisabledCells", false, "Use Random disabled cells, default no"} |
|
BooleanProperty | m_createNoiseSDO {this, "CreateNoiseSDO", false, "Create SDOs for strips with only noise hits (huge increase in SDO collection size"} |
|
IntegerProperty | m_HardScatterSplittingMode {this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting. Process all SiHit or just those from signal or background events"} |
|
BooleanProperty | m_WriteSCT1_RawData {this, "WriteSCT1_RawData", false, "Write out SCT1_RawData rather than SCT3_RawData"} |
|
BooleanProperty | m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."} |
|
SG::ReadHandleKey< SiHitCollection > | m_hitsContainerKey {this, "InputObjectName", "SCT_Hits", "Input HITS collection name"} |
|
std::string | m_inputObjectName {""} |
|
SG::WriteHandleKey< SCT_RDO_Container > | m_rdoContainerKey {this, "OutputObjectName", "SCT_RDOs", "Output Object name"} |
|
SG::WriteHandle< SCT_RDO_Container > | m_rdoContainer |
| RDO container handle. More...
|
|
SG::WriteHandleKey< InDetSimDataCollection > | m_simDataCollMapKey {this, "OutputSDOName", "SCT_SDO_Map", "Output SDO container name"} |
|
SG::WriteHandle< InDetSimDataCollection > | m_simDataCollMap |
| SDO Map handle. More...
|
|
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > | m_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"} |
|
ToolHandle< IFrontEnd > | m_sct_FrontEnd {this, "FrontEnd", "SCT_FrontEnd", "Handle the Front End Electronic tool"} |
|
ToolHandle< ISurfaceChargesGenerator > | m_sct_SurfaceChargesGenerator {this, "SurfaceChargesGenerator", "SCT_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"} |
|
ToolHandle< IRandomDisabledCellGenerator > | m_sct_RandomDisabledCellGenerator {this, "RandomDisabledCellGenerator", "SCT_RandomDisabledCellGenerator", ""} |
|
ServiceHandle< IAthRNGSvc > | m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""} |
| Random number service. More...
|
|
ServiceHandle< PileUpMergeSvc > | m_mergeSvc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & SCT digitization"} |
|
const SCT_ID * | m_detID {nullptr} |
| Handle to the ID helper. More...
|
|
std::unique_ptr< TimedHitCollection< SiHit > > | m_thpcsi {nullptr} |
|
std::vector< ISiChargedDiodesProcessorTool * > | m_diodeCollectionTools |
|
std::vector< bool > | m_processedElements |
| vector of processed elements - set by digitizeHits() */ More...
|
|
std::vector< std::unique_ptr< SiHitCollection > > | m_hitCollPtrs |
|
bool | m_HardScatterSplittingSkipper {false} |
|
Definition at line 53 of file SCT_DigitizationTool.h.
◆ SCT_DigitizationTool()
SCT_DigitizationTool::SCT_DigitizationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~SCT_DigitizationTool()
SCT_DigitizationTool::~SCT_DigitizationTool |
( |
| ) |
|
|
virtualdefault |
◆ addSDO()
Definition at line 757 of file SCT_DigitizationTool.cxx.
759 std::vector<InDetSimData::Deposit> deposits;
761 const auto collectionid = collection->
identify();
770 const list_t& charges{(*i_chargedDiode).second.totalCharge().chargeComposition()};
772 bool real_particle_hit{
false};
774 const list_t::const_iterator EndOfChargeList{charges.end()};
775 for (list_t::const_iterator i_ListOfCharges{charges.begin()}; i_ListOfCharges != EndOfChargeList; ++i_ListOfCharges) {
780 if (!real_particle_hit) {
791 real_particle_hit =
true;
795 std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit{deposits.rend()};
796 std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end{deposits.rend()};
797 std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit{deposits.rbegin()};
798 for (; i_Deposit != depositsR_end; ++i_Deposit) {
799 if ((*i_Deposit).first == trkLink) {
800 theDeposit = i_Deposit;
806 if (theDeposit != depositsR_end) {
807 (*theDeposit).second += i_ListOfCharges->charge();
809 deposits.emplace_back(trkLink, i_ListOfCharges->charge());
816 const int strip{roCell.strip()};
817 const int row2D{sctDesign.row(
strip)};
819 (*simDataCollMap)->try_emplace(id_readout, std::move(deposits),(*i_chargedDiode).second.flag());
◆ applyProcessorTools()
void SCT_DigitizationTool::applyProcessorTools |
( |
SiChargedDiodeCollection * |
chargedDiodes, |
|
|
CLHEP::HepRandomEngine * |
rndmEngine |
|
) |
| const |
|
protected |
◆ createAndStoreRDO()
RDO and SDO methods.
Create RDOs from the SiChargedDiodeCollection for the current wafer and save to StoreGate
- Parameters
-
chDiodeCollection | list of the SiChargedDiodes on the current wafer |
Definition at line 527 of file SCT_DigitizationTool.cxx.
530 std::unique_ptr<SCT_RDO_Collection> RDOColl{
createRDO(chDiodeCollection)};
538 if ((*rdoContainer)->addCollection(RDOColl.release(), identifyHash).isFailure()) {
539 ATH_MSG_FATAL(
"SCT RDO collection could not be added to container!");
540 return StatusCode::FAILURE;
545 return StatusCode::SUCCESS;
◆ createRDO()
Create RDOs from the SiChargedDiodeCollection for the current wafer.
- Parameters
-
collection | list of the SiChargedDiodes on the current wafer |
Definition at line 551 of file SCT_DigitizationTool.cxx.
554 std::unique_ptr<SCT_RDO_Collection> p_rdocoll;
560 p_rdocoll = std::make_unique<SCT_RDO_Collection>(idHash_de);
561 }
catch (
const std::bad_alloc&) {
562 ATH_MSG_FATAL(
"Could not create a new SCT_RDORawDataCollection !");
570 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
571 unsigned int flagmask{
static_cast<unsigned int>((*i_chargedDiode).second.flag() & 0xFE)};
578 int strip{roCell.strip()};
579 if (
strip > 0xffff) {
581 ATH_MSG_FATAL(
"Strip number too big for SCT1 raw data format.");
586 const unsigned int strip_rdo{
static_cast<unsigned int>((
strip & 0xFFFF) << 16)};
591 unsigned int size_rdo{
static_cast<unsigned int>(
size & 0xFFFF)};
598 for (; it2 != i_chargedDiode_end; ++it2) {
600 if (cluscounter >=
size) {
603 if (it2->second.flag() & 0xDE) {
604 int tmp{cluscounter};
605 while ((it2 != i_chargedDiode_end) and (cluscounter <
size - 1) and (it2->
second.
flag() & 0xDE)) {
609 if ((it2 != collection->
end()) and !(it2->second.flag() & 0xDE)) {
614 size_rdo =
tmp & 0xFFFF;
619 unsigned int SCT_Word{strip_rdo | size_rdo};
630 static const std::vector<int> dummyvector;
631 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
632 unsigned int flagmask{
static_cast<unsigned int>((*i_chargedDiode).second.flag() & 0xFE)};
638 int strip{roCell.strip()};
645 int strip2D{sctDesign.strip(
strip)};
660 if (cluscounter >=
size) {
661 ATH_MSG_WARNING(
"Cluster size reached while neighbouring strips still defined.");
664 if (diode->flag() & 0xDE) {
665 int tmp{cluscounter};
666 while ((cluscounter <
size - 1) and (diode->flag() & 0xDE)) {
667 diode = diode->nextInCluster();
670 if (diode and !(diode->flag() & 0xDE)) {
677 diode = diode->nextInCluster();
681 int stripIn11bits{
strip & 0x7ff};
682 if (stripIn11bits !=
strip) {
683 ATH_MSG_DEBUG(
"Strip number " <<
strip <<
" doesn't fit into 11 bits - will be truncated");
686 unsigned int SCT_Word{
static_cast<unsigned int>(groupSize | (stripIn11bits << 11) | (tbin << 22) | (ERRORS << 25))};
◆ digitizeAllHits()
digitize all hits
Definition at line 261 of file SCT_DigitizationTool.cxx.
280 ATH_MSG_DEBUG(
"in digitize elements with hits: ec - layer - eta - phi "
285 <<
" processing hit number " << hitcount);
292 assert(idHash < processedElements->
size());
293 (*processedElements)[idHash] =
true;
297 if (not chargedDiodes.
empty()) {
299 if (
sc.isSuccess()) {
301 addSDO(&chargedDiodes, simDataCollMap);
305 chargedDiodes.
clear();
◆ digitizeElement()
Definition at line 359 of file SCT_DigitizationTool.cxx.
360 if (
nullptr == thpcsi) {
376 int barrel{firstHit->getBarrelEndcap()};
378 firstHit->getLayerDisk(),
379 firstHit->getPhiModule(),
380 firstHit->getEtaModule(),
381 firstHit->getSide())};
387 if (elements==
nullptr) {
395 if (sielement ==
nullptr) {
396 ATH_MSG_DEBUG(
"Barrel=" <<
barrel <<
" layer=" << firstHit->getLayerDisk() <<
" Eta=" << firstHit->getEtaModule() <<
" Phi=" << firstHit->getPhiModule() <<
" Side=" << firstHit->getSide());
397 ATH_MSG_ERROR(
"detector manager could not find element with id = " <<
id);
408 if (std::abs(phit->meanTime()) < 10000. *
CLHEP::ns) {
410 phit->getLayerDisk(),
411 phit->getPhiModule(),
412 phit->getEtaModule(),
415 SiDigitizationSurfaceChargeInserter inserter(sielement, chargedDiodes);
◆ digitizeNonHits()
digitize SCT without hits
Definition at line 311 of file SCT_DigitizationTool.cxx.
315 if (elements==
nullptr) {
323 for (
unsigned int i{0};
i < processedElements->size();
i++) {
324 if (not (*processedElements)[
i]) {
326 if (not idHash.is_valid()) {
332 ATH_MSG_DEBUG(
"In digitize of untouched elements: layer - phi - eta "
336 <<
"size: " << processedElements->size());
344 if (not chargedDiodes.
empty()) {
346 if (
sc.isSuccess()) {
348 addSDO(&chargedDiodes, simDataCollMap);
352 chargedDiodes.
clear();
◆ getNextEvent()
StatusCode SCT_DigitizationTool::getNextEvent |
( |
const EventContext & |
ctx | ) |
|
|
private |
Definition at line 700 of file SCT_DigitizationTool.cxx.
709 if (!hitCollection.isValid()) {
710 ATH_MSG_ERROR(
"Could not get SCT SiHitCollection container " << hitCollection.name() <<
" from store " << hitCollection.store());
711 return StatusCode::FAILURE;
715 m_thpcsi = std::make_unique<TimedHitCollection<SiHit>>(1);
716 m_thpcsi->insert(0, hitCollection.cptr());
717 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollection->size() <<
" hits");
719 return StatusCode::SUCCESS;
722 TimedHitCollList hitCollList;
726 return StatusCode::FAILURE;
748 m_thpcsi->insert(iColl->first, p_collection);
749 ATH_MSG_DEBUG(
"SiTrackerHitCollection found with " << p_collection->size() <<
" hits");
751 return StatusCode::SUCCESS;
◆ initDisabledCells()
StatusCode SCT_DigitizationTool::initDisabledCells |
( |
| ) |
|
|
private |
◆ initFrontEndTool()
StatusCode SCT_DigitizationTool::initFrontEndTool |
( |
| ) |
|
|
private |
◆ initialize()
StatusCode SCT_DigitizationTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ initServices()
StatusCode SCT_DigitizationTool::initServices |
( |
| ) |
|
|
private |
◆ initSurfaceChargesGeneratorTool()
StatusCode SCT_DigitizationTool::initSurfaceChargesGeneratorTool |
( |
| ) |
|
|
private |
◆ interfaceID()
const InterfaceID & SCT_DigitizationTool::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ mergeEvent()
StatusCode SCT_DigitizationTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
◆ prepareEvent()
StatusCode SCT_DigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
unsigned int |
|
|
) |
| |
|
finaloverridevirtual |
Called before processing physics events.
Definition at line 215 of file SCT_DigitizationTool.cxx.
229 m_thpcsi = std::make_unique<TimedHitCollection<SiHit>>();
231 return StatusCode::SUCCESS;
◆ processAllSubEvents()
StatusCode SCT_DigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
Definition at line 183 of file SCT_DigitizationTool.cxx.
185 return StatusCode::FAILURE;
190 CLHEP::HepRandomEngine *rndmEngine = rngWrapper->
getEngine(ctx);
209 return StatusCode::SUCCESS;
◆ processBunchXing()
Definition at line 440 of file SCT_DigitizationTool.cxx.
443 ATH_MSG_VERBOSE(
"SCT_DigitizationTool::processBunchXing() " << bunchXing);
448 return StatusCode::SUCCESS;
451 return StatusCode::SUCCESS;
458 TimedHitCollList hitCollList;
461 bSubEvents, eSubEvents).isSuccess())) and
462 hitCollList.empty()) {
464 return StatusCode::FAILURE;
472 std::unique_ptr<SiHitCollection> hitCollPtr{std::make_unique<SiHitCollection>(*iColl->second)};
474 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollPtr->size() <<
477 <<
" index: " << timeIndex.index()
478 <<
" type: " << timeIndex.type());
479 m_thpcsi->insert(timeIndex, hitCollPtr.get());
483 return StatusCode::SUCCESS;
◆ SetupRdoOutputType()
void SCT_DigitizationTool::SetupRdoOutputType |
( |
Gaudi::Details::PropertyBase & |
| ) |
|
|
private |
◆ storeTool()
◆ m_barrelonly
BooleanProperty SCT_DigitizationTool::m_barrelonly {this, "BarrelOnly", false, "Only Barrel layers"} |
|
private |
◆ m_cosmicsRun
BooleanProperty SCT_DigitizationTool::m_cosmicsRun {this, "CosmicsRun", false, "Cosmics run selection"} |
|
private |
◆ m_createNoiseSDO
BooleanProperty SCT_DigitizationTool::m_createNoiseSDO {this, "CreateNoiseSDO", false, "Create SDOs for strips with only noise hits (huge increase in SDO collection size"} |
|
private |
◆ m_detID
◆ m_diodeCollectionTools
◆ m_enableHits
BooleanProperty SCT_DigitizationTool::m_enableHits {this, "EnableHits", true, "Enable hits"} |
|
private |
◆ m_HardScatterSplittingMode
IntegerProperty SCT_DigitizationTool::m_HardScatterSplittingMode {this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting. Process all SiHit or just those from signal or background events"} |
|
private |
◆ m_HardScatterSplittingSkipper
bool SCT_DigitizationTool::m_HardScatterSplittingSkipper {false} |
|
private |
◆ m_hitCollPtrs
std::vector<std::unique_ptr<SiHitCollection> > SCT_DigitizationTool::m_hitCollPtrs |
|
private |
◆ m_hitsContainerKey
◆ m_inputObjectName
std::string SCT_DigitizationTool::m_inputObjectName {""} |
|
private |
◆ m_mergeSvc
◆ m_onlyHitElements
BooleanProperty SCT_DigitizationTool::m_onlyHitElements {this, "OnlyHitElements", false, "Process only elements with hits"} |
|
private |
◆ m_onlyUseContainerName
BooleanProperty SCT_DigitizationTool::m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."} |
|
private |
◆ m_processedElements
std::vector<bool> SCT_DigitizationTool::m_processedElements |
|
private |
◆ m_randomDisabledCells
BooleanProperty SCT_DigitizationTool::m_randomDisabledCells {this, "RandomDisabledCells", false, "Use Random disabled cells, default no"} |
|
private |
◆ m_rdoContainer
◆ m_rdoContainerKey
◆ m_rndmSvc
◆ m_sct_FrontEnd
ToolHandle<IFrontEnd> SCT_DigitizationTool::m_sct_FrontEnd {this, "FrontEnd", "SCT_FrontEnd", "Handle the Front End Electronic tool"} |
|
private |
◆ m_sct_RandomDisabledCellGenerator
◆ m_sct_SurfaceChargesGenerator
◆ m_SCTDetEleCollKey
◆ m_simDataCollMap
◆ m_simDataCollMapKey
◆ m_tfix
FloatProperty SCT_DigitizationTool::m_tfix {this, "FixedTime", -999., "Fixed time for Cosmics run selection"} |
|
private |
◆ m_thpcsi
◆ m_WriteSCT1_RawData
BooleanProperty SCT_DigitizationTool::m_WriteSCT1_RawData {this, "WriteSCT1_RawData", false, "Write out SCT1_RawData rather than SCT3_RawData"} |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
void setIdentifier(Identifier id)
virtual IdentifierHash identifyHash() const override final
SiChargedDiodeIterator end()
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int phi_module(const Identifier &id) const
#define ATH_MSG_VERBOSE(x)
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
std::vector< SiCharge > list_t
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
SiChargedDiodeIterator begin()
SiChargedDiodeMap::iterator SiChargedDiodeIterator
std::list< value_t > type
type of the collection of timed data object
virtual int row(int stripId1Dim) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
a link optimized in size for a GenParticle in a McEventCollection
void setDetectorElement(const InDetDD::SolidStateDetectorElementBase *SiElement)
::StatusCode StatusCode
StatusCode definition for legacy code.
static int GetTimeBin(SiChargedDiode &chDiode)
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static void ClusterUsed(SiChargedDiode &chDiode, bool flag)
size_type wafer_hash_max(void) const
A wrapper class for event-slot-local random engines.
int layer_disk(const Identifier &id) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
static int GetStripNum(SiChargedDiode &chDiode)
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
#define ATH_MSG_WARNING(x)
int eta_module(const Identifier &id) const
static void SetStripNum(SiChargedDiode &chDiode, int nstrip, MsgStream *log=nullptr)
SiChargedDiode * nextInCluster()
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
a struct encapsulating the identifier of a pile-up event
bool no_truth_link(const T &p)
Method to establish if a if the object is linked to something which was never saved to the HepMC Trut...
const InDetDD::DetectorDesign & design() const
virtual Identifier identify() const override final
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.