PandaRoot
PndMdtPointsToWaveform.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //----------------------------------------------------------------------
14 // File and Version Information:
15 // $Id: Exp $
16 //
17 // Description:
18 // Class PndMdtPointsToWaveform. Module to take the point list for the
19 // mdt induced current.
20 //
21 //
22 // Author List:
23 // Jifeng Hu, hu@to.infn.it, Torino University
24 //----------------------------------------------------------------------
25 //#pragma once
26 #ifndef PndMdtPointsToWaveform_H
27 #define PndMdtPointsToWaveform_H
28 
29 #include <PndPersistencyTask.h>
30 #include "PndMdtWaveform.h"
31 #include "TVector3.h"
32 #include <TFile.h>
33 #include <TTree.h>
34 
35 class TClonesArray;
36 // class PndMdtDigiPar;
37 // class PndMdtGeoPar;
39 class PndMdtParamDigi;
40 class PndMdtIGeometry;
41 
43 
44  public:
45  // Constructors
46 
47  PndMdtPointsToWaveform(Int_t verbose = 0, Bool_t storewaves = kTRUE);
48 
49  // Destructor
50 
51  virtual ~PndMdtPointsToWaveform();
52 
54  virtual InitStatus Init();
55 
57  virtual void Exec(Option_t *opt);
58 
59  void SetStorageOfData(Bool_t val); // Method to specify whether waveforms are stored or not.
60 
61  void RunTimeBased() { fTimeOrderedWaveform = kTRUE; }
62 
63  void FinishTask();
64 
65  private:
66  TClonesArray *fMcTrackArray;
67 
69  TClonesArray *fPointArray;
70 
71  /* output array for general sim */
72  TClonesArray *fWaveformArray;
73 
74  /* output array for time-based sim */
75  Bool_t fTimeOrderedWaveform;
76  PndMdtWaveformWriteoutBuffer *fDataBuffer;
77 
78  PndMdtParamDigi *fParamDigiModel;
79  PndMdtIGeometry *fGeoIF;
80 
81  // PndMdtDigiPar* fDigiPar; /** Digitisation parameter container **/
82  // PndMdtGeoPar* fGeoPar; /** Geometry parameter container **/
84  virtual void SetParContainers();
85  virtual void exec_t();
86  virtual void exec_e();
87  Int_t PdgToIndex(Int_t pdg);
88 
90  Int_t fVerbose;
91  // counters for task
92  Int_t HowManyPoint;
93  Int_t nWaveformProduced;
94 
97 
98  Bool_t Digitize(PndMdtWaveform *theWf, Double_t &time, Double_t &amp, Bool_t isWire);
99 
100  struct key {
101  key() {}
102  key(Int_t _tid, Int_t _detid) : TrkID(_tid), DetID(_detid) {}
103  bool operator<(const key &rhs) const
104  {
105  if (TrkID < rhs.TrkID)
106  return true;
107  if (TrkID == rhs.TrkID)
108  return DetID < rhs.DetID;
109  return false;
110  }
111  bool operator==(const key &rhs) const { return TrkID == rhs.TrkID && DetID == rhs.DetID; }
112  Int_t TrkID; // track id
113  Int_t DetID; // detector id
114  };
115 
116  TFile *fFile;
117  TTree *tTree;
118  Double_t fWirpT;
119  Double_t fStripT;
120  Double_t fEvtT;
121  Double_t fLength;
122  Double_t fDis;
123  Int_t fMod;
124  Int_t fPid;
125 
126  ClassDef(PndMdtPointsToWaveform, 2);
127 };
128 
129 #endif
virtual void Exec(Option_t *opt)
PndMdtPointsToWaveform(Int_t verbose=0, Bool_t storewaves=kTRUE)
virtual InitStatus Init()
virtual ~PndMdtPointsToWaveform()
void SetStorageOfData(Bool_t val)
friend F32vec4 operator<(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:88
friend F32vec4 operator==(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:104