ATLAS Offline Software
Loading...
Searching...
No Matches
ISCT_CalibHistoTool Class Referenceabstract

#include <ISCT_CalibHistoTool.h>

Inheritance diagram for ISCT_CalibHistoTool:
Collaboration diagram for ISCT_CalibHistoTool:

Public Member Functions

 DeclareInterfaceID (ISCT_CalibHistoTool, 1, 0)
 ISCT_CalibHistoTool ()
virtual ~ISCT_CalibHistoTool ()=default
 no-op destructor
virtual bool book ()=0
 book histograms
virtual bool read (const std::string &fileName)=0
 read histograms
virtual bool fill (const bool fromData=false)=0
 fill histograms from simulation
virtual bool fillFromData ()=0
 fill histograms from data
virtual int getNumberOfEventsInBin (const int nbin) const
 get number of events in a specific bin
int size () const
 get total number of entries in the number of events histo
double getBinForHistogramIndex (const int bin, const int histogramIndex) const
 get bin content for bin in specific histogram
int size (const int histogramIndex) const
 get the number of entries in a given histogram
void binHistograms (const int nLbMerged)
void setNumberOfLb (const int nLb)
 set number of lumiblocks
int numberOfLb () const
 get number of lumiblocks
void setLbToMerge (const int nLbMerge)
 set number of lumiblocks
void setLb (const int nLb)
 set lumiblock for Lb dependent maps
int LbToMerge () const
 get number of lumiblocks

Protected Member Functions

bool init ()
template<class T>
std::pair< std::string, bool > retrievedTool (T &tool) const

Protected Attributes

std::vector< TH1F * > m_phistoVector
std::vector< TH2F * > m_phistoVector2D
TH1I * m_numberOfEventsHisto {nullptr}
SmartIF< ITHistSvc > m_thistSvc {nullptr}
const SCT_IDm_pSCTHelper {nullptr}
int m_lumiBlock {0}
int m_nLb {0}
int m_nLbMerge {0}

Detailed Description

Definition at line 27 of file ISCT_CalibHistoTool.h.

Constructor & Destructor Documentation

◆ ISCT_CalibHistoTool()

ISCT_CalibHistoTool::ISCT_CalibHistoTool ( )

Definition at line 18 of file ISCT_CalibHistoTool.cxx.

18 {
19}

◆ ~ISCT_CalibHistoTool()

virtual ISCT_CalibHistoTool::~ISCT_CalibHistoTool ( )
virtualdefault

no-op destructor

Member Function Documentation

◆ binHistograms()

void ISCT_CalibHistoTool::binHistograms ( const int nLbMerged)

Definition at line 60 of file ISCT_CalibHistoTool.cxx.

60 {
61 int nLb{numberOfLb()};
62 int yAxisBins{static_cast<int>(TMath::Ceil(1.0*nLb/nLbMerged))};
63
64 for (std::vector<TH2F*>::iterator it{m_phistoVector2D.begin()}; it != m_phistoVector2D.end(); ++it) {
65 (*it)->SetBins(768, -0.5, 768+0.5, yAxisBins, 0.5, nLbMerged*yAxisBins+0.5);
66 }
67
68}
std::vector< TH2F * > m_phistoVector2D
int numberOfLb() const
get number of lumiblocks

◆ book()

virtual bool ISCT_CalibHistoTool::book ( )
pure virtual

book histograms

◆ DeclareInterfaceID()

ISCT_CalibHistoTool::DeclareInterfaceID ( ISCT_CalibHistoTool ,
1 ,
0  )

◆ fill()

virtual bool ISCT_CalibHistoTool::fill ( const bool fromData = false)
pure virtual

fill histograms from simulation

◆ fillFromData()

virtual bool ISCT_CalibHistoTool::fillFromData ( )
pure virtual

fill histograms from data

◆ getBinForHistogramIndex()

double ISCT_CalibHistoTool::getBinForHistogramIndex ( const int bin,
const int histogramIndex ) const

get bin content for bin in specific histogram

Definition at line 47 of file ISCT_CalibHistoTool.cxx.

47 {
48 TH1F* pHisto{nullptr};
49 double result{0.0};
50 try {
51 pHisto = m_phistoVector.at(histogramIndex);
52 result = pHisto->GetBinContent(bin);
53 } catch (const std::out_of_range& outOfRange) {
54 //do nothing, result is zero if the vector<>.at() throws
55 }
56 return result;
57}
std::vector< TH1F * > m_phistoVector
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ getNumberOfEventsInBin()

int ISCT_CalibHistoTool::getNumberOfEventsInBin ( const int nbin) const
virtual

get number of events in a specific bin

