Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:39

0001 /*
0002   Author:  Adam Hunt
0003   email:   ahunt@princeton.edu
0004   Date:    2007-08-25
0005 */
0006 
0007 #include "RecoLuminosity/TCPReceiver/interface/TCPReceiver.h"
0008 #include "RecoLuminosity/TCPReceiver/interface/LumiStructures.hh"
0009 
0010 #include <iostream>
0011 #include <signal.h>
0012 #include <cstdlib>
0013 
0014 int gContinue = 1;
0015 
0016 void CtrlC(int aSigNum) {
0017   std::cout << "Ctrl-c detected, stopping run" << std::endl;
0018   gContinue = 0;
0019 }
0020 
0021 int main() {
0022   HCAL_HLX::TCPReceiver HT;
0023   HCAL_HLX::LUMI_SECTION L;
0024 
0025   int errorCode;
0026 
0027   errorCode = HT.SetMode(0);
0028   std::cout << "SetMode: " << errorCode << std::endl;
0029   if (errorCode != 1)
0030     exit(1);
0031   errorCode = HT.SetPort(50002);
0032   std::cout << "SetPort: " << errorCode << std::endl;
0033   if (errorCode != 1)
0034     exit(1);
0035 
0036   while (gContinue) {
0037     if (!HT.IsConnected()) {
0038       errorCode = HT.Connect();
0039       std::cout << "Connect: " << errorCode << std::endl;
0040       if (errorCode != 1)
0041         exit(1);
0042     }
0043 
0044     errorCode = HT.ReceiveLumiSection(L);
0045     std::cout << "ReceiveLumiSection(): " << errorCode << std::endl;
0046 
0047     HT.VerifyFakeData(L);
0048 
0049     if (errorCode != 1)
0050       exit(1);
0051   }
0052   return 0;
0053 }