15 #include "FairRootManager.h"
17 #include "FairEventHeader.h"
21 #include "TClonesArray.h"
23 #include "TGeoManager.h"
36 double lambda_um_sq = lambda_um*lambda_um;
37 return sqrt( coeff[0]/(1.0-(coeff[3]/lambda_um_sq)) + coeff[1]/(1.0-(coeff[4]/lambda_um_sq)) + coeff[2]/(1.0-(coeff[5]/lambda_um_sq)) + 1.0);
45 ,pde_interpolator(0,
ROOT::Math::Interpolation::kLINEAR)
52 array =
new TClonesArray(
"PndDiscDigitizedHit");
82 FairRootManager* io_manager = FairRootManager::Instance();
85 LOG(FATAL) <<
"FairRootManager instance is NULL !!!";
93 LOG(ERROR) <<
"Branch "<<
branch_name_mc_point.Data() <<
" is not accessible through FairRootManager.";
113 LOG(ERROR) <<
"GetObject(\"DiscParticleMCPoint\") returned NULL";
126 double pde_wl_nm[74] =
204 double pde_efficiency[74] =
298 FairEventHeader* event_header = (FairEventHeader*)FairRootManager::Instance()->GetObject(
"EventHeader.");
299 Int_t input_file_id = event_header->GetInputFileId();
310 Double_t sellmeier_coeff [6] = {0.473115591, 0.631038719, 0.906404498, 0.012995717, 0.0041280992, 98.7685322};
315 for(i=0; i<n_mc_points; i++)
318 Double_t photon_momentum =
sqrt( (mc_point->GetPx()*mc_point->GetPx()) + (mc_point->GetPy()*mc_point->GetPy()) + (mc_point->GetPz()*mc_point->GetPz()));
322 Double_t reflection_probability = 1. - pow(4.*
TMath::Pi()*rms_roughness_nm * sin_iref_angle * rindex/wavelength_nm, 2);
325 Int_t n_reflections = (Int_t)(mc_point->GetLength()*sin_iref_angle/radiator_thickness);
326 if( gRandom->Uniform(1.0) > pow( reflection_probability, n_reflections) )
continue;
332 double absolute_time = mc_point->GetTime() + FairRootManager::Instance()->GetEventTime();
336 int pixel_id =
photo_detector->
Detect(mc_point->GetX(), mc_point->GetY(), absolute_time, wavelength_nm, pixel_info, tdc_time_ns);
337 if( pixel_id < 0)
continue;
339 tdc_time_ns = (floor(tdc_time_ns/binning_ns) + 0.5) * binning_ns;
347 Int_t copy_number = mc_point->GetDetectorID();
348 div_t
res = div(copy_number, 27);
349 Int_t detector_id = res.quot;
350 Int_t readout_id = res.rem;
354 LOG(FATAL) <<
"gGeoManager is NULL - cannot retrieve geo information !!!";
358 detector_id, readout_id, readout_id*3 + 3-pixel_info.column_on_grid, pixel_info.pixel_number,
359 pixel_info.row_on_grid, hit_z, tdc_time_ns, absolute_time, classifier);
372 for(i=0; i<n_mc_points; i++)
379 Double_t particle_tof = particle_mc_point->GetTime();
380 particle_mc_point->SetTime(particle_tof + FairRootManager::Instance()->GetEventTime());
virtual void FinishEvent()
std::set< int > particle_types
virtual void Print(std::ostream &out=std::cout)
Double_t n_phase_sellmeier(Double_t *coeff, Double_t lambda_um)
virtual void Exec(Option_t *opt)
friend F32vec4 sqrt(const F32vec4 &a)
DiscDIRC_Photodetector * photo_detector
friend F32vec4 sin(const F32vec4 &a)
FairWriteoutBuffer * writeout_buffer
particle types to filter in output
TString branch_name_mc_point
Branch name where mc points were stored.
TString folder_name_digits
Folder name for output in root file.
void SetPDE(int n_entries, const double *wavelength_nm, const double *pde)
TGeoManager * gGeoManager
Int_t mc_point_branch_id
Cache branch id of the mc point branch for linking with FairLink.
virtual InitStatus Init()
virtual void FinishTask()
TClonesArray * tclarr_particle_tracks_out
PndDiscTaskDigitization()
virtual bool PixelToPosition(PixelInfo &pixel_info, double &x, double &y) const =0
void FilterParticleSpecies(Int_t pdg)
TString branch_name_digits
Branch name where digitized hits shall be stored.
const Double_t & GetTotalReflectionAngle()
FairMCPoint forces the implementation.
virtual InitStatus ReInit()
const SensorGridBase * GetGrid()
virtual ~PndDiscTaskDigitization()
int Detect(double const &hit_pos_x, double const &hit_pos_y, double const &hit_time_ns, double const &wavelength_nm, PixelInfo &pixel_info, double &smeared_time_ns) const
Handle photon detection:
TClonesArray * tclarr_mc_points
TClonesArray * tclarr_particle_tracks_in
to cache the pointer to input TClonesArray returned by IO manager.