ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
ZDCHitsTestTool Class Reference

#include <ZDCHitsTestTool.h>

Inheritance diagram for ZDCHitsTestTool:
Collaboration diagram for ZDCHitsTestTool:

Public Member Functions

 ZDCHitsTestTool (const std::string &type, const std::string &name, const IInterface *parent)
 
StatusCode initialize ()
 
StatusCode processEvent ()
 

Protected Attributes

std::string m_path {"/truth/"}
 
ServiceHandle< ITHistSvc > m_histSvc {"THistSvc", "SimTestHisto"}
 

Private Attributes

TH1 * m_zdc [2][4]
 
TH1 * m_rpd [2][16]
 
const ZdcIDm_ZdcID = nullptr
 

structors and AlgTool implementation

std::string m_key
 The MC truth key. More...
 
HepMC::ConstGenParticlePtr getPrimary ()
 

Detailed Description

Definition at line 12 of file ZDCHitsTestTool.h.

Constructor & Destructor Documentation

◆ ZDCHitsTestTool()

ZDCHitsTestTool::ZDCHitsTestTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 15 of file ZDCHitsTestTool.cxx.

17 {
18  for(int side : {0,1}){
19  for(int module = 0; module < 4; module++){
20  m_zdc[side][module] = nullptr;
21  }
22  for(int channel = 0; channel < 16; channel++){
23  m_rpd[side][channel] = nullptr;
24  }
25  }
26 }

Member Function Documentation

◆ getPrimary()

HepMC::ConstGenParticlePtr SimTestToolBase::getPrimary ( )
protectedinherited

Definition at line 20 of file SimTestToolBase.cxx.

21 {
22  const McEventCollection* mcCollection;
23  if (evtStore()->retrieve(mcCollection,m_key).isSuccess()) {
25  for (e=mcCollection->begin();e!=mcCollection->end(); ++e) {
26  for (auto p : (**e)) {
28  return p;
29  }
30  }
31  }
32  }
33  return 0;
34 }

◆ initialize()

StatusCode ZDCHitsTestTool::initialize ( )
virtual

Reimplemented from SimTestToolBase.

Definition at line 28 of file ZDCHitsTestTool.cxx.

29 {
31 
32  m_path+="ZDC/";
33 
34  for(int side : {0,1}){
35  std::string sideStr = (side == 0) ? "A" : "C";
36  //ZDCs
37  for(int module = 0; module < 4; module++){
38  _TH1D(m_zdc[side][module],Form("zdc_side%c_%d", std::tolower(sideStr[0]), module),100,0.,1.e6);
39  _SET_TITLE(m_zdc[side][module], Form("Cherenkov photons in ZDC - Side %s - Module %d", sideStr.c_str(), module),"n_{gamma}","counts");
40  }
41  //RPDs
42  for(int channel = 0; channel < 16; channel++){
43  _TH1D(m_rpd[side][channel],Form("rpd_side%c_%d", std::tolower(sideStr[0]), channel),100,0.,1.e4);
44  _SET_TITLE(m_rpd[side][channel], Form("Cherenkov photons in RPD - Side %s - Channel %d", sideStr.c_str(), channel),"n_{gamma}","counts");
45  }
46  }
47 
48  return StatusCode::SUCCESS;
49 }

◆ processEvent()

StatusCode ZDCHitsTestTool::processEvent ( )

Definition at line 51 of file ZDCHitsTestTool.cxx.

51  {
52 
53  const ZDC_SimFiberHit_Collection* iter;
54  CHECK( evtStore()->retrieve(iter,"ZDC_SimFiberHit_Collection") );
55 
57  for (it=(*iter).begin(); it != (*iter).end(); ++it) {
58  ZDC_SimFiberHit ghit(*it);
59 
60  Identifier id = ghit.getID( );
61  int side = (m_ZdcID->side(id) == -1) ? 0 : 1;
62  int module = m_ZdcID->module(id);
63  int channel = m_ZdcID->channel(id);
64 
65  if(module < 4){//ZDC
66  m_zdc[side][module]->Fill(ghit.getNPhotons());
67 
68  }else if(module == 4){//RPD
69  m_rpd[side][channel]->Fill(ghit.getNPhotons());
70 
71  }else{//Undefined
72  ATH_MSG_ERROR("ZDCHitsTestTool::processEvent Hit detected in an undefined module. Module# " << module);
73  }
74  }
75 
76  return StatusCode::SUCCESS;
77 }

Member Data Documentation

◆ m_histSvc

ServiceHandle<ITHistSvc> SimTestHisto::m_histSvc {"THistSvc", "SimTestHisto"}
protectedinherited

Definition at line 35 of file SimTestHisto.h.

◆ m_key

std::string SimTestToolBase::m_key
protectedinherited

The MC truth key.

Definition at line 34 of file SimTestToolBase.h.

◆ m_path

std::string SimTestHisto::m_path {"/truth/"}
protectedinherited

Definition at line 34 of file SimTestHisto.h.

◆ m_rpd

TH1 * ZDCHitsTestTool::m_rpd[2][16]
private

Definition at line 25 of file ZDCHitsTestTool.h.

◆ m_zdc

TH1* ZDCHitsTestTool::m_zdc[2][4]
private

Definition at line 25 of file ZDCHitsTestTool.h.

◆ m_ZdcID

const ZdcID* ZDCHitsTestTool::m_ZdcID = nullptr
private

Definition at line 26 of file ZDCHitsTestTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ZDCHitsTestTool::m_rpd
TH1 * m_rpd[2][16]
Definition: ZDCHitsTestTool.h:25
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
ZDCHitsTestTool::m_zdc
TH1 * m_zdc[2][4]
Definition: ZDCHitsTestTool.h:25
ZdcID::module
int module(const Identifier &id) const
Definition: ZdcID.h:163
skel.it
it
Definition: skel.GENtoEVGEN.py:396
_SET_TITLE
#define _SET_TITLE(var, title, xaxis, yaxis)
Definition: SimTestHisto.h:93
SimTestToolBase::SimTestToolBase
SimTestToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SimTestToolBase.cxx:11
ZDC_SimFiberHit_ConstIterator
ZDC_SimFiberHit_Collection::const_iterator ZDC_SimFiberHit_ConstIterator
Definition: ZDC_SimFiberHit_Collection.h:24
_TH1D
#define _TH1D(var, name, nbin, xmin, xmax)
Definition: SimTestHisto.h:47
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.PyAthena.module
module
Definition: PyAthena.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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:342
PixelAthClusterMonAlgCfg.e4
e4
Definition: PixelAthClusterMonAlgCfg.py:332
tolower
void tolower(std::string &s)
Definition: AthenaSummarySvc.cxx:111
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ZDCHitsTestTool::m_ZdcID
const ZdcID * m_ZdcID
Definition: ZDCHitsTestTool.h:26
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ZdcID::side
int side(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: ZdcID.h:157
ZDC_SimFiberHit
Definition: ZDC_SimFiberHit.h:11
SimTestHisto::m_path
std::string m_path
Definition: SimTestHisto.h:34
ZDC_SimFiberHit_Collection
Definition: ZDC_SimFiberHit_Collection.h:16
SimTestToolBase::m_key
std::string m_key
The MC truth key.
Definition: SimTestToolBase.h:34
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ZdcID::channel
int channel(const Identifier &id) const
Definition: ZdcID.h:175
Identifier
Definition: IdentifierFieldParser.cxx:14