Skip to content
Snippets Groups Projects
Commit 06ffd92e authored by John Chapman's avatar John Chapman
Browse files

Drop inheritance of CscDigitizationTool on IMuonDigitizationTool

Also tidied up whitespace and moved the initialization of more member
variables to the header file.
parent a5e8f57b
No related branches found
No related tags found
No related merge requests found
Pipeline #716705 passed
......@@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PUBLIC
MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools
MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry
MuonSpectrometer/MuonDigitContainer
MuonSpectrometer/MuonDigitization/MuonDigToolInterfaces
MuonSpectrometer/MuonIdHelpers
MuonSpectrometer/MuonSimData
MuonSpectrometer/MuonSimEvent
......
......@@ -3,9 +3,7 @@
*/
#ifndef MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H
#define MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H
#include "MuonDigToolInterfaces/IMuonDigitizationTool.h"
#define MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H
#include "GaudiKernel/ToolHandle.h"
#include "AthenaKernel/IAthRNGSvc.h"
......@@ -40,75 +38,69 @@ class PileUpMergeSvc;
// loop over the digit and build the digit container
// store the digits in StoreGate
class CscDigitizationTool : virtual public IMuonDigitizationTool, public PileUpToolBase {
class CscDigitizationTool : public PileUpToolBase {
typedef std::vector<CscSimData::Deposit> deposits;
typedef std::map<IdentifierHash,std::pair<double,double> > csc_map;
typedef std::map<IdentifierHash,std::vector<float> > csc_newmap;
public:
CscDigitizationTool(const std::string& type, const std::string& name, const IInterface* pIID);
~CscDigitizationTool();
virtual StatusCode initialize() override final;
virtual StatusCode finalize() override final;
virtual StatusCode initialize() override final;
// PileUpTool methods...
///called at the end of the subevts loop. Not (necessarily) able to access subEvents
virtual StatusCode mergeEvent() override final;
///called for each active bunch-crossing to process current subEvents. bunchXing is in ns
virtual StatusCode processBunchXing(
int bunchXing,
SubEventIterator bSubEvents,
SubEventIterator eSubEvents
) override final;
int bunchXing,
SubEventIterator bSubEvents,
SubEventIterator eSubEvents
) override final;
/// return false if not interested in certain xing times (in ns)
/// implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing
// virtual bool toProcess(int bunchXing) const;
virtual StatusCode prepareEvent(unsigned int /*nInputEvents*/) override final;
/// alternative interface which uses the PileUpMergeSvc to obtain
/// all the required SubEvents.
virtual StatusCode processAllSubEvents() override final;
/// Used by CscDigitBuilder. Just calls processAllSubEvents -
/// leaving for back-compatibility (IMuonDigitizationTool)
virtual StatusCode digitize() override final;
public: //possibly these should be private?
StatusCode FillCollectionWithNewDigitEDM(csc_newmap& data_SampleMap, //csc_newmap& data_SampleMapOddPhase,
std::map<IdentifierHash,deposits>& myDeposits,bool phaseToSet,
CscDigitContainer* cscDigits,CscSimDataCollection* cscSimData);
CscDigitContainer* cscDigits,CscSimDataCollection* cscSimData);
StatusCode FillCollectionWithOldDigitEDM(csc_map& data_map, std::map<IdentifierHash,deposits>& myDeposits,CscDigitContainer* cscDigits,CscSimDataCollection* cscSimData);
StatusCode CoreDigitization(CscDigitContainer* cscDigits,CscSimDataCollection* cscSimData, CLHEP::HepRandomEngine* rndmEngine);
private:
ToolHandle<ICscCalibTool> m_pcalib;
private:
PublicToolHandle<ICscCalibTool> m_pcalib{this, "cscCalibTool", "CscCalibTool", ""};
SG::WriteHandleKey<CscSimDataCollection> m_cscSimDataCollectionWriteHandleKey{this,"CSCSimDataCollectionOutputName","CSC_SDO","WriteHandleKey for Output CscSimDataCollection"};
SG::WriteHandleKey<CscDigitContainer> m_cscDigitContainerKey{this,"OutputObjectName","CSC_DIGITS","CSC digit container object"};
//SG::WriteHandle<CscDigitContainer> m_container;
//SG::WriteHandle<CscSimDataCollection> m_CSCSimDataCollectionWriteHandle;
const MuonGM::MuonDetectorManager * m_geoMgr;
CSC_Digitizer * m_cscDigitizer;
const MuonGM::MuonDetectorManager * m_geoMgr{nullptr};
CSC_Digitizer * m_cscDigitizer{nullptr};
const CscIdHelper * m_cscIdHelper;
const CscIdHelper * m_cscIdHelper{nullptr};
double m_pedestal;
bool m_maskBadChannel;
double m_amplification;
//pile-up
TimedHitCollection<CSCSimHit>* m_thpcCSC; // the hits
TimedHitCollection<CSCSimHit>* m_thpcCSC{nullptr}; // the hits
std::list<CSCSimHitCollection*> m_cscHitCollList; // only for pileup events..
//pileup truth veto
bool m_includePileUpTruth;
......@@ -121,22 +113,22 @@ public: //possibly these should be private?
double m_driftVelocity;
double m_electronEnergy;
bool m_NInterFixed;
unsigned int m_run;
unsigned int m_evt;
unsigned int m_run{0};
unsigned int m_evt{0};
///////////////////////////////////////////////////////////////////
// Access to the event methods:
///////////////////////////////////////////////////////////////////
private:
// Get next event and extract collection of hit collections:
StatusCode getNextEvent();
protected:
PileUpMergeSvc *m_mergeSvc; // Pile up service
std::string m_inputObjectName; // name of the input objects
protected:
PileUpMergeSvc *m_mergeSvc{nullptr}; // Pile up service
std::string m_inputObjectName{"CSC_Hits"}; // name of the input objects
ServiceHandle <IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""}; // Random number service
CLHEP::HepRandomEngine *m_rndmEngine; // Random number engine used - not init in SiDigitization
std::string m_rndmEngineName;// name of random engine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment