Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

FluxSvc Class Reference

Service that implements the IFluxSvc interface, to return an IFlux object. FluxSvc handles the creation and interfacing with Flux objects. More...

Inheritance diagram for FluxSvc:

Inheritance graph
[legend]
Collaboration diagram for FluxSvc:

Collaboration graph
[legend]
List of all members.

Public Member Functions

StatusCode source (std::string name, IFlux *&)
 return pointer to a flux object

StatusCode compositeSource (std::vector< std::string > names, IFlux *&flux)
 set pointer to a flux object, constructed from set of names

std::list< std::string > fluxNames () const
 return a list of possible names

virtual void addFactory (std::string name, const ISpectrumFactory *factory)
 add a new SpectrumFactory

virtual void pass (double t)
 pass a specific amount of time

virtual CLHEP::HepRandomEngine * getRandomEngine ()
 return pointer to the random engine that FluxSvc uses

virtual void rootDisplay (std::vector< std::string > arguments)
 create a set of display windows using rootplot.

void attachGpsObserver (Observer *anObserver)
 attach an external observer to GPS

IFluxcurrentFlux ()
 return the pointer to the current IFlux object

std::string fluxName () const
 name of the flux

void setPointingDirection (const astro::SkyDir &dir)
 set the pointing direction

std::pair< double, double > getExplicitRockingAngles ()
 get the angular values of the satellite

CLHEP::HepRotation transformGlastToGalactic (double time) const
 this transforms glast-local (cartesian) vectors into galactic (cartesian) vectors

CLHEP::HepRotation transformToGlast (double seconds, GPS::CoordSystem index) const
 get the angular values of the satellite

std::pair< double, double > location ()
 get the current satellite location

GPS * GPSinstance ()
 return pointer to our GPS instance

std::string uniqueIDString () const
 return a string which uniquely identifies the source

std::vector< double > setRockType (astro::GPS::RockType rockType, double rockAngle=35.)
 Set the satellite rocking mode: 0=NONE, 1=UPDOWN(up in the northern hemisphere, down in the southern, 2=SLEWING(like updown, but not discontinuous at the equator), 3=ONEPERORBIT (rock norh one orbit, south the next, 4=EXPLICIT (use the internal rotangles rotation angles (this should be set through setOrientation)).

std::vector< std::pair< std::string,
std::list< std::string > > > 
sourceOriginList () const
 this should return the source file names, along with the contained sources.

bool insideSAA ()
 return current SAA status

virtual StatusCode run ()
 for the IRunnable interfce

double endruntime ()
 access the end of run time

virtual void setFilterCone (std::vector< double > cone)
 set filter cone parameters (ra, dec, radius)

virtual void setAlignmentRotation (double qx, double qy, double qz, bool misalign)
 set aligmnment for Glast.

virtual void setSAABoundary (const std::vector< std::pair< double, double > > &boundary)
 set the SAA boundary

virtual StatusCode initialize ()
 perform initializations for this service.

virtual StatusCode finalize ()
 perform the finalization, as required for a service.

virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 Query interface.


Protected Member Functions

 FluxSvc (const std::string &name, ISvcLocator *al)
 Standard Constructor.

virtual ~FluxSvc ()
 destructor


Private Member Functions

int askGPS ()

Private Attributes

IParticlePropertySvc * m_partSvc
FluxMgr * m_fluxMgr
std::vector< std::string > m_source_lib
 the user-defined list of acceptable XML sources (from JobOptions.txt)

std::string m_source_lib_default
 the default XML file name (from JobOptions.txt)

std::string m_dtd_file
 set dtd to use.

IFluxm_currentFlux
 the "current" flux object

IAppMgrUI * m_appMgrUI
 Reference to application manager UI.

IntegerProperty m_evtMax
FluxSvc::Times m_times
ObserverAdapter< FluxSvcm_observer
bool m_insideSAA
DoubleProperty m_expansionFactor
DoubleProperty m_sampleInterval
DoubleProperty m_orbitInclination
DoubleArrayProperty m_SAA_poly_lat
DoubleArrayProperty m_SAA_poly_lon
StringProperty m_xmlFiles
BooleanProperty m_aberrate

Friends

class SvcFactory< FluxSvc >
 Allow SvcFactory to instantiate the service.


Detailed Description

Service that implements the IFluxSvc interface, to return an IFlux object. FluxSvc handles the creation and interfacing with Flux objects.

Author:
Toby Burnett tburnett@u.washington.edu
Header
/nfs/slac/g/glast/ground/cvs/FluxSvc/src/FluxSvc.cxx,v 1.111 2008/07/21 15:17:28 glastrm Exp

Definition at line 73 of file FluxSvc.cxx.


Constructor & Destructor Documentation

FluxSvc::FluxSvc const std::string &  name,
ISvcLocator *  al
[protected]
 

Standard Constructor.

Definition at line 315 of file FluxSvc.cxx.

References m_aberrate, FluxSvc::Times::m_deltaTime, m_dtd_file, FluxSvc::Times::m_endTime, m_evtMax, FluxSvc::Times::m_launchDate, m_orbitInclination, m_SAA_poly_lat, m_SAA_poly_lon, m_sampleInterval, m_source_lib, FluxSvc::Times::m_startDate, FluxSvc::Times::m_startTime, FluxSvc::Times::m_startTimeEnvVar, m_times, and m_xmlFiles.

00316 : Service(name,svc), m_currentFlux(0), m_insideSAA(false)
00317 {
00318 
00319     declareProperty("source_lib" , m_source_lib); 
00320     declareProperty("dtd_file"   , m_dtd_file=default_dtd_file);
00321     declareProperty("EvtMax"     , m_evtMax=0);
00322 
00323     declareProperty("StartTime"   , m_times.m_startTime=0);
00324     declareProperty("EndTime"     , m_times.m_endTime=0);
00325     declareProperty("DeltaTime"   , m_times.m_deltaTime=0);
00326     declareProperty("StartDate"   , m_times.m_startDate="");
00327     declareProperty("LaunchDate"  , m_times.m_launchDate="");
00328     declareProperty("StartTimeEnvVar", m_times.m_startTimeEnvVar="");
00329     declareProperty("SampleInterval", m_sampleInterval=1.0);
00330     declareProperty("OrbitInclination", m_orbitInclination=25.3);
00331 
00332     declareProperty("SAApolyLat"  , m_SAA_poly_lat);
00333     declareProperty("SAApolyLon"  , m_SAA_poly_lon);
00334     declareProperty("xmlListFile"    , m_xmlFiles="");
00335     declareProperty("EnableAberration", m_aberrate=false);
00336 
00337 }

FluxSvc::~FluxSvc  )  [protected, virtual]
 

destructor

Definition at line 362 of file FluxSvc.cxx.

00363 {
00364 }


Member Function Documentation

void FluxSvc::addFactory std::string  name,
const ISpectrumFactory factory
[virtual]
 

add a new SpectrumFactory

Implements IFluxSvc.

Definition at line 564 of file FluxSvc.cxx.

References m_fluxMgr.

00564                                                                         {
00565     m_fluxMgr->addFactory(name, factory);
00566 }

int FluxSvc::askGPS  )  [private]
 

Definition at line 513 of file FluxSvc.cxx.

References m_insideSAA.

Referenced by initialize().

00514 {
00515     astro::EarthCoordinate pos = GPS::instance()->earthpos();
00516     bool inside = pos.insideSAA();
00517 
00518     double curtime = GPS::instance()->time();
00519 
00520     if( m_insideSAA == inside) return 0; // no change
00521 
00522     MsgStream log( msgSvc(), name() );
00523     log << MSG::INFO;
00524     std::stringstream t;
00525         t<< (!inside? " leaving" : "entering") 
00526         << " SAA at "  << std::setprecision(10)<< curtime;
00527     log << t.str()    << endreq;
00528     m_insideSAA = inside;
00529 
00530     return 0; // can't be void in observer pattern
00531 }

void FluxSvc::attachGpsObserver Observer *  anObserver  )  [virtual]
 

attach an external observer to GPS

Implements IFluxSvc.

Definition at line 579 of file FluxSvc.cxx.

Referenced by initialize().

00580 {
00581     GPS::instance()->notification().attach( anObserver );
00582     GPS::instance()->notifyObservers(); // make sure everyone notified as observers are attached?
00583 }

StatusCode FluxSvc::compositeSource std::vector< std::string >  names,
IFlux *&  flux
[virtual]
 

set pointer to a flux object, constructed from set of names

Implements IFluxSvc.

Definition at line 355 of file FluxSvc.cxx.

References IFlux::currentEvent(), and m_currentFlux.

00355                                                                             {
00356     flux =  new Flux(names);
00357     if( flux->currentEvent()==0) return StatusCode::FAILURE;
00358     m_currentFlux = flux;    
00359     return StatusCode::SUCCESS;
00360 }

IFlux * FluxSvc::currentFlux  )  [virtual]
 

return the pointer to the current IFlux object

Implements IFluxSvc.

Definition at line 591 of file FluxSvc.cxx.

References m_currentFlux.

00591                            {
00592     return m_currentFlux;
00593 }

double FluxSvc::endruntime  )  [virtual]
 

access the end of run time

Implements IFluxSvc.

Definition at line 636 of file FluxSvc.cxx.

References FluxSvc::Times::end(), and m_times.

00636                            {
00637     return m_times.end() ;
00638 }

StatusCode FluxSvc::finalize  )  [virtual]
 

perform the finalization, as required for a service.

Definition at line 540 of file FluxSvc.cxx.

References m_fluxMgr.

00541 {
00542     StatusCode  status = StatusCode::SUCCESS;
00543 
00544     delete m_fluxMgr;
00545     return status;
00546 }

std::string FluxSvc::fluxName  )  const [virtual]
 

name of the flux

Implements IFluxSvc.

Definition at line 596 of file FluxSvc.cxx.

00596                                 {
00597     return m_currentFlux->name();
00598 }

std::list< std::string > FluxSvc::fluxNames  )  const [virtual]
 

return a list of possible names

Implements IFluxSvc.

Definition at line 339 of file FluxSvc.cxx.

Referenced by source().

00339                                           {
00340     return m_fluxMgr->sourceList();
00341 }

std::pair<double,double> FluxSvc::getExplicitRockingAngles  ) 
 

get the angular values of the satellite

CLHEP::HepRandomEngine * FluxSvc::getRandomEngine  )  [virtual]
 

return pointer to the random engine that FluxSvc uses

Implements IFluxSvc.

Definition at line 535 of file FluxSvc.cxx.

00535                                               {
00536     return  CLHEP::HepRandom::getTheEngine();
00537 };

GPS * FluxSvc::GPSinstance  )  [virtual]
 

return pointer to our GPS instance

Implements IFluxSvc.

Definition at line 587 of file FluxSvc.cxx.

00587 { return GPS::instance();}

StatusCode FluxSvc::initialize  )  [virtual]
 

perform initializations for this service.

Definition at line 366 of file FluxSvc.cxx.

References askGPS(), attachGpsObserver(), FluxSvc::Times::initialize(), IRegisterSource::interfaceID(), FluxSvc::Times::launch(), m_aberrate, m_appMgrUI, m_dtd_file, m_expansionFactor, m_fluxMgr, m_observer, m_orbitInclination, m_partSvc, m_SAA_poly_lat, m_SAA_poly_lon, m_sampleInterval, m_source_lib, m_times, m_xmlFiles, and IRegisterSource::registerMe().

00367 {   
00368     StatusCode  status =  Service::initialize ();
00369 
00370     // bind all of the properties for this service
00371     setProperties ();
00372 
00373 
00374     // open the message log
00375     MsgStream log( msgSvc(), name() );
00376 
00377     // set orbit properties: needs to be done before EarthOrbit object gets created by GPS
00378     astro::EarthOrbit::set_inclination(m_orbitInclination);
00379 
00380 
00381     m_times.initialize(log);
00382 
00383     // set starting, or "launch" time for easy access by sources
00384     Spectrum::setStartTime(m_times.launch());
00385 
00386 
00387     status = serviceLocator()->queryInterface(IID_IAppMgrUI, (void**)&m_appMgrUI);
00388 
00389     // parse file with source library entries (consistent with obssim)
00390     if( !m_xmlFiles.value().empty() ) {
00391 
00392         std::string xmlFiles(m_xmlFiles.value() );
00393         facilities::Util::expandEnvVar(&xmlFiles);
00394         std::ifstream xmls(xmlFiles.c_str());
00395         if( !xmls.is_open() ){
00396             throw std::invalid_argument("File not found: " + xmlFiles);
00397         }
00398         while( ! xmls.eof()){
00399             std::string line; std::getline(xmls, line);
00400             if( line.empty() || line[0]=='#' ) continue; 
00401             m_source_lib.push_back(line);
00402         }
00403     }
00404 
00405     // If source library was not set, put in default
00406     if( m_source_lib.empty() ){
00407         m_source_lib.push_back(default_source_library);
00408         log << MSG::INFO << "Set source library list to " << default_source_library << endreq;
00409     }
00410 
00411     try {
00412         // create a FluxMgr object which will then be available.
00413         m_fluxMgr = new FluxMgr(m_source_lib, m_dtd_file);
00414     }catch(...){
00415         return StatusCode::FAILURE;
00416     }
00417 
00418     Flux::mgr(m_fluxMgr); // tell our Flux object
00419 
00420     // check that it was made properly
00421     if( m_fluxMgr->sourceList().empty()) {
00422         log << MSG::ERROR  << "Did not initialize properly: no sources detected" << endreq;
00423         status = StatusCode::FAILURE;
00424     }
00425 
00426     m_fluxMgr->setExpansion(m_expansionFactor);
00427 
00428     if ( service("ParticlePropertySvc", m_partSvc).isFailure() ){
00429         log << MSG::ERROR << "Couldn't find the ParticlePropertySvc!" << endreq;
00430         return StatusCode::FAILURE;
00431     }
00432 
00433     log << MSG::INFO << "Registering factories external to flux: ";
00434     SpectrumFactoryLoader externals;
00435     std::vector<std::string> flux_names(externals.names());
00436 
00437     std::copy( flux_names.begin(), flux_names.end(), 
00438         std::ostream_iterator<std::string>(log.stream(), ", "));
00439     log  << endreq;
00440 
00441     size_t nsaa =m_SAA_poly_lat.value().size();
00442     if( nsaa>0) {
00443         if( m_SAA_poly_lon.value().size() != nsaa ){
00444             log << MSG::ERROR <<"sizes of SAA arrays do not match"<< endreq;
00445             return StatusCode::FAILURE;
00446         }
00447         std::vector<std::pair<double,double> > saa_array;
00448         for( size_t i = 0; i< nsaa; ++i){
00449             saa_array.push_back( std::make_pair(m_SAA_poly_lat.value()[i], m_SAA_poly_lon.value()[i]) );
00450         }
00451         astro::EarthCoordinate::setSAAboundary( saa_array);
00452     }
00453 
00454 
00455     if( m_aberrate ){
00456         log << MSG::INFO << "Enabled generation of stellar aberration" << endreq;
00457     }
00458     astro::GPS::instance()->enableAberration(m_aberrate.value());
00459 
00460 
00461     //----------------------------------------------------------------
00462     // most of  the following cribbed from ToolSvc and ObjManager
00463 
00464     // look for a factory of an AlgTool that implements the IRegisterSource interface:
00465     // if found, make one and call the special method  
00466 
00467     // Manager of the AlgTool Objects
00468     IObjManager* objManager=0;             
00469 
00470     // locate Object Manager to locate later the tools 
00471     status = serviceLocator()->service("ApplicationMgr", objManager );
00472     if( status.isFailure()) {
00473         log << MSG::ERROR << "Unable to locate ObjectManager Service" << endreq;
00474         return status;
00475     }
00476 
00477     IToolFactory* toolfactory = 0;
00478     
00479     // search throught all objects (factories?)
00480     for(IObjManager::ObjIterator it = objManager->objBegin(); it !=objManager->objEnd(); ++ it){
00481 
00482         std::string tooltype= (*it)->ident();
00483         // is it a tool factory?
00484         const IFactory* factory = objManager->objFactory( tooltype );
00485         IFactory* fact = const_cast<IFactory*>(factory);
00486         status = fact->queryInterface( IID_IToolFactory, (void**)&toolfactory );
00487         if( status.isSuccess() ) {
00488 
00489             IAlgTool* itool = toolfactory->instantiate(name()+"."+tooltype,  this );
00490             IRegisterSource* ireg;
00491             status =itool->queryInterface( IRegisterSource::interfaceID(), (void**)&ireg);
00492             if( status.isSuccess() ){
00493                 log << MSG::INFO << "Registering sources in " << tooltype << endreq;
00494                 ireg->registerMe(this);
00495             }
00496             log << MSG::DEBUG << "Releasing the tool " << tooltype << endreq;
00497             itool->release();
00498         }
00499 
00500     }
00501 
00502     // attach an observer to be notified when orbital position changes
00503     // set callback to be notified when the position changes
00504     m_observer.setAdapter( new ActionAdapter<FluxSvc>
00505         (this, &FluxSvc::askGPS) );
00506 
00507     attachGpsObserver(&m_observer);
00508 
00509     astro::GPS::instance()->sampleintvl(m_sampleInterval.value()); // set sample interval for position updates
00510     return StatusCode::SUCCESS;
00511 }

bool FluxSvc::insideSAA  )  [inline, virtual]
 

return current SAA status

Implements IFluxSvc.

Definition at line 142 of file FluxSvc.cxx.

References m_insideSAA.

00142 { return m_insideSAA;}

std::pair< double, double > FluxSvc::location  )  [virtual]
 

get the current satellite location

Implements IFluxSvc.

Definition at line 624 of file FluxSvc.cxx.

References m_fluxMgr.

00624                                         {
00625     return m_fluxMgr->location();
00626 }

void FluxSvc::pass double  t  )  [virtual]
 

pass a specific amount of time

Implements IFluxSvc.

Definition at line 570 of file FluxSvc.cxx.

References m_fluxMgr.

00570                             {
00571     m_fluxMgr->pass(t);
00572 }

StatusCode FluxSvc::queryInterface const InterfaceID &  riid,
void **  ppvUnknown
[virtual]
 

Query interface.

Definition at line 549 of file FluxSvc.cxx.

00549                                                                                 {
00550     if ( IID_IFluxSvc.versionMatch(riid) )  {
00551         *ppvInterface = (IFluxSvc*)this;
00552     }else if (IID_IRunable.versionMatch(riid) ) {
00553         *ppvInterface = (IRunable*)this;
00554     } else  {
00555         return Service::queryInterface(riid, ppvInterface);
00556     }
00557 
00558     addRef();
00559     return SUCCESS;
00560 }

void FluxSvc::rootDisplay std::vector< std::string >  arguments  )  [virtual]
 

create a set of display windows using rootplot.

Implements IFluxSvc.

Definition at line 574 of file FluxSvc.cxx.

References m_fluxMgr.

00574                                                        {
00575     rootplot abc(arguments, m_fluxMgr);   
00576 }

StatusCode FluxSvc::run  )  [virtual]
 

for the IRunnable interfce

time stamp for progress messages

Definition at line 641 of file FluxSvc.cxx.

References FluxSvc::Times::current(), FluxSvc::Times::end(), FluxSvc::Times::launch(), m_appMgrUI, m_evtMax, m_times, and FluxSvc::Times::start().

00641                        {
00642     StatusCode status = StatusCode::FAILURE;
00643     MsgStream log( msgSvc(), name() );
00644 
00645     if ( 0 == m_appMgrUI )  return status; 
00646 
00647     IProperty* propMgr=0;
00648     status = serviceLocator()->service("ApplicationMgr", propMgr );
00649     if( status.isFailure()) {
00650         log << MSG::ERROR << "Unable to locate PropertyManager Service" << endreq;
00651         return status;
00652     }
00653 
00654     IntegerProperty evtMax("EvtMax",0);
00655     status = propMgr->getProperty( &evtMax );
00656     if (status.isFailure()) return status;
00657 
00658     setProperty(evtMax);
00659 
00660     // now find the top alg so we can monitor its error count
00661     //
00662     IAlgManager* theAlgMgr;
00663     status = serviceLocator( )->getService( "ApplicationMgr",
00664         IID_IAlgManager,
00665         (IInterface*&)theAlgMgr );
00666     IAlgorithm* theIAlg;
00667     Algorithm*  theAlgorithm=0;
00668     IntegerProperty errorProperty("ErrorCount",0);
00669 
00670     status = theAlgMgr->getAlgorithm( "Top", theIAlg );
00671     if ( status.isSuccess( ) ) {
00672         try{
00673             theAlgorithm = dynamic_cast<Algorithm*>(theIAlg);
00674         } catch(...){
00675             status = StatusCode::FAILURE;
00676         }
00677     }
00678     if ( status.isFailure( ) ) {
00679         log << MSG::WARNING << "Could not find algorithm 'Top'; will not monitor errors" << endreq;
00680     }
00681 
00682 
00683     // loop over the events
00684     int eventNumber= 0;
00685     
00686     // access the starting time from the job properties
00687     { bool noend=true;
00688     log << MSG::INFO << "Runable interface starting event loop as :" ; 
00689     if( m_evtMax>0)  { log << " MaxEvt = " << m_evtMax; noend=false;  }
00690     if( m_times.start()>0) { log << " StartTime= launch+" << m_times.start() -m_times.launch(); }
00691     if( m_times.end()>0  ) { log << " EndTime=launch+ " << m_times.end()-m_times.launch(); noend=false; }
00692     log << endreq;
00693 
00694     if(noend) { 
00695         log << MSG::ERROR<< "No end condition specified: will not process any events!" << endreq; 
00696         return StatusCode::FAILURE;
00697     }
00698     }
00699     if( m_times.end()>0 && m_times.start() > m_times.end()){
00700         log << MSG::ERROR << "Start time after end time!" << endreq;
00701         return StatusCode::FAILURE;
00702     }
00703     int last_fraction=0;
00704 
00705     GPS::instance()->notifyObservers(); // make sure all are in the
00706 
00707     // loop: will quit if either limit is set, and exceeded
00708     bool first(true);
00709     while( (m_evtMax==0  || m_evtMax>0 &&  eventNumber < m_evtMax)
00710         && (m_times.end()==0 || m_times.end()>0 && m_times.current() < m_times.end()) ) {
00711 
00712             double efrac =   (m_evtMax>0? 100.*eventNumber/m_evtMax: 0.0), 
00713                 tfrac =   (m_times.end()>0? 100.*(m_times.current()-m_times.start())/(m_times.end()-m_times.start()) : 0.0) ;
00714 
00715             int percent_complete= static_cast<int>(  std::max( efrac, tfrac)  );
00716             if( percent_complete!=last_fraction){
00717                 last_fraction=percent_complete;
00718                 if( percent_complete<10 || percent_complete%10 ==0 || first){
00719                     first = false;
00720 
00722                     facilities::Timestamp tstamp;
00723                     
00724                     log << MSG::INFO 
00725                         << " [" << tstamp.getString() << "]  "
00726                         <<  std::setprecision(12)<< std::resetiosflags(4096) // scientific??
00727                         << percent_complete << "% complete: "
00728                         << " event "<< eventNumber<<",  time= " 
00729                         <<  m_times.current() << "= launch+ "
00730                         << (m_times.current()-m_times.launch()) << endreq;
00731                 }
00732 
00733             }
00734 
00735             status =  m_appMgrUI->nextEvent(1); // currently, always success
00736 
00737             // the single event may have created a failure. Check the ErrorCount propery of the Top alg.
00738             if( theAlgorithm !=0) theAlgorithm->getProperty(&errorProperty);
00739             if( status.isFailure() || errorProperty.value() > 0){
00740                 status = StatusCode::FAILURE;
00741             }
00742 
00743             if( status.isFailure()) break;
00744             eventNumber ++;
00745         }
00746         if( status.isFailure()){
00747             log << MSG::ERROR << "Terminating FluxSvc loop due to error" << endreq;
00748 
00749         }else if( m_times.end()>0 && m_times.current() >= m_times.end() ) {
00750             log << MSG::INFO << "Loop terminated by time " << endreq;
00751         }else {
00752             log << MSG::INFO << "Processing loop terminated by event count" << endreq;
00753         }
00754         log << MSG::INFO << "End after "<< eventNumber << " events, time = " << m_times.current() << endreq;
00755         return status;
00756     }

