source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/detector/optics/src/FastDetectorTransportManager.cc @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 2.0 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: FastDetectorTransportManager.cc 2804 2008-10-09 12:10:06Z biktem $
3// M. Pallavicini created Apr, 27 2003
4
5#include "FastDetectorTransportManager.hh"
6#include "EEvent.hh"
7#include "PhotonsOnPupil.hh"
8#include "Photomultiplier.hh"
9#include "EusoDetector.hh"
10#include "EusoElectronics.hh"
11#include "EDetectorPhotonAdder.hh"
12
13ClassImp(FastDetectorTransportManager)
14
15// ctor
16FastDetectorTransportManager::FastDetectorTransportManager() : DetectorTransportManager() {
17}
18
19// dtor
20FastDetectorTransportManager::~FastDetectorTransportManager() {
21}
22
23// nothing to draw in this case
24void
25FastDetectorTransportManager::Draw() const {
26}
27
28// fast transport
29// each photon is brought directly to the chief ray pixel of the optics
30// no tracking inside detector
31// it behaves like an ideal optics module
32void
33FastDetectorTransportManager::Go( PhotonsOnPupil* pupil ) {
34    while ( Photon *p = pupil->GetPhoton() ) {
35        Transport( p );
36    }
37}
38
39Photon* FastDetectorTransportManager::Transport( Photon* p ) const {
40
41    EEvent *ev = EEvent::GetCurrent();
42    if ( p && ev ) {
43        EDetectorPhotonAdder a(p,0,true); // fill root event with initial infos
44        ev->Fill( a );
45    }
46    // search for right Pmt and fill it
47    FillPmt( *p );
48
49    return 0;
50}
51
52// mapping photon to the right PMT
53void FastDetectorTransportManager::FillPmt( Photon& photon ) const {
54
55    // get photon theta
56    double th = photon.dir.Theta();
57
58    // compute theta bin
59    int iTheta = (int) (GetNumThBins() * ( 6.* th / 3.14159265359 ));
60
61    // get photon Phi
62    double ph = photon.dir.Phi();
63
64    // compute phi bin
65    int iPhi = (int) (GetNumPhBins(iTheta) * ( ph / 2.*3.14159265359 ));
66
67    // get channel id
68    int chid = GetUId( iTheta, iPhi );
69
70    if ( GetEusoDetector() ) {
71        Photomultiplier *pPmt = gEusoElectronics->PmtId( chid );
72        if ( pPmt ) {
73            pPmt->Add( photon );
74        }
75    }
76    else {
77        throw runtime_error("Undefined Euso Detector");
78    }
79    // FIXME: need to get position from pmt and fill root file with final photon position
80}
Note: See TracBrowser for help on using the repository browser.