9 #include "ERN15B11Digitizer.h" 11 #include <TClonesArray.h> 25 InitStatus ERN15B11Digitizer::Init()
27 FairRootManager* ioman = FairRootManager::Instance();
28 if ( ! ioman ) Fatal(
"Init",
"No FairRootManager");
30 TList* BranchsNamesList = ioman->GetBranchNameList();
31 TIter next(BranchsNamesList);
32 TObjString* branchName;
33 while (branchName = (TObjString*)next()) {
34 TString curBranchName = branchName->GetString();
35 if (curBranchName.Contains(
"Point")) {
37 fPoints[curBranchName] = (TClonesArray*) ioman->GetObject(curBranchName);
38 if (!fPoints[curBranchName]) {
39 Fatal(
"Init",
"Can't find input collection DetectorvDetGasPartPoint!");
43 fDigis[curBranchName] =
new TClonesArray(
"ERDigi");
44 ioman->Register(curBranchName(0, curBranchName.Length()-5)+
"Digi", curBranchName, fDigis[curBranchName], kTRUE);
50 void ERN15B11Digitizer::Exec(Option_t* option)
52 for(
const auto &itPoints: fPoints) {
53 TClonesArray* curBranchArray = itPoints.second;
54 Double_t curEdep = 0.;
55 Double_t curTime = 0.;
56 Int_t curEntries = curBranchArray->GetEntries();
57 for (UInt_t i = 0; i < curEntries; i++) {
59 curEdep = curEdep + curPoint->GetEnergyLoss();
60 curTime = curTime + curPoint->GetTime();
62 TClonesArray* curOutBra = fDigis[itPoints.first];
69 UInt_t size = clref.GetEntries();
70 new(clref[size])
ERDigi(Edep, Time, 1);
73 void ERN15B11Digitizer::FinishEvent()
75 for (
const auto &itfDigis: fDigis) {
76 itfDigis.second->Clear();
Class for the detectors response simulate.
ERN15B11Digitizer()
Default constructor.
void AddOutputDigi(TClonesArray &clref, Double_t Edep=0., Double_t Time=0.)
Write data to output file.
virtual ~ERN15B11Digitizer()
Destructor.
The data class for storing pieces of charged tracks in sensitive volumes in NeuRad.