Skip to content

Commit 4029c11

Browse files
authored
Considering also the charge when making LUT (#81)
1 parent ed2c324 commit 4029c11

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/lutWrite.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ DetectorK fat;
88
void diagonalise(lutEntry_t &lutEntry);
99

1010
bool
11-
fatSolve(float *eff, float *covm, float pt = 0.1, float eta = 0.0, float mass = 0.13957000, int layer = 0, int what = 0, int efftype = 0)
11+
fatSolve(float *eff, float *covm, float pt = 0.1, float eta = 0.0, float mass = 0.13957000, int layer = 0, int what = 0, int efftype = 0, int q = 1)
1212
{
13-
int q = 1;
1413
TrackSol tr(1, pt, eta, q, mass);
1514
bool retval = fat.SolveTrack(tr);
1615
if (!retval) return false;
@@ -61,6 +60,11 @@ lutWrite(const char *filename = "lutCovm.dat", int pdg = 211, float field = 0.2,
6160
// pid
6261
lutHeader.pdg = pdg;
6362
lutHeader.mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
63+
const int q = TDatabasePDG::Instance()->GetParticle(pdg)->Charge() / 3;
64+
if (q <= 0) {
65+
Printf("Negative or null charge for %i. Fix the charge!", pdg);
66+
return;
67+
}
6468
lutHeader.field = field;
6569
// nch
6670
lutHeader.nchmap.log = true;
@@ -102,7 +106,7 @@ lutWrite(const char *filename = "lutCovm.dat", int pdg = 211, float field = 0.2,
102106
lutEntry.valid = true;
103107
if (fabs(eta) < 2.) {
104108
// printf(" --- fatSolve: pt = %f, eta = %f, mass = %f, field=%f \n", lutEntry.pt, lutEntry.eta, lutHeader.mass, lutHeader.field);
105-
if (!fatSolve(&lutEntry.eff, lutEntry.covm, lutEntry.pt, lutEntry.eta, lutHeader.mass, layer, what, efftype)) {
109+
if (!fatSolve(&lutEntry.eff, lutEntry.covm, lutEntry.pt, lutEntry.eta, lutHeader.mass, layer, what, efftype, q)) {
106110
// printf(" --- fatSolve: error \n");
107111
lutEntry.valid = false;
108112
for (int i = 0; i < 15; ++i)

0 commit comments

Comments
 (0)