Definition at line 22 of file ISCT_CalibHistoTool.cxx.

22 {
23 if (m_numberOfEventsHisto) return m_numberOfEventsHisto->GetBinContent(nbin);
24 std::cout << "ERROR: a histogram pointer, m_numberOfEventsHisto, is zero" << std::endl;
25 return 0;
26}

◆ init()

bool ISCT_CalibHistoTool::init ( )
protected

◆ LbToMerge()

int ISCT_CalibHistoTool::LbToMerge ( ) const

get number of lumiblocks

Definition at line 91 of file ISCT_CalibHistoTool.cxx.

91 {
92 return m_nLbMerge;
93}

◆ numberOfLb()

int ISCT_CalibHistoTool::numberOfLb ( ) const

get number of lumiblocks

Definition at line 76 of file ISCT_CalibHistoTool.cxx.

76 {
77 return m_nLb;
78}

◆ read()

virtual bool ISCT_CalibHistoTool::read ( const std::string & fileName)
pure virtual

read histograms

◆ retrievedTool()

template<class T>
std::pair< std::string, bool > ISCT_CalibHistoTool::retrievedTool ( T & tool) const
inlineprotected

Definition at line 73 of file ISCT_CalibHistoTool.h.

73 {
74 if (tool.retrieve().isFailure() ) return std::make_pair(std::string{"Unable to retrieve "}+tool.name(), false);
75 return std::make_pair("", true);
76 }

◆ setLb()

void ISCT_CalibHistoTool::setLb ( const int nLb)

set lumiblock for Lb dependent maps

Definition at line 86 of file ISCT_CalibHistoTool.cxx.

86 {
87 m_lumiBlock = nLb;
88}

◆ setLbToMerge()

void ISCT_CalibHistoTool::setLbToMerge ( const int nLbMerge)

set number of lumiblocks

Definition at line 81 of file ISCT_CalibHistoTool.cxx.

81 {
82 m_nLbMerge = nLbMerge;
83}

◆ setNumberOfLb()

void ISCT_CalibHistoTool::setNumberOfLb ( const int nLb)

set number of lumiblocks

Definition at line 71 of file ISCT_CalibHistoTool.cxx.

71 {
72 m_nLb=nLb;
73}

◆ size() [1/2]

int ISCT_CalibHistoTool::size ( ) const

get total number of entries in the number of events histo

Definition at line 29 of file ISCT_CalibHistoTool.cxx.

29 {
30 return m_numberOfEventsHisto->GetEntries();
31}

◆ size() [2/2]

int ISCT_CalibHistoTool::size ( const int histogramIndex) const

get the number of entries in a given histogram

Definition at line 34 of file ISCT_CalibHistoTool.cxx.

34 {
35 TH1F* pHisto{nullptr};
36 int result{0};
37 try {
38 pHisto = m_phistoVector.at(histogramIndex);
39 result = pHisto->GetEntries();
40 } catch (const std::out_of_range& outOfRange) {
41 //do nothing, result is zero if the vector<>.at() throws
42 }
43 return result;
44}

Member Data Documentation

◆ m_lumiBlock

int ISCT_CalibHistoTool::m_lumiBlock {0}
protected

Definition at line 67 of file ISCT_CalibHistoTool.h.

67{0};

◆ m_nLb

int ISCT_CalibHistoTool::m_nLb {0}
protected

Definition at line 68 of file ISCT_CalibHistoTool.h.

68{0};

◆ m_nLbMerge

int ISCT_CalibHistoTool::m_nLbMerge {0}
protected

Definition at line 69 of file ISCT_CalibHistoTool.h.

69{0};

◆ m_numberOfEventsHisto

TH1I* ISCT_CalibHistoTool::m_numberOfEventsHisto {nullptr}
protected

Definition at line 64 of file ISCT_CalibHistoTool.h.

64{nullptr};

◆ m_phistoVector

std::vector<TH1F*> ISCT_CalibHistoTool::m_phistoVector
protected

Definition at line 62 of file ISCT_CalibHistoTool.h.

◆ m_phistoVector2D

std::vector<TH2F*> ISCT_CalibHistoTool::m_phistoVector2D
protected

Definition at line 63 of file ISCT_CalibHistoTool.h.

◆ m_pSCTHelper

const SCT_ID* ISCT_CalibHistoTool::m_pSCTHelper {nullptr}
protected

Definition at line 66 of file ISCT_CalibHistoTool.h.

66{nullptr};

◆ m_thistSvc

SmartIF<ITHistSvc> ISCT_CalibHistoTool::m_thistSvc {nullptr}
protected

Definition at line 65 of file ISCT_CalibHistoTool.h.

65{nullptr};

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