Skip to content

Commit

Permalink
Merge pull request AliceO2Group#20 from noferini/tof-dev
Browse files Browse the repository at this point in the history
add TOFSimParams
  • Loading branch information
noferini authored Oct 28, 2020
2 parents 8fee630 + b979264 commit 94c4f1f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Detectors/TOF/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
# submit itself to any jurisdiction.

o2_add_library(TOFSimulation
SOURCES src/Detector.cxx src/Digitizer.cxx src/DigitizerTask.cxx
SOURCES src/Detector.cxx src/Digitizer.cxx src/DigitizerTask.cxx src/TOFSimParams.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::TOFBase
O2::SimulationDataFormat
O2::TOFCalibration)

o2_target_root_dictionary(TOFSimulation
HEADERS include/TOFSimulation/Detector.h
include/TOFSimulation/Digitizer.h
include/TOFSimulation/DigitizerTask.h)
include/TOFSimulation/DigitizerTask.h
include/TOFSimulation/TOFSimParams.h)

o2_add_executable(digi2raw
COMPONENT_NAME tof
Expand Down
41 changes: 41 additions & 0 deletions Detectors/TOF/simulation/include/TOFSimulation/TOFSimParams.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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_CONF_TOFDIGIPARAMS_H_
#define O2_CONF_TOFDIGIPARAMS_H_

// Global parameters for TOF simulation / digitization

#include "CommonUtils/ConfigurableParam.h"
#include "CommonUtils/ConfigurableParamHelper.h"

namespace o2
{
namespace tof
{

// Global parameters for TOF simulation / digitization
struct TOFSimParams : public o2::conf::ConfigurableParamHelper<TOFSimParams> {

int time_resolution = 60; // TOF resolution in ps

// efficiency parameters
float eff_center = 0.995; // efficiency in the center of the fired pad
float eff_boundary1 = 0.94; // efficiency in mBound2
float eff_boundary2 = 0.833; // efficiency in the pad border
float eff_boundary3 = 0.1; // efficiency in mBound3

O2ParamDef(TOFSimParams, "TOFSimParams");
};

} // namespace tof
} // namespace o2

#endif
11 changes: 6 additions & 5 deletions Detectors/TOF/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "TOFSimulation/Digitizer.h"
#include "DetectorsBase/GeometryManager.h"
#include "TOFSimulation/TOFSimParams.h"

#include "TCanvas.h"
#include "TFile.h"
Expand Down Expand Up @@ -498,7 +499,7 @@ void Digitizer::initParameters()
mBound4 = 0.9; // distance from border (not fired pad) when efficiency vanishes

// resolution parameters
mTOFresolution = 60; // TOF global resolution in ps
mTOFresolution = TOFSimParams::Instance().time_resolution; // TOF global resolution in ps
mShowerResolution = 50; // smearing correlated for all digits of the same hit
if (mTOFresolution > mShowerResolution)
mDigitResolution = TMath::Sqrt(mTOFresolution * mTOFresolution -
Expand Down Expand Up @@ -530,10 +531,10 @@ void Digitizer::initParameters()
mShowerResolution = 0;

// efficiency parameters
mEffCenter = 0.995; // efficiency in the center of the fired pad
mEffBoundary1 = 0.94; // efficiency in mBound2
mEffBoundary2 = 0.833; // efficiency in the pad border
mEffBoundary3 = 0.1; // efficiency in mBound3
mEffCenter = TOFSimParams::Instance().eff_center; // efficiency in the center of the fired pad
mEffBoundary1 = TOFSimParams::Instance().eff_boundary1; // efficiency in mBound2
mEffBoundary2 = TOFSimParams::Instance().eff_boundary2; // efficiency in the pad border
mEffBoundary3 = TOFSimParams::Instance().eff_boundary3; // efficiency in mBound3
}

//______________________________________________________________________
Expand Down
12 changes: 12 additions & 0 deletions Detectors/TOF/simulation/src/TOFSimParams.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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.

#include "TOFSimulation/TOFSimParams.h"
O2ParamImpl(o2::tof::TOFSimParams);
3 changes: 3 additions & 0 deletions Detectors/TOF/simulation/src/TOFSimulationLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
#pragma link C++ class o2::tof::HitType + ;
#pragma link C++ class vector < o2::tof::HitType> + ;

#pragma link C++ class o2::tof::TOFSimParams + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::tof::TOFSimParams> + ;

#endif

0 comments on commit 94c4f1f

Please sign in to comment.