void FluxSvc::setAlignmentRotation double  qx,
double  qy,
double  qz,
bool  misalign
[virtual]
 

set aligmnment for Glast.

Parameters:
qx,qy,qz x, y, z rotation angles (radians) asssumed small
misalign [false] set true to apply as a misalignment

Implements IFluxSvc.

Definition at line 758 of file FluxSvc.cxx.

References m_fluxMgr.

00759     {
00760         m_fluxMgr->setAlignmentRotation(qx, qy, qz, misalign);
00761     }

void FluxSvc::setFilterCone std::vector< double >  cone  )  [virtual]
 

set filter cone parameters (ra, dec, radius)

Implements IFluxSvc.

Definition at line 764 of file FluxSvc.cxx.

References m_fluxMgr.

00765     {
00766         assert( cone.size()>2); // assume this already checked
00767         m_fluxMgr->setFilterCone(cone[0], cone[1], cone[2]);
00768     }

void FluxSvc::setPointingDirection const astro::SkyDir &  dir  )  [virtual]
 

set the pointing direction

Implements IFluxSvc.

Definition at line 608 of file FluxSvc.cxx.

00608                                                         {
00609     astro::GPS::instance()->setPointingDirection(dir);
00610 }

std::vector< double > FluxSvc::setRockType astro::GPS::RockType  rockType,
double  rockAngle = 35.
[virtual]
 

Set the satellite rocking mode: 0=NONE, 1=UPDOWN(up in the northern hemisphere, down in the southern, 2=SLEWING(like updown, but not discontinuous at the equator), 3=ONEPERORBIT (rock norh one orbit, south the next, 4=EXPLICIT (use the internal rotangles rotation angles (this should be set through setOrientation)).

5 = POINT: Explicit pointing direction given - setExplicitRockingAngles are (l,b). 6 = HISTORY - Filename given to stand for a pre-recorded pointing history. Use the setPointingHistoryFile function.

Implements IFluxSvc.

Definition at line 628 of file FluxSvc.cxx.

References m_fluxMgr.

00628                                                                                  {
00629     return m_fluxMgr->setRockType(rockType, rockAngle);
00630 }

void FluxSvc::setSAABoundary const std::vector< std::pair< double, double > > &  boundary  )  [virtual]
 

set the SAA boundary

Parameters:
boundard set of (lat, lon) pairs of the polygon

Implements IFluxSvc.

Definition at line 772 of file FluxSvc.cxx.

00773     {
00774     }

StatusCode FluxSvc::source std::string  name,
IFlux *& 
[virtual]
 

return pointer to a flux object

Implements IFluxSvc.

Definition at line 343 of file FluxSvc.cxx.

References fluxNames(), and m_currentFlux.

00343                                                        {
00344     std::list<std::string> source_list( fluxNames() );
00345     std::list<std::string> source_list2( SpectrumFactoryTable::instance()->spectrumList() );
00346 
00347     if( std::find(source_list.begin(), source_list.end(), name) == source_list.end() 
00348         &&(std::find(source_list2.begin(), source_list2.end(), name) == source_list2.end()))
00349         return StatusCode::FAILURE;
00350     flux =  new Flux(name);
00351     m_currentFlux = flux;    
00352     return StatusCode::SUCCESS;
00353 }

std::vector< std::pair< std::string,std::list< std::string > > > FluxSvc::sourceOriginList  )  const [virtual]
 

this should return the source file names, along with the contained sources.

Implements IFluxSvc.

Definition at line 632 of file FluxSvc.cxx.

References m_fluxMgr.

00632                                                                                     {
00633     return m_fluxMgr->sourceOriginList();
00634 }

