ATLAS Offline Software
CscOverlay.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Overlaying RDOs from two different events for InDet subdetectors.
6 //
7 // Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
8 //
9 // Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
10 
11 #ifndef CSCOVERLAY_CSCOVERLAY_H
12 #define CSCOVERLAY_CSCOVERLAY_H
13 
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/ToolHandle.h"
17 
23 
24 #include <vector>
25 #include <string>
26 #include <map>
27 
28 namespace CLHEP {
29  class HepRandomEngine;
30 }
31 
33 public:
34 
35  CscOverlay(const std::string &name,ISvcLocator *pSvcLocator);
36 
37  virtual StatusCode initialize() override final;
38  virtual StatusCode execute(const EventContext& ctx) const override final;
39 
40 private:
41 
44  const CscRawDataContainer *signalContainer,
45  CscRawDataContainer *outputContainer) const;
46 
48  std::unique_ptr<CscRawDataCollection> copyCollection(const CscRawDataCollection *collection,
49  bool propertiesOnly = false) const;
50 
52  void mergeCollections(const CscRawDataCollection *bkgCollection,
53  const CscRawDataCollection *signalCollection,
55  CLHEP::HepRandomEngine *rndmEngine) const;
56 
58  void spuData( const CscRawDataCollection * coll, const uint16_t spuID, std::vector<const CscRawData*>& data) const;
59 
61  uint32_t stripData ( const std::vector<const CscRawData*>& data,
62  const unsigned int numSamples,
63  std::map< int,std::vector<uint16_t> >& samples,
64  uint32_t& hash,
65  const uint16_t spuID,
66  const int gasLayer, bool isdata) const;
67 
71  std::vector<CscRawData*> overlay( const std::map< int,std::vector<uint16_t> >& sigSamples,
72  const std::map< int,std::vector<uint16_t> >& ovlSamples,
73  const uint32_t address,
74  const uint16_t spuID,
75  const uint16_t collId,
76  const uint32_t hash,
77  CLHEP::HepRandomEngine *rndmEngine) const;
78 
79  //Whether the data needs to be fliped by 49-strip for bug#56002
80  bool needtoflip(const int address) const;
81 
82  // ----------------------------------------------------------------
83 
84  // jO controllable properties.
85  // "Main" containers are read, have data from "overlay" containers added,
86  // and written out with the original SG keys.
87  SG::ReadHandleKey<CscRawDataContainer> m_bkgInputKey{this,"BkgInputKey","Bkg_CSCRDO",""};
88  SG::ReadHandleKey<CscRawDataContainer> m_signalInputKey{this,"SignalInputKey","Sig_CSCRDO",""};
90 
91  Gaudi::Property<bool> m_isDataOverlay{this, "isDataOverlay", false, ""};
92  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
93  ToolHandle<ICscCalibTool> m_cscCalibTool{this, "CalibTool", "CscCalibTool", ""};
94  ToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool{this, "CscRdoDecoderTool", "Muon::CscRDO_Decoder", ""};
95 
96  ServiceHandle <IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", "Random Number Service"}; // Random number service
97 };
98 
99 #endif/*CSCOVERLAY_CSCOVERLAY_H*/
ICSC_RDO_Decoder.h
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CscOverlay::m_outputKey
SG::WriteHandleKey< CscRawDataContainer > m_outputKey
Definition: CscOverlay.h:89
CscOverlay::mergeCollections
void mergeCollections(const CscRawDataCollection *bkgCollection, const CscRawDataCollection *signalCollection, CscRawDataCollection *outputCollection, CLHEP::HepRandomEngine *rndmEngine) const
In case of overlap merge signal and background collections.
Definition: CscOverlay.cxx:275
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
CscRawDataContainer.h
CscOverlay::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: CscOverlay.cxx:44
CscOverlay::spuData
void spuData(const CscRawDataCollection *coll, const uint16_t spuID, std::vector< const CscRawData * > &data) const
get the data in one SPU of a chamber
Definition: CscOverlay.cxx:252
CscOverlay::CscOverlay
CscOverlay(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CscOverlay.cxx:18
ICscCalibTool.h
CscOverlay
Definition: CscOverlay.h:32
SG::ReadHandleKey< CscRawDataContainer >
CscOverlay::m_cscRdoDecoderTool
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
Definition: CscOverlay.h:94
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
CscOverlay::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscOverlay.h:92
SG::WriteHandleKey< CscRawDataContainer >
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
CscOverlay::initialize
virtual StatusCode initialize() override final
Definition: CscOverlay.cxx:23
CscOverlay::m_signalInputKey
SG::ReadHandleKey< CscRawDataContainer > m_signalInputKey
Definition: CscOverlay.h:88
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
CscOverlay::overlayContainer
StatusCode overlayContainer(const CscRawDataContainer *bkgContainer, const CscRawDataContainer *signalContainer, CscRawDataContainer *outputContainer) const
Overlay signal on the background container and record to the output one.
Definition: CscOverlay.cxx:79
CscOverlay::copyCollection
std::unique_ptr< CscRawDataCollection > copyCollection(const CscRawDataCollection *collection, bool propertiesOnly=false) const
Copy CscRawDataCollection, optionally only copy properties.
Definition: CscOverlay.cxx:220
CscRawDataCollection
Collection of CSC Raw Hits, arranged according to CSC Detector Elements Author: Ketevi A.
Definition: CscRawDataCollection.h:24
AthReentrantAlgorithm.h
postInclude.outputCollection
outputCollection
Definition: postInclude.SortInput.py:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CscOverlay::stripData
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
Definition: CscOverlay.cxx:435
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
CscOverlay::needtoflip
bool needtoflip(const int address) const
Definition: CscOverlay.cxx:263
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CscOverlay::m_cscCalibTool
ToolHandle< ICscCalibTool > m_cscCalibTool
Definition: CscOverlay.h:93
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
CscOverlay::m_bkgInputKey
SG::ReadHandleKey< CscRawDataContainer > m_bkgInputKey
Definition: CscOverlay.h:87
CscOverlay::overlay
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 ...
Definition: CscOverlay.cxx:532
CscOverlay::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: CscOverlay.h:96
CscOverlay::m_isDataOverlay
Gaudi::Property< bool > m_isDataOverlay
Definition: CscOverlay.h:91
IMuonIdHelperSvc.h
IAthRNGSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >