 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ToolHandle.h"
11 #include "CLHEP/Units/SystemOfUnits.h"
51 ATH_MSG_DEBUG (
"======== LArCalibDigitMaker Initialize ========" );
56 ATH_MSG_DEBUG (
"======== LArCalibDigitMaker isSC is True ========" );
64 std::vector<std::vector<unsigned>> theseBoardIDs;
65 std::vector<std::vector<unsigned>> thesePatterns;
66 std::vector<std::vector<unsigned>> theseDACs;
69 theseDACs.reserve(
m_vDAC.size());
71 theseBoardIDs.emplace_back(
elem.begin(),
elem.end());
74 thesePatterns.emplace_back(
elem.begin(),
elem.end());
77 theseDACs.emplace_back(
elem.begin(),
elem.end());
79 std::vector<unsigned> cutPattern;
81 auto calibParams = std::make_unique<LArCalibParams>();
83 for(
long unsigned int i=0;
i < theseBoardIDs.size();
i++ ){
85 cutPattern = thesePatterns[
i];
91 if (thesePatterns[
i].
size()%4) {
92 ATH_MSG_ERROR (
"Problem with jobOptions! One Pattern must conists of 4 32bit values! Pattern "<<
i );
93 return StatusCode::FAILURE;
95 for (
unsigned id : theseBoardIDs[
i]) {
111 ATH_MSG_DEBUG (
"======== LArCalibDigitMaker initialize successfully ========" );
112 return StatusCode::SUCCESS;
118 if (
m_dontRun)
return StatusCode::SUCCESS;
120 const EventContext& ctx = Gaudi::Hive::currentContext();
125 ATH_MSG_DEBUG (
"======== LArCalibDigitMaker: using SC calib line map" );
136 return StatusCode::FAILURE;
139 const unsigned eventNb=(ctx.eventID().event_number())&0xffffff ;
141 ATH_MSG_DEBUG (
"======== executing event "<< eventNb <<
" ========" );
150 if (
sc.isFailure()) {
151 ATH_MSG_DEBUG (
"Cannot read LArDigitContainer from StoreGate! key=" <<
key );
154 if (larDigitCont->
empty()) {
155 ATH_MSG_DEBUG (
"LArDigitContainer with key '" <<
key <<
"' is empty. Ignored." );
160 auto calibDigitContainer=std::make_unique<LArCalibDigitContainer>();
171 const std::vector<short>& samples=
digit->samples();
173 const std::vector<HWIdentifier>& calibChannelIDs=clcabling->
calibSlotLine(chid);
174 if (calibChannelIDs.empty()) {
178 std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin();
181 unsigned ddac=calibParams->
DAC(eventNb,*csl_it);
190 for(; csl_it != calibChannelIDs.end(); ++csl_it) {
191 if(calibParams->
isPulsed(eventNb,*csl_it)){
198 ATH_MSG_VERBOSE(
"HERE!! "<<chid<<
" "<<
gain<<
" "<<
dac<<
" "<<
delay<<
" "<<ispulsed<<
" event no "<<eventNb<<
" "<<calibChannelIDs.size()<<
" calib lines, first is "<<*csl_it);
202 calibDigitContainer->push_back(calibDigit);
206 ATH_MSG_DEBUG (
"LArCalibDigitContainer recorded to StoreGate. key=" <<
key );
208 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
std::vector< HWIdentifier > m_pulsedChids
std::vector< int > m_nPatterns
std::vector< std::vector< double > > m_vBoardIDs
std::string find(const std::string &s)
return a remapped string
const std::vector< HWIdentifier > & calibSlotLine(const HWIdentifier id) const
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
LArCalibDigitMaker(const std::string &name, ISvcLocator *pSvcLocator)
#define kmaxDAC
This class contains the LAr Calibration Board settings and a set of functions to decoded them.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Liquid Argon digit base class.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< std::vector< double > > m_vDAC
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool isPulsed(const unsigned event, const HWIdentifier calibLineID) const
double delay(std::size_t d)
SG::ReadCondHandleKey< LArCalibLineMapping > m_calibMapKey
std::vector< std::vector< double > > m_vPattern
unsigned DAC(const unsigned event, const HWIdentifier calibLineID) const
Base class for LArDigits taken during calibration runs.
unsigned Delay(const unsigned event, const HWIdentifier calibLineID) const
StatusCode initialize(bool used=true)
std::vector< unsigned > m_vDelay
#define ATH_MSG_WARNING(x)
Container class for LArDigit.
std::vector< std::string > m_keylist
bool empty() const noexcept
Returns true if the collection is empty.
SG::ReadCondHandleKey< LArCalibLineMapping > m_calibMapSCKey