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