ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
CompBHist Class Reference
Collaboration diagram for CompBHist:

Public Member Functions

 CompBHist (int, const std::vector< int > &, int, int)
 
 ~CompBHist ()
 
 CompBHist (const CompBHist &)=delete
 
CompBHistoperator= (const CompBHist &)=delete
 
int Print ()
 
void Write (ofstream *)
 
int GetStat (int)
 

Public Attributes

int * hist {}
 
int id {}
 
int npop {}
 

Detailed Description

Definition at line 142 of file TRTCalib_bhadd.cxx.

Constructor & Destructor Documentation

◆ CompBHist() [1/2]

CompBHist::CompBHist ( int  sid,
const std::vector< int > &  uchist,
int  ntbins,
int  nrbins 
)

Definition at line 159 of file TRTCalib_bhadd.cxx.

160 {
161 
162  id = sid;
163  npop = 0;
164  std::vector<std::vector<int>> tmp(2, std::vector<int>(ntbins * nrbins + 200, 0));
165 
166  for (int ibin = 0; ibin < ntbins * nrbins + 200; ibin++)
167  {
168  if (uchist.at(ibin) > 0)
169  {
170  tmp.at(0).at(npop) = ibin;
171  tmp.at(1).at(npop) = uchist.at(ibin);
172  npop++;
173  }
174  }
175 
176  hist = new int[npop * 2 + 2];
177  hist[0] = npop;
178  hist[npop * 2 + 1] = id;
179  for (int ipop = 0; ipop < npop; ipop++)
180  {
181  hist[ipop * 2 + 1] = tmp.at(0).at(ipop);
182  hist[ipop * 2 + 2] = tmp.at(1).at(ipop);
183  }
184 }

◆ ~CompBHist()

CompBHist::~CompBHist ( )

Definition at line 186 of file TRTCalib_bhadd.cxx.

187 {
188  delete[] hist;
189 }

◆ CompBHist() [2/2]

CompBHist::CompBHist ( const CompBHist )
delete

Member Function Documentation

◆ GetStat()

int CompBHist::GetStat ( int  val)

Definition at line 206 of file TRTCalib_bhadd.cxx.

207 {
208 
209  int stat[3];
210  stat[0] = 0;
211  stat[1] = 0;
212  stat[2] = 0;
213 
214  for (int ipop = 0; ipop < 2 * npop; ipop = ipop + 2)
215  {
216  if (hist[ipop] < 100)
217  stat[0] += hist[ipop + 1];
218  else if (hist[ipop] >= 100 && hist[ipop] < 200)
219  stat[1] += hist[ipop + 1];
220  else
221  stat[2] += hist[ipop + 1];
222  }
223 
224  return stat[val];
225 }

◆ operator=()

CompBHist& CompBHist::operator= ( const CompBHist )
delete

◆ Print()

int CompBHist::Print ( )

Definition at line 191 of file TRTCalib_bhadd.cxx.

192 {
193  // for(int ipop=0;ipop<1;ipop++) cout << hist[ipop] << " ";
194  cout << npop << " " << id << " ";
195  for (int ipop = 0; ipop < 2 * npop + 2; ipop++)
196  cout << hist[ipop] << " ";
197  cout << endl;
198  return 0;
199 }

◆ Write()

void CompBHist::Write ( ofstream *  file)

Definition at line 201 of file TRTCalib_bhadd.cxx.

202 {
203  file->write((char *)hist, (npop * 2 + 2) * sizeof(int));
204 }

Member Data Documentation

◆ hist

int* CompBHist::hist {}

Definition at line 154 of file TRTCalib_bhadd.cxx.

◆ id

int CompBHist::id {}

Definition at line 155 of file TRTCalib_bhadd.cxx.

◆ npop

int CompBHist::npop {}

Definition at line 156 of file TRTCalib_bhadd.cxx.


The documentation for this class was generated from the following file:
CompBHist::npop
int npop
Definition: TRTCalib_bhadd.cxx:156
CompBHist::id
int id
Definition: TRTCalib_bhadd.cxx:155
file
TFile * file
Definition: tile_monitor.h:29
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
beamspotman.stat
stat
Definition: beamspotman.py:266
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CompBHist::hist
int * hist
Definition: TRTCalib_bhadd.cxx:154