 |
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, V, H > &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, V, H > &hndl, const SG::VarHandleKeyType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &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 41 of file CscOverlay.h.
◆ StoreGateSvc_t
◆ CscOverlay()
| CscOverlay::CscOverlay |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ cardinality()
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 75 of file AthCommonReentrantAlgorithm.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 54 of file CscOverlay.cxx.
59 if(!bkgContainer.isValid()) {
60 ATH_MSG_ERROR(
"Could not get background CscRawDataContainer called " << bkgContainer.name() <<
" from store " << bkgContainer.store());
61 return StatusCode::FAILURE;
63 ATH_MSG_DEBUG(
"Found background CscRawDataContainer called " << bkgContainer.name() <<
" in store " << bkgContainer.store());
66 if(!signalContainer.isValid()) {
67 ATH_MSG_ERROR(
"Could not get signal CscRawOverlayContainer called " << signalContainer.name() <<
" from store " << signalContainer.store());
68 return StatusCode::FAILURE;
70 ATH_MSG_DEBUG(
"Found signal CscRawOverlayContainer called " << signalContainer.name() <<
" in store " << signalContainer.store());
73 ATH_CHECK(outputContainer.record(std::make_unique<CscRawDataContainer>(bkgContainer->size())));
74 if (!outputContainer.isValid()) {
75 ATH_MSG_ERROR(
"Could not record output CscRawOverlayContainer called " << outputContainer.name() <<
" to store " << outputContainer.store());
76 return StatusCode::FAILURE;
78 ATH_MSG_DEBUG(
"Recorded output CscRawOverlayContainer called " << outputContainer.name() <<
" in store " << outputContainer.store());
85 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()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ filterPassed()
◆ initialize()
| StatusCode CscOverlay::initialize |
( |
| ) |
|
|
finaloverridevirtual |
CSC calibratin tool for the Condtiions Data base access
Definition at line 33 of file CscOverlay.cxx.
50 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()
◆ 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 281 of file CscOverlay.cxx.
289 unsigned int nSigSamples = bkgCollection->
numSamples();
290 unsigned int nOvlSamples = signalCollection->
numSamples();
293 unsigned int dataSamplingTime = bkgCollection->
rate();
294 unsigned int ovlSamplingTime = signalCollection->
rate();
296 if ( dataSamplingTime != ovlSamplingTime ) {
297 ATH_MSG_ERROR(
"Overlay of inconsistent data - sampling times not the same "
298 << dataSamplingTime <<
" ns " << ovlSamplingTime <<
" ns");
299 throw std::runtime_error(
"mergeCollections(): sampling time mismatch");
302 if ( nSigSamples != nOvlSamples ) {
303 ATH_MSG_ERROR(
"Overlay of inconsistent data - number of samples not the same "
304 << nSigSamples <<
" " << nOvlSamples);
305 throw std::runtime_error(
"mergeCollections(): number of samples mismatch");
310 uint16_t clusterCounts[] = {0,0,0,0,0,0,0,0,0,0};
312 for (
uint16_t spuID=0; spuID<10; ++spuID) {
314 std::vector<const CscRawData*> sigData;
315 this->
spuData(bkgCollection, spuID, sigData);
317 std::vector<const CscRawData*> ovlData;
318 this->
spuData(signalCollection, spuID, ovlData);
323 if ( spuID == 4 || spuID == 9 )
layer=4;
324 for (
int j=0; j<=
layer; ++j ) {
325 std::map< int,std::vector<uint16_t> > sigSamples;
326 std::map< int,std::vector<uint16_t> > ovlSamples;
330 uint32_t ovlAddress = this->
stripData( ovlData, nOvlSamples, ovlSamples, ovlHash, spuID, j ,
false);
331 if (sigSamples.size()==0 && ovlSamples.size()==0)
continue;
336 ATH_MSG_DEBUG(
"Looking for overlap of hashes and addresses within widths because needtoflip");
338 std::set<int>
sig;
int lastindex=-1;
339 for (std::map<
int,std::vector<uint16_t> >::const_iterator si=sigSamples.begin(); si!=sigSamples.end(); ++si) {
340 if (si!=sigSamples.begin() && si->first-lastindex!=1)
break;
342 sig.insert(si->first);
msg() << si->first <<
" ";
347 for (std::map<
int,std::vector<uint16_t> >::const_iterator so=ovlSamples.begin(); so!=ovlSamples.end(); ++so) {
349 msg() << (so->first)-1 <<
" ";
350 if (
sig.find((so->first)-1)!=
sig.end()) {overlap=
true;
msg() <<
"!!";}
351 msg() << (so->first) <<
" ";
352 if (
sig.find((so->first))!=
sig.end()) {overlap=
true;
msg() <<
"!!";}
353 msg() << (so->first)+1 <<
" ";
354 if (
sig.find((so->first)+1)!=
sig.end()) {overlap=
true;
msg() <<
"!!";}
358 ATH_MSG_DEBUG(
"Taking max of hashes and addresses because needtoflip and no overlap");
365 std::set<int> insertedstrips, readstrips;
366 for (std::map<
int,std::vector<uint16_t> >::const_iterator
s=sigSamples.begin();
s!=sigSamples.end(); ++
s){readstrips.insert(
s->first);}
367 for (std::map<
int,std::vector<uint16_t> >::const_iterator si=ovlSamples.begin(); si!=ovlSamples.end(); ++si){readstrips.insert(si->first);}
371 for (
unsigned int di=0; di<datums.size(); ++di){
375 int stripstart = (
address & 0x000000FF) + 1 + 0;
376 ATH_MSG_DEBUG(
"Datum in layer="<<j<<
" has hash="<<
hash<<
" address="<<
address<<
" stripstart="<<stripstart<<
", "<< *datum );
377 if (datum->
width()==0) {
389 for (
unsigned int j=0; j<datum->
width(); ++j) {
390 int chamberLayer = ( (
address & 0x00000800) >> 11) + 1;
391 int wireLayer = ( (
address & 0x00000600) >> 9) + 1;
392 int measuresPhi = ( (
address & 0x00000100) >> 8);
394 ATH_MSG_VERBOSE(
"chamberlayer,wirelayer,measuresphi,strip="<<chamberLayer<<
","<<wireLayer<<
","<<measuresPhi<<
","<<
strip);
403 insertedstrips.insert(
strip);
417 if (spuID <10) clusterCounts[spuID] += 1;
418 if ( spuID <= 4 ) rpuCount[0] = 5;
419 else if ( spuID > 4 && spuID <= 9 ) rpuCount[1] = 11;
423 if (readstrips!=insertedstrips){
425 std::ostringstream readstream;
426 for (std::set<int>::const_iterator
i = readstrips.begin();
i!=readstrips.end(); ++
i){readstream<<*
i<<
" ";}
428 std::ostringstream insertstream;
429 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 538 of file CscOverlay.cxx.
547 std::vector<CscRawData*> datas;
550 if ( spuID == 4 || spuID == 9 )
max = 48;
551 std::vector<uint16_t> samples;
552 std::map< int,std::vector<uint16_t> >::const_iterator
sig;
553 std::map< int,std::vector<uint16_t> >::const_iterator ovl;
558 for (
int i=1;
i<=
max; ++
i) {
559 sig = sigSamples.find(
i);
560 ovl = ovlSamples.find(
i);
563 if (
sig != sigSamples.end() && ovl == ovlSamples.end() ) {
565 for (
unsigned int j=0; j<(*sig).second.size(); ++j ) {
566 samples.push_back( (*sig).second.at(j) );
567 assert((*sig).second.at(j)<=
MAX_AMPL);
571 else if (
sig == sigSamples.end() && ovl != ovlSamples.end() ) {
575 for (
unsigned int j=0; j<(*ovl).second.size(); ++j ) {
576 double theNoise = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 0.0,
noise);
577 float adcCount = (*ovl).second.at(j) + theNoise ;
579 ATH_MSG_DEBUG(
"value out of range (adding noise): " << adcCount <<
" "
580 <<
" Setting it to max value = " <<
MAX_AMPL
581 <<
" IdentifierHash is " << (myhashw));
584 samples.push_back( (
uint16_t) rint(adcCount) );
588 else if (
sig != sigSamples.end() && ovl != ovlSamples.end() ) {
591 double pedestal =
m_cscCalibTool->stripPedestal( (myhashw),
false );
592 for (
unsigned int j=0; j<(*sig).second.size(); ++j ) {
593 float adcCount = (*sig).second.at(j) + (*ovl).second.at(j) - pedestal ;
595 ATH_MSG_DEBUG(
"value out of range (adding data+MC samples - pedestal): " << adcCount <<
" "
596 <<
" Setting it to max value = " <<
MAX_AMPL
597 <<
" IdentifierHash is " << (myhashw));
600 samples.push_back( (
uint16_t) rint(adcCount) );
605 if (
used==
false && datas.size()>0 ){
606 if (
needtoflip(myaddress)) {myhash-=1; myaddress-=1;}
607 else {myhash+=1; myaddress+=1;}
612 if ( (
used==
false||
i==
max) && samples.size()>0){
617 datas.push_back(rawData);
618 ATH_MSG_DEBUG(
"overlay<>() add datum: hash="<<myhash<<
" address="<<myaddress<<
" width="<<
width);
625 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 89 of file CscOverlay.cxx.
98 std::vector < std::pair<IdentifierHash, bool> > overlapMap;
101 overlapMap.emplace_back(hashId,
false);
106 auto search = std::lower_bound( overlapMap.begin(), overlapMap.end(), hashId,
107 [](
const std::pair<IdentifierHash, bool> &lhs,
IdentifierHash rhs) ->
bool { return lhs.first < rhs; } );
108 if (
search == overlapMap.end() ||
search->first != hashId) {
112 if (outputContainer->
addCollection(bkgCollection.get(), hashId).isFailure()) {
113 ATH_MSG_ERROR(
"Adding background Collection with hashId " << hashId <<
" failed");
114 return StatusCode::FAILURE;
116 (void)bkgCollection.release();
126 rngWrapper->
setSeed(
name(), Gaudi::Hive::currentContext() );
127 CLHEP::HepRandomEngine *rndmEngine(*rngWrapper);
131 for (
const auto &[hashId, overlap] : overlapMap) {
161 std::vector<uint16_t> samples;
168 uint32_t stripHash = hashOffset + j;
171 std::vector<uint16_t> stripSamples;
172 bool extractSamplesStatus =
data->samples(j, numSamples, stripSamples);
173 if (!extractSamplesStatus) {
175 <<
" Online Cluster width = " <<
width
176 <<
" for number of Samples = " << numSamples
177 <<
" continuing ...");
180 double sampleNoise = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 0.0, stripNoise);
181 float adcCount =
sample + sampleNoise;
183 ATH_MSG_DEBUG(
"value out of range (copying over signal): " << adcCount <<
" "
184 <<
" Setting it to max value = " <<
MAX_AMPL
185 <<
" IdentifierHash is " << stripHash);
188 samples.push_back( (
uint16_t) std::rint(adcCount) );
194 auto rdo = std::make_unique<CscRawData>(samples,
data->address(),
data->identify(),
data->time(),
data->rpuID(),
data->width(),
data->hashId());
213 ATH_MSG_ERROR(
"Adding overlaid Collection with hashId " << hashId <<
" failed");
214 return StatusCode::FAILURE;
221 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ spuData()
get the data in one SPU of a chamber
Definition at line 258 of file CscOverlay.cxx.
260 data.clear();
if ( !coll )
return;
263 for ( ; idata != edata; ++idata ) {
264 if ( (*idata)->rpuID() == spuID )
data.push_back( *idata );
266 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 441 of file CscOverlay.cxx.
448 ATH_MSG_DEBUG(
"stripData<>() begin: gasLayer="<<gasLayer<<
" spuID="<<spuID<<
" isdata="<<isdata);
458 std::vector<const CscRawData*>::const_iterator idata =
data.begin();
459 std::vector<const CscRawData*>::const_iterator edata =
data.end();
460 for ( ; idata != edata; ++idata ) {
466 m_idHelperSvc->cscIdHelper().get_id(hashOffset, stripId, &context);
467 unsigned int strip =
static_cast<unsigned int> (
m_idHelperSvc->cscIdHelper().strip( stripId ) );
474 bool non_precision = (gasLayer==
layer) && (spuID==4 || spuID==9);
475 bool precision = (gasLayer==0) && (!(spuID==4 || spuID==9));
476 bool check = precision || non_precision;
483 unsigned int newaddress = datum->
address();
486 ATH_MSG_VERBOSE(
"needtoflip in stripdata, newaddress was = "<<newaddress<<
", strip was = "<<
strip);
494 newaddress=newaddress - oldFirstStrip + newFirstStrip;
500 ATH_MSG_VERBOSE(
"needtoflip in stripdata, newaddress now = "<<newaddress<<
", strip now = "<<
strip);
506 if ( hashOffset >
hash )
hash = hashOffset;
510 if ( hashOffset <
hash )
hash = hashOffset;
516 for (
unsigned int j=0; j<
width; ++j) {
517 std::vector<uint16_t> adcs;
518 bool extractSamples = datum->
samples(j, numSamples, adcs);
519 if ( !extractSamples ) {
521 <<
" Online Cluster width = " <<
width <<
" for number of Samples = " << numSamples);
524 int newstrip = (
strip+j);
529 samples.insert ( std::make_pair( newstrip, adcs) );
◆ sysExecute()
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 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
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 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 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
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.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.
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
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
virtual size_t numberOfCollections() const override final
return number of collections
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
uint32_t scaAddress() const
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
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.
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
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.
virtual StatusCode sysInitialize() override
Override sysInitialize.
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)
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
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.