260{
261 std::unique_ptr<TFile>
f(TFile::Open(fileName,
"RECREATE"));
262 auto tree = std::make_unique<TTree>(
"tree",
"");
263
265 double xi1[99], xi2[99], xip1[99], xip2[99];
266 int calo;
269
270 tree->Branch(
"hash", &hash);
271
272 if (tmpl) {
273 tree->Branch(
"calo", &calo);
274 tree->Branch(
"layer", &layer);
275 tree->Branch(
"ft", &ft);
276 tree->Branch(
"slot", &slot);
277 tree->Branch(
"channel", &channel);
280 }
281 tree->Branch(
"gain", &gain);
282 tree->Branch(
"lwb1", &lwb1);
283 tree->Branch(
"lwb2", &lwb2);
284 tree->Branch(
"nSamples", &nSamples);
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");
289
291 if (k % 10000 == 0) cout <<
"Processing entry " <<
k << endl;
293 if (tmpl) {
294 const CellInfo* cellInfo = tmpl->
cellInfo(k);
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 );
302 }
303 for (
unsigned int g = 0;
g < 3;
g++) {
307
309 lwb2 = (data2 ? data2->lwb() : -1);
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++) {
316 xi2[j] = (data2 && data2->isInRange(j) ? data2->xi()(j) : -999);
317 xip2[j] = (data2 && data2->isInRange(j) ? data2->xip()(j) : -999);
318 }
320 }
321 }
324 return true;
325}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
virtual const CellInfo * cellInfo(unsigned int i) const
short feedThrough() const
ShapeErrorData * shapeErrorData(unsigned int hash, CaloGain::CaloGain gain, const Residual *toExclude=0) const
static const unsigned int nChannels