ATLAS Offline Software
Loading...
Searching...
No Matches
FCALFastSimDedicatedSD Class Reference

NEEDS DOCUMENTATION. More...

#include <FCALFastSimDedicatedSD.h>

Inheritance diagram for FCALFastSimDedicatedSD:
Collaboration diagram for FCALFastSimDedicatedSD:

Public Types

enum  LArHitTimeBins { HitTimeBinDefault = 0 , HitTimeBinUniform = 1 }

Public Member Functions

 FCALFastSimDedicatedSD (StoreGateSvc *, bool verbose)
 ~FCALFastSimDedicatedSD ()
virtual void ProcessSpot (const EnergySpot &spot, double weight) override final
 ProcessHitsMethod.
G4bool ProcessHits (G4Step *a_step, G4TouchableHistory *) override
 Main processing method.
G4bool SimpleHit (const LArG4Identifier &lar_id, G4double time, G4double energy)
 First method translates to this - also for fast sims.
void EndOfAthenaEvent (LArHitContainer *hitContnainer)
 End of athena event processing.
void setupHelpers (const LArEM_ID *EM, const LArFCAL_ID *FCAL, const LArHEC_ID *HEC)
 Sets the ID helper pointers.
Identifier ConvertID (const LArG4Identifier &a_ident) const
 Helper function for making "real" identifiers from LArG4Identifiers.

Protected Types

typedef std::set< LArHit *, LessHithits_t
typedef std::map< G4int, hits_t * > timeBins_t

Protected Member Functions

G4int getTimeBin (G4double time) const
 Helper method for time info.

Protected Attributes

ILArCalculatorSvcm_calculator
 Member variable - the calculator we'll use.
G4int m_numberInvalidHits
 Count the number of invalid hits.
LArG4SimpleSD::LArHitTimeBins m_timeBinType
G4float m_timeBinWidth
 Width of the time bins for summing hits - for the uniform binning.
timeBins_t m_timeBins
 The map of hit sets binned in time.
const LArEM_IDm_larEmID
 Pointers to the identifier helpers.
const LArFCAL_IDm_larFcalID
const LArHEC_IDm_larHecID

Private Member Functions

 FRIEND_TEST (LArG4SimpleSDtest, ProcessHits)
 FRIEND_TEST (LArG4SimpleSDtest, EndOfAthenaEvent)
 FRIEND_TEST (LArG4SimpleSDtest, setupHelpers)
 FRIEND_TEST (LArG4SimpleSDtest, getTimeBin)
 FRIEND_TEST (LArG4SimpleSDtest, SimpleHit)
 FRIEND_TEST (LArG4SimpleSDtest, ConvertID)
 FRIEND_TEST (SDWrappertest, Initialize)
 FRIEND_TEST (SDWrappertest, EndOfAthenaEvent)
 FRIEND_TEST (SDWrappertest, addSD)
 FRIEND_TEST (SDWrappertest, addFastSimSD)
 FRIEND_TEST (SDWrappertest, ProcessHits)

Private Attributes

FCALDetectorManagerm_fcalManager
LArG4Identifier m_larID
 My LAr identifier.

Detailed Description

NEEDS DOCUMENTATION.

Definition at line 21 of file FCALFastSimDedicatedSD.h.

Member Typedef Documentation

◆ hits_t

typedef std::set< LArHit*, LessHit > LArG4SimpleSD::hits_t
protectedinherited

Definition at line 113 of file LArG4SimpleSD.h.

◆ timeBins_t

typedef std::map< G4int, hits_t* > LArG4SimpleSD::timeBins_t
protectedinherited

Definition at line 119 of file LArG4SimpleSD.h.

Member Enumeration Documentation

◆ LArHitTimeBins

Enumerator
HitTimeBinDefault 
HitTimeBinUniform 

Definition at line 50 of file LArG4SimpleSD.h.

51 {
54 };

Constructor & Destructor Documentation

◆ FCALFastSimDedicatedSD()

FCALFastSimDedicatedSD::FCALFastSimDedicatedSD ( StoreGateSvc * detStore,
bool verbose )

Definition at line 21 of file FCALFastSimDedicatedSD.cxx.

22 : IFastSimDedicatedSD("FCALFastSimDedicatedSD", detStore)
23 , m_fcalManager(nullptr)
24{
25 if (verbose) { G4cout << GetName() << "::initialize()" << G4endl; }
26 if ( detStore->retrieve(m_fcalManager).isFailure() ){
27 throw std::runtime_error("Could not retrieve FCAL manager");
28 }
29}
FCALDetectorManager * m_fcalManager
IFastSimDedicatedSD(const std::string &name, StoreGateSvc *detStore)
Simple constructor and destructor.
bool verbose
Definition hcg.cxx:73

◆ ~FCALFastSimDedicatedSD()

FCALFastSimDedicatedSD::~FCALFastSimDedicatedSD ( )
inline

Definition at line 29 of file FCALFastSimDedicatedSD.h.

29{}

Member Function Documentation

◆ ConvertID()

Identifier LArG4SimpleSD::ConvertID ( const LArG4Identifier & a_ident) const
inherited

