#include <TreeShapeErrorGetter.h>
|
| TreeShapeErrorGetter (const TString &fileName, bool recreate=false) |
|
virtual | ~TreeShapeErrorGetter () |
|
ShapeErrorData * | shapeErrorData (unsigned int hash, CaloGain::CaloGain gain, const Residual *toExclude=0) const |
|
ShapeErrorData * | phiSymShapeErrorData (short ring, CaloGain::CaloGain gain, const Residual *toExclude=0) const |
|
int | addCell (const ResidualCalculator &calc, CaloGain::CaloGain gain) |
|
int | addRing (const ResidualCalculator &calc, CaloGain::CaloGain gain) |
|
void | dump (CaloGain::CaloGain gain) const |
|
TH2D * | correlate (const TreeShapeErrorGetter &other, CaloGain::CaloGain gain, unsigned short sample, bool xip, unsigned int nBins, double xMin, double xMax) const |
|
bool | compare (const TreeShapeErrorGetter &other, const TString &fileName, const Interface *tmpl=0) const |
|
const ResidualCalculator * | cellCalc () const |
|
const ResidualCalculator * | ringCalc () const |
|
TTree * | cellTree (CaloGain::CaloGain gain) const |
|
TTree * | ringTree (CaloGain::CaloGain gain) const |
|
TFile * | file () const |
|
Definition at line 30 of file TreeShapeErrorGetter.h.
◆ TreeShapeErrorGetter()
TreeShapeErrorGetter::TreeShapeErrorGetter |
( |
const TString & |
fileName, |
|
|
bool |
recreate = false |
|
) |
| |
Definition at line 25 of file TreeShapeErrorGetter.cxx.
30 cout <<
"File " <<
fileName <<
" is not accessible" << endl;
40 for (
unsigned int i = 0;
i < 3;
i++ ) {
50 cout <<
"Trees with cell shape error data not found in " <<
fileName << endl;
57 cout <<
"Trees with phi symmetric shape error data not found in " <<
fileName << endl;
60 for (
unsigned int i = 0;
i < 3;
i++ ) {
◆ ~TreeShapeErrorGetter()
TreeShapeErrorGetter::~TreeShapeErrorGetter |
( |
| ) |
|
|
virtual |
Definition at line 68 of file TreeShapeErrorGetter.cxx.
70 if (
m_file->GetOption() == TString(
"CREATE")) {
72 for (
unsigned int g = 0;
g < 3;
g++ ) {
74 cout <<
"Missing trees, error writing data to TreeShapeErrorGetter" << endl;
◆ addCell()
◆ addRing()
◆ cellCalc()
◆ cellTree()
◆ compare()
Definition at line 259 of file TreeShapeErrorGetter.cxx.
261 std::unique_ptr<TFile>
f(TFile::Open(
fileName,
"RECREATE"));
262 auto tree = std::make_unique<TTree>(
"tree",
"");
265 double xi1[99], xi2[99], xip1[99], xip2[99];
273 tree->Branch(
"calo", &calo);
276 tree->Branch(
"slot", &slot);
278 tree->Branch(
"eta", &eta);
279 tree->Branch(
"phi", &phi);
282 tree->Branch(
"lwb1", &lwb1);
283 tree->Branch(
"lwb2", &lwb2);
285 tree->Branch(
"xi1", xi1,
"xi1[nSamples]/D");
286 tree->Branch(
"xi2", xi2,
"xi2[nSamples]/D");
287 tree->Branch(
"xip1", xip1,
"xip1[nSamples]/D");
288 tree->Branch(
"xip2", xip2,
"xip2[nSamples]/D");
291 if (
k % 10000 == 0) cout <<
"Processing entry " <<
k << endl;
295 calo = (cellInfo ? cellInfo->
calo() : -999 );
296 layer = (cellInfo ? cellInfo->
layer() : -999 );
298 slot = (cellInfo ? cellInfo->
slot() : -999 );
300 eta = (cellInfo ? cellInfo->
eta() : -999 );
301 phi = (cellInfo ? cellInfo->
phi() : -999 );
303 for (
unsigned int g = 0;
g < 3;
g++) {
311 int lwb = (lwb1 >= 0 ? lwb1 : lwb2);
312 if (lwb<0)
throw std::runtime_error(
"TreeShapeErrorGetter::compare() attempt to access arrays with negative index");
313 for (
int j = lwb; j < lwb +
nSamples; j++) {
◆ correlate()
Definition at line 164 of file TreeShapeErrorGetter.cxx.
167 TH2D*
h =
new TH2D(Form(
"%s_%d", xip ?
"xip" :
"xi",
sample),
"",
nBins, xMin, xMax,
nBins, xMin, xMax);
170 if (!
data1)
continue;
174 unsigned int sample1 =
sample +
data1->xip().GetLwb();
175 unsigned int sample2 =
sample +
data2->xip().GetLwb();
176 if (
data1->isInRange(sample1) &&
data2->isInRange(sample2))
177 h->Fill(xip ?
data1->xip()(sample1) :
data1->xi()(sample1),
178 xip ?
data2->xip()(sample2) :
data2->xi()(sample2));
◆ dump()
◆ file()
TFile* LArSamples::TreeShapeErrorGetter::file |
( |
| ) |
const |
|
inline |
◆ merge() [1/2]
Definition at line 217 of file TreeShapeErrorGetter.cxx.
221 for (
unsigned int g = 0;
g < 3;
g++) {
222 bool gotResult =
false;
226 cout <<
"TreeShapeErrorGetter::merge : input getters have non-zero overlap for cell " <<
i <<
" -- not supported, exiting." << endl;
230 cout <<
"Adding " <<
i <<
" " <<
g <<
" " << getter->cellCalc()->size() << endl;
239 for (
unsigned int g = 0;
g < 3;
g++) {
240 bool gotResult =
false;
244 cout <<
"TreeShapeErrorGetter::merge : input getters have non-zero overlap for ring " <<
i <<
" -- not supported, exiting." << endl;
248 cout <<
"Adding ring " <<
i <<
" " <<
g << endl;
◆ merge() [2/2]
bool TreeShapeErrorGetter::merge |
( |
const TString & |
listFile, |
|
|
const TString & |
outputFile |
|
) |
| |
|
static |
Definition at line 186 of file TreeShapeErrorGetter.cxx.
188 std::ifstream
f(listFile);
190 cout <<
"file " << listFile <<
" not accessible" << endl;
196 std::vector<const TreeShapeErrorGetter*> getters;
202 cout <<
"Skipping invalid file " <<
fileName << endl;
205 cout << std::setw(2) << ++
i <<
" - " <<
fileName << endl;
206 getters.push_back(getter);
◆ phiSymShapeErrorData()
◆ ringCalc()
◆ ringTree()
◆ shapeErrorData()
◆ m_cellCalc
◆ m_cellTrees
std::vector<TTree*> LArSamples::TreeShapeErrorGetter::m_cellTrees |
|
private |
◆ m_file
TFile* LArSamples::TreeShapeErrorGetter::m_file |
|
private |
◆ m_ringCalc
◆ m_ringTrees
std::vector<TTree*> LArSamples::TreeShapeErrorGetter::m_ringTrees |
|
private |
The documentation for this class was generated from the following files: