|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | +#include "IOTOFDigitizerSpec.h" |
| 13 | +#include "Framework/ControlService.h" |
| 14 | +#include "Framework/ConfigParamRegistry.h" |
| 15 | +#include "Framework/CCDBParamSpec.h" |
| 16 | +#include "Framework/DataProcessorSpec.h" |
| 17 | +#include "Framework/DataRefUtils.h" |
| 18 | +#include "Framework/Lifetime.h" |
| 19 | +#include "Framework/Task.h" |
| 20 | +#include "Steer/HitProcessingManager.h" |
| 21 | +#include "DataFormatsITSMFT/Digit.h" |
| 22 | +#include "SimulationDataFormat/ConstMCTruthContainer.h" |
| 23 | +#include "DetectorsBase/BaseDPLDigitizer.h" |
| 24 | +#include "DetectorsRaw/HBFUtils.h" |
| 25 | +#include "DetectorsCommonDataFormats/DetID.h" |
| 26 | +#include "DetectorsCommonDataFormats/SimTraits.h" |
| 27 | +#include "DataFormatsParameters/GRPObject.h" |
| 28 | +#include "DataFormatsITSMFT/ROFRecord.h" |
| 29 | +#include "IOTOFSimulation/Digitizer.h" |
| 30 | + |
| 31 | +#include <TChain.h> |
| 32 | +#include <TStopwatch.h> |
| 33 | + |
| 34 | +#include <algorithm> |
| 35 | +#include <memory> |
| 36 | +#include <string> |
| 37 | + |
| 38 | +namespace o2::iotof |
| 39 | +{ |
| 40 | + |
| 41 | +class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer |
| 42 | +{ |
| 43 | + public: |
| 44 | + using BaseDPLDigitizer::init; |
| 45 | + |
| 46 | + IOTOFDPLDigitizerTask(bool mctruth = true) : BaseDPLDigitizer(o2::base::InitServices::FIELD | o2::base::InitServices::GEOM), |
| 47 | + mWithMCTruth(mctruth) {} |
| 48 | + |
| 49 | + void initDigitizerTask(framework::InitContext& ic) override |
| 50 | + { |
| 51 | + } |
| 52 | + |
| 53 | + void run(framework::ProcessingContext& pc) |
| 54 | + { |
| 55 | + } |
| 56 | + |
| 57 | + private: |
| 58 | + bool mWithMCTruth{true}; |
| 59 | +}; |
| 60 | + |
| 61 | +DataProcessorSpec getIOTOFDigitizerSpec(int channel, bool mctruth) |
| 62 | +{ |
| 63 | + std::string detStr = o2::detectors::DetID::getName(o2::detectors::DetID::TF3); |
| 64 | + auto detOrig = o2::header::gDataOriginIOTOF; |
| 65 | + std::vector<InputSpec> inputs; |
| 66 | + inputs.emplace_back("collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast<SubSpecificationType>(channel), Lifetime::Timeframe); |
| 67 | + inputs.emplace_back("IOTOF_aptsresp", "TF3", "APTSRESP", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/APTSResponse")); |
| 68 | + |
| 69 | + return DataProcessorSpec{detStr + "Digitizer", |
| 70 | + inputs, makeOutChannels(detOrig, mctruth), |
| 71 | + AlgorithmSpec{adaptFromTask<IOTOFDPLDigitizerTask>(mctruth)}, |
| 72 | + Options{ |
| 73 | + {"disable-qed", o2::framework::VariantType::Bool, false, {"disable QED handling"}}, |
| 74 | + {"local-response-file", o2::framework::VariantType::String, "", {"use response file saved locally at this path/filename"}}}}; |
| 75 | +} |
| 76 | + |
| 77 | +} // namespace o2::iotof |
0 commit comments