ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_RandomDisabledCellGenerator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
10
11#include "CLHEP/Random/RandomEngine.h"
12#include "CLHEP/Random/RandFlat.h"
13
14// constructor
15SCT_RandomDisabledCellGenerator::SCT_RandomDisabledCellGenerator(const std::string& type, const std::string& name, const IInterface* parent)
16 : base_class(type, name, parent)
17{
18}
19
21 ATH_MSG_DEBUG("SCT_RandomDisabledCellGenerator::initialize()");
22 ATH_MSG_INFO("\tCreating missing bond generator with "<<m_disableProbability<<" probability");
23 return StatusCode::SUCCESS;
24}
25
27 ATH_MSG_INFO("SCT_RandomDisabledCellGenerator::finalize()");
28 return StatusCode::SUCCESS;
29}
30
31// process the collection
32void SCT_RandomDisabledCellGenerator::process(SiChargedDiodeCollection& collection, CLHEP::HepRandomEngine * rndmEngine) const {
33 // disabling is applied to all cells even unconnected or below threshold ones to be able to use these cells as well
34 // loop on all charged diodes
35 for (std::pair<const InDetDD::SiCellId, SiChargedDiode>& chargedDiode: collection) {
36 if (CLHEP::RandFlat::shoot(rndmEngine)<m_disableProbability) {
37 SiHelper::disconnected(chargedDiode.second, true, false);
38 }
39 }
40}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
SCT_RandomDisabledCellGenerator(const std::string &type, const std::string &name, const IInterface *parent)
constructor
virtual StatusCode finalize() override
AlgTool finalize.
virtual StatusCode initialize() override
AlgTool initialize.
virtual void process(SiChargedDiodeCollection &collection, CLHEP::HepRandomEngine *rndmEngine) const override
static void disconnected(SiChargedDiode &chDiode, bool flag, bool mask=false)
Definition SiHelper.h:111