Helper function for making "real" identifiers from LArG4Identifiers.

◆ EndOfAthenaEvent()

void LArG4SimpleSD::EndOfAthenaEvent ( LArHitContainer * hitContnainer)
inherited

End of athena event processing.

◆ FRIEND_TEST() [1/11]

LArG4SimpleSD::FRIEND_TEST ( LArG4SimpleSDtest ,
ConvertID  )
privateinherited

◆ FRIEND_TEST() [2/11]

LArG4SimpleSD::FRIEND_TEST ( LArG4SimpleSDtest ,
EndOfAthenaEvent  )
privateinherited

◆ FRIEND_TEST() [3/11]

LArG4SimpleSD::FRIEND_TEST ( LArG4SimpleSDtest ,
getTimeBin  )
privateinherited

◆ FRIEND_TEST() [4/11]

LArG4SimpleSD::FRIEND_TEST ( LArG4SimpleSDtest ,
ProcessHits  )
privateinherited

◆ FRIEND_TEST() [5/11]

LArG4SimpleSD::FRIEND_TEST ( LArG4SimpleSDtest ,
setupHelpers  )
privateinherited

◆ FRIEND_TEST() [6/11]

LArG4SimpleSD::FRIEND_TEST ( LArG4SimpleSDtest ,
SimpleHit  )
privateinherited

◆ FRIEND_TEST() [7/11]

LArG4SimpleSD::FRIEND_TEST ( SDWrappertest ,
addFastSimSD  )
privateinherited

◆ FRIEND_TEST() [8/11]

LArG4SimpleSD::FRIEND_TEST ( SDWrappertest ,
addSD  )
privateinherited

◆ FRIEND_TEST() [9/11]

LArG4SimpleSD::FRIEND_TEST ( SDWrappertest ,
EndOfAthenaEvent  )
privateinherited

◆ FRIEND_TEST() [10/11]

LArG4SimpleSD::FRIEND_TEST ( SDWrappertest ,
Initialize  )
privateinherited

◆ FRIEND_TEST() [11/11]

LArG4SimpleSD::FRIEND_TEST ( SDWrappertest ,
ProcessHits  )
privateinherited

◆ getTimeBin()

G4int LArG4SimpleSD::getTimeBin ( G4double time) const
protectedinherited

Helper method for time info.

◆ ProcessHits()

G4bool LArG4SimpleSD::ProcessHits ( G4Step * a_step,
G4TouchableHistory *  )
overrideinherited

Main processing method.

◆ ProcessSpot()

void FCALFastSimDedicatedSD::ProcessSpot ( const EnergySpot & spot,
double weight )
finaloverridevirtual

ProcessHitsMethod.

Process a single energy spot from a frozen shower. The appropriate region of the sensitive detector is calculated and a LArIdentifier is constructed

Implements IFastSimDedicatedSD.

Definition at line 32 of file FCALFastSimDedicatedSD.cxx.

32 {
33 // Fill the identifier.
34
35 static const Transform3D xfNeg[3] = {
36 Amg::EigenTransformToCLHEP(m_fcalManager->getFCAL(FCALModule::Module(1),FCALModule::Endcap(0))->getAbsoluteTransform().inverse()),
37 Amg::EigenTransformToCLHEP(m_fcalManager->getFCAL(FCALModule::Module(2),FCALModule::Endcap(0))->getAbsoluteTransform().inverse()),
38 Amg::EigenTransformToCLHEP(m_fcalManager->getFCAL(FCALModule::Module(3),FCALModule::Endcap(0))->getAbsoluteTransform().inverse())};
39
40 static const Transform3D xfPos[3] = {
41 Amg::EigenTransformToCLHEP(m_fcalManager->getFCAL(FCALModule::Module(1),FCALModule::Endcap(1))->getAbsoluteTransform().inverse()),
42 Amg::EigenTransformToCLHEP(m_fcalManager->getFCAL(FCALModule::Module(2),FCALModule::Endcap(1))->getAbsoluteTransform().inverse()),
43 Amg::EigenTransformToCLHEP(m_fcalManager->getFCAL(FCALModule::Module(3),FCALModule::Endcap(1))->getAbsoluteTransform().inverse())};
44
45 static const GeoTubs * const fcalTubs[3] = {
46 (const GeoTubs *) m_fcalManager->getFCAL(FCALModule::Module(1),FCALModule::Endcap(0))->getMaterialGeom()->getLogVol()->getShape(),
47 (const GeoTubs *) m_fcalManager->getFCAL(FCALModule::Module(2),FCALModule::Endcap(0))->getMaterialGeom()->getLogVol()->getShape(),
48 (const GeoTubs *) m_fcalManager->getFCAL(FCALModule::Module(3),FCALModule::Endcap(0))->getMaterialGeom()->getLogVol()->getShape()};
49
50
51 // Fill the identifier.
52 Point3D<double> globalPosition=spot.GetPosition();
53
54 // Figure out if it is in the positive endcap or the netative endcap:
55 bool iAmPositive=globalPosition.z()>0.;
56 int module=1;
57 Point3D<double> localPosition= iAmPositive ? (xfPos[0]*globalPosition) : (xfNeg[0]*globalPosition);
58 if (fabs(localPosition.z()) > fcalTubs[0]->getZHalfLength()) {
59 module=2;
60 localPosition= iAmPositive ? (xfPos[1]*globalPosition) : (xfNeg[1]*globalPosition);
61 if (fabs(localPosition.z()) > fcalTubs[1]->getZHalfLength()) {
62 module=3;
63 localPosition= iAmPositive ? (xfPos[2]*globalPosition) : (xfNeg[2]*globalPosition);
64 if (fabs(localPosition.z()) > fcalTubs[2]->getZHalfLength()) {
65 module=0;
66 }
67 }
68 }
69
70 if (!module) {
71 // std::cout << "Warning in FCALFastSimDedicatedSD: Cannot locate module" << std::endl;
72 return;
73 }
74
75 const FCAL_ChannelMap *cmap = m_fcalManager->getChannelMap();
76 int sampling=module;
77 int etaIndex=0, phiIndex=0;
78 bool ok = cmap->getTileID(sampling,
79 localPosition.x(),
80 localPosition.y(),
81 etaIndex,
82 phiIndex);
83
84
85 // zSide is negative if z<0.
86 int zSide = iAmPositive ? 2:-2;
87 //static LArG4Identifier id;
88 m_larID.clear();
89 if (ok){
90 m_larID << 4 // LArCalorimeter
91 << 3 // LArFCAL
92 << zSide // EndCap
93 << sampling // FCal Module #
94 << etaIndex
95 << phiIndex;
96 } else {
97 return;
98 }
99
100 // call process to add this to the collection
101 SimpleHit(m_larID, spot.GetTime(), spot.GetEnergy()*weight);
102 return;
103}
Eigen::Affine3d Transform3D
G4ThreeVector GetPosition() const
Definition EnergySpot.h:40
G4double GetEnergy() const
Definition EnergySpot.h:37
G4double GetTime() const
Definition EnergySpot.h:43
LArG4Identifier m_larID
My LAr identifier.
bool getTileID(int isam, float x, float y, int &eta, int &phi) const
-— For the new LArFCAL_ID Identifier
G4bool SimpleHit(const LArG4Identifier &lar_id, G4double time, G4double energy)
First method translates to this - also for fast sims.
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

◆ setupHelpers()

void LArG4SimpleSD::setupHelpers ( const LArEM_ID * EM,
const LArFCAL_ID * FCAL,
const LArHEC_ID * HEC )
inlineinherited

Sets the ID helper pointers.

Definition at line 77 of file LArG4SimpleSD.h.

79 {
80 m_larEmID = EM;
83 }
const LArHEC_ID * m_larHecID
const LArFCAL_ID * m_larFcalID
const LArEM_ID * m_larEmID
Pointers to the identifier helpers.

◆ SimpleHit()

G4bool LArG4SimpleSD::SimpleHit ( const LArG4Identifier & lar_id,
G4double time,
G4double energy )
inherited

First method translates to this - also for fast sims.

Member Data Documentation

◆ m_calculator

ILArCalculatorSvc* LArG4SimpleSD::m_calculator
protectedinherited

Member variable - the calculator we'll use.

Definition at line 93 of file LArG4SimpleSD.h.

◆ m_fcalManager

FCALDetectorManager* FCALFastSimDedicatedSD::m_fcalManager
private

Definition at line 36 of file FCALFastSimDedicatedSD.h.

◆ m_larEmID

const LArEM_ID* LArG4SimpleSD::m_larEmID
protectedinherited

Pointers to the identifier helpers.

Definition at line 143 of file LArG4SimpleSD.h.

◆ m_larFcalID

const LArFCAL_ID* LArG4SimpleSD::m_larFcalID
protectedinherited

Definition at line 144 of file LArG4SimpleSD.h.

◆ m_larHecID

const LArHEC_ID* LArG4SimpleSD::m_larHecID
protectedinherited

Definition at line 145 of file LArG4SimpleSD.h.

◆ m_larID

LArG4Identifier FCALFastSimDedicatedSD::m_larID
private

My LAr identifier.

Definition at line 39 of file FCALFastSimDedicatedSD.h.

◆ m_numberInvalidHits

G4int LArG4SimpleSD::m_numberInvalidHits
protectedinherited

Count the number of invalid hits.

Definition at line 96 of file LArG4SimpleSD.h.

◆ m_timeBins

timeBins_t LArG4SimpleSD::m_timeBins
protectedinherited

The map of hit sets binned in time.

Definition at line 140 of file LArG4SimpleSD.h.

◆ m_timeBinType

LArG4SimpleSD::LArHitTimeBins LArG4SimpleSD::m_timeBinType
protectedinherited

Definition at line 134 of file LArG4SimpleSD.h.

◆ m_timeBinWidth

G4float LArG4SimpleSD::m_timeBinWidth
protectedinherited

Width of the time bins for summing hits - for the uniform binning.

Definition at line 137 of file LArG4SimpleSD.h.


The documentation for this class was generated from the following files: