ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
LArHitEMap Class Reference

#include <LArHitEMap.h>

Collaboration diagram for LArHitEMap:

Public Types

typedef std::vector< const LArDigit * > DIGMAP
 

Public Member Functions

 LArHitEMap ()=delete
 
 LArHitEMap (const LArOnOffIdMapping *cabling, const CaloCell_ID *cellid, const CaloDetDescrManager *cddMgr, bool digit=false)
 
 ~LArHitEMap (void)
 
bool AddEnergy (const IdentifierHash index, const float energy, const float time)
 
bool AddEnergy (const Identifier cellid, const float energy, const float time)
 
bool BuildWindows (const McEventCollection *mcCollptr, float deta, float dphi, float ptmin)
 
int GetNbCells (void) const
 
const LArHitListGetCell (const unsigned int index) const
 
const std::vector< std::pair< float, float > > & GetTimeE (const IdentifierHash index) const
 
bool AddDigit (const LArDigit *digit)
 
const LArDigitGetDigit (unsigned int index) const
 

Private Attributes

std::vector< LArHitListm_emap
 
DIGMAP m_digmap
 
const LArOnOffIdMappingm_cabling
 
const CaloCell_IDm_calocell_id
 
const CaloDetDescrManagerm_cddMgr
 

Detailed Description

Definition at line 21 of file LArHitEMap.h.

Member Typedef Documentation

◆ DIGMAP

typedef std::vector<const LArDigit*> LArHitEMap::DIGMAP

Definition at line 25 of file LArHitEMap.h.

Constructor & Destructor Documentation

◆ LArHitEMap() [1/2]

LArHitEMap::LArHitEMap ( )
delete

◆ LArHitEMap() [2/2]

LArHitEMap::LArHitEMap ( const LArOnOffIdMapping cabling,
const CaloCell_ID cellid,
const CaloDetDescrManager cddMgr,
bool  digit = false 
)

Definition at line 23 of file LArHitEMap.cxx.

23  :
25  m_calocell_id(cellid),
26  m_cddMgr(cddMgr) {
27 
28  //the last cell of the FCAL is the hash-max for LAr (ignore the Tile part)
29  IdentifierHash fcalCellMin, fcalCellMax;
30  cellid->calo_cell_hash_range(CaloCell_ID::LARFCAL,fcalCellMin,fcalCellMax);
31 
32  //fill energy map up to fcal-hashmax(= lar-hashmax)
33  m_emap.resize(fcalCellMax);
34  if (digit) m_digmap.resize(fcalCellMax,nullptr);
35 }

◆ ~LArHitEMap()

LArHitEMap::~LArHitEMap ( void  )
default

Member Function Documentation

◆ AddDigit()

bool LArHitEMap::AddDigit ( const LArDigit digit)

Definition at line 51 of file LArHitEMap.cxx.

51  {
52  const HWIdentifier ch_id = digit->channelID();
53  if (m_cabling->isOnlineConnected(ch_id)) {
54  Identifier cellid=m_cabling->cnvToIdentifier(ch_id);
56 
57  if (h>=m_digmap.size()) return false ;
58  m_digmap[h]=digit;
59  return true;
60  }
61  else
62  return false;
63 }

◆ AddEnergy() [1/2]

bool LArHitEMap::AddEnergy ( const Identifier  cellid,
const float  energy,
const float  time 
)

Definition at line 46 of file LArHitEMap.cxx.

46  {
48  return AddEnergy(idHash,energy,time);
49 }

◆ AddEnergy() [2/2]

bool LArHitEMap::AddEnergy ( const IdentifierHash  index,
const float  energy,
const float  time 
)

Definition at line 39 of file LArHitEMap.cxx.

39  {
40  if(index >= m_emap.size()) return(false);
41  m_emap[index].AddHit(energy,time);
42  return true;
43 }

◆ BuildWindows()

bool LArHitEMap::BuildWindows ( const McEventCollection mcCollptr,
float  deta,
float  dphi,
float  ptmin 
)

Definition at line 70 of file LArHitEMap.cxx.

72 {
73 // get list of particles
74  std::vector<double> phiPart;
75  std::vector<double> etaPart;
76 
77  etaPart.clear();
78  phiPart.clear();
79 
80  if (!mcCollptr) {
81  return false;
82  }
83 
85 // std::cout << " start loop over particles " << std::endl;
86  for (itr = mcCollptr->begin(); itr!=mcCollptr->end(); ++itr) {
87  for (const auto& part: *(*itr))
88  {
89  //works only for photons(22) and electrons(11) primary particle (+pi0 in case not decayed by generator)
90  // with pt>5 GeV
91  // pickup "stable" particle from generator excluding G4 secondaries
92  if( ( MC::isPhoton(part) || MC::isElectron(part) || part->pdg_id()==111) && part->momentum().perp()> ptmin
94  {
95  etaPart.push_back(part->momentum().pseudoRapidity());
96  phiPart.push_back(part->momentum().phi());
97  }
98  }
99  }
100 
101 
102  if ( etaPart.empty()) return true;
103 
104  for (unsigned int i=0; i < m_emap.size(); i++)
105  {
106  LArHitList& theLArHitList = m_emap[i];
108  double eta=calodde->eta();
109  double phi=calodde->phi();
110  for(unsigned int iPart=0;iPart<etaPart.size();++iPart)
111  {
112  double deltaPhi=fmod(phiPart[iPart]-phi+3.0*M_PI,2.0*M_PI)-M_PI;
113  double deltaEta=etaPart[iPart]-eta;
114  if( std::fabs(deltaPhi)<dphi/2. &&
115  std::fabs(deltaEta)<deta/2. )
116  {
117  theLArHitList.setInWindows();
118  break;
119  }
120  } // loop over particles
121  } // loop over cells
122  return true;
123 }

◆ GetCell()

const LArHitList& LArHitEMap::GetCell ( const unsigned int  index) const
inline

Definition at line 43 of file LArHitEMap.h.

43 {return m_emap[index];} ;

◆ GetDigit()

const LArDigit* LArHitEMap::GetDigit ( unsigned int  index) const
inline

Definition at line 48 of file LArHitEMap.h.

48  {
49  if (index<m_digmap.size()) return m_digmap[index];
50  else return 0;
51  }

◆ GetNbCells()

int LArHitEMap::GetNbCells ( void  ) const

Definition at line 65 of file LArHitEMap.cxx.

66 {
67  return m_emap.size() ;
68 }

◆ GetTimeE()

const std::vector<std::pair<float,float> >& LArHitEMap::GetTimeE ( const IdentifierHash  index) const
inline

Definition at line 44 of file LArHitEMap.h.

44 { return m_emap[index].getData();}

Member Data Documentation

◆ m_cabling

const LArOnOffIdMapping* LArHitEMap::m_cabling
private

Definition at line 30 of file LArHitEMap.h.

◆ m_calocell_id

const CaloCell_ID* LArHitEMap::m_calocell_id
private

Definition at line 31 of file LArHitEMap.h.

◆ m_cddMgr

const CaloDetDescrManager* LArHitEMap::m_cddMgr
private

Definition at line 32 of file LArHitEMap.h.

◆ m_digmap

DIGMAP LArHitEMap::m_digmap
private

Definition at line 29 of file LArHitEMap.h.

◆ m_emap

std::vector<LArHitList> LArHitEMap::m_emap
private

Definition at line 28 of file LArHitEMap.h.


The documentation for this class was generated from the following files:
LArHitList::setInWindows
void setInWindows()
Definition: LArHitList.h:27
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
LArHitEMap::m_digmap
DIGMAP m_digmap
Definition: LArHitEMap.h:29
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LArHitEMap::m_calocell_id
const CaloCell_ID * m_calocell_id
Definition: LArHitEMap.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
index
Definition: index.py:1
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
TrigJetMonitorAlgorithm.ptmin
ptmin
Definition: TrigJetMonitorAlgorithm.py:1081
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
LArHitEMap::AddEnergy
bool AddEnergy(const IdentifierHash index, const float energy, const float time)
Definition: LArHitEMap.cxx:39
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
M_PI
#define M_PI
Definition: ActiveFraction.h:11
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
HWIdentifier
Definition: HWIdentifier.h:13
LArHitEMap::m_cabling
const LArOnOffIdMapping * m_cabling
Definition: LArHitEMap.h:30
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:299
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:53
LArHitEMap::m_cddMgr
const CaloDetDescrManager * m_cddMgr
Definition: LArHitEMap.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloCell_Base_ID::calo_cell_hash_range
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
extractSporadic.h
list h
Definition: extractSporadic.py:97
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:12
LArHitEMap::m_emap
std::vector< LArHitList > m_emap
Definition: LArHitEMap.h:28
LArHitList
Definition: LArHitList.h:9
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DeMoScan.index
string index
Definition: DeMoScan.py:362
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
LArOnOffIdMapping::cnvToIdentifier
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
Definition: LArOnOffIdMapping.h:116
xAOD::EgammaHelpers::isPhoton
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Definition: EgammaxAODHelpers.cxx:21
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
IdentifierHash
Definition: IdentifierHash.h:38
LArOnOffIdMapping::isOnlineConnected
bool isOnlineConnected(const HWIdentifier &sid) const
Test whether a HWIdentifier is connected of not (inline)
Definition: LArOnOffIdMapping.h:121
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.