Skip to content
Snippets Groups Projects
Commit d76a634e authored by Apar Agarwal's avatar Apar Agarwal Committed by Administrator
Browse files

To implement correct digitization on the side boundary pads for both GEM and RPC

Earlier the pads on one edge of the frame used to be under estimated on one
side while they were overestimated on the opposite side.
This problem should now be rectified by taking into account the special case
of module boundaries.
Add special case of pad size being smaller than the spot radius
parent 149dcc54
No related branches found
No related tags found
1 merge request!1554To implement correct digitization on the side boundary pads for both GEM and...
/* Copyright (C) 2009-2021 St. Petersburg Polytechnic University, St. Petersburg
SPDX-License-Identifier: GPL-3.0-only
Authors: Vikas Singhal, Ekata Nandy, Volker Friese, Evgeny Kryshen [committer] */
Authors: Apar Agarwal, Vikas Singhal, Ekata Nandy, Volker Friese, Evgeny Kryshen [committer] */
/** CbmMuchDigitizeGem.cxx
*@author Vikas Singhal <vikas@vecc.gov.in>
......@@ -1145,15 +1145,45 @@ Double_t CbmMuchDigitizeGem::GetNPrimaryElectronsPerCm(const CbmMuchPoint* point
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
Bool_t CbmMuchDigitizeGem::AddCharge(CbmMuchSectorRadial* s, UInt_t ne, Int_t /*iPoint*/, Double_t /*time*/,
Double_t /*driftTime*/, Double_t phi1, Double_t phi2)
{
CbmMuchPadRadial* pad1 = s->GetPadByPhi(phi1);
if (!pad1) return kFALSE;
//assert(pad1); has to check if any pad address is NULL
CbmMuchPadRadial* pad2 = s->GetPadByPhi(phi2);
if (!pad2) return kFALSE;
//assert(pad2); has to check if any pad address is NULL
Bool_t CbmMuchDigitizeGem::AddCharge(CbmMuchSectorRadial *s, UInt_t ne,
Int_t /*iPoint*/, Double_t /*time*/,
Double_t /*driftTime*/, Double_t phi1,
Double_t phi2) {
CbmMuchPadRadial *pad1 = s->GetPadByPhi(phi1);
if (!pad1)
pad1 = s->GetPadByPhi(
(phi1 + phi2) / 2.0); // This condition helps us deal with boundary pads
else // Special case if pad size is smaller than spot radius
{
for (Double_t phi = phi1; phi < (phi1 + phi2) / 2.0;
phi += 0.1) // This may potentially slow down the code
{
pad1 = s->GetPadByPhi(phi);
if (pad1)
break;
}
}
if (!pad1)
return kFALSE;
// assert(pad1); has to check if any pad address is NULL
CbmMuchPadRadial *pad2 = s->GetPadByPhi(phi2);
if (!pad2)
pad2 = s->GetPadByPhi(
(phi1 + phi2) / 2.0); // This condition helps us deal with boundary pads
else // Special case if pad size is smaller than spot radius
{
for (Double_t phi = phi2; phi > (phi1 + phi2) / 2.0;
phi -= 0.1) // This may potentially slow down the code
{
pad2 = s->GetPadByPhi(phi);
if (pad2)
break;
}
}
if (!pad2)
return kFALSE;
// assert(pad2); has to check if any pad address is NULL
if (pad1 == pad2) {
UInt_t address = pad1->GetAddress();
//Finding that if for the same address if already charge stored then add the charge.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment