/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DetLatency.h
Go to the documentation of this file.
00001 /*****************************************
00002 
00003    Trigger latency calibration ammong detectors in EH
00004 
00005    Author: Zhimin 
00006    Date: June, 2011
00007 
00008 
00009 *****************************************/
00010 
00011 #ifndef _DETLATENCY_H_
00012 #define _DETLATENCY_H_
00013 
00014 #include "GaudiAlg/GaudiAlgorithm.h"
00015 #include "Conventions/Detectors.h"
00016 #include "Event/ReadoutHeader.h"
00017 #include "Event/CalibReadoutHeader.h"
00018 #include "DataSvc/ICableSvc.h"
00019 #include "DataSvc/IRunDataSvc.h"
00020 #include "TH1F.h"
00021 #include "TF1.h"
00022 #include "TFile.h"
00023 #include "TTree.h"
00024 #include <map>
00025 
00026 #include "GaudiKernel/NTuple.h"
00027 #include "Context/TimeStamp.h"
00028 #include "Conventions/DetectorId.h"
00029 #include "Event/JobInfo.h"
00030 #include "Conventions/JobId.h"
00031 #include "DataSvc/IJobInfoSvc.h"
00032 #include "Event/RecHeader.h"
00033 #include "Event/HeaderObject.h"
00034 #include "GaudiKernel/IDataProviderSvc.h"
00035 #include "DataUtilities/DybArchiveList.h"
00036 
00037 
00038 using namespace std;
00039 using namespace DayaBay;
00040 //using namespace DetectorId;
00041 
00042 class IDataProvider;
00043 class IJobInfoSvc;
00044 
00045 class DetLatency : public GaudiAlgorithm 
00046 {
00047 
00048  public:
00049   
00050   DetLatency(const std::string& name, ISvcLocator* pSvcLocator);
00051   virtual ~DetLatency();
00052   
00053   virtual StatusCode initialize();
00054   virtual StatusCode execute();
00055   virtual StatusCode finalize();
00056   
00057   void Fit();
00058 
00059   int InitPmtProp(const ServiceMode& svc);
00060   int ResetPmtProp();
00061 
00062  private:
00064   ICableSvc* m_cableSvc;
00065   IRunDataSvc* m_runDataSvc;
00066 
00067   TF1* f1;
00068   TF1 * f2;
00069   TF1 * f3;
00070   TF1 * f4;
00071   TF1 * f5;
00072   TF1 * f6;
00073   TF1 * f7;
00074   TFile* m_rootfile;
00075   TTree* m_tree;
00076   FILE* m_masterfile;
00077   string m_fileName;
00078   int   m_execNum;
00079 
00080   unsigned long m_NTrigger;
00081 
00082 // all relative to AD1
00083   int trigLatencyAD1Status;
00084   double trigLatencyAD1;
00085   double trigLatencyAD1Err;
00086   double trigLatencyAD1Sigma;
00087   double trigLatencyAD1SigmaErr;
00088   int trigLatencyAD2Status;
00089   double trigLatencyAD2;
00090   double trigLatencyAD2Err;
00091   double trigLatencyAD2Sigma;
00092   double trigLatencyAD2SigmaErr;
00093   int trigLatencyAD3Status;
00094   double trigLatencyAD3;
00095   double trigLatencyAD3Err;
00096   double trigLatencyAD3Sigma;
00097   double trigLatencyAD3SigmaErr;
00098   double trigLatencyAD4;
00099   int trigLatencyAD4Status;
00100   double trigLatencyAD4Err;
00101   double trigLatencyAD4Sigma;
00102   double trigLatencyAD4SigmaErr;
00103   int trigLatencyOWSStatus;
00104   double trigLatencyOWS;
00105   double trigLatencyOWSErr;
00106   double trigLatencyOWSSigma;
00107   double trigLatencyOWSSigmaErr;
00108   double trigLatencyIWS;
00109   int trigLatencyIWSStatus;
00110   double trigLatencyIWSErr;
00111   double trigLatencyIWSSigma;
00112   double trigLatencyIWSSigmaErr;
00113   int trigLatencyRPCStatus;
00114   double trigLatencyRPC;
00115   double trigLatencyRPCErr;
00116   double trigLatencyRPCSigma;
00117   double trigLatencyRPCSigmaErr;
00118 
00119   TH1F * h_TrigT_AD1;
00120   TH1F * h_TrigT_AD2;
00121   TH1F * h_TrigT_AD3;
00122   TH1F * h_TrigT_AD4;
00123   TH1F * h_TrigT_IWS;
00124   TH1F * h_TrigT_OWS;
00125   TH1F * h_TrigT_RPC;
00126 
00127   TH1F * h_TrigT_All;
00128   TH1F * h_CalibTrigT;
00129   TH1F * h_CalibTrigTErr;
00130   TH1F * h_CalibTrigTSigma;
00131   TH1F * h_CalibTrigTSigmaErr;
00132 
00133       IDataProviderSvc* p_archiveSvc;
00134     //IJobInfoSvc *m_jobInfoSvc;
00135 
00136 
00137   double m_Trig_Interval_Offset_ns;
00138   int m_AD_triger_time_sec;
00139   int m_AD_triger_time_nanosec;
00140 
00141   TimeStamp m_tagTimeStamp;
00142   TimeStamp m_tagTimeStamp_last;
00143   double m_StartTime;
00144   double m_EndTime;
00145 
00146 
00147   int m_Fix;
00148   int m_NStop;
00149   int m_FirstTrigSecond;
00150   int m_FirstTrigNanoSec;
00151   int m_LastTrigSecond;
00152   int m_LastTrigNanoSec;
00153   int m_startrun;
00154   int m_currentrun;
00155 
00156   int m_site;                   // Site determined by the first trigger 
00157   int m_simFlag;                // SimFlag determined by the first trigger
00158   double m_currentTime;         // Time of current trigger
00159   double m_prevTrigTime;        // Time of previous trigger
00160   double m_lastFitTime;         // Time when last fit occurs
00161   double m_fitPeriod;           // Fitting period in second
00162 };
00163 
00164 #endif  // _DETLATENCY_H_
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:09:25 for DetLatency by doxygen 1.7.4