Project
Loading...
Searching...
No Matches
IDCGroup.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16#include "TPCBase/Mapper.h"
17#include "TPCBase/CalDet.h"
18#include "TFile.h"
19#include <numeric>
20
21void o2::tpc::IDCGroup::dumpToTree(const char* outname) const
22{
23 o2::utils::TreeStreamRedirector pcstream(outname, "RECREATE");
24 pcstream.GetFile()->cd();
25 for (unsigned int integrationInterval = 0; integrationInterval < getNIntegrationIntervals(); ++integrationInterval) {
26 for (unsigned int irow = 0; irow < mRows; ++irow) {
27 for (unsigned int ipad = 0; ipad < mPadsPerRow[irow]; ++ipad) {
28 float idc = (*this)(irow, ipad, integrationInterval);
29 pcstream << "idcs"
30 << "row=" << irow
31 << "pad=" << ipad
32 << "IDC=" << idc
33 << "\n";
34 }
35 }
36 }
37 pcstream.Close();
38}
39
40void o2::tpc::IDCGroup::draw(const unsigned int integrationInterval, const std::string filename) const
41{
42 std::function<float(const unsigned int, const unsigned int, const unsigned int, const unsigned int)> idcFunc = [this, integrationInterval](const unsigned int, const unsigned int region, const unsigned int irow, const unsigned int pad) {
43 return this->getValUngrouped(irow, pad, integrationInterval);
44 };
45
47 drawFun.mIDCFunc = idcFunc;
48 const std::string zAxisTitle = IDCDrawHelper::getZAxisTitle(IDCType::IDC);
49 IDCDrawHelper::drawSector(drawFun, mRegion, mRegion + 1, 0, zAxisTitle, filename);
50}
51
52void o2::tpc::IDCGroup::dumpToFile(const char* outFileName, const char* outName) const
53{
54 TFile fOut(outFileName, "UPDATE");
55 fOut.WriteObject(this, outName);
56 fOut.Close();
57}
58
59float o2::tpc::IDCGroup::getValUngroupedGlobal(unsigned int ugrow, unsigned int upad, unsigned int integrationInterval) const
60{
61 return mIDCsGrouped[getIndexUngrouped(Mapper::getLocalRowFromGlobalRow(ugrow), upad, integrationInterval)];
62}
This file provides the structs for storing the factorized IDC values and fourier coefficients to be s...
helper class for drawing IDCs per region/side
class for storing grouped IDCs
static std::string getZAxisTitle(const IDCType type, const IDCDeltaCompression compression=IDCDeltaCompression::NO)
static void drawSector(const IDCDraw &idc, const unsigned int startRegion, const unsigned int endRegion, const unsigned int sector, const std::string zAxisTitle, const std::string filename, const float minZ=0, const float maxZ=-1)
std::vector< unsigned int > mPadsPerRow
number of grouped pads per grouped row
unsigned int mRows
number of grouped rows
float getValUngroupedGlobal(unsigned int ugrow, unsigned int upad, unsigned int integrationInterval) const
Definition IDCGroup.cxx:59
unsigned int getNIntegrationIntervals() const
Definition IDCGroup.h:91
void dumpToFile(const char *outFileName="IDCGroup.root", const char *outName="IDCGroup") const
Definition IDCGroup.cxx:52
void dumpToTree(const char *outname="IDCGroup.root") const
Definition IDCGroup.cxx:21
void draw(const unsigned int integrationInterval=0, const std::string filename="IDCsGrouped.pdf") const
Definition IDCGroup.cxx:40
static unsigned int getLocalRowFromGlobalRow(const unsigned int row)
Definition Mapper.h:72
@ IDC
integrated and grouped IDCs
std::string filename()
std::function< float(const unsigned int, const unsigned int, const unsigned int, const unsigned int)> mIDCFunc
function returning the value which will be drawn for sector, region, row, pad