#ifndef __RDTOOLS_H #define __RDTOOLS_H #include #include "IoSd.h" #include "HdTools.h" #include #include #include #include #include #include #include #include #include "TGraph.h" using namespace std; void SetROut(std::string &fileName, const std::string &year, const std::string &month, const std::string &day, const int & verbose, const std::string prefix ); #define PRODVERSION "v1r0" static const double NANOSECIN_SEC = 1000000000; static const int NANOSECIN_MICROSEC = 1000; static const int COINC_INTERVALL_NANOSEC = 500000; static const double COINCOFFSET = 136000; static const double COINCOFFSETAERA = 1; static const double COINCWINDOW = 40000; static const double COINCWINDOWAERA = 45000; /*Maximun filename size */ static const int RD_MAXFILENAMESIZE = 4096; /*Maximum and minimun time differences between T3s*/ static const int RD_MAXTIMEDIFF = 500; static const int RD_MINTIMEDIFF = 120; /* Root dir where files will be written */ //static string RDMDIR("/Raid/data/Rdm"); /* To control time */ volatile static bool keepTucking(true); #endif bool RadioFileOpen(const char *filename); vector BuildSortedEventList( const char *filename, vector &vEntryInTree ); void fTest( AERAevent AEvent ); bool fCheckDateRange ( TTree* IOLibTree, vector &vCandidates, int iNrOfRadioCandidates, RadioFileIO* RadioFileIORead, IoSdT3Trigger &sdtrig, int verbose ); bool fReachedEndOfRadioList ( vector &vCandidates, int iCurrentRdCtr ); void fWriteEvent( int rdobserver, bool MatchFound, int radioradioMerging, bool MatchFoundRRM, AugerFile& outputXrd, AugerEvent &eventAd ); int fCheckCoincidences( AERAevent AEvent, AugerEvent &eventAd, int verbose, int counter2, vector vAugerKeys ); int fCheckCoincidencesRRM( AERAevent AEvent, AugerEvent &eventAd, unsigned int iSDTrigSecond, unsigned int iSDTrigMicroSecond, unsigned int iFDTrigSecond, unsigned int iFDTrigNanoSecond, double dRDSDDiff, double dRDFDDiff, int iCurrentRdCtr, int verbose, string rdFileNametxtMatched ); void fCalcDistance( AERAevent AEvent, AugerEvent &eventAd, vector &vRadioStationId, vector &vRadioStationNorthing, vector &vRadioStationEasting, vector &vRDSDMinDistance, vector < vector < int > > &vAllSDMinDistance, int iMatchCounter ); void fGetRadioStationCoord( vector &vRadioStationId, vector &vRadioStationNorthing, vector &vRadioStationEasting ); void fNotMatched( AERAevent AEvent, string Reason, string rdmFileNametxtNotMatched ); int fCheckMatched( vector &vCandidates, vector &vMatched, TTree* IOLibTree, RadioFileIO* RadioFileIORead, string rdmFileName, string logFileName ); void fCheckSDFD(); void fMergeRadioRadio ( AERAevent &AEvent, AERAevent AEventRRM ); void fSetRadioNewEventType( AERAevent &AEvent, vector vNewEvtTypes, int iCurrentRdCtr ); bool fCheckForMultipleRadioEvents( TTree* IOLibTree, RadioFileIO* RadioFileIORead, vector &vSortedEventTimes, int i, vector &vEvtTypesStore, vector &vEntryInTree ); double fCalcRdEventsDiff( TTree* IOLibTree, vector &vCandidates, int iCurrentRdCtr, RadioFileIO* RadioFileIORead ); double fCalcRdSdDiff( TTree* IOLibTree, vector &vCandidates, int iCurrentRdCtr, RadioFileIO* RadioFileIORead, IoSdT3Trigger &sdtrig ); double fCalcRdFdDiff( TTree* IOLibTree, vector &vCandidates, int iCurrentRdCtr, RadioFileIO* RadioFileIORead, const unsigned int iFDTrigSecond, const unsigned int iFDTrigNanoSecond ); void fWriteOutRDTSInfo( string rdFileNametxt, TTree* IOLibTree, vector &vCandidates, RadioFileIO* RadioFileIORead ); void fWriteOutSDTSInfo( AugerFile& inputAd, AugerEvent &eventAd, int verbose, int fdonly, string adFileNametxt );