ATLAS Offline Software
DNNCaloSimSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // DNNCaloSimSvc.h, (c) ATLAS Detector software
8 
9 #ifndef ISF_DNNCALOSIMSVC_H
10 #define ISF_DNNCALOSIMSVC_H 1
11 
12 // ISF includes
14 
15 // Framework includes
16 #include "GaudiKernel/IChronoStatSvc.h"
17 
18 // FastCaloSim includes
21 
23 
25 
30 #include "CaloIdentifier/TileID.h"
32 
33 #include "lwtnn/LightweightGraph.hh"
35 #include "CLHEP/Units/PhysicalConstants.h"
36 
38 
39 namespace CLHEP
40 {
41  class HepRandomEngine;
42 }
43 
44 //forward declarations
45 class CaloCellContainer;
48 
49 
50 namespace ISF {
57  {
58  public:
60  DNNCaloSimSvc(const std::string& name, ISvcLocator* pSvcLocator);
61 
63  virtual ~DNNCaloSimSvc() final;
64 
66  virtual StatusCode initialize() override final;
67  virtual StatusCode finalize() override final;
68 
70  StatusCode initializeNetwork();
71 
73  virtual StatusCode simulate(ISFParticle& isp, McEventCollection*) override final;
74  // type of input requested by lwtnn
75  typedef std::map<std::string, std::map<std::string, double> > NetworkInputs ;
76  typedef std::map<std::string, double> NetworkOutputs;
77  StatusCode fillNetworkInputs(const ISF::ISFParticle& isfp, NetworkInputs & inputs, double & trueEnergy);
78  StatusCode fillWindowCells(const double etaExtrap,const double phiExtrap,const CaloDetDescrElement* & impactCellDDE);
79 
81  virtual StatusCode setupEvent() override final;
82 
84  virtual StatusCode releaseEvent() override final;
85 
86  std::string m_paramsFilename;
87  std::string m_paramsInputArchitecture;
88 
89  std::unique_ptr<lwt::LightweightGraph> m_graph;
90 
91  ToolHandleArray<ICaloCellMakerTool> m_caloCellMakerToolsSetup ;
92  ToolHandleArray<ICaloCellMakerTool> m_caloCellMakerToolsRelease ;
93 
94  ToolHandle<IFastCaloSimCaloExtrapolation> m_FastCaloSimCaloExtrapolation;
95  ToolHandle<Trk::ITimedExtrapolator> m_extrapolator;
96 
97  CaloCellContainer * m_theContainer;
98 
100  CLHEP::HepRandomEngine* m_randomEngine;
101  std::string m_randomEngineName;
102 
103 
104  const CaloDetDescrManager* m_caloDetDescrManager;
105  std::unique_ptr<CaloGeometryFromCaloDDM> m_caloGeo;
106  const LArEM_ID* m_emID = nullptr;
107  std::vector<CaloCell*> m_windowCells;
108 
109  // specific to architecture
110  // preprocessing of input
111  int m_GANLatentSize = 0;
112  double m_logTrueEnergyMean = 0.;
113  double m_logTrueEnergyScale = 0.;
114  double m_riImpactEtaMean = 0.;
115  double m_riImpactEtaScale = 0.;
116  double m_riImpactPhiMean = 0.;
117  double m_riImpactPhiScale = 0.;
118 
119  // building of the 266 cells cluster
120  const int m_numberOfCellsForDNN = 266;
121  const double m_middleCellWidthEta = 0.025;
122  const double m_middleCellWidthPhi = CLHEP::pi / std::pow(2,7);
123  const double m_etaRawMiddleCut = m_middleCellWidthEta * 3.5;
124  const double m_etaRawBackCut = m_middleCellWidthEta * 4.;
125  const double m_phiRawMiddleCut = m_middleCellWidthPhi * 3.5;
126  const double m_phiRawStripCut = m_middleCellWidthPhi * 6.0;
127 
128 
129  std::string m_caloCellsOutputName;
130  };
131 
132 }
133 
134 #endif //> !ISF_DNNCALOSIMSVC_H
ISF::DNNCaloSimSvc::NetworkOutputs
std::map< std::string, double > NetworkOutputs
Definition: DNNCaloSimSvc.h:76
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
LArEM_ID.h
IFastCaloSimCaloExtrapolation.h
ITimedExtrapolator.h
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
initialize
void initialize()
Definition: run_EoverP.cxx:894
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::DNNCaloSimSvc
Definition: DNNCaloSimSvc.h:57
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
LArHEC_ID.h
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
pi
#define pi
Definition: TileMuonFitter.cxx:65
TileID.h
ICaloCellMakerTool
Definition: ICaloCellMakerTool.h:20
TFCSParametrizationBase
Definition: TFCSParametrizationBase.h:46
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
ISF::DNNCaloSimSvc::NetworkInputs
std::map< std::string, std::map< std::string, double > > NetworkInputs
Definition: DNNCaloSimSvc.h:75
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
lwt
Definition: NnClusterizationFactory.h:52
BaseSimulationSvc.h
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
IAtRndmGenSvc
manage multiple CLHEP random engines as named streams
Definition: IAtRndmGenSvc.h:23
IAtRndmGenSvc.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
ICaloCellMakerTool.h
LArFCAL_ID.h
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
IFastCaloSimCaloExtrapolation
Definition: IFastCaloSimCaloExtrapolation.h:18
ISF::DNNCaloSimSvc::~DNNCaloSimSvc
virtual ~DNNCaloSimSvc() final
Destructor.
ISF::BaseSimulationSvc
Definition: BaseSimulationSvc.h:40
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
checker_macros.h
Define macros for attributes used to control the static checker.
CaloGeometryFromCaloDDM
Definition: CaloGeometryFromCaloDDM.h:15
ServiceHandle
Definition: ClusterMakerTool.h:37