All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
include/N3AnaBase/measurements/tof_reflect_measurement.h
00001 #ifndef __N3AnaBase__tof_reflect_measurement_h
00002 #define __N3AnaBase__tof_reflect_measurement_h 1
00003 
00004 #include <string>
00005 #include <sstream>
00006 
00007 #include <datatools/utils/properties.h>
00008 
00009 #include <N3AnaBase/event/ana_event.h>
00010 
00011 // include common utilities:
00012 #include <N3AnaBase/measurements/tof_tools.h>
00013 
00014 namespace nemo3 {
00016 
00037   class tof_reflect_measurement : public ana_event::i_measurement
00038     {
00039 
00040     private:
00041       bool        __absolute;           
00042       bool        __extern;             
00043       bool        __debug;              
00044       double      __min_prob;           
00045       double      __min_E;              
00046       std::string __tracking_name;      
00047       std::string __required_channel;   
00048       ana_event * __event;              
00049       tof_tools   __tof_tools;          
00050       bool        __associated;         
00051       bool        __nodb4simu;          
00052       std::list<int> __prestarts;       
00053       std::list<int> __poststarts;      
00054 
00055     public:
00056 
00057       tof_reflect_measurement (); 
00058       tof_reflect_measurement (bool debug_); 
00059 
00060       ~tof_reflect_measurement (); //<! default destructor
00061 
00062     public:
00063 
00064       void set_debug     (bool debug_); 
00065       void set_absolute  (bool absolute_) {__absolute=absolute_;} 
00066       void set_extern    (bool extern_) {__extern=extern_;}       
00067       void set_nodb4simu (bool nodb4simu_);         
00068       void set_ECorr     (bool energy_loss_);       
00069       void set_TimeErr   (bool timeerr_);           
00070       void set_LTFluct   (bool fluct_);             
00071       void set_prestart  (std::list<int> &starts_); 
00072       void set_poststart (std::list<int> &starts_); 
00073       void set_prestart  (int start_) {__prestarts.push_back (start_);}    
00074       void set_poststart (int start_) {__poststarts.push_back (start_);}   
00075       void flush_starts  () {__prestarts.clear (); __poststarts.clear ();} 
00076 
00077       void       set_Emin       (double E_) {__min_E=E_;} 
00078       double     get_Emin       () {return __min_E;} 
00079       void       set_associated (bool); 
00080       void       set_prob_min   (double prob_) {__min_prob=prob_;}
00081       tof_tools& get_tof_tools   () {return __tof_tools;} 
00082 
00084 
00085       void do_measurement (ana_event &);
00087       void init_from (const datatools::utils::properties &);
00088 
00089     protected:
00090 
00091       void _compute_tof (); 
00092 
00093       //gamma tracking tools
00094 
00095     public:
00096 
00097       static double get_energy (const gamma_tracking::ref_t&, ana_event&); 
00098       static void merge_starts (gamma_tracking::refcoll_t&); //merge every gamma_tracking::ref_t of a gamma_tracking::refcoll_t
00099       static gamma_tracking::refcoll_t get_full_gt
00100       (
00101        const ana_event &ev_, double gt_prob_=0.01,
00102        bool electron_gamma_=true, bool vertex_gamma_=true,
00103        double internal_=0.01, double external_=0.01
00104        );
00106   };
00107 
00108 } // end of namespace nemo3
00109 
00110 #endif // __N3AnaBase__tof_reflect_measurement_h
00111 
00112 // end of tof_reflect_measurement.h