PandaRoot
PndMixBackgroundEvents.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 #ifndef PNDMIXBACKGROUNDEVENTS_H
14 #define PNDMIXBACKGROUNDEVENTS_H 1
15 
16 #include "PndMCTrack.h"
17 #include "PndSttTrack.h"
18 #include "FairTask.h"
19 #include "FairRootManager.h"
20 #include "FairRunAna.h"
21 #include "FairRuntimeDb.h"
22 #include "FairTrackParP.h"
23 #include "PndGeoSttPar.h"
24 
25 #include "TFile.h"
26 #include "TVector3.h"
27 #include "TH1F.h"
28 #include "TH2F.h"
29 #include "TRandom.h"
30 
31 class TClonesArray;
32 class TObjectArray;
33 
34 class PndMixBackgroundEvents : public FairTask {
35 
36  public:
39 
40  PndMixBackgroundEvents(Int_t verbose);
41 
44 
45  Double_t fInteractionRate; // in MHz, average interaction rate in PANDA.
46 
48  virtual InitStatus Init();
49 
51  virtual void Exec(Option_t *opt);
52 
53  void WriteHistograms();
54 
56  void SetPersistence(Bool_t persistence) { fPersistence = persistence; }
57 
58  void SetParContainers();
59 
60  void SetInputBkgFilesName(char *string1)
61  {
62  sprintf(fSttBkgFilename, "%s", string1);
63  return;
64  };
65 
66  void SetInteractionRate(Double_t rate)
67  {
68  fInteractionRate = rate;
69  return;
70  };
71 
72  private:
73  // Int_t IVOLTE,
74  // istampa;
75 
76  char fSttBkgFilename[1000], fMvdBkgFilename[1000];
77 
78  static const UShort_t NMAXBCKGRND = 1000;
79  // static const UShort_t NMAXBCKGRND ;
80 
81  static const Double_t MVDTYPICALTIME, // in nsec; time after which the Mvd hit disappears.
82  RATE, // in MHz, average interaction rate in PANDA.
83  STRAWRADIUS, // in cm.
84  STTdriftVEL, // in cm/nsec
85  MAXSTTdriftTIME; // in nsec
86 
87  Int_t nTotalBkgEvents;
88 
89  TFile *filedigirun;
90 
91  TFile *filerecorun;
92 
93  TTree *treedigibkg; // pointer to root Tree of digi background file.
94 
95  TTree *treerecobkg; // pointer to root Tree of reco background file, only for Mvd hits.
96 
98  TClonesArray *fMCTrackArray;
99  TClonesArray *fSttTubeArray;
100 
102  TClonesArray *fSttHitArray;
103 
105  TClonesArray *fMvdPixelHitArray;
106 
108  TClonesArray *fMvdStripHitArray;
109 
110  //--------------------- input Arrays for the Background hits -------------
111 
113  TClonesArray *fSttHitBkgArray;
114 
116  TClonesArray *fMvdPixelHitBkgArray;
117 
119  TClonesArray *fMvdStripHitBkgArray;
120 
121  //-----------------
122 
124  TClonesArray *fSttHitandBckgrndArray;
125 
127  TClonesArray *fMvdPixelHitandBckgrndArray;
128 
130  TClonesArray *fMvdStripHitandBckgrndArray;
131 
132  //---------------------------------------------------------
133 
135  Bool_t fPersistence;
136 
137  PndGeoSttPar *fSttParameters; // CHECK added
138 
139  void Initialization_ClassVariables();
140 
141  void BackgroundNandT(UShort_t *nBkgEventsToAdd, Double_t *times);
142 
143  bool ModifyIsochrone(Double_t isochrone,
144  Double_t time, // nanosec
145  Double_t *modified);
146 
147  ClassDef(PndMixBackgroundEvents, 1);
148 };
149 
150 #endif
void SetPersistence(Bool_t persistence)
void SetInteractionRate(Double_t rate)
void SetInputBkgFilesName(char *string1)
virtual InitStatus Init()
virtual void Exec(Option_t *opt)