MarlinTPC  1.2.0
ElectronCloudDrifterProcessor.h
1 #ifndef ELECTRONCLOUDDRIFTERPROCESSOR_H
2 #define ELECTRONCLOUDDRIFTERPROCESSOR_H 1
3 
4 // CLHEP
5 #include <CLHEP/Vector/ThreeVector.h>
6 
7 // Marlin
8 #include <marlin/Processor.h>
9 
10 // GSL
11 #include <gsl/gsl_errno.h>
12 #include <gsl/gsl_odeiv.h>
13 
14 #ifdef MARLIN_USE_AIDA
15 //Root
16 #include "TTree.h"
17 #endif
18 
19 namespace EVENT {
20 
21  class LCRunHeader;
22  class LCEvent;
23 }
24 
25 namespace marlintpc {
26 
40 class ElectronCloudDrifterProcessor : public marlin::Processor {
41 
42 public:
46 
50 
53  virtual Processor* newProcessor() { return new ElectronCloudDrifterProcessor() ; }
54 
58  virtual void init();
59 
62  virtual void processRunHeader(lcio::LCRunHeader* run );
63 
66  virtual void processEvent(lcio::LCEvent * evt );
67 
70  virtual void check(lcio::LCEvent * evt );
71 
74  virtual void end();
75 
78  static int ion_drift_derivative( double t, const double y[], double f[], void *params );
79 
82  static int drift_through_cylinder( double (&)[4], const double min_radius, const double max_radius, const double min_z, const double max_z, const double drift_velocity, const double omega_tau, const bool disable_magnetic_field = false , marlintpc::ElectronCloudDrifterProcessor* processor = 0);
83 
88 #ifdef MARLIN_USE_AIDA
89 
92  std::vector<TTree*> _tDrift;
93 #endif
94 
95 protected:
99  struct driftInfo {
100  std::vector<double> *position[3];
101  std::vector<double> *velocity[3];
102  std::vector<double> *Ex;
103  std::vector<double> *Ey;
104  std::vector<double> *Ez;
105  std::vector<double> *Bz;
106  std::vector<double> *Br;
107  };
108 
110 
111  double _drift_velocity;
112  double _omega_tau;
113  double _omega_tau_squared;
114  bool _disable_magnetic_field;
116  };
117 
118 
119 private:
120 
123  std::string _input_collection_name;
124 
127  std::string _tpc_conditions_collection_name;
128 
131  std::string _tpc_section_name;
132 
135  bool _primary_drift_section;
136 
139  double _omega_tau;
140 
143  double _drift_velocity;
144 
148  double _longitudinal_diffusion;
149 
153  double _transverse_diffusion;
154 
158  double _tpc_outer_radius;
159 
163  double _tpc_inner_radius;
164 
168  double _section_outer_z;
169 
173  double _section_inner_z;
174 
178  bool _disable_magnetic_field;
179 
182  static gsl_odeiv_step *stepper;
183 
184  static gsl_odeiv_control *step_control;
185 
186  static gsl_odeiv_evolve *evolver;
187 };
188 
189 } // namespace marlintpc
190 
191 #endif // ELECTRONCLOUDDRIFTERPROCESSOR_H
Definition: ElectronCloudDrifterProcessor.h:109
static int ion_drift_derivative(double t, const double y[], double f[], void *params)
the derivative function used for the GSL ode solving function
Definition: ElectronCloudDrifterProcessor.cc:361
virtual void init()
Called at the begin of the job before anything is read.
Definition: ElectronCloudDrifterProcessor.cc:336
virtual void processRunHeader(lcio::LCRunHeader *run)
Called for every run.
Definition: ElectronCloudDrifterProcessor.cc:202
int _current_cloud
Number of the current cloud needed by AIDA.
Definition: ElectronCloudDrifterProcessor.h:87
~ElectronCloudDrifterProcessor()
destructor
Definition: ElectronCloudDrifterProcessor.cc:183
driftInfo * _info
Object used to store detailed drift information if AIDA is used.
Definition: ElectronCloudDrifterProcessor.h:115
ElectronCloudDrifterProcessor()
constructor
Definition: ElectronCloudDrifterProcessor.cc:70
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Definition: ElectronCloudDrifterProcessor.cc:215
virtual Processor * newProcessor()
used by Marlin to create a new processor
Definition: ElectronCloudDrifterProcessor.h:53
static int drift_through_cylinder(double(&)[4], const double min_radius, const double max_radius, const double min_z, const double max_z, const double drift_velocity, const double omega_tau, const bool disable_magnetic_field=false, marlintpc::ElectronCloudDrifterProcessor *processor=0)
the static drifting function that can be used by other processors (ie the LikelihoodFitter) ...
Definition: ElectronCloudDrifterProcessor.cc:416
virtual void check(lcio::LCEvent *evt)
Called after the event has been processed.
Definition: ElectronCloudDrifterProcessor.cc:350
virtual void end()
Called after data processing for clean up.
Definition: ElectronCloudDrifterProcessor.cc:355
Detailed information about the drift path.
Definition: ElectronCloudDrifterProcessor.h:99
ElectronCloudDrifterProcessor : This processor takes a collection of electron clouds from a previous ...
Definition: ElectronCloudDrifterProcessor.h:40