// $Id: Detector.cc,v 1.4 2005/05/08 21:02:44 thea Exp $
// Author: A.Thea 2004/12/07
/*****************************************************************************
* ESAF: Euso Simulation and Analysis Framework *
* *
* Id: Detector *
* Package: <packagename> *
* Coordinator: <coordinator> *
* *
*****************************************************************************/
//_____________________________________________________________________________
//
// Detector
//
// <extensive class description>
//
// Config file parameters
// ======================
//
// <parameter name>: <parameter description>
// -Valid options: <available options>
//
#include "Detector.hh"
#include "Photon.hh"
#include "PhotonsOnPupil.hh"
#include "EEvent.hh"
#include "EDetectorPhotonAdder.hh"
ClassImp(Detector)
ClassImp(TestDetector)
//_____________________________________________________________________________
Detector::Detector() {
//
// Constructor
//
}
//_____________________________________________________________________________
Detector::~Detector() {
//
// Destructor
//
}
//_____________________________________________________________________________
TestDetector::TestDetector() {
//
// Constructor
//
}
//_____________________________________________________________________________
TestDetector::~TestDetector() {
//
// Destructor
//
}
//______________________________________________________________________________
Telemetry* TestDetector::Get( PhotonsOnPupil* pupil ) {
//
// Simulate one event and return a pointer to a Telemetry object
//
if ( !pupil ) {
MsgForm(EsafMsg::Warning,"PhotonsOnPupil is NULL. Photon tracing disabled.");
return NULL;
}
Photon* p = 0;
EEvent *ev = EEvent::GetCurrent();
Int_t nTracked=0, nTotal(pupil->GetNphotons());
Msg(EsafMsg::Info) << "Tracking Photons: " << MsgFlush;
while( (p = pupil->Get()) ) {
if (ev) {
EDetectorPhotonAdder a(p,0,kTRUE);
ev->Fill(a);
}
// update display
if ( nTracked*50 % nTotal == 0 || (nTracked-1)*50 % nTotal > nTracked*50 % nTotal )
if ( nTracked*10 % nTotal == 0 || (nTracked-1)*10 % nTotal > nTracked*10 % nTotal ){
Msg(EsafMsg::Info) << Form("%d",nTracked*100/nTotal) << '%'<< MsgFlush;
}
else
Msg(EsafMsg::Info) << "." << MsgFlush;
nTracked++;
}
Msg(EsafMsg::Info) << " -done" << MsgDispatch;
return NULL;
}