All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
icarus::crt::CrtCalTree Class Reference

#include <CrtCalTree.h>

Public Member Functions

 CrtCalTree (TTree *tree)
 
 CrtCalTree (string fname)
 
 ~CrtCalTree ()
 
float GetGain (uint8_t mac, uint8_t channel)
 
float GetPed (uint8_t mac, uint8_t channel)
 
bool GetActive (uint8_t mac, uint8_t channel)
 
vector< uint8_t > GetMacs ()
 
float GetGainXsqr (uint8_t mac, uint8_t channel)
 
short GetGainNdf (uint8_t mac, uint8_t channel)
 
float GetGainErr (uint8_t mac, uint8_t channel)
 
float GetPedErr (uint8_t mac, uint8_t channel)
 
float GetPedXsqr (uint8_t mac, uint8_t channel)
 
short GetPedNdf (uint8_t mac, uint8_t channel)
 
float GetPedSigma (uint8_t mac, uint8_t channel)
 
float GetPedSigmaErr (uint8_t mac, uint8_t channel)
 
void Dump ()
 

Private Member Functions

void Init ()
 

Private Attributes

TTree * fTree
 
std::map< std::pair< uint8_t,
uint8_t >, float > 
fMacChanToGain
 
std::map< std::pair< uint8_t,
uint8_t >, float > 
fMacChanToPed
 
std::map< std::pair< uint8_t,
uint8_t >, bool > 
fMacChanToActive
 
std::vector< uint8_t > fMacs
 
std::map< uint8_t, int > fMacToEntry
 
uint8_t mac5
 
float gain [32]
 
float ped [32]
 
bool active [32]
 
float gainXsqr [32]
 
UShort_t gainNdf [32]
 
float gainErr [32]
 
float pedXsqr [32]
 
UShort_t pedNdf [32]
 
float pedErr [32]
 
float pedSigma [32]
 
float pedSigmaErr [32]
 
TBranch * b_mac5
 
TBranch * b_gain
 
TBranch * b_ped
 
TBranch * b_active
 
TBranch * b_gainXsqr
 
TBranch * b_gainNdf
 
TBranch * b_gainErr
 
TBranch * b_pedXsqr
 
TBranch * b_pedNdf
 
TBranch * b_pedErr
 
TBranch * b_pedSigma
 
TBranch * b_pedSigmaErr
 

Detailed Description

Definition at line 24 of file CrtCalTree.h.

Constructor & Destructor Documentation

CrtCalTree::CrtCalTree ( TTree *  tree)

Definition at line 8 of file CrtCalTree.cxx.

8  {
9  fTree = tree;
10  Init();
11 }
CrtCalTree::CrtCalTree ( string  fname)

Definition at line 13 of file CrtCalTree.cxx.

13  {
14  TFile fin(fname.c_str());//,"READ");
15  fTree = (TTree*)fin.FindObjectAny("calTree");
16  Init();
17 }
string fname
Definition: demo.py:5
CrtCalTree::~CrtCalTree ( )

Definition at line 19 of file CrtCalTree.cxx.

19 {}

Member Function Documentation

void CrtCalTree::Dump ( )

Definition at line 117 of file CrtCalTree.cxx.

117  {
118  std::cout << "preparing to dump " << fMacChanToGain.size() << " channels." << std::endl;
119 
120  std::cout << "mac5, channel -> gain, ped (active)" << std::endl;
121  for(auto const& mc : fMacChanToGain) {
122  std::cout << " " << (int)mc.first.first << ", "
123  << (int)mc.first.second << "-> " << mc.second
124  << ", " << fMacChanToPed[mc.first] << " ("
125  << fMacChanToActive[mc.first] << ")" << std::endl;
126  }
127 }
std::map< std::pair< uint8_t, uint8_t >, float > fMacChanToPed
Definition: CrtCalTree.h:52
std::map< std::pair< uint8_t, uint8_t >, float > fMacChanToGain
Definition: CrtCalTree.h:51
std::map< std::pair< uint8_t, uint8_t >, bool > fMacChanToActive
Definition: CrtCalTree.h:53
BEGIN_PROLOG could also be cout
bool CrtCalTree::GetActive ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 60 of file CrtCalTree.cxx.

60  {
61  return fMacChanToActive[std::make_pair(mac,channel)];
62 }
std::map< std::pair< uint8_t, uint8_t >, bool > fMacChanToActive
Definition: CrtCalTree.h:53
float CrtCalTree::GetGain ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 52 of file CrtCalTree.cxx.

52  {
53  return fMacChanToGain[std::make_pair(mac,channel)];
54 }
std::map< std::pair< uint8_t, uint8_t >, float > fMacChanToGain
Definition: CrtCalTree.h:51
float CrtCalTree::GetGainErr ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 80 of file CrtCalTree.cxx.

80  {
81  float val = -1.;
82  fTree->GetEntry(fMacToEntry[mac]);
83  val = gainErr[channel];
84  return val;
85 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
short CrtCalTree::GetGainNdf ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 74 of file CrtCalTree.cxx.

74  {
75  float val = -1.;
76  fTree->GetEntry(fMacToEntry[mac]);
77  val = gainNdf[channel];
78  return val;
79 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
UShort_t gainNdf[32]
Definition: CrtCalTree.h:62
float CrtCalTree::GetGainXsqr ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 68 of file CrtCalTree.cxx.

68  {
69  float val = -1.;
70  fTree->GetEntry(fMacToEntry[mac]);
71  val = gainXsqr[channel];
72  return val;
73 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
std::vector< uint8_t > CrtCalTree::GetMacs ( )

Definition at line 64 of file CrtCalTree.cxx.

64  {
65  return fMacs;
66 }
std::vector< uint8_t > fMacs
Definition: CrtCalTree.h:54
float CrtCalTree::GetPed ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 56 of file CrtCalTree.cxx.

56  {
57  return fMacChanToPed[std::make_pair(mac,channel)];
58 }
std::map< std::pair< uint8_t, uint8_t >, float > fMacChanToPed
Definition: CrtCalTree.h:52
float CrtCalTree::GetPedErr ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 86 of file CrtCalTree.cxx.

86  {
87  float val = -1.;
88  fTree->GetEntry(fMacToEntry[mac]);
89  val = pedErr[channel];
90  return val;
91 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
short CrtCalTree::GetPedNdf ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 98 of file CrtCalTree.cxx.

98  {
99  float val = -1.;
100  fTree->GetEntry(fMacToEntry[mac]);
101  val = pedNdf[channel];
102  return val;
103 }
UShort_t pedNdf[32]
Definition: CrtCalTree.h:65
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
float CrtCalTree::GetPedSigma ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 104 of file CrtCalTree.cxx.

104  {
105  float val = -1.;
106  fTree->GetEntry(fMacToEntry[mac]);
107  val = pedSigma[channel];
108  return val;
109 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
float CrtCalTree::GetPedSigmaErr ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 110 of file CrtCalTree.cxx.

110  {
111  float val = -1.;
112  fTree->GetEntry(fMacToEntry[mac]);
113  val = pedSigmaErr[channel];
114  return val;
115 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
float CrtCalTree::GetPedXsqr ( uint8_t  mac,
uint8_t  channel 
)

Definition at line 92 of file CrtCalTree.cxx.

92  {
93  float val = -1.;
94  fTree->GetEntry(fMacToEntry[mac]);
95  val = pedXsqr[channel];
96  return val;
97 }
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
void CrtCalTree::Init ( )
private

Definition at line 21 of file CrtCalTree.cxx.

21  {
22 
23  fTree->SetBranchAddress("mac5", &mac5, &b_mac5);
24  fTree->SetBranchAddress("gain", gain, &b_gain);
25  fTree->SetBranchAddress("ped", ped, &b_ped);
26  fTree->SetBranchAddress("active", active, &b_active);
27  fTree->SetBranchAddress("gainXsqr", gainXsqr, &b_gainXsqr);
28  fTree->SetBranchAddress("gainNdf", gainNdf, &b_gainNdf);
29  fTree->SetBranchAddress("gainErr", gainErr, &b_gainErr);
30  fTree->SetBranchAddress("pedXsqr", pedXsqr, &b_pedXsqr);
31  fTree->SetBranchAddress("pedNdf", pedNdf, &b_pedNdf);
32  fTree->SetBranchAddress("pedErr", pedErr, &b_pedErr);
33  fTree->SetBranchAddress("pedSigma", pedSigma, &b_pedSigma);
34  fTree->SetBranchAddress("pedSigmaErr", pedSigmaErr, &b_pedSigmaErr);
35 
36  const size_t nmac = fTree->GetEntriesFast();
37  std::cout << "retreiving calibration data for " << nmac << " FEBs..." << std::endl;
38 
39  for(size_t imac=0; imac<nmac; imac++){
40  fTree->GetEntry(imac);
41 
42  fMacs.push_back(mac5);
43  fMacToEntry[mac5] = imac;
44  for(size_t chan=0; chan < 32; chan++){
45  fMacChanToGain[std::make_pair(mac5,chan)] = gain[chan];
46  fMacChanToPed[std::make_pair(mac5,chan)] = ped[chan];
47  fMacChanToActive[std::make_pair(mac5,chan)] = active[chan];
48  }
49  }
50 }
UShort_t pedNdf[32]
Definition: CrtCalTree.h:65
std::map< uint8_t, int > fMacToEntry
Definition: CrtCalTree.h:55
std::vector< uint8_t > fMacs
Definition: CrtCalTree.h:54
std::map< std::pair< uint8_t, uint8_t >, float > fMacChanToPed
Definition: CrtCalTree.h:52
UShort_t gainNdf[32]
Definition: CrtCalTree.h:62
std::map< std::pair< uint8_t, uint8_t >, float > fMacChanToGain
Definition: CrtCalTree.h:51
std::map< std::pair< uint8_t, uint8_t >, bool > fMacChanToActive
Definition: CrtCalTree.h:53
BEGIN_PROLOG could also be cout

Member Data Documentation

bool icarus::crt::CrtCalTree::active[32]
private

Definition at line 60 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_active
private

Definition at line 73 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_gain
private

Definition at line 71 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_gainErr
private

Definition at line 76 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_gainNdf
private

Definition at line 75 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_gainXsqr
private

Definition at line 74 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_mac5
private

Definition at line 70 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_ped
private

Definition at line 72 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_pedErr
private

Definition at line 79 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_pedNdf
private

Definition at line 78 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_pedSigma
private

Definition at line 80 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_pedSigmaErr
private

Definition at line 81 of file CrtCalTree.h.

TBranch* icarus::crt::CrtCalTree::b_pedXsqr
private

Definition at line 77 of file CrtCalTree.h.

std::map<std::pair<uint8_t,uint8_t>,bool> icarus::crt::CrtCalTree::fMacChanToActive
private

Definition at line 53 of file CrtCalTree.h.

std::map<std::pair<uint8_t,uint8_t>,float> icarus::crt::CrtCalTree::fMacChanToGain
private

Definition at line 51 of file CrtCalTree.h.

std::map<std::pair<uint8_t,uint8_t>,float> icarus::crt::CrtCalTree::fMacChanToPed
private

Definition at line 52 of file CrtCalTree.h.

std::vector<uint8_t> icarus::crt::CrtCalTree::fMacs
private

Definition at line 54 of file CrtCalTree.h.

std::map<uint8_t,int> icarus::crt::CrtCalTree::fMacToEntry
private

Definition at line 55 of file CrtCalTree.h.

TTree* icarus::crt::CrtCalTree::fTree
private

Definition at line 50 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::gain[32]
private

Definition at line 58 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::gainErr[32]
private

Definition at line 63 of file CrtCalTree.h.

UShort_t icarus::crt::CrtCalTree::gainNdf[32]
private

Definition at line 62 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::gainXsqr[32]
private

Definition at line 61 of file CrtCalTree.h.

uint8_t icarus::crt::CrtCalTree::mac5
private

Definition at line 57 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::ped[32]
private

Definition at line 59 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::pedErr[32]
private

Definition at line 66 of file CrtCalTree.h.

UShort_t icarus::crt::CrtCalTree::pedNdf[32]
private

Definition at line 65 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::pedSigma[32]
private

Definition at line 67 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::pedSigmaErr[32]
private

Definition at line 68 of file CrtCalTree.h.

float icarus::crt::CrtCalTree::pedXsqr[32]
private

Definition at line 64 of file CrtCalTree.h.


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