88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11-
12- // /
13- // / @file DelphesO2LutWriter.h
14- // / @brief Porting to O2Physics of DelphesO2 code.
11+ // / \file DelphesO2LutWriter.h
12+ // / \brief Porting to O2Physics of DelphesO2 code.
1513// / Minimal changes have been made to the original code for adaptation purposes, formatting and commented parts have been considered.
1614// / Relevant sources:
1715// / DelphesO2/src/lutWrite.cc https://github.com/AliceO2Group/DelphesO2/blob/master/src/lutWrite.cc
18- // / @ author: Roberto Preghenella
19- // / @ email: preghenella@bo.infn.it
16+ // / \ author: Roberto Preghenella
17+ // / \ email: preghenella@bo.infn.it
2018// /
2119
2220#ifndef ALICE3_CORE_DELPHESO2LUTWRITER_H_
2321#define ALICE3_CORE_DELPHESO2LUTWRITER_H_
2422
2523#include " ALICE3/Core/DelphesO2TrackSmearer.h"
2624#include " ALICE3/Core/FastTracker.h"
25+
26+ #include " ReconstructionDataFormats/PID.h"
27+
2728#include " TGraph.h"
2829
30+ #include < string>
31+
2932namespace o2 ::fastsim
3033{
3134class DelphesO2LutWriter
@@ -34,7 +37,33 @@ class DelphesO2LutWriter
3437 DelphesO2LutWriter () = default ;
3538 virtual ~DelphesO2LutWriter () = default ;
3639
40+ // Setters
41+ void setBinningNch (bool log, int nbins, float min, float max) { mNchBinning = {log, nbins, min, max}; }
42+ void setBinningRadius (bool log, int nbins, float min, float max) { mRadiusBinning = {log, nbins, min, max}; }
43+ void setBinningEta (bool log, int nbins, float min, float max) { mEtaBinning = {log, nbins, min, max}; }
44+ void setBinningPt (bool log, int nbins, float min, float max) { mPtBinning = {log, nbins, min, max}; }
45+ void setEtaMaxBarrel (float eta) { etaMaxBarrel = eta; }
46+ void setAtLeastHits (int n) { mAtLeastHits = n; }
47+ void setAtLeastCorr (int n) { mAtLeastCorr = n; }
48+ void setAtLeastFake (int n) { mAtLeastFake = n; }
49+ bool fatSolve (lutEntry_t& lutEntry,
50+ float pt = 0.1 ,
51+ float eta = 0.0 ,
52+ const float mass = o2::track::pid_constants::sMasses [o2::track::PID::Pion],
53+ size_t itof = 0 ,
54+ size_t otof = 0 ,
55+ int q = 1 ,
56+ const float nch = 1 );
57+
58+ void print () const ;
59+ bool fwdSolve (float * covm, float pt = 0.1 , float eta = 0.0 , float mass = o2::track::pid_constants::sMasses [o2::track::PID::Pion]);
60+ bool fwdPara (lutEntry_t& lutEntry, float pt = 0.1 , float eta = 0.0 , float mass = o2::track::pid_constants::sMasses [o2::track::PID::Pion], float Bfield = 0.5 );
61+ void lutWrite (const char * filename = " lutCovm.dat" , int pdg = 211 , float field = 0.2 , size_t itof = 0 , size_t otof = 0 );
62+ TGraph* lutRead (const char * filename, int pdg, int what, int vs, float nch = 0 ., float radius = 0 ., float eta = 0 ., float pt = 0 .);
63+
3764 o2::fastsim::FastTracker fat;
65+
66+ private:
3867 void diagonalise (lutEntry_t& lutEntry);
3968 float etaMaxBarrel = 1 .75f ;
4069 bool usePara = true ; // use fwd parameterisation
@@ -44,23 +73,19 @@ class DelphesO2LutWriter
4473 int mAtLeastHits = 4 ;
4574 int mAtLeastCorr = 4 ;
4675 int mAtLeastFake = 0 ;
47- void SetAtLeastHits (int n) { mAtLeastHits = n; }
48- void SetAtLeastCorr (int n) { mAtLeastCorr = n; }
49- void SetAtLeastFake (int n) { mAtLeastFake = n; }
5076
51- void printLutWriterConfiguration ();
52- bool fatSolve (lutEntry_t& lutEntry,
53- float pt = 0.1 ,
54- float eta = 0.0 ,
55- const float mass = 0.13957000 ,
56- int itof = 0 ,
57- int otof = 0 ,
58- int q = 1 ,
59- const float nch = 1 );
60- bool fwdSolve (float * covm, float pt = 0.1 , float eta = 0.0 , float mass = 0.13957000 );
61- bool fwdPara (lutEntry_t& lutEntry, float pt = 0.1 , float eta = 0.0 , float mass = 0.13957000 , float Bfield = 0.5 );
62- void lutWrite (const char * filename = " lutCovm.dat" , int pdg = 211 , float field = 0.2 , int itof = 0 , int otof = 0 );
63- TGraph* lutRead (const char * filename, int pdg, int what, int vs, float nch = 0 ., float radius = 0 ., float eta = 0 ., float pt = 0 .);
77+ // Binning of the LUT to make
78+ struct LutBinning {
79+ bool log;
80+ int nbins;
81+ float min;
82+ float max;
83+ std::string toString () const ;
84+ };
85+ LutBinning mNchBinning = {true , 20 , 0 .5f , 3 .5f };
86+ LutBinning mRadiusBinning = {false , 1 , 0 .0f , 100 .0f };
87+ LutBinning mEtaBinning = {false , 80 , -4 .0f , 4 .0f };
88+ LutBinning mPtBinning = {true , 200 , -2 .0f , 2 .0f };
6489
6590 ClassDef (DelphesO2LutWriter, 1 );
6691};
0 commit comments