CLHEP::HepRotation FluxSvc::transformGlastToGalactic double  time  )  const [virtual]
 

this transforms glast-local (cartesian) vectors into galactic (cartesian) vectors

Implements IFluxSvc.

Definition at line 620 of file FluxSvc.cxx.

00620                                                                   {
00621     return transformToGlast(time, GPS::CELESTIAL).inverse();
00622 }

CLHEP::HepRotation FluxSvc::transformToGlast double  seconds,
GPS::CoordSystem  index
const
 

get the angular values of the satellite

Definition at line 616 of file FluxSvc.cxx.

00616                                                                                 {
00617     return m_fluxMgr->transformToGlast(time,index);
00618 }

std::string FluxSvc::uniqueIDString  )  const
 

return a string which uniquely identifies the source

Definition at line 601 of file FluxSvc.cxx.

00601                                       {
00602     std::stringstream t;
00603     t << m_currentFlux->numSource();
00604     return m_currentFlux->name() + t.str();
00605 }


Friends And Related Function Documentation

friend class SvcFactory< FluxSvc > [friend]
 

Allow SvcFactory to instantiate the service.

Definition at line 188 of file FluxSvc.cxx.


Member Data Documentation

BooleanProperty FluxSvc::m_aberrate [private]
 

Definition at line 298 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

IAppMgrUI* FluxSvc::m_appMgrUI [private]
 

Reference to application manager UI.

Definition at line 203 of file FluxSvc.cxx.

Referenced by initialize(), and run().

IFlux* FluxSvc::m_currentFlux [private]
 

the "current" flux object

Definition at line 199 of file FluxSvc.cxx.

Referenced by compositeSource(), currentFlux(), and source().

std::string FluxSvc::m_dtd_file [private]
 

set dtd to use.

Definition at line 197 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

IntegerProperty FluxSvc::m_evtMax [private]
 

Definition at line 204 of file FluxSvc.cxx.

Referenced by FluxSvc(), and run().

DoubleProperty FluxSvc::m_expansionFactor [private]
 

Definition at line 291 of file FluxSvc.cxx.

Referenced by initialize().

FluxMgr* FluxSvc::m_fluxMgr [private]
 

Definition at line 190 of file FluxSvc.cxx.

Referenced by addFactory(), finalize(), initialize(), location(), pass(), rootDisplay(), setAlignmentRotation(), setFilterCone(), setRockType(), and sourceOriginList().

bool FluxSvc::m_insideSAA [private]
 

Definition at line 289 of file FluxSvc.cxx.

Referenced by askGPS(), and insideSAA().

ObserverAdapter< FluxSvc > FluxSvc::m_observer [private]
 

Definition at line 287 of file FluxSvc.cxx.

Referenced by initialize().

DoubleProperty FluxSvc::m_orbitInclination [private]
 

Definition at line 293 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

IParticlePropertySvc* FluxSvc::m_partSvc [private]
 

Definition at line 185 of file FluxSvc.cxx.

Referenced by initialize().

DoubleArrayProperty FluxSvc::m_SAA_poly_lat [private]
 

Definition at line 295 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

DoubleArrayProperty FluxSvc::m_SAA_poly_lon [private]
 

Definition at line 296 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

DoubleProperty FluxSvc::m_sampleInterval [private]
 

Definition at line 292 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

std::vector<std::string> FluxSvc::m_source_lib [private]
 

the user-defined list of acceptable XML sources (from JobOptions.txt)

Definition at line 193 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().

std::string FluxSvc::m_source_lib_default [private]
 

the default XML file name (from JobOptions.txt)

Definition at line 195 of file FluxSvc.cxx.

class FluxSvc::Times FluxSvc::m_times [private]
 

Referenced by endruntime(), FluxSvc(), initialize(), and run().

StringProperty FluxSvc::m_xmlFiles [private]
 

Definition at line 297 of file FluxSvc.cxx.

Referenced by FluxSvc(), and initialize().


The documentation for this class was generated from the following file:
Generated on Wed Nov 26 20:29:33 2008 by doxygen 1.3.3