|
ATLAS Offline Software
|
#include <CscOverlay.h>
|
| CscOverlay (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override final |
|
virtual StatusCode | execute (const EventContext &ctx) const override final |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | overlayContainer (const CscRawDataContainer *bkgContainer, const CscRawDataContainer *signalContainer, CscRawDataContainer *outputContainer) const |
| Overlay signal on the background container and record to the output one. More...
|
|
std::unique_ptr< CscRawDataCollection > | copyCollection (const CscRawDataCollection *collection, bool propertiesOnly=false) const |
| Copy CscRawDataCollection, optionally only copy properties. More...
|
|
void | mergeCollections (const CscRawDataCollection *bkgCollection, const CscRawDataCollection *signalCollection, CscRawDataCollection *outputCollection, CLHEP::HepRandomEngine *rndmEngine) const |
| In case of overlap merge signal and background collections. More...
|
|
void | spuData (const CscRawDataCollection *coll, const uint16_t spuID, std::vector< const CscRawData * > &data) const |
| get the data in one SPU of a chamber More...
|
|
uint32_t | stripData (const std::vector< const CscRawData * > &data, const unsigned int numSamples, std::map< int, std::vector< uint16_t > > &samples, uint32_t &hash, const uint16_t spuID, const int gasLayer, bool isdata) const |
| data in one gas lauer More...
|
|
std::vector< CscRawData * > | overlay (const std::map< int, std::vector< uint16_t > > &sigSamples, const std::map< int, std::vector< uint16_t > > &ovlSamples, const uint32_t address, const uint16_t spuID, const uint16_t collId, const uint32_t hash, CLHEP::HepRandomEngine *rndmEngine) const |
| do the overlay - summing the ADC samples on one plane if there is overlap between zero bias data and simulation. More...
|
|
bool | needtoflip (const int address) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
SG::ReadHandleKey< CscRawDataContainer > | m_bkgInputKey {this,"BkgInputKey","Bkg_CSCRDO",""} |
|
SG::ReadHandleKey< CscRawDataContainer > | m_signalInputKey {this,"SignalInputKey","Sig_CSCRDO",""} |
|
SG::WriteHandleKey< CscRawDataContainer > | m_outputKey {this,"OutputKey","CSCRDO",""} |
|
Gaudi::Property< bool > | m_isDataOverlay {this, "isDataOverlay", false, ""} |
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
ToolHandle< ICscCalibTool > | m_cscCalibTool {this, "CalibTool", "CscCalibTool", ""} |
|
ToolHandle< Muon::ICSC_RDO_Decoder > | m_cscRdoDecoderTool {this, "CscRdoDecoderTool", "Muon::CscRDO_Decoder", ""} |
|
ServiceHandle< IAthRNGSvc > | m_rndmSvc {this, "RndmSvc", "AthRNGSvc", "Random Number Service"} |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 32 of file CscOverlay.h.
◆ StoreGateSvc_t
◆ CscOverlay()
CscOverlay::CscOverlay |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ cardinality()
unsigned int AthReentrantAlgorithm::cardinality |
( |
| ) |
const |
|
overridevirtualinherited |
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
◆ copyCollection()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode CscOverlay::execute |
( |
const EventContext & |
ctx | ) |
const |
|
finaloverridevirtual |
Definition at line 44 of file CscOverlay.cxx.
49 if(!bkgContainer.isValid()) {
50 ATH_MSG_ERROR(
"Could not get background CscRawDataContainer called " << bkgContainer.name() <<
" from store " << bkgContainer.store());
51 return StatusCode::FAILURE;
53 ATH_MSG_DEBUG(
"Found background CscRawDataContainer called " << bkgContainer.name() <<
" in store " << bkgContainer.store());
56 if(!signalContainer.isValid()) {
57 ATH_MSG_ERROR(
"Could not get signal CscRawOverlayContainer called " << signalContainer.name() <<
" from store " << signalContainer.store());
58 return StatusCode::FAILURE;
60 ATH_MSG_DEBUG(
"Found signal CscRawOverlayContainer called " << signalContainer.name() <<
" in store " << signalContainer.store());
63 ATH_CHECK(outputContainer.record(std::make_unique<CscRawDataContainer>(bkgContainer->size())));
64 if (!outputContainer.isValid()) {
65 ATH_MSG_ERROR(
"Could not record output CscRawOverlayContainer called " << outputContainer.name() <<
" to store " << outputContainer.store());
66 return StatusCode::FAILURE;
68 ATH_MSG_DEBUG(
"Recorded output CscRawOverlayContainer called " << outputContainer.name() <<
" in store " << outputContainer.store());
75 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ initialize()
StatusCode CscOverlay::initialize |
( |
| ) |
|
|
finaloverridevirtual |
CSC calibratin tool for the Condtiions Data base access
Definition at line 23 of file CscOverlay.cxx.
40 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, InDet::SiSPGNNTrackMaker, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ mergeCollections()
In case of overlap merge signal and background collections.
loop over the SPU - collecting thr data by layer do the overlay by igas layer in a chamber
for the non-precision strips, all the 4 layers in a chamber are in the same SPU, we need to recover the data by chamber layer
Definition at line 275 of file CscOverlay.cxx.
283 unsigned int nSigSamples = bkgCollection->
numSamples();
284 unsigned int nOvlSamples = signalCollection->
numSamples();
287 unsigned int dataSamplingTime = bkgCollection->
rate();
288 unsigned int ovlSamplingTime = signalCollection->
rate();
290 if ( dataSamplingTime != ovlSamplingTime ) {
291 ATH_MSG_ERROR(
"Overlay of inconsistent data - sampling times not the same "
292 << dataSamplingTime <<
" ns " << ovlSamplingTime <<
" ns");
293 throw std::runtime_error(
"mergeCollections(): sampling time mismatch");
296 if ( nSigSamples != nOvlSamples ) {
297 ATH_MSG_ERROR(
"Overlay of inconsistent data - number of samples not the same "
298 << nSigSamples <<
" " << nOvlSamples);
299 throw std::runtime_error(
"mergeCollections(): number of samples mismatch");
304 uint16_t clusterCounts[] = {0,0,0,0,0,0,0,0,0,0};
306 for (
uint16_t spuID=0; spuID<10; ++spuID) {
308 std::vector<const CscRawData*> sigData;
309 this->
spuData(bkgCollection, spuID, sigData);
311 std::vector<const CscRawData*> ovlData;
312 this->
spuData(signalCollection, spuID, ovlData);
317 if ( spuID == 4 || spuID == 9 )
layer=4;
318 for (
int j=0; j<=
layer; ++j ) {
319 std::map< int,std::vector<uint16_t> > sigSamples;
320 std::map< int,std::vector<uint16_t> > ovlSamples;
324 uint32_t ovlAddress = this->
stripData( ovlData, nOvlSamples, ovlSamples, ovlHash, spuID, j ,
false);
325 if (sigSamples.size()==0 && ovlSamples.size()==0)
continue;
330 ATH_MSG_DEBUG(
"Looking for overlap of hashes and addresses within widths because needtoflip");
332 std::set<int>
sig;
int lastindex=-1;
333 for (std::map<
int,std::vector<uint16_t> >::const_iterator si=sigSamples.begin(); si!=sigSamples.end(); ++si) {
334 if (si!=sigSamples.begin() && si->first-lastindex!=1)
break;
336 sig.insert(si->first);
msg() << si->first <<
" ";
341 for (std::map<
int,std::vector<uint16_t> >::const_iterator so=ovlSamples.begin(); so!=ovlSamples.end(); ++so) {
343 msg() << (so->first)-1 <<
" ";
344 if (
sig.find((so->first)-1)!=
sig.end()) {overlap=
true;
msg() <<
"!!";}
345 msg() << (so->first) <<
" ";
346 if (
sig.find((so->first))!=
sig.end()) {overlap=
true;
msg() <<
"!!";}
347 msg() << (so->first)+1 <<
" ";
348 if (
sig.find((so->first)+1)!=
sig.end()) {overlap=
true;
msg() <<
"!!";}
352 ATH_MSG_DEBUG(
"Taking max of hashes and addresses because needtoflip and no overlap");
359 std::set<int> insertedstrips, readstrips;
360 for (std::map<
int,std::vector<uint16_t> >::const_iterator
s=sigSamples.begin();
s!=sigSamples.end(); ++
s){readstrips.insert(
s->first);}
361 for (std::map<
int,std::vector<uint16_t> >::const_iterator si=ovlSamples.begin(); si!=ovlSamples.end(); ++si){readstrips.insert(si->first);}
365 for (
unsigned int di=0; di<datums.size(); ++di){
369 int stripstart = (
address & 0x000000FF) + 1 + 0;
370 ATH_MSG_DEBUG(
"Datum in layer="<<j<<
" has hash="<<
hash<<
" address="<<
address<<
" stripstart="<<stripstart<<
", "<< *datum );
371 if (datum->
width()==0) {
383 for (
unsigned int j=0; j<datum->
width(); ++j) {
384 int chamberLayer = ( (
address & 0x00000800) >> 11) + 1;
385 int wireLayer = ( (
address & 0x00000600) >> 9) + 1;
386 int measuresPhi = ( (
address & 0x00000100) >> 8);
388 ATH_MSG_VERBOSE(
"chamberlayer,wirelayer,measuresphi,strip="<<chamberLayer<<
","<<wireLayer<<
","<<measuresPhi<<
","<<
strip);
397 insertedstrips.insert(
strip);
411 if (spuID <10) clusterCounts[spuID] += 1;
412 if ( spuID <= 4 ) rpuCount[0] = 5;
413 else if ( spuID > 4 && spuID <= 9 ) rpuCount[1] = 11;
417 if (readstrips!=insertedstrips){
419 std::ostringstream readstream;
420 for (std::set<int>::const_iterator
i = readstrips.begin();
i!=readstrips.end(); ++
i){readstream<<*
i<<
" ";}
422 std::ostringstream insertstream;
423 for (std::set<int>::const_iterator
i = insertedstrips.begin();
i!=insertedstrips.end(); ++
i){insertstream<<*
i<<
" ";}
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ needtoflip()
bool CscOverlay::needtoflip |
( |
const int |
address | ) |
const |
|
private |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ overlay()
std::vector< CscRawData * > CscOverlay::overlay |
( |
const std::map< int, std::vector< uint16_t > > & |
sigSamples, |
|
|
const std::map< int, std::vector< uint16_t > > & |
ovlSamples, |
|
|
const uint32_t |
address, |
|
|
const uint16_t |
spuID, |
|
|
const uint16_t |
collId, |
|
|
const uint32_t |
hash, |
|
|
CLHEP::HepRandomEngine * |
rndmEngine |
|
) |
| const |
|
private |
do the overlay - summing the ADC samples on one plane if there is overlap between zero bias data and simulation.
If there is no overlap, simply copy the data
Definition at line 532 of file CscOverlay.cxx.
541 std::vector<CscRawData*> datas;
544 if ( spuID == 4 || spuID == 9 )
max = 48;
545 std::vector<uint16_t> samples;
546 std::map< int,std::vector<uint16_t> >::const_iterator
sig;
547 std::map< int,std::vector<uint16_t> >::const_iterator ovl;
552 for (
int i=1;
i<=
max; ++
i) {
553 sig = sigSamples.find(
i);
554 ovl = ovlSamples.find(
i);
557 if (
sig != sigSamples.end() && ovl == ovlSamples.end() ) {
559 for (
unsigned int j=0; j<(*sig).second.size(); ++j ) {
560 samples.push_back( (*sig).second.at(j) );
561 assert((*sig).second.at(j)<=
MAX_AMPL);
565 else if (
sig == sigSamples.end() && ovl != ovlSamples.end() ) {
569 for (
unsigned int j=0; j<(*ovl).second.size(); ++j ) {
570 double theNoise = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 0.0,
noise);
571 float adcCount = (*ovl).second.at(j) + theNoise ;
573 ATH_MSG_DEBUG(
"value out of range (adding noise): " << adcCount <<
" "
574 <<
" Setting it to max value = " <<
MAX_AMPL
575 <<
" IdentifierHash is " << (myhashw));
578 samples.push_back( (
uint16_t) rint(adcCount) );
582 else if (
sig != sigSamples.end() && ovl != ovlSamples.end() ) {
585 double pedestal =
m_cscCalibTool->stripPedestal( (myhashw),
false );
586 for (
unsigned int j=0; j<(*sig).second.size(); ++j ) {
587 float adcCount = (*sig).second.at(j) + (*ovl).second.at(j) - pedestal ;
589 ATH_MSG_DEBUG(
"value out of range (adding data+MC samples - pedestal): " << adcCount <<
" "
590 <<
" Setting it to max value = " <<
MAX_AMPL
591 <<
" IdentifierHash is " << (myhashw));
594 samples.push_back( (
uint16_t) rint(adcCount) );
599 if (
used==
false && datas.size()>0 ){
600 if (
needtoflip(myaddress)) {myhash-=1; myaddress-=1;}
601 else {myhash+=1; myaddress+=1;}
606 if ( (
used==
false||
i==
max) && samples.size()>0){
611 datas.push_back(rawData);
612 ATH_MSG_DEBUG(
"overlay<>() add datum: hash="<<myhash<<
" address="<<myaddress<<
" width="<<
width);
619 ATH_MSG_DEBUG(
"overlay<>() end: CscRawDatas size="<<datas.size());
◆ overlayContainer()
Overlay signal on the background container and record to the output one.
Definition at line 79 of file CscOverlay.cxx.
88 std::vector < std::pair<IdentifierHash, bool> > overlapMap;
91 overlapMap.emplace_back(hashId,
false);
96 auto search = std::lower_bound( overlapMap.begin(), overlapMap.end(), hashId,
97 [](
const std::pair<IdentifierHash, bool> &lhs,
IdentifierHash rhs) ->
bool { return lhs.first < rhs; } );
98 if (
search == overlapMap.end() ||
search->first != hashId) {
102 if (outputContainer->
addCollection(bkgCollection.get(), hashId).isFailure()) {
103 ATH_MSG_ERROR(
"Adding background Collection with hashId " << hashId <<
" failed");
104 return StatusCode::FAILURE;
106 (void)bkgCollection.release();
116 rngWrapper->
setSeed(
name(), Gaudi::Hive::currentContext() );
117 CLHEP::HepRandomEngine *rndmEngine(*rngWrapper);
121 for (
const auto &[hashId, overlap] : overlapMap) {
151 std::vector<uint16_t> samples;
158 uint32_t stripHash = hashOffset + j;
161 std::vector<uint16_t> stripSamples;
162 bool extractSamplesStatus =
data->samples(j, numSamples, stripSamples);
163 if (!extractSamplesStatus) {
165 <<
" Online Cluster width = " <<
width
166 <<
" for number of Samples = " << numSamples
167 <<
" continuing ...");
170 double sampleNoise = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 0.0, stripNoise);
173 float adcCount =
sample + sampleNoise;
175 ATH_MSG_DEBUG(
"value out of range (copying over signal): " << adcCount <<
" "
176 <<
" Setting it to max value = " <<
MAX_AMPL
177 <<
" IdentifierHash is " << stripHash);
182 samples.push_back( (
uint16_t) rint(adcCount) );
188 auto rdo = std::make_unique<CscRawData>(samples,
data->address(),
data->identify(),
data->time(),
data->rpuID(),
data->width(),
data->hashId());
207 ATH_MSG_ERROR(
"Adding overlaid Collection with hashId " << hashId <<
" failed");
208 return StatusCode::FAILURE;
215 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ spuData()
get the data in one SPU of a chamber
Definition at line 252 of file CscOverlay.cxx.
254 data.clear();
if ( !coll )
return;
257 for ( ; idata != edata; ++idata ) {
258 if ( (*idata)->rpuID() == spuID )
data.push_back( *idata );
260 ATH_MSG_DEBUG(
"spuData(): made data vector of size "<<
data.size()<<
" for SPU "<<spuID);
◆ stripData()
uint32_t CscOverlay::stripData |
( |
const std::vector< const CscRawData * > & |
data, |
|
|
const unsigned int |
numSamples, |
|
|
std::map< int, std::vector< uint16_t > > & |
samples, |
|
|
uint32_t & |
hash, |
|
|
const uint16_t |
spuID, |
|
|
const int |
gasLayer, |
|
|
bool |
isdata |
|
) |
| const |
|
private |
data in one gas lauer
loop over the data in the SPU
find the strip Identifier given the strip hash ID
create the map only layer by layer for the precision strip, we set gasLayer=0 because the spuID tells you the gas layer for the non-precision strips, we need to explicitly get the gas layer number form the Identifier
Definition at line 435 of file CscOverlay.cxx.
442 ATH_MSG_DEBUG(
"stripData<>() begin: gasLayer="<<gasLayer<<
" spuID="<<spuID<<
" isdata="<<isdata);
452 std::vector<const CscRawData*>::const_iterator idata =
data.begin();
453 std::vector<const CscRawData*>::const_iterator edata =
data.end();
454 for ( ; idata != edata; ++idata ) {
460 m_idHelperSvc->cscIdHelper().get_id(hashOffset, stripId, &context);
461 unsigned int strip =
static_cast<unsigned int> (
m_idHelperSvc->cscIdHelper().strip( stripId ) );
468 bool non_precision = (gasLayer==
layer) && (spuID==4 || spuID==9);
469 bool precision = (gasLayer==0) && (!(spuID==4 || spuID==9));
470 bool check = precision || non_precision;
477 unsigned int newaddress = datum->
address();
480 ATH_MSG_VERBOSE(
"needtoflip in stripdata, newaddress was = "<<newaddress<<
", strip was = "<<
strip);
488 newaddress=newaddress - oldFirstStrip + newFirstStrip;
494 ATH_MSG_VERBOSE(
"needtoflip in stripdata, newaddress now = "<<newaddress<<
", strip now = "<<
strip);
500 if ( hashOffset >
hash )
hash = hashOffset;
504 if ( hashOffset <
hash )
hash = hashOffset;
510 for (
unsigned int j=0; j<
width; ++j) {
511 std::vector<uint16_t> adcs;
512 bool extractSamples = datum->
samples(j, numSamples, adcs);
513 if ( !extractSamples ) {
515 <<
" Online Cluster width = " <<
width <<
" for number of Samples = " << numSamples);
518 int newstrip = (
strip+j);
523 samples.insert ( std::make_pair( newstrip, adcs) );
◆ sysExecute()
StatusCode AthReentrantAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_bkgInputKey
◆ m_cscCalibTool
◆ m_cscRdoDecoderTool
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_idHelperSvc
◆ m_isDataOverlay
Gaudi::Property<bool> CscOverlay::m_isDataOverlay {this, "isDataOverlay", false, ""} |
|
private |
◆ m_outputKey
◆ m_rndmSvc
◆ m_signalInputKey
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
char data[hepevt_bytes_allocation_ATLAS]
constexpr uint8_t stationPhi
station Phi 1 to 8
Const iterator class for DataVector/DataList.
uint16_t identify() const
access methods
SG::WriteHandleKey< CscRawDataContainer > m_outputKey
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
void mergeCollections(const CscRawDataCollection *bkgCollection, const CscRawDataCollection *signalCollection, CscRawDataCollection *outputCollection, CLHEP::HepRandomEngine *rndmEngine) const
In case of overlap merge signal and background collections.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void spuData(const CscRawDataCollection *coll, const uint16_t spuID, std::vector< const CscRawData * > &data) const
get the data in one SPU of a chamber
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool samplingPhase() const
#define ATH_MSG_VERBOSE(x)
uint32_t eventType() const
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
virtual void setOwner(IDataHandleHolder *o)=0
virtual size_t numberOfCollections() const override final
return number of collections
AthReentrantAlgorithm()
Default constructor:
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdentifierHash identifyHash() const
Returns the OFFLINE identifier hash for this collection.
const std::vector< uint8_t > & dataType() const
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
uint8_t firstBitSummary() const
SG::ReadHandleKey< CscRawDataContainer > m_signalInputKey
::StatusCode StatusCode
StatusCode definition for legacy code.
uint32_t scaAddress() const
StatusCode overlayContainer(const CscRawDataContainer *bkgContainer, const CscRawDataContainer *signalContainer, CscRawDataContainer *outputContainer) const
Overlay signal on the background container and record to the output one.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void setHashID(uint32_t hash)
std::unique_ptr< CscRawDataCollection > copyCollection(const CscRawDataCollection *collection, bool propertiesOnly=false) const
Copy CscRawDataCollection, optionally only copy properties.
Collection of CSC Raw Hits, arranged according to CSC Detector Elements Author: Ketevi A.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
virtual void renounce()=0
uint16_t numSamples() const
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
A wrapper class for event-slot-local random engines.
const std::vector< uint16_t > & samples() const
virtual StatusCode sysInitialize() override
Override sysInitialize.
uint32_t stripData(const std::vector< const CscRawData * > &data, const unsigned int numSamples, std::map< int, std::vector< uint16_t > > &samples, uint32_t &hash, const uint16_t spuID, const int gasLayer, bool isdata) const
data in one gas lauer
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool needtoflip(const int address) const
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
Class to hold the electronic output for a single CSC readout channel: n sampling ADC data + the addre...
#define ATH_MSG_WARNING(x)
ToolHandle< ICscCalibTool > m_cscCalibTool
const std::vector< EventContainers::hashPair< T > > & GetAllHashPtrPair() const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::ReadHandleKey< CscRawDataContainer > m_bkgInputKey
std::vector< CscRawData * > overlay(const std::map< int, std::vector< uint16_t > > &sigSamples, const std::map< int, std::vector< uint16_t > > &ovlSamples, const uint32_t address, const uint16_t spuID, const uint16_t collId, const uint32_t hash, CLHEP::HepRandomEngine *rndmEngine) const
do the overlay - summing the ADC samples on one plane if there is overlap between zero bias data and ...
ServiceHandle< IAthRNGSvc > m_rndmSvc
constexpr uint8_t stationEta
1 to 3
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Gaudi::Property< bool > m_isDataOverlay
void setTime(uint16_t time)
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
uint16_t subDetectorId() const
uint8_t rate() const
the rate could be 25 or 50 ns
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.