ATLAS Offline Software
Loading...
Searching...
No Matches
TBTailCatcherRaw.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7
10
11#include <vector>
12
16
17TBTailCatcherRaw::TBTailCatcherRaw(const std::string& thisTailCatcherName,
18 bool overflow,
19 const
20 std::vector< TBScintillatorRaw* >&
21 theScints)
22 : TBBeamDetector(thisTailCatcherName,overflow)
23{
24 // store scintillator signals internally
25 m_signals.resize(theScints.size(),0);
26 for ( unsigned int i=0; i<theScints.size(); i++ )
27 {
28 m_signals[i] = theScints[i]->getADCSignal();
29 m_overflow = m_overflow || theScints[i]->isOverflow();
30 push_back(theScints[i]);
31 }
32}
33
36
37void
39{
40 m_overflow = m_overflow || thisScint->isOverflow();
41 this->push_back(thisScint);
42}
43
45TBTailCatcherRaw::getScintillator(const std::string& thisScintName) const
46{
48 while ( first != this->end() && (*first)->getDetectorName() != thisScintName )
49 {
50 ++first;
51 }
52 return ( first != this->end() )
53 ? *first
54 : 0;
55}
56
57const std::vector<int>& TBTailCatcherRaw::getSignals() const
58{
59 return m_signals;
60}
61
62int
63TBTailCatcherRaw::getSignal(const std::string& thisScintName) const
64{
65 return ( this->findIndex(thisScintName) < m_signals.size() )
66 ? m_signals[this->findIndex(thisScintName)]
67 : 0;
68}
69
70int
72{
73 return ( this->findIndex(thisScint->getDetectorName()) < m_signals.size() )
74 ? m_signals[this->findIndex(thisScint->getDetectorName())]
75 : 0;
76}
77
78unsigned int
79TBTailCatcherRaw::findIndex(const std::string& thisScintName) const
80{
82 unsigned int theIndex = 0;
83 while( first != this->end() && thisScintName != (*first)->getDetectorName() )
84 {
85 ++first;
86 ++theIndex;
87 }
88 return theIndex;
89}
An STL vector of pointers that by default owns its pointed-to elements.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
value_type push_back(value_type pElem)
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
const_iterator end() const noexcept
const_iterator begin() const noexcept
bool isOverflow() const
bool m_overflow
Detector Name.
const std::string & getDetectorName() const
void addScintillator(TBScintillatorRaw *thisScint)
const std::vector< signal_type > & getSignals() const
unsigned int findIndex(const std::string &thisScintName) const
const TBScintillatorRaw * getScintillator(const std::string &thisScintName) const
signal_type getSignal(const std::string &thisScintName) const
std::vector< int > m_signals