Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Detectors/GlobalTrackingWorkflow/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ o2_add_library(GlobalTrackingStudy
src/TrackMCStudyConfig.cxx
src/TrackMCStudyTypes.cxx
src/TPCClusSelector.cxx
src/CheckResid.cxx
src/CheckResidSpec.cxx
src/CheckResidConfig.cxx
src/HistoManager.cxx
PUBLIC_LINK_LIBRARIES O2::GlobalTracking
O2::GlobalTrackingWorkflowReaders
O2::GlobalTrackingWorkflowHelpers
Expand All @@ -42,6 +43,7 @@ o2_target_root_dictionary(GlobalTrackingStudy
include/GlobalTrackingStudy/TrackMCStudyTypes.h
include/GlobalTrackingStudy/CheckResidTypes.h
include/GlobalTrackingStudy/CheckResidConfig.h
include/GlobalTrackingStudy/HistoManager.h
LINKDEF src/GlobalTrackingStudyLinkDef.h
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ struct CheckResidConfig : o2::conf::ConfigurableParamHelper<CheckResidConfig> {
int minTPCCl = 60;
int minITSCl = 7;
float minPt = 0.4f;
float maxPt = 100.f;
float maxPt = 50.f;
float maxTgl = 2.f;
float rCompIBOB = 12.f;

bool pvcontribOnly = true;
Expand All @@ -34,6 +35,27 @@ struct CheckResidConfig : o2::conf::ConfigurableParamHelper<CheckResidConfig> {
float refitPVMV = false;
float refitPVIniScale = 100.f;

std::string outname{"checkResid"};
// histogram settings
int nBinsRes = 100;
int nBinsPhi = 30;
int nBinsZ = 20;
int nBinsPt = 15;
int nBinsTgl = 20;
int minHistoStat2Fit = 1000;
float maxPull = 4;
float zranges[8] = {10.f, 15.f, 15.f, 15.f, 40.f, 40.f, 74.f, 74.f};
float maxDYZ[8] = {0.03, 0.015, 0.01, 0.01, 0.08, 0.08, 0.12, 0.1};
float maxDPar[5] = {0.15, 0.15, 0.015, 0.015, 1.};
// drawing settings
float resMMLrY[8] = {0.003, 0.003, 0.003, 0.003, 0.005, 0.005, 0.005, 0.005};
float resMMLrZ[8] = {0.002, 0.0015, 0.0015, 0.0015, 0.005, 0.005, 0.005, 0.005};
float resMMPar[5] = {0.03, 0.01, 0.005, 0.001, 0.5};
//
// string with existing histomanagers files to draw (comma or semicolon separated) and optional legends
std::string ext_hm_list{};
std::string ext_leg_list{};

O2ParamDef(CheckResidConfig, "checkresid");
};
} // namespace o2::checkresid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace o2::checkresid
{
/// create a processor spec
o2::framework::DataProcessorSpec getCheckResidSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC /*, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts*/);
o2::framework::DataProcessorSpec getCheckResidSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool drawOnly);

} // namespace o2::checkresid

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef _O2_HISTOMANAGER_H_
#define _O2_HISTOMANAGER_H_

#include <string>
#include <Rtypes.h>
#include "TObjArray.h"

class TH1;
class TH2;
class TH1F;
class TH2F;
class TProfile;
class TGraph;
class TFile;

namespace o2
{

class HistoManager : public TObjArray
{
public:
HistoManager(const std::string& dirname = "", const std::string& fname = "histoman.root", bool load = kFALSE, const std::string& prefix = "");
~HistoManager() override { Delete(); }

HistoManager* createClone(const std::string& prefix) const;
void addPrefix(const std::string& pref = "");

int getNHistos() const { return mNHistos; }
TGraph* getGraph(int id) const;
TH1* getHisto(int id) const;
TH1* getHisto(const std::string& name) const;
TH1F* getHisto1F(int id) const;
TH2F* getHisto2F(int id) const;
TProfile* getHistoP(int id) const;

int addHisto(TH1* histo, int at = -1);
int addGraph(TGraph* gr, int at = -1);
void delHisto(int at);

void setFile(TFile* file);
void setFileName(const std::string& fname);
const std::string& getFileName() const { return mDefName; }
void setDirName(const std::string& name) { mDirName = name; }
const std::string& getDirName() const { return mDirName; }

void reset();
void write(TFile* file = nullptr);
int write(const std::string& flname)
{
setFileName(flname);
write();
return 0;
}

void addHistos(const HistoManager* hm, Double_t c1 = 1.);
void divideHistos(const HistoManager* hm);
void multiplyHistos(const HistoManager* hm);
void scaleHistos(Double_t c1 = 1.);
void setColor(int tcolor = 1);
void setMarkerStyle(Style_t mstyle = 1, Size_t msize = 1);
void setMarkerSize(Size_t msize = 1);
void sumw2();
int load(const std::string& fname, const std::string& dirname = "");

void purify(bool emptyToo = kFALSE);

void Print(Option_t* option = "") const override;
void Clear(Option_t* option = "") override;
void Delete(Option_t* option = "") override;
void Compress() override;

private:
int mNHistos{0}; //! Number of histograms defined
std::string mDefName{}; //! Default file name
std::string mDirName{}; //! Directory name in the output file

ClassDefOverride(HistoManager, 0);
};

} // namespace o2

#endif // _O2_HISTOMANAGER_H_
Loading