Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <CscDigitizationTool.h>
|
StatusCode | FillCollectionWithNewDigitEDM (csc_newmap &data_SampleMap, std::map< IdentifierHash, deposits > &myDeposits, bool phaseToSet, Collections_t &collections, CscSimDataCollection *cscSimData) |
|
StatusCode | FillCollectionWithOldDigitEDM (csc_map &data_map, std::map< IdentifierHash, deposits > &myDeposits, Collections_t &collections, CscSimDataCollection *cscSimData) |
|
StatusCode | CoreDigitization (Collections_t &collections, CscSimDataCollection *cscSimData, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx) |
|
StatusCode | getNextEvent (const EventContext &ctx) |
|
|
ToolHandle< ICscCalibTool > | m_pcalib {this, "cscCalibTool", "CscCalibTool", "CSC calibration tool"} |
|
BooleanProperty | m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."} |
|
SG::ReadHandleKey< CSCSimHitCollection > | m_hitsContainerKey {this, "InputObjectName", "CSC_Hits", "name of the input objects"} |
|
std::string | m_inputObjectName {""} |
|
SG::WriteHandleKey< CscSimDataCollection > | m_cscSimDataCollectionWriteHandleKey {this,"CSCSimDataCollectionOutputName","CSC_SDO","WriteHandleKey for Output CscSimDataCollection"} |
|
SG::WriteHandleKey< CscDigitContainer > | m_cscDigitContainerKey {this,"OutputObjectName","CSC_DIGITS","CSC digit container object"} |
|
std::unique_ptr< CSC_Digitizer > | m_cscDigitizer {nullptr} |
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
Gaudi::Property< double > | m_pedestal {this, "pedestal",0.0, ""} |
|
Gaudi::Property< bool > | m_maskBadChannel {this, "maskBadChannels", true, ""} |
|
Gaudi::Property< double > | m_amplification {this, "amplification", 0.58e5, ""} |
|
TimedHitCollection< CSCSimHit > * | m_thpcCSC {nullptr} |
|
std::list< CSCSimHitCollection * > | m_cscHitCollList |
|
Gaudi::Property< bool > | m_includePileUpTruth {this, "IncludePileUpTruth", true, "Include pile-up truth info"} |
|
Gaudi::Property< double > | m_timeWindowLowerOffset {this, "WindowLowerOffset", -25., ""} |
|
Gaudi::Property< double > | m_timeWindowUpperOffset {this, "WindowUpperOffset", +25., ""} |
|
Gaudi::Property< bool > | m_isPileUp {this, "isPileUp", false, ""} |
|
Gaudi::Property< bool > | m_newDigitEDM {this, "NewDigitEDM", true, ""} |
|
Gaudi::Property< double > | m_driftVelocity {this, "DriftVelocity", 60, ""} |
|
Gaudi::Property< double > | m_electronEnergy {this, "ElectronEnergy", 66, ""} |
|
Gaudi::Property< bool > | m_NInterFixed {this, "NInterFixed", false, ""} |
|
ServiceHandle< PileUpMergeSvc > | m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""} |
|
ServiceHandle< IAthRNGSvc > | m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""} |
|
Definition at line 39 of file CscDigitizationTool.h.
◆ Collections_t
◆ csc_map
◆ csc_newmap
◆ deposits
◆ CscDigitizationTool()
CscDigitizationTool::CscDigitizationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
pIID |
|
) |
| |
◆ ~CscDigitizationTool()
CscDigitizationTool::~CscDigitizationTool |
( |
| ) |
|
|
default |
◆ CoreDigitization()
Definition at line 139 of file CscDigitizationTool.cxx.
141 std::map <IdentifierHash,deposits> myDeposits;
143 csc_newmap data_SampleMap, data_SampleMapOddPhase;
150 return StatusCode::FAILURE;
167 double globalHitTime(
hitTime(phit));
168 double bunchTime(globalHitTime - hit.globalTime());
172 ATH_MSG_DEBUG (
"bunch time (ns) " << bunchTime <<
"globalHitTime (ns) " << globalHitTime <<
" hit Time (ns) " <<
hitTime(phit) );
175 std::vector<IdentifierHash> hashVec;
177 ?
m_cscDigitizer->digitize_hit(&hit, hashVec, data_SampleMap, data_SampleMapOddPhase, rndmEngine)
178 :
m_cscDigitizer->digitize_hit(&hit, hashVec, data_map, rndmEngine);
185 std::vector<IdentifierHash>::const_iterator vecBeg = hashVec.begin();
186 std::vector<IdentifierHash>::const_iterator vecEnd = hashVec.end();
188 const double energy = hit.energyDeposit();
190 float ypos = -99999.9;
192 double xi = hit.getHitStart().x();
193 double yi = hit.getHitStart().y();
194 double zi = hit.getHitStart().z();
195 double xf = hit.getHitEnd().x();
196 double yf = hit.getHitEnd().y();
197 double zf = hit.getHitEnd().z();
201 if (
dx>0.0 && xi<=0.0 && xf>=0.0 ) {
213 for (; vecBeg != vecEnd; ++vecBeg) {
214 myDeposits[(*vecBeg)].emplace_back(trackLink,cscd);
229 double flat = CLHEP::RandFlat::shoot(rndmEngine, 0.0,1.0);
230 bool phaseToSet = flat<0.5;
◆ FillCollectionWithNewDigitEDM()
mask this readout channel if it is a dead channel or a hot channel
Definition at line 241 of file CscDigitizationTool.cxx.
254 csc_newmap::const_iterator cscMap = data_SampleMap.begin();
255 csc_newmap::const_iterator cscMapEnd = data_SampleMap.end();
257 for (; cscMap != cscMapEnd; ++cscMap) {
259 IdentifierHash hashId = (*cscMap).first;
260 if (
m_idHelperSvc->cscIdHelper().get_id( hashId, digitId, &context ) ) {
261 ATH_MSG_ERROR (
"cannot get CSC channel identifier from hash " << hashId );
262 return StatusCode::FAILURE;
266 IdentifierHash coll_hash;
267 if (
m_idHelperSvc->cscIdHelper().get_hash(elementId, coll_hash, &cscContext)) {
268 ATH_MSG_ERROR (
"Unable to get CSC hash id from CSC Digit collection "
269 <<
"context begin_index = " << cscContext.
begin_index()
270 <<
" context end_index = " << cscContext.
end_index()
271 <<
" the identifier is " );
277 double stripCharge = 0.0;
279 const std::vector<float> samples = (*cscMap).second;
281 unsigned int samplingPhase =0;
282 double samplingTime =
m_pcalib->getSamplingTime();
283 m_pcalib->findCharge(samplingTime, samplingPhase, samples, stripCharge,
driftTime);
293 int phisec =
m_idHelperSvc->cscIdHelper().stationPhi(digitId);
294 int istation =
m_idHelperSvc->cscIdHelper().stationName(digitId) - 49;
297 int measphi =
m_idHelperSvc->cscIdHelper().measuresPhi(digitId);
300 int sector = zsec*(2*phisec-istation+1);
302 auto depositsForHash = myDeposits.find(hashId);
303 if (depositsForHash != myDeposits.end() && !depositsForHash->second.empty()) {
304 depositsForHash->second[0].second.setCharge(stripCharge);
305 cscSimData->insert ( std::make_pair(digitId,
CscSimData(depositsForHash->second,0)) );
311 ATH_MSG_DEBUG (
"NEWDigit sec:measphi:wlay:istr:chg:t(w/latency) "
312 <<
m_idHelperSvc->cscIdHelper().show_to_string(digitId,&context)
313 <<
" hash:eleId = " << hashId <<
" " << elementId <<
" " << prevId <<
" "
314 << sector <<
" " << measphi <<
" " << wlay <<
" " << istrip <<
" "
315 <<
int(stripCharge+1) <<
" " <<
float(
driftTime)
316 <<
" phase=" << phaseToSet
317 <<
" samps: " << samples[0] <<
" " << samples[1] <<
" "
318 << samples[2] <<
" " << samples[3]
321 if (prevId != elementId) {
322 if (coll_hash >= collections.size()) {
323 collections.resize (coll_hash+1);
325 collection = collections[coll_hash].
get();
326 if (
nullptr == collection) {
327 collections[coll_hash] = std::make_unique<CscDigitCollection>(elementId,coll_hash);
328 collection = collections[coll_hash].
get();
331 collection->
push_back (std::make_unique<CscDigit>(digitId, samples));
338 return StatusCode::FAILURE;
342 collection->
push_back (std::make_unique<CscDigit>(digitId, samples));
345 return StatusCode::SUCCESS;
◆ FillCollectionWithOldDigitEDM()
mask this readout channel if it is a dead channel or a hot channel
Definition at line 349 of file CscDigitizationTool.cxx.
357 csc_map::const_iterator cscMap = data_map.begin();
358 csc_map::const_iterator cscMapEnd = data_map.end();
359 for (; cscMap != cscMapEnd; ++cscMap) {
361 IdentifierHash hashId = (*cscMap).first;
362 if (
m_idHelperSvc->cscIdHelper().get_id( hashId, digitId, &context ) ) {
363 ATH_MSG_ERROR (
"cannot get CSC channel identifier from hash " << hashId );
364 return StatusCode::FAILURE;
368 double stripCharge = 0.0;
379 <<
" hash = " << hashId
380 <<
" charge = " <<
int (stripCharge+1) );
383 int phisec =
m_idHelperSvc->cscIdHelper().stationPhi(digitId);
384 int istation =
m_idHelperSvc->cscIdHelper().stationName(digitId) - 49;
387 int measphi =
m_idHelperSvc->cscIdHelper().measuresPhi(digitId);
390 int sector = zsec*(2*phisec-istation+1);
392 auto depositsForHash = myDeposits.find(hashId);
393 if (depositsForHash != myDeposits.end() && !depositsForHash->second.empty()) {
394 depositsForHash->second[0].second.setCharge(stripCharge);
395 cscSimData->insert ( std::make_pair(digitId,
CscSimData(depositsForHash->second,0)) );
401 auto newDigit = std::make_unique<CscDigit>(digitId,
int(stripCharge+1),
float(
driftTime) );
404 ATH_MSG_DEBUG (
"CSC Digit sector:measphi:wlay:istrip:charge "
406 << measphi <<
" " << wlay <<
" " << istrip
407 <<
" " <<
int(stripCharge+1) <<
" " <<
float(
driftTime) <<
" " << (newDigit->sampleCharges()).size());
410 IdentifierHash coll_hash;
411 if (
m_idHelperSvc->cscIdHelper().get_hash(elementId, coll_hash, &cscContext)) {
412 ATH_MSG_ERROR (
"Unable to get CSC hash id from CSC Digit collection "
413 <<
"context begin_index = " << cscContext.
begin_index()
414 <<
" context end_index = " << cscContext.
end_index()
415 <<
" the identifier is " );
419 if (prevId != elementId) {
420 if (coll_hash >= collections.size()) {
421 collections.resize (coll_hash+1);
423 collection = collections[coll_hash].
get();
424 if (
nullptr == collection) {
425 collections[coll_hash] = std::make_unique<CscDigitCollection>(elementId,coll_hash);
426 collection = collections[coll_hash].
get();
428 collection->
push_back(std::move(newDigit));
433 collection->
push_back(std::move(newDigit));
435 ATH_MSG_ERROR(
"Trying to push back NULL CscDigitCollection");
436 return StatusCode::FAILURE;
440 return StatusCode::SUCCESS;
◆ filterPassed()
virtual bool PileUpToolBase::filterPassed |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ getNextEvent()
StatusCode CscDigitizationTool::getNextEvent |
( |
const EventContext & |
ctx | ) |
|
|
private |
Definition at line 445 of file CscDigitizationTool.cxx.
454 if (!hitCollection.isValid()) {
455 ATH_MSG_ERROR(
"Could not get CSCSimHitCollection container " << hitCollection.name() <<
" from store " << hitCollection.store());
456 return StatusCode::FAILURE;
462 ATH_MSG_DEBUG(
"CSCSimHitCollection found with " << hitCollection->size() <<
" hits");
464 return StatusCode::SUCCESS;
468 TimedHitCollList hitCollList;
472 return StatusCode::FAILURE;
474 if (hitCollList.empty()) {
476 return StatusCode::FAILURE;
489 while (iColl != endColl) {
493 << p_collection->size() <<
" hits" );
496 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CscDigitizationTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
CSC calibratin tool for the Condtiions Data base access
Reimplemented from PileUpToolBase.
Definition at line 21 of file CscDigitizationTool.cxx.
44 ATH_MSG_DEBUG (
"MuonDetectorManager retrieved from StoreGate.");
73 return StatusCode::FAILURE;
85 return StatusCode::SUCCESS;
◆ mergeEvent()
StatusCode CscDigitizationTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
called at the end of the subevts loop. Not (necessarily) able to access subEvents
Definition at line 545 of file CscDigitizationTool.cxx.
551 ATH_CHECK(cscDigits.record(std::make_unique<CscDigitContainer>(
m_idHelperSvc->cscIdHelper().module_hash_max())));
552 ATH_MSG_DEBUG(
"recorded CscDigitContainer with name "<<cscDigits.key());
556 ATH_CHECK(cscSimData.record(std::make_unique<CscSimDataCollection>()));
563 for (
size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
564 if (collections[coll_hash]) {
565 ATH_CHECK( cscDigits->addCollection (collections[coll_hash].release(), coll_hash) );
572 while(cscHitColl!=cscHitCollEnd)
574 delete (*cscHitColl);
579 return StatusCode::SUCCESS;
◆ prepareEvent()
StatusCode CscDigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
unsigned int |
|
|
) |
| |
|
finaloverridevirtual |
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing
Definition at line 90 of file CscDigitizationTool.cxx.
97 return StatusCode::SUCCESS;
◆ processAllSubEvents() [1/2]
StatusCode CscDigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Reimplemented from PileUpToolBase.
Definition at line 101 of file CscDigitizationTool.cxx.
107 ATH_CHECK(cscDigits.record(std::make_unique<CscDigitContainer>(
m_idHelperSvc->cscIdHelper().module_hash_max())));
108 ATH_MSG_DEBUG(
"recorded CscDigitContainer with name "<<cscDigits.key());
114 ATH_CHECK(cscSimData.record(std::make_unique<CscSimDataCollection>()));
119 if (StatusCode::FAILURE ==
sc) {
130 for (
size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
131 if (collections[coll_hash]) {
132 ATH_CHECK( cscDigits->addCollection (collections[coll_hash].release(), coll_hash) );
136 return StatusCode::SUCCESS;
◆ processAllSubEvents() [2/2]
virtual StatusCode IPileUpTool::processAllSubEvents |
|
inherited |
dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.
◆ processBunchXing()
called for each active bunch-crossing to process current subEvents. bunchXing is in ns
Reimplemented from PileUpToolBase.
Definition at line 502 of file CscDigitizationTool.cxx.
506 ATH_MSG_DEBUG(
"CscDigitizationTool::processBunchXing() " << bunchXing);
509 TimedHitCollList hitCollList;
512 bSubEvents, eSubEvents).isSuccess()) &&
513 hitCollList.empty()) {
515 return StatusCode::FAILURE;
517 ATH_MSG_VERBOSE(hitCollList.size() <<
" CSCSimHitCollection with key " <<
525 for( ; iColl != endColl; ++iColl){
533 <<
" index: " << timeIndex.index()
534 <<
" type: " << timeIndex.type());
541 return StatusCode::SUCCESS;
◆ resetFilter()
virtual void PileUpToolBase::resetFilter |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ toProcess()
virtual bool PileUpToolBase::toProcess |
( |
int |
bunchXing | ) |
const |
|
inlineoverridevirtualinherited |
◆ m_amplification
Gaudi::Property<double> CscDigitizationTool::m_amplification {this, "amplification", 0.58e5, ""} |
|
private |
◆ m_cscDigitContainerKey
◆ m_cscDigitizer
std::unique_ptr<CSC_Digitizer> CscDigitizationTool::m_cscDigitizer {nullptr} |
|
private |
◆ m_cscHitCollList
◆ m_cscSimDataCollectionWriteHandleKey
◆ m_driftVelocity
Gaudi::Property<double> CscDigitizationTool::m_driftVelocity {this, "DriftVelocity", 60, ""} |
|
private |
◆ m_electronEnergy
Gaudi::Property<double> CscDigitizationTool::m_electronEnergy {this, "ElectronEnergy", 66, ""} |
|
private |
◆ m_filterPassed
bool PileUpToolBase::m_filterPassed {true} |
|
protectedinherited |
◆ m_firstXing
Gaudi::Property<int> PileUpToolBase::m_firstXing |
|
protectedinherited |
Initial value:{this, "FirstXing", -999,
"First bunch-crossing in which det is live"}
Definition at line 54 of file PileUpToolBase.h.
◆ m_hitsContainerKey
◆ m_idHelperSvc
◆ m_includePileUpTruth
Gaudi::Property<bool> CscDigitizationTool::m_includePileUpTruth {this, "IncludePileUpTruth", true, "Include pile-up truth info"} |
|
private |
◆ m_inputObjectName
std::string CscDigitizationTool::m_inputObjectName {""} |
|
private |
◆ m_isPileUp
Gaudi::Property<bool> CscDigitizationTool::m_isPileUp {this, "isPileUp", false, ""} |
|
private |
◆ m_lastXing
Gaudi::Property<int> PileUpToolBase::m_lastXing |
|
protectedinherited |
Initial value:{this, "LastXing", 999,
"Last bunch-crossing in which det is live"}
Definition at line 56 of file PileUpToolBase.h.
◆ m_maskBadChannel
Gaudi::Property<bool> CscDigitizationTool::m_maskBadChannel {this, "maskBadChannels", true, ""} |
|
private |
◆ m_mergeSvc
◆ m_newDigitEDM
Gaudi::Property<bool> CscDigitizationTool::m_newDigitEDM {this, "NewDigitEDM", true, ""} |
|
private |
◆ m_NInterFixed
Gaudi::Property<bool> CscDigitizationTool::m_NInterFixed {this, "NInterFixed", false, ""} |
|
private |
◆ m_onlyUseContainerName
BooleanProperty CscDigitizationTool::m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."} |
|
private |
◆ m_pcalib
◆ m_pedestal
Gaudi::Property<double> CscDigitizationTool::m_pedestal {this, "pedestal",0.0, ""} |
|
private |
◆ m_rndmSvc
◆ m_thpcCSC
◆ m_timeWindowLowerOffset
Gaudi::Property<double> CscDigitizationTool::m_timeWindowLowerOffset {this, "WindowLowerOffset", -25., ""} |
|
private |
◆ m_timeWindowUpperOffset
Gaudi::Property<double> CscDigitizationTool::m_timeWindowUpperOffset {this, "WindowUpperOffset", +25., ""} |
|
private |
◆ m_vetoPileUpTruthLinks
Gaudi::Property<int> PileUpToolBase::m_vetoPileUpTruthLinks |
|
protectedinherited |
Initial value:{this, "VetoPileUpTruthLinks", true,
"Ignore links to suppressed pile-up truth"}
Definition at line 58 of file PileUpToolBase.h.
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.
size_type end_index() const
const T * get(size_type n) const
Access an element, as an rvalue.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
AtlasHitsVector< CSCSimHit > CSCSimHitCollection
std::list< value_t > type
type of the collection of timed data object
a link optimized in size for a GenParticle in a McEventCollection
static const CscHitIdHelper * GetHelper()
size_type begin_index() const
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
A wrapper class for event-slot-local random engines.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
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.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
float hitTime(const AFP_SIDSimHit &hit)
a struct encapsulating the identifier of a pile-up event
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...