CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
RPCFw Class Reference

#include <RPCFw.h>

Inheritance diagram for RPCFw:
RPCDBCom

Public Member Functions

std::vector< RPCObFebmap::Feb_ItemcreateFEB (long long since, long long till)
 
std::vector< RPCObGas::ItemcreateGAS (long long since, long long till)
 
std::vector< RPCObPVSSmap::ItemcreateIDMAP ()
 
std::vector< RPCObImon::I_ItemcreateIMON (long long since, long long till)
 
std::vector< RPCObGasMix::ItemcreateMix (long long since, long long till)
 
std::vector< RPCObStatus::S_ItemcreateSTATUS (long long since, long long till)
 
std::vector< RPCObTemp::T_ItemcreateT (long long since, long long till)
 
std::vector< RPCObUXC::ItemcreateUXC (long long since, long long till)
 
std::vector< RPCObVmon::V_ItemcreateVMON (long long from, long long till)
 
bool isMajor (const coral::TimeStamp &fir, const coral::TimeStamp &sec)
 
 RPCFw (const std::string &connectionString, const std::string &userName, const std::string &password)
 
void run () override
 
unsigned long long TtoUT (const coral::TimeStamp &time)
 
coral::TimeStamp UTtoT (long long utime)
 
 ~RPCFw () override
 
- Public Member Functions inherited from RPCDBCom
 RPCDBCom ()
 
void setVerbosityLevel (coral::MsgLevel level)
 
virtual ~RPCDBCom ()
 

Public Attributes

unsigned long long N_IOV
 
coral::TimeStamp tMAX
 
coral::TimeStamp tMIN
 

Private Attributes

std::string m_connectionString
 
std::string m_password
 
std::string m_userName
 

Additional Inherited Members

- Protected Member Functions inherited from RPCDBCom
coral::ISession * connect (const std::string &connectionString, const std::string &userName, const std::string &password)
 

Detailed Description

Definition at line 29 of file RPCFw.h.

Constructor & Destructor Documentation

◆ RPCFw()

RPCFw::RPCFw ( const std::string &  connectionString,
const std::string &  userName,
const std::string &  password 
)

◆ ~RPCFw()

RPCFw::~RPCFw ( )
override

Definition at line 33 of file RPCFw.cc.

33 {}

Member Function Documentation

◆ createFEB()

std::vector< RPCObFebmap::Feb_Item > RPCFw::createFEB ( long long  since,
long long  till 
)

Definition at line 635 of file RPCFw.cc.

635  {
636  tMIN = UTtoT(since);
637  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
638  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
639 
640  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
641  session->transaction().start(true);
642  coral::ISchema& schema = session->nominalSchema();
643  std::cout << ">> creating FEB object..." << std::endl;
644 
645  // VTH1
646  coral::IQuery* queryFVTH1 = schema.newQuery();
647  queryFVTH1->addToTableList("RPCFEB");
648  queryFVTH1->addToOutputList("RPCFEB.DPID", "DPID");
649  queryFVTH1->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
650  queryFVTH1->addToOutputList("RPCFEB.VTH1", "VTH1");
651 
652  // VTH2
653  coral::IQuery* queryFVTH2 = schema.newQuery();
654  queryFVTH2->addToTableList("RPCFEB");
655  queryFVTH2->addToOutputList("RPCFEB.DPID", "DPID");
656  queryFVTH2->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
657  queryFVTH2->addToOutputList("RPCFEB.VTH2", "VTH2");
658 
659  // VTH3
660  coral::IQuery* queryFVTH3 = schema.newQuery();
661  queryFVTH3->addToTableList("RPCFEB");
662  queryFVTH3->addToOutputList("RPCFEB.DPID", "DPID");
663  queryFVTH3->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
664  queryFVTH3->addToOutputList("RPCFEB.VTH3", "VTH3");
665 
666  // VTH4
667  coral::IQuery* queryFVTH4 = schema.newQuery();
668  queryFVTH4->addToTableList("RPCFEB");
669  queryFVTH4->addToOutputList("RPCFEB.DPID", "DPID");
670  queryFVTH4->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
671  queryFVTH4->addToOutputList("RPCFEB.VTH4", "VTH4");
672 
673  // VMON1
674  coral::IQuery* queryFVMON1 = schema.newQuery();
675  queryFVMON1->addToTableList("RPCFEB");
676  queryFVMON1->addToOutputList("RPCFEB.DPID", "DPID");
677  queryFVMON1->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
678  queryFVMON1->addToOutputList("RPCFEB.VMON1", "VMON1");
679 
680  // VMON2
681  coral::IQuery* queryFVMON2 = schema.newQuery();
682  queryFVMON2->addToTableList("RPCFEB");
683  queryFVMON2->addToOutputList("RPCFEB.DPID", "DPID");
684  queryFVMON2->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
685  queryFVMON2->addToOutputList("RPCFEB.VMON2", "VMON2");
686 
687  // VMON3
688  coral::IQuery* queryFVMON3 = schema.newQuery();
689  queryFVMON3->addToTableList("RPCFEB");
690  queryFVMON3->addToOutputList("RPCFEB.DPID", "DPID");
691  queryFVMON3->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
692  queryFVMON3->addToOutputList("RPCFEB.VMON3", "VMON3");
693 
694  // VMON4
695  coral::IQuery* queryFVMON4 = schema.newQuery();
696  queryFVMON4->addToTableList("RPCFEB");
697  queryFVMON4->addToOutputList("RPCFEB.DPID", "DPID");
698  queryFVMON4->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
699  queryFVMON4->addToOutputList("RPCFEB.VMON4", "VMON4");
700 
701  // TEMP1
702  coral::IQuery* queryFTEMP1 = schema.newQuery();
703  queryFTEMP1->addToTableList("RPCFEB");
704  queryFTEMP1->addToOutputList("RPCFEB.DPID", "DPID");
705  queryFTEMP1->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
706  queryFTEMP1->addToOutputList("RPCFEB.TEMPERATURE1", "TEMP1");
707 
708  // TEMP2
709  coral::IQuery* queryFTEMP2 = schema.newQuery();
710  queryFTEMP2->addToTableList("RPCFEB");
711  queryFTEMP2->addToOutputList("RPCFEB.DPID", "DPID");
712  queryFTEMP2->addToOutputList("RPCFEB.CHANGE_DATE", "TSTAMP");
713  queryFTEMP2->addToOutputList("RPCFEB.TEMPERATURE2", "TEMP2");
714 
715  RPCObFebmap::Feb_Item Itemp;
716  std::vector<RPCObFebmap::Feb_Item> febarray;
717  coral::TimeStamp tlast = tMIN;
718  if (till > since) {
719  tMAX = UTtoT(till);
720  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
721  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
722  std::cout << "Processing VTH1..." << std::endl;
723  coral::AttributeList conditionData;
724  conditionData.extend<coral::TimeStamp>("tmin");
725  conditionData.extend<coral::TimeStamp>("tmax");
726  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
727  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
728  std::string conditionVTH1 = "RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
729  queryFVTH1->setCondition(conditionVTH1, conditionData);
730  coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
731  while (cursorFVTH1.next()) {
732  Itemp.thr1 = 0;
733  Itemp.thr2 = 0;
734  Itemp.thr3 = 0;
735  Itemp.thr4 = 0;
736  Itemp.vmon1 = 0;
737  Itemp.vmon2 = 0;
738  Itemp.vmon3 = 0;
739  Itemp.vmon4 = 0;
740  Itemp.temp1 = 0;
741  Itemp.temp2 = 0;
742  Itemp.noise1 = 0;
743  Itemp.noise2 = 0;
744  Itemp.noise3 = 0;
745  Itemp.noise4 = 0;
746  const coral::AttributeList& row = cursorFVTH1.currentRow();
747  float idoub = row["DPID"].data<float>();
748  int id = static_cast<int>(idoub);
749  float vth1 = row["VTH1"].data<float>();
750  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
751  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
752  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
753  Itemp.dpid = id;
754  Itemp.thr1 = vth1;
755  Itemp.day = ndate;
756  Itemp.time = ntime;
757  febarray.push_back(Itemp);
758  }
759  } else {
760  std::cout << ">> Processing VTH1..." << std::endl;
761  coral::AttributeList conditionData;
762  conditionData.extend<coral::TimeStamp>("tmin");
763  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
764  std::string conditionVTH1 = "RPCFEB.VTH1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
765  queryFVTH1->setCondition(conditionVTH1, conditionData);
766  coral::ICursor& cursorFVTH1 = queryFVTH1->execute();
767  while (cursorFVTH1.next()) {
768  Itemp.thr1 = 0;
769  Itemp.thr2 = 0;
770  Itemp.thr3 = 0;
771  Itemp.thr4 = 0;
772  Itemp.vmon1 = 0;
773  Itemp.vmon2 = 0;
774  Itemp.vmon3 = 0;
775  Itemp.vmon4 = 0;
776  Itemp.temp1 = 0;
777  Itemp.temp2 = 0;
778  Itemp.noise1 = 0;
779  Itemp.noise2 = 0;
780  Itemp.noise3 = 0;
781  Itemp.noise4 = 0;
782  const coral::AttributeList& row = cursorFVTH1.currentRow();
783  float idoub = row["DPID"].data<float>();
784  int id = static_cast<int>(idoub);
785  float vth1 = row["VTH1"].data<float>();
786  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
787  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
788  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
789  Itemp.dpid = id;
790  Itemp.thr1 = vth1;
791  Itemp.day = ndate;
792  Itemp.time = ntime;
793  febarray.push_back(Itemp);
794  }
795  }
796 
797  if (till > since) {
798  tMAX = UTtoT(till);
799  std::cout << "Processing VTH2..." << std::endl;
800  coral::AttributeList conditionData;
801  conditionData.extend<coral::TimeStamp>("tmin");
802  conditionData.extend<coral::TimeStamp>("tmax");
803  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
804  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
805  std::string conditionVTH2 = "RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
806  queryFVTH2->setCondition(conditionVTH2, conditionData);
807  coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
808  while (cursorFVTH2.next()) {
809  Itemp.thr1 = 0;
810  Itemp.thr2 = 0;
811  Itemp.thr3 = 0;
812  Itemp.thr4 = 0;
813  Itemp.vmon1 = 0;
814  Itemp.vmon2 = 0;
815  Itemp.vmon3 = 0;
816  Itemp.vmon4 = 0;
817  Itemp.temp1 = 0;
818  Itemp.temp2 = 0;
819  Itemp.noise1 = 0;
820  Itemp.noise2 = 0;
821  Itemp.noise3 = 0;
822  Itemp.noise4 = 0;
823  const coral::AttributeList& row = cursorFVTH2.currentRow();
824  float idoub = row["DPID"].data<float>();
825  int id = static_cast<int>(idoub);
826  float vth2 = row["VTH2"].data<float>();
827  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
828  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
829  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
830  Itemp.dpid = id;
831  Itemp.thr2 = vth2;
832  Itemp.day = ndate;
833  Itemp.time = ntime;
834  febarray.push_back(Itemp);
835  }
836  } else {
837  std::cout << ">> Processing VTH2..." << std::endl;
838  coral::AttributeList conditionData;
839  conditionData.extend<coral::TimeStamp>("tmin");
840  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
841  std::string conditionVTH2 = "RPCFEB.VTH2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
842  queryFVTH2->setCondition(conditionVTH2, conditionData);
843  coral::ICursor& cursorFVTH2 = queryFVTH2->execute();
844  while (cursorFVTH2.next()) {
845  Itemp.thr1 = 0;
846  Itemp.thr2 = 0;
847  Itemp.thr3 = 0;
848  Itemp.thr4 = 0;
849  Itemp.vmon1 = 0;
850  Itemp.vmon2 = 0;
851  Itemp.vmon3 = 0;
852  Itemp.vmon4 = 0;
853  Itemp.temp1 = 0;
854  Itemp.temp2 = 0;
855  Itemp.noise1 = 0;
856  Itemp.noise2 = 0;
857  Itemp.noise3 = 0;
858  Itemp.noise4 = 0;
859  const coral::AttributeList& row = cursorFVTH2.currentRow();
860  float idoub = row["DPID"].data<float>();
861  int id = static_cast<int>(idoub);
862  float vth2 = row["VTH2"].data<float>();
863  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
864  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
865  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
866  Itemp.dpid = id;
867  Itemp.thr2 = vth2;
868  Itemp.day = ndate;
869  Itemp.time = ntime;
870  febarray.push_back(Itemp);
871  }
872  }
873 
874  if (till > since) {
875  tMAX = UTtoT(till);
876  std::cout << "Processing VTH3..." << std::endl;
877  coral::AttributeList conditionData;
878  conditionData.extend<coral::TimeStamp>("tmin");
879  conditionData.extend<coral::TimeStamp>("tmax");
880  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
881  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
882  std::string conditionVTH3 = "RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
883  queryFVTH3->setCondition(conditionVTH3, conditionData);
884  coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
885  while (cursorFVTH3.next()) {
886  Itemp.thr1 = 0;
887  Itemp.thr2 = 0;
888  Itemp.thr3 = 0;
889  Itemp.thr4 = 0;
890  Itemp.vmon1 = 0;
891  Itemp.vmon2 = 0;
892  Itemp.vmon3 = 0;
893  Itemp.vmon4 = 0;
894  Itemp.temp1 = 0;
895  Itemp.temp2 = 0;
896  Itemp.noise1 = 0;
897  Itemp.noise2 = 0;
898  Itemp.noise3 = 0;
899  Itemp.noise4 = 0;
900  const coral::AttributeList& row = cursorFVTH3.currentRow();
901  float idoub = row["DPID"].data<float>();
902  int id = static_cast<int>(idoub);
903  float vth3 = row["VTH3"].data<float>();
904  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
905  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
906  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
907  Itemp.dpid = id;
908  Itemp.thr3 = vth3;
909  Itemp.day = ndate;
910  Itemp.time = ntime;
911  febarray.push_back(Itemp);
912  }
913  } else {
914  std::cout << ">> Processing VTH3..." << std::endl;
915  coral::AttributeList conditionData;
916  conditionData.extend<coral::TimeStamp>("tmin");
917  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
918  std::string conditionVTH3 = "RPCFEB.VTH3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
919  queryFVTH3->setCondition(conditionVTH3, conditionData);
920  coral::ICursor& cursorFVTH3 = queryFVTH3->execute();
921  while (cursorFVTH3.next()) {
922  Itemp.thr1 = 0;
923  Itemp.thr2 = 0;
924  Itemp.thr3 = 0;
925  Itemp.thr4 = 0;
926  Itemp.vmon1 = 0;
927  Itemp.vmon2 = 0;
928  Itemp.vmon3 = 0;
929  Itemp.vmon4 = 0;
930  Itemp.temp1 = 0;
931  Itemp.temp2 = 0;
932  Itemp.noise1 = 0;
933  Itemp.noise2 = 0;
934  Itemp.noise3 = 0;
935  Itemp.noise4 = 0;
936  const coral::AttributeList& row = cursorFVTH3.currentRow();
937  float idoub = row["DPID"].data<float>();
938  int id = static_cast<int>(idoub);
939  float vth3 = row["VTH3"].data<float>();
940  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
941  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
942  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
943  Itemp.dpid = id;
944  Itemp.thr3 = vth3;
945  Itemp.day = ndate;
946  Itemp.time = ntime;
947  febarray.push_back(Itemp);
948  }
949  }
950 
951  if (till > since) {
952  tMAX = UTtoT(till);
953  std::cout << "Processing VTH4..." << std::endl;
954  coral::AttributeList conditionData;
955  conditionData.extend<coral::TimeStamp>("tmin");
956  conditionData.extend<coral::TimeStamp>("tmax");
957  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
958  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
959  std::string conditionVTH4 = "RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
960  queryFVTH4->setCondition(conditionVTH4, conditionData);
961  coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
962  while (cursorFVTH4.next()) {
963  Itemp.thr1 = 0;
964  Itemp.thr2 = 0;
965  Itemp.thr3 = 0;
966  Itemp.thr4 = 0;
967  Itemp.vmon1 = 0;
968  Itemp.vmon2 = 0;
969  Itemp.vmon3 = 0;
970  Itemp.vmon4 = 0;
971  Itemp.temp1 = 0;
972  Itemp.temp2 = 0;
973  Itemp.noise1 = 0;
974  Itemp.noise2 = 0;
975  Itemp.noise3 = 0;
976  Itemp.noise4 = 0;
977  const coral::AttributeList& row = cursorFVTH4.currentRow();
978  float idoub = row["DPID"].data<float>();
979  int id = static_cast<int>(idoub);
980  float vth4 = row["VTH4"].data<float>();
981  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
982  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
983  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
984  Itemp.dpid = id;
985  Itemp.thr4 = vth4;
986  Itemp.day = ndate;
987  Itemp.time = ntime;
988  febarray.push_back(Itemp);
989  }
990  } else {
991  std::cout << ">> Processing VTH4..." << std::endl;
992  coral::AttributeList conditionData;
993  conditionData.extend<coral::TimeStamp>("tmin");
994  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
995  std::string conditionVTH4 = "RPCFEB.VTH4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
996  queryFVTH4->setCondition(conditionVTH4, conditionData);
997  coral::ICursor& cursorFVTH4 = queryFVTH4->execute();
998  while (cursorFVTH4.next()) {
999  Itemp.thr1 = 0;
1000  Itemp.thr2 = 0;
1001  Itemp.thr3 = 0;
1002  Itemp.thr4 = 0;
1003  Itemp.vmon1 = 0;
1004  Itemp.vmon2 = 0;
1005  Itemp.vmon3 = 0;
1006  Itemp.vmon4 = 0;
1007  Itemp.temp1 = 0;
1008  Itemp.temp2 = 0;
1009  Itemp.noise1 = 0;
1010  Itemp.noise2 = 0;
1011  Itemp.noise3 = 0;
1012  Itemp.noise4 = 0;
1013  const coral::AttributeList& row = cursorFVTH4.currentRow();
1014  float idoub = row["DPID"].data<float>();
1015  int id = static_cast<int>(idoub);
1016  float vth4 = row["VTH4"].data<float>();
1017  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1018  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1019  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1020  Itemp.dpid = id;
1021  Itemp.thr4 = vth4;
1022  Itemp.day = ndate;
1023  Itemp.time = ntime;
1024  febarray.push_back(Itemp);
1025  }
1026  }
1027 
1028  if (till > since) {
1029  tMAX = UTtoT(till);
1030  std::cout << "Processing VMON1..." << std::endl;
1031  coral::AttributeList conditionData;
1032  conditionData.extend<coral::TimeStamp>("tmin");
1033  conditionData.extend<coral::TimeStamp>("tmax");
1034  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1035  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1036  std::string conditionVMON1 = "RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1037  queryFVMON1->setCondition(conditionVMON1, conditionData);
1038  coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1039  while (cursorFVMON1.next()) {
1040  Itemp.thr1 = 0;
1041  Itemp.thr2 = 0;
1042  Itemp.thr3 = 0;
1043  Itemp.thr4 = 0;
1044  Itemp.vmon1 = 0;
1045  Itemp.vmon2 = 0;
1046  Itemp.vmon3 = 0;
1047  Itemp.vmon4 = 0;
1048  Itemp.temp1 = 0;
1049  Itemp.temp2 = 0;
1050  Itemp.noise1 = 0;
1051  Itemp.noise2 = 0;
1052  Itemp.noise3 = 0;
1053  Itemp.noise4 = 0;
1054  const coral::AttributeList& row = cursorFVMON1.currentRow();
1055  float idoub = row["DPID"].data<float>();
1056  int id = static_cast<int>(idoub);
1057  float vmon1 = row["VMON1"].data<float>();
1058  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1059  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1060  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1061  Itemp.dpid = id;
1062  Itemp.vmon1 = vmon1;
1063  Itemp.day = ndate;
1064  Itemp.time = ntime;
1065  febarray.push_back(Itemp);
1066  }
1067  } else {
1068  std::cout << ">> Processing VMON1..." << std::endl;
1069  coral::AttributeList conditionData;
1070  conditionData.extend<coral::TimeStamp>("tmin");
1071  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1072  std::string conditionVMON1 = "RPCFEB.VMON1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1073  queryFVMON1->setCondition(conditionVMON1, conditionData);
1074  coral::ICursor& cursorFVMON1 = queryFVMON1->execute();
1075  while (cursorFVMON1.next()) {
1076  Itemp.thr1 = 0;
1077  Itemp.thr2 = 0;
1078  Itemp.thr3 = 0;
1079  Itemp.thr4 = 0;
1080  Itemp.vmon1 = 0;
1081  Itemp.vmon2 = 0;
1082  Itemp.vmon3 = 0;
1083  Itemp.vmon4 = 0;
1084  Itemp.temp1 = 0;
1085  Itemp.temp2 = 0;
1086  Itemp.noise1 = 0;
1087  Itemp.noise2 = 0;
1088  Itemp.noise3 = 0;
1089  Itemp.noise4 = 0;
1090  const coral::AttributeList& row = cursorFVMON1.currentRow();
1091  float idoub = row["DPID"].data<float>();
1092  int id = static_cast<int>(idoub);
1093  float vmon1 = row["VMON1"].data<float>();
1094  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1095  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1096  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1097  Itemp.dpid = id;
1098  Itemp.vmon1 = vmon1;
1099  Itemp.day = ndate;
1100  Itemp.time = ntime;
1101  febarray.push_back(Itemp);
1102  }
1103  }
1104 
1105  if (till > since) {
1106  tMAX = UTtoT(till);
1107  std::cout << "Processing VMON2..." << std::endl;
1108  coral::AttributeList conditionData;
1109  conditionData.extend<coral::TimeStamp>("tmin");
1110  conditionData.extend<coral::TimeStamp>("tmax");
1111  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1112  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1113  std::string conditionVMON2 = "RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1114  queryFVMON2->setCondition(conditionVMON2, conditionData);
1115  coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1116  while (cursorFVMON2.next()) {
1117  Itemp.thr1 = 0;
1118  Itemp.thr2 = 0;
1119  Itemp.thr3 = 0;
1120  Itemp.thr4 = 0;
1121  Itemp.vmon1 = 0;
1122  Itemp.vmon2 = 0;
1123  Itemp.vmon3 = 0;
1124  Itemp.vmon4 = 0;
1125  Itemp.temp1 = 0;
1126  Itemp.temp2 = 0;
1127  Itemp.noise1 = 0;
1128  Itemp.noise2 = 0;
1129  Itemp.noise3 = 0;
1130  Itemp.noise4 = 0;
1131  const coral::AttributeList& row = cursorFVMON2.currentRow();
1132  float idoub = row["DPID"].data<float>();
1133  int id = static_cast<int>(idoub);
1134  float vmon2 = row["VMON2"].data<float>();
1135  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1136  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1137  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1138  Itemp.dpid = id;
1139  Itemp.vmon2 = vmon2;
1140  Itemp.day = ndate;
1141  Itemp.time = ntime;
1142  febarray.push_back(Itemp);
1143  }
1144  } else {
1145  std::cout << ">> Processing VMON2..." << std::endl;
1146  coral::AttributeList conditionData;
1147  conditionData.extend<coral::TimeStamp>("tmin");
1148  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1149  std::string conditionVMON2 = "RPCFEB.VMON2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1150  queryFVMON2->setCondition(conditionVMON2, conditionData);
1151  coral::ICursor& cursorFVMON2 = queryFVMON2->execute();
1152  while (cursorFVMON2.next()) {
1153  Itemp.thr1 = 0;
1154  Itemp.thr2 = 0;
1155  Itemp.thr3 = 0;
1156  Itemp.thr4 = 0;
1157  Itemp.vmon1 = 0;
1158  Itemp.vmon2 = 0;
1159  Itemp.vmon3 = 0;
1160  Itemp.vmon4 = 0;
1161  Itemp.temp1 = 0;
1162  Itemp.temp2 = 0;
1163  Itemp.noise1 = 0;
1164  Itemp.noise2 = 0;
1165  Itemp.noise3 = 0;
1166  Itemp.noise4 = 0;
1167  const coral::AttributeList& row = cursorFVMON2.currentRow();
1168  float idoub = row["DPID"].data<float>();
1169  int id = static_cast<int>(idoub);
1170  float vmon2 = row["VMON2"].data<float>();
1171  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1172  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1173  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1174  Itemp.dpid = id;
1175  Itemp.vmon2 = vmon2;
1176  Itemp.day = ndate;
1177  Itemp.time = ntime;
1178  febarray.push_back(Itemp);
1179  }
1180  }
1181 
1182  if (till > since) {
1183  tMAX = UTtoT(till);
1184  std::cout << "Processing VMON3..." << std::endl;
1185  coral::AttributeList conditionData;
1186  conditionData.extend<coral::TimeStamp>("tmin");
1187  conditionData.extend<coral::TimeStamp>("tmax");
1188  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1189  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1190  std::string conditionVMON3 = "RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1191  queryFVMON3->setCondition(conditionVMON3, conditionData);
1192  coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1193  while (cursorFVMON3.next()) {
1194  Itemp.thr1 = 0;
1195  Itemp.thr2 = 0;
1196  Itemp.thr3 = 0;
1197  Itemp.thr4 = 0;
1198  Itemp.vmon1 = 0;
1199  Itemp.vmon2 = 0;
1200  Itemp.vmon3 = 0;
1201  Itemp.vmon4 = 0;
1202  Itemp.temp1 = 0;
1203  Itemp.temp2 = 0;
1204  Itemp.noise1 = 0;
1205  Itemp.noise2 = 0;
1206  Itemp.noise3 = 0;
1207  Itemp.noise4 = 0;
1208  const coral::AttributeList& row = cursorFVMON3.currentRow();
1209  float idoub = row["DPID"].data<float>();
1210  int id = static_cast<int>(idoub);
1211  float vmon3 = row["VMON3"].data<float>();
1212  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1213  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1214  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1215  Itemp.dpid = id;
1216  Itemp.vmon3 = vmon3;
1217  Itemp.day = ndate;
1218  Itemp.time = ntime;
1219  febarray.push_back(Itemp);
1220  }
1221  } else {
1222  std::cout << ">> Processing VMON3..." << std::endl;
1223  coral::AttributeList conditionData;
1224  conditionData.extend<coral::TimeStamp>("tmin");
1225  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1226  std::string conditionVMON3 = "RPCFEB.VMON3 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1227  queryFVMON3->setCondition(conditionVMON3, conditionData);
1228  coral::ICursor& cursorFVMON3 = queryFVMON3->execute();
1229  while (cursorFVMON3.next()) {
1230  Itemp.thr1 = 0;
1231  Itemp.thr2 = 0;
1232  Itemp.thr3 = 0;
1233  Itemp.thr4 = 0;
1234  Itemp.vmon1 = 0;
1235  Itemp.vmon2 = 0;
1236  Itemp.vmon3 = 0;
1237  Itemp.vmon4 = 0;
1238  Itemp.temp1 = 0;
1239  Itemp.temp2 = 0;
1240  Itemp.noise1 = 0;
1241  Itemp.noise2 = 0;
1242  Itemp.noise3 = 0;
1243  Itemp.noise4 = 0;
1244  const coral::AttributeList& row = cursorFVMON3.currentRow();
1245  float idoub = row["DPID"].data<float>();
1246  int id = static_cast<int>(idoub);
1247  float vmon3 = row["VMON3"].data<float>();
1248  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1249  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1250  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1251  Itemp.dpid = id;
1252  Itemp.vmon3 = vmon3;
1253  Itemp.day = ndate;
1254  Itemp.time = ntime;
1255  febarray.push_back(Itemp);
1256  }
1257  }
1258 
1259  if (till > since) {
1260  tMAX = UTtoT(till);
1261  std::cout << "Processing VMON4..." << std::endl;
1262  coral::AttributeList conditionData;
1263  conditionData.extend<coral::TimeStamp>("tmin");
1264  conditionData.extend<coral::TimeStamp>("tmax");
1265  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1266  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1267  std::string conditionVMON4 = "RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1268  queryFVMON4->setCondition(conditionVMON4, conditionData);
1269  coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1270  while (cursorFVMON4.next()) {
1271  Itemp.thr1 = 0;
1272  Itemp.thr2 = 0;
1273  Itemp.thr3 = 0;
1274  Itemp.thr4 = 0;
1275  Itemp.vmon1 = 0;
1276  Itemp.vmon2 = 0;
1277  Itemp.vmon3 = 0;
1278  Itemp.vmon4 = 0;
1279  Itemp.temp1 = 0;
1280  Itemp.temp2 = 0;
1281  Itemp.noise1 = 0;
1282  Itemp.noise2 = 0;
1283  Itemp.noise3 = 0;
1284  Itemp.noise4 = 0;
1285  const coral::AttributeList& row = cursorFVMON4.currentRow();
1286  float idoub = row["DPID"].data<float>();
1287  int id = static_cast<int>(idoub);
1288  float vmon4 = row["VMON4"].data<float>();
1289  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1290  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1291  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1292  Itemp.dpid = id;
1293  Itemp.vmon4 = vmon4;
1294  Itemp.day = ndate;
1295  Itemp.time = ntime;
1296  febarray.push_back(Itemp);
1297  }
1298  } else {
1299  std::cout << ">> Processing VMON4..." << std::endl;
1300  coral::AttributeList conditionData;
1301  conditionData.extend<coral::TimeStamp>("tmin");
1302  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1303  std::string conditionVMON4 = "RPCFEB.VMON4 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1304  queryFVMON4->setCondition(conditionVMON4, conditionData);
1305  coral::ICursor& cursorFVMON4 = queryFVMON4->execute();
1306  while (cursorFVMON4.next()) {
1307  Itemp.thr1 = 0;
1308  Itemp.thr2 = 0;
1309  Itemp.thr3 = 0;
1310  Itemp.thr4 = 0;
1311  Itemp.vmon1 = 0;
1312  Itemp.vmon2 = 0;
1313  Itemp.vmon3 = 0;
1314  Itemp.vmon4 = 0;
1315  Itemp.temp1 = 0;
1316  Itemp.temp2 = 0;
1317  Itemp.noise1 = 0;
1318  Itemp.noise2 = 0;
1319  Itemp.noise3 = 0;
1320  Itemp.noise4 = 0;
1321  const coral::AttributeList& row = cursorFVMON4.currentRow();
1322  float idoub = row["DPID"].data<float>();
1323  int id = static_cast<int>(idoub);
1324  float vmon4 = row["VMON4"].data<float>();
1325  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1326  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1327  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1328  Itemp.dpid = id;
1329  Itemp.vmon4 = vmon4;
1330  Itemp.day = ndate;
1331  Itemp.time = ntime;
1332  febarray.push_back(Itemp);
1333  }
1334  }
1335 
1336  if (till > since) {
1337  tMAX = UTtoT(till);
1338  std::cout << "Processing TEMP1..." << std::endl;
1339  coral::AttributeList conditionData;
1340  conditionData.extend<coral::TimeStamp>("tmin");
1341  conditionData.extend<coral::TimeStamp>("tmax");
1342  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1343  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1344  std::string conditionTEMP1 =
1345  "RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1346  queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1347  coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1348  while (cursorFTEMP1.next()) {
1349  Itemp.thr1 = 0;
1350  Itemp.thr2 = 0;
1351  Itemp.thr3 = 0;
1352  Itemp.thr4 = 0;
1353  Itemp.vmon1 = 0;
1354  Itemp.vmon2 = 0;
1355  Itemp.vmon3 = 0;
1356  Itemp.vmon4 = 0;
1357  Itemp.temp1 = 0;
1358  Itemp.temp2 = 0;
1359  Itemp.noise1 = 0;
1360  Itemp.noise2 = 0;
1361  Itemp.noise3 = 0;
1362  Itemp.noise4 = 0;
1363  const coral::AttributeList& row = cursorFTEMP1.currentRow();
1364  float idoub = row["DPID"].data<float>();
1365  int id = static_cast<int>(idoub);
1366  float temp1 = row["TEMP1"].data<float>();
1367  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1368  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1369  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1370  Itemp.dpid = id;
1371  Itemp.temp1 = temp1;
1372  Itemp.day = ndate;
1373  Itemp.time = ntime;
1374  febarray.push_back(Itemp);
1375  }
1376  } else {
1377  std::cout << ">> Processing TEMP1..." << std::endl;
1378  coral::AttributeList conditionData;
1379  conditionData.extend<coral::TimeStamp>("tmin");
1380  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1381  std::string conditionTEMP1 = "RPCFEB.TEMPERATURE1 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1382  queryFTEMP1->setCondition(conditionTEMP1, conditionData);
1383  coral::ICursor& cursorFTEMP1 = queryFTEMP1->execute();
1384  while (cursorFTEMP1.next()) {
1385  Itemp.thr1 = 0;
1386  Itemp.thr2 = 0;
1387  Itemp.thr3 = 0;
1388  Itemp.thr4 = 0;
1389  Itemp.vmon1 = 0;
1390  Itemp.vmon2 = 0;
1391  Itemp.vmon3 = 0;
1392  Itemp.vmon4 = 0;
1393  Itemp.temp1 = 0;
1394  Itemp.temp2 = 0;
1395  Itemp.noise1 = 0;
1396  Itemp.noise2 = 0;
1397  Itemp.noise3 = 0;
1398  Itemp.noise4 = 0;
1399  const coral::AttributeList& row = cursorFTEMP1.currentRow();
1400  float idoub = row["DPID"].data<float>();
1401  int id = static_cast<int>(idoub);
1402  float temp1 = row["TEMP1"].data<float>();
1403  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1404  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1405  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1406  Itemp.dpid = id;
1407  Itemp.temp1 = temp1;
1408  Itemp.day = ndate;
1409  Itemp.time = ntime;
1410  febarray.push_back(Itemp);
1411  }
1412  }
1413 
1414  if (till > since) {
1415  tMAX = UTtoT(till);
1416  std::cout << "Processing TEMP2..." << std::endl;
1417  coral::AttributeList conditionData;
1418  conditionData.extend<coral::TimeStamp>("tmin");
1419  conditionData.extend<coral::TimeStamp>("tmax");
1420  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1421  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1422  std::string conditionTEMP2 =
1423  "RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin AND RPCFEB.CHANGE_DATE <:tmax";
1424  queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1425  coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1426  while (cursorFTEMP2.next()) {
1427  Itemp.thr1 = 0;
1428  Itemp.thr2 = 0;
1429  Itemp.thr3 = 0;
1430  Itemp.thr4 = 0;
1431  Itemp.vmon1 = 0;
1432  Itemp.vmon2 = 0;
1433  Itemp.vmon3 = 0;
1434  Itemp.vmon4 = 0;
1435  Itemp.temp1 = 0;
1436  Itemp.temp2 = 0;
1437  Itemp.noise1 = 0;
1438  Itemp.noise2 = 0;
1439  Itemp.noise3 = 0;
1440  Itemp.noise4 = 0;
1441  const coral::AttributeList& row = cursorFTEMP2.currentRow();
1442  float idoub = row["DPID"].data<float>();
1443  int id = static_cast<int>(idoub);
1444  float temp2 = row["TEMP2"].data<float>();
1445  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1446  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1447  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1448  Itemp.dpid = id;
1449  Itemp.temp2 = temp2;
1450  Itemp.day = ndate;
1451  Itemp.time = ntime;
1452  febarray.push_back(Itemp);
1453  }
1454  } else {
1455  std::cout << ">> Processing TEMP2..." << std::endl;
1456  coral::AttributeList conditionData;
1457  conditionData.extend<coral::TimeStamp>("tmin");
1458  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1459  std::string conditionTEMP2 = "RPCFEB.TEMPERATURE2 IS NOT NULL AND RPCFEB.CHANGE_DATE >:tmin";
1460  queryFTEMP2->setCondition(conditionTEMP2, conditionData);
1461  coral::ICursor& cursorFTEMP2 = queryFTEMP2->execute();
1462  while (cursorFTEMP2.next()) {
1463  Itemp.thr1 = 0;
1464  Itemp.thr2 = 0;
1465  Itemp.thr3 = 0;
1466  Itemp.thr4 = 0;
1467  Itemp.vmon1 = 0;
1468  Itemp.vmon2 = 0;
1469  Itemp.vmon3 = 0;
1470  Itemp.vmon4 = 0;
1471  Itemp.temp1 = 0;
1472  Itemp.temp2 = 0;
1473  Itemp.noise1 = 0;
1474  Itemp.noise2 = 0;
1475  Itemp.noise3 = 0;
1476  Itemp.noise4 = 0;
1477  const coral::AttributeList& row = cursorFTEMP2.currentRow();
1478  float idoub = row["DPID"].data<float>();
1479  int id = static_cast<int>(idoub);
1480  float temp2 = row["TEMP2"].data<float>();
1481  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1482  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
1483  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
1484  Itemp.dpid = id;
1485  Itemp.temp2 = temp2;
1486  Itemp.day = ndate;
1487  Itemp.time = ntime;
1488  febarray.push_back(Itemp);
1489  }
1490  }
1491 
1492  std::cout << ">> FEB array --> size: " << febarray.size() << " >> done." << std::endl;
1493  delete queryFVTH1;
1494  delete queryFVTH2;
1495  delete queryFVTH3;
1496  delete queryFVTH4;
1497  delete queryFTEMP1;
1498  session->transaction().commit();
1499  delete session;
1500  return febarray;
1501 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObFebmap::Feb_Item::day, RPCObFebmap::Feb_Item::dpid, triggerObjects_cff::id, m_connectionString, m_password, m_userName, RPCObFebmap::Feb_Item::noise1, RPCObFebmap::Feb_Item::noise2, RPCObFebmap::Feb_Item::noise3, RPCObFebmap::Feb_Item::noise4, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, RPCObFebmap::Feb_Item::temp1, RPCObFebmap::Feb_Item::temp2, RPCObFebmap::Feb_Item::thr1, RPCObFebmap::Feb_Item::thr2, RPCObFebmap::Feb_Item::thr3, RPCObFebmap::Feb_Item::thr4, ntuplemaker::till, RPCObFebmap::Feb_Item::time, tMAX, tMIN, UTtoT(), RPCObFebmap::Feb_Item::vmon1, RPCObFebmap::Feb_Item::vmon2, RPCObFebmap::Feb_Item::vmon3, and RPCObFebmap::Feb_Item::vmon4.

Referenced by popcon::RpcDataFebmap::getNewObjects().

◆ createGAS()

std::vector< RPCObGas::Item > RPCFw::createGAS ( long long  since,
long long  till 
)

Definition at line 287 of file RPCFw.cc.

287  {
288  tMIN = UTtoT(since);
289  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
290  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
291 
292  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
293  session->transaction().start(true);
294  coral::ISchema& schema = session->nominalSchema();
295 
296  coral::TimeStamp tlast = tMIN;
297 
298  // FLOWIN
299  coral::IQuery* querySIN = schema.newQuery();
300  querySIN->addToTableList("RPCGASCHANNEL");
301  querySIN->addToOutputList("RPCGASCHANNEL.DPID", "DPID");
302  querySIN->addToOutputList("RPCGASCHANNEL.CHANGE_DATE", "TSTAMP");
303  querySIN->addToOutputList("RPCGASCHANNEL.FLOWIN", "FLOWIN");
304 
305  // FLOWOUT
306  coral::IQuery* querySOUT = schema.newQuery();
307  querySOUT->addToTableList("RPCGASCHANNEL");
308  querySOUT->addToOutputList("RPCGASCHANNEL.DPID", "DPID");
309  querySOUT->addToOutputList("RPCGASCHANNEL.CHANGE_DATE", "TSTAMP");
310  querySOUT->addToOutputList("RPCGASCHANNEL.FLOWOUT", "FLOWOUT");
311 
312  RPCObGas::Item gastemp;
313  std::vector<RPCObGas::Item> gasarray;
314 
315  if (till > since) {
316  tMAX = UTtoT(till);
317  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
318  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
319  std::cout << ">> creating GAS object..." << std::endl;
320  std::cout << ">> processing FLOWIN..." << std::endl;
321  coral::AttributeList conditionData;
322  conditionData.extend<coral::TimeStamp>("tmin");
323  conditionData.extend<coral::TimeStamp>("tmax");
324  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
325  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
326  std::string conditionIN = "RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
327 
328  querySIN->setCondition(conditionIN, conditionData);
329  coral::ICursor& cursorSIN = querySIN->execute();
330  while (cursorSIN.next()) {
331  gastemp.dpid = 0;
332  gastemp.flowin = 0;
333  gastemp.flowout = 0;
334  gastemp.day = 0;
335  gastemp.time = 0;
336  const coral::AttributeList& row = cursorSIN.currentRow();
337  float idoub = row["DPID"].data<float>();
338  int id = static_cast<int>(idoub);
339  float val = row["FLOWIN"].data<float>();
340  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
341  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
342  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
343  gastemp.dpid = id;
344  gastemp.flowin = val;
345  gastemp.day = ndate;
346  gastemp.time = ntime;
347  gasarray.push_back(gastemp);
348  }
349  } else {
350  std::cout << ">> creating GAS object..." << std::endl;
351  std::cout << ">> processing FLOWIN..." << std::endl;
352  coral::AttributeList conditionData;
353  conditionData.extend<coral::TimeStamp>("tmin");
354  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
355  std::string conditionIN = "RPCGASCHANNEL.FLOWIN IS NOT NULL AND CHANGE_DATE >:tmin";
356  std::cout << "processing FLOWIN..." << std::endl;
357  querySIN->setCondition(conditionIN, conditionData);
358  coral::ICursor& cursorSIN = querySIN->execute();
359  while (cursorSIN.next()) {
360  gastemp.dpid = 0;
361  gastemp.flowin = 0;
362  gastemp.flowout = 0;
363  gastemp.day = 0;
364  gastemp.time = 0;
365  const coral::AttributeList& row = cursorSIN.currentRow();
366  float idoub = row["DPID"].data<float>();
367  int id = static_cast<int>(idoub);
368  float val = row["FLOWIN"].data<float>();
369  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
370  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
371  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
372  gastemp.dpid = id;
373  gastemp.flowin = val;
374  gastemp.day = ndate;
375  gastemp.time = ntime;
376  gasarray.push_back(gastemp);
377  }
378  }
379 
380  if (till > since) {
381  tMAX = UTtoT(till);
382  // std::cout <<">> Processing till: "<<tMAX.day()<<"/"<<tMAX.month()<<"/"<<tMAX.year()<<" "<<tMAX.hour()<<":"<<tMAX.minute()<<"."<<tMAX.second()<< std::endl;
383  std::cout << ">> processing FLOWOUT..." << std::endl;
384  coral::AttributeList conditionData;
385  conditionData.extend<coral::TimeStamp>("tmin");
386  conditionData.extend<coral::TimeStamp>("tmax");
387  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
388  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
389  std::string conditionOUT = "RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
390 
391  querySOUT->setCondition(conditionOUT, conditionData);
392  coral::ICursor& cursorSOUT = querySOUT->execute();
393  while (cursorSOUT.next()) {
394  gastemp.dpid = 0;
395  gastemp.flowin = 0;
396  gastemp.flowout = 0;
397  gastemp.day = 0;
398  gastemp.time = 0;
399  const coral::AttributeList& row = cursorSOUT.currentRow();
400  float idoub = row["DPID"].data<float>();
401  int id = static_cast<int>(idoub);
402  float val = row["FLOWOUT"].data<float>();
403  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
404  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
405  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
406  gastemp.dpid = id;
407  gastemp.flowout = val;
408  gastemp.day = ndate;
409  gastemp.time = ntime;
410  gasarray.push_back(gastemp);
411  }
412  } else {
413  std::cout << ">> processing FLOWOUT..." << std::endl;
414  coral::AttributeList conditionData;
415  conditionData.extend<coral::TimeStamp>("tmin");
416  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
417  std::string conditionOUT = "RPCGASCHANNEL.FLOWOUT IS NOT NULL AND CHANGE_DATE >:tmin";
418  querySOUT->setCondition(conditionOUT, conditionData);
419  coral::ICursor& cursorSOUT = querySOUT->execute();
420  while (cursorSOUT.next()) {
421  gastemp.dpid = 0;
422  gastemp.flowin = 0;
423  gastemp.flowout = 0;
424  gastemp.day = 0;
425  gastemp.time = 0;
426  const coral::AttributeList& row = cursorSOUT.currentRow();
427  float idoub = row["DPID"].data<float>();
428  int id = static_cast<int>(idoub);
429  float val = row["FLOWOUT"].data<float>();
430  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
431  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
432  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
433  gastemp.dpid = id;
434  gastemp.flowout = val;
435  gastemp.day = ndate;
436  gastemp.time = ntime;
437  gasarray.push_back(gastemp);
438  }
439  }
440 
441  N_IOV = TtoUT(tlast);
442  if (till > since)
443  N_IOV = till;
444  std::cout << ">> Gas array --> size: " << gasarray.size() << " >> done." << std::endl << std::endl << std::endl;
445 
446  delete querySIN;
447  delete querySOUT;
448  session->transaction().commit();
449  delete session;
450 
451  return gasarray;
452 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObGas::Item::day, RPCObGas::Item::dpid, RPCObGas::Item::flowin, RPCObGas::Item::flowout, triggerObjects_cff::id, m_connectionString, m_password, m_userName, N_IOV, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::till, RPCObGas::Item::time, tMAX, tMIN, TtoUT(), UTtoT(), and heppy_batch::val.

Referenced by popcon::RpcObGasData::getNewObjects().

◆ createIDMAP()

std::vector< RPCObPVSSmap::Item > RPCFw::createIDMAP ( )

Definition at line 544 of file RPCFw.cc.

544  {
545  // float tMINi = 0;
546  std::cout << ">> Processing data..." << std::endl;
547 
548  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
549  session->transaction().start(true);
550  coral::ISchema& schema = session->nominalSchema();
551  int nRows = 0;
552  std::cout << ">> creating IDMAP object..." << std::endl;
553  coral::IQuery* queryM = schema.newQuery();
554  queryM->addToTableList("RPCPVSSDETID");
555  queryM->addToOutputList("RPCPVSSDETID.SINCE", "SINCE");
556  queryM->addToOutputList("RPCPVSSDETID.PVSS_ID", "PVSS_ID");
557  queryM->addToOutputList("RPCPVSSDETID.REGION", "REGION");
558  queryM->addToOutputList("RPCPVSSDETID.RING", "RING");
559  queryM->addToOutputList("RPCPVSSDETID.STATION", "STATION");
560  queryM->addToOutputList("RPCPVSSDETID.SECTOR", "SECTOR");
561  queryM->addToOutputList("RPCPVSSDETID.LAYER", "LAYER");
562  queryM->addToOutputList("RPCPVSSDETID.SUBSECTOR", "SUBSECTOR");
563  queryM->addToOutputList("RPCPVSSDETID.SUPPLYTYPE", "SUPPLYTYPE");
564 
565  std::string condM = "RPCPVSSDETID.PVSS_ID is not NULL";
566 
567  // queryM->setCondition(condM);
568  coral::ICursor& cursorM = queryM->execute();
569 
570  RPCObPVSSmap::Item Itemp;
571  std::vector<RPCObPVSSmap::Item> idmaparray;
572  while (cursorM.next()) {
573  const coral::AttributeList& row = cursorM.currentRow();
574  int id = row["PVSS_ID"].data<int>();
575  std::string reg_s = row["REGION"].data<std::string>();
576  std::string rin_s = row["RING"].data<std::string>();
577  std::string sta_s = row["STATION"].data<std::string>();
578  std::string sec_s = row["SECTOR"].data<std::string>();
579  std::string lay_s = row["LAYER"].data<std::string>();
580  std::string sub_s = row["SUBSECTOR"].data<std::string>();
581  std::string sup_s = row["SUPPLYTYPE"].data<std::string>();
582 
583  int reg = atoi(reg_s.c_str());
584  int rin = atoi(rin_s.c_str());
585  int sta = atoi(sta_s.c_str());
586  int sec = atoi(sec_s.c_str());
587  int lay = atoi(lay_s.c_str());
588  int sub = atoi(sub_s.c_str());
589  int sup = 5;
590 
591  if (sup_s == "HV")
592  sup = 0;
593  if (sup_s == "LVA")
594  sup = 1;
595  if (sup_s == "LVD")
596  sup = 2;
597  if (sup_s == "LB")
598  sup = 3;
599  if (sup_s == "T")
600  sup = 4;
601 
602  coral::TimeStamp ts = row["SINCE"].data<coral::TimeStamp>();
603 
604  std::ostringstream dday;
605  std::ostringstream dmon;
606  std::ostringstream dyea;
607  dday << ts.day();
608  dmon << ts.month();
609  dyea << ts.year();
610  std::string date = dday.str() + "-" + dmon.str() + "-" + dyea.str();
611 
612  Itemp.since = atoi(date.c_str());
613  Itemp.dpid = id;
614  Itemp.region = reg;
615  Itemp.ring = rin;
616  Itemp.station = sta;
617  Itemp.sector = sec;
618  Itemp.layer = lay;
619  Itemp.subsector = sub;
620  Itemp.suptype = sup;
621 
622  idmaparray.push_back(Itemp);
623 
624  ++nRows;
625  }
626 
627  std::cout << ">> IDMAP array --> size: " << idmaparray.size() << " >> done." << std::endl;
628  delete queryM;
629  session->transaction().commit();
630  delete session;
631  return idmaparray;
632 }

References RPCDBCom::connect(), gather_cfg::cout, indexGen::date, RPCObPVSSmap::Item::dpid, triggerObjects_cff::id, RPCObPVSSmap::Item::layer, m_connectionString, m_password, m_userName, RPCObPVSSmap::Item::region, RPCObPVSSmap::Item::ring, fileinputsource_cfi::sec, RPCObPVSSmap::Item::sector, RPCObPVSSmap::Item::since, RPCObPVSSmap::Item::station, AlCaHLTBitMon_QueryRunRegistry::string, RPCObPVSSmap::Item::subsector, and RPCObPVSSmap::Item::suptype.

Referenced by popcon::RPCObPVSSmapData::getNewObjects().

◆ createIMON()

std::vector< RPCObImon::I_Item > RPCFw::createIMON ( long long  since,
long long  till 
)

Definition at line 38 of file RPCFw.cc.

38  {
39  tMIN = UTtoT(since);
40  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
41  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
42 
43  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
44  session->transaction().start(true);
45  coral::ISchema& schema = session->nominalSchema();
46  int nRows = 0;
47  coral::IQuery* queryI = schema.newQuery();
48  queryI->addToTableList("FWCAENCHANNEL");
49  queryI->addToOutputList("FWCAENCHANNEL.DPID", "DPID");
50  queryI->addToOutputList("FWCAENCHANNEL.CHANGE_DATE", "TSTAMP");
51  queryI->addToOutputList("FWCAENCHANNEL.ACTUAL_IMON", "IMON");
52 
53  RPCObImon::I_Item Itemp;
54  std::vector<RPCObImon::I_Item> imonarray;
55  coral::TimeStamp tlast = tMIN;
56  if (till > since) {
57  tMAX = UTtoT(till);
58  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
59  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
60  std::cout << ">> creating IMON object..." << std::endl;
61  coral::AttributeList conditionData;
62  conditionData.extend<coral::TimeStamp>("tmin");
63  conditionData.extend<coral::TimeStamp>("tmax");
64  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
65  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
66  std::string condition = "FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
67  queryI->setCondition(condition, conditionData);
68  coral::ICursor& cursorI = queryI->execute();
69  while (cursorI.next()) {
70  const coral::AttributeList& row = cursorI.currentRow();
71  float idoub = row["DPID"].data<float>();
72  int id = static_cast<int>(idoub);
73  float val = row["IMON"].data<float>();
74  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
75  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
76  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
77  Itemp.dpid = id;
78  Itemp.value = val;
79  Itemp.day = ndate;
80  Itemp.time = ntime;
81  imonarray.push_back(Itemp);
82  ++nRows;
83  }
84  } else {
85  std::cout << ">> creating IMON object..." << std::endl;
86  coral::AttributeList conditionData;
87  conditionData.extend<coral::TimeStamp>("tmin");
88  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
89  std::string condition = "FWCAENCHANNEL.ACTUAL_IMON IS NOT NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
90  queryI->setCondition(condition, conditionData);
91  coral::ICursor& cursorI = queryI->execute();
92  while (cursorI.next()) {
93  const coral::AttributeList& row = cursorI.currentRow();
94  float idoub = row["DPID"].data<float>();
95  int id = static_cast<int>(idoub);
96  float val = row["IMON"].data<float>();
97  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
98  if (isMajor(ts, tlast))
99  tlast = ts;
100  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
101  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
102  Itemp.dpid = id;
103  Itemp.value = val;
104  Itemp.day = ndate;
105  Itemp.time = ntime;
106  imonarray.push_back(Itemp);
107  ++nRows;
108  }
109  }
110  N_IOV = TtoUT(tlast);
111  if (till > since)
112  N_IOV = till;
113  std::cout << ">> Imon array --> size: " << imonarray.size() << " >> done." << std::endl;
114  delete queryI;
115  session->transaction().commit();
116  delete session;
117  return imonarray;
118 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObImon::I_Item::day, RPCObImon::I_Item::dpid, triggerObjects_cff::id, isMajor(), m_connectionString, m_password, m_userName, N_IOV, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::till, RPCObImon::I_Item::time, tMAX, tMIN, TtoUT(), UTtoT(), heppy_batch::val, and RPCObImon::I_Item::value.

Referenced by popcon::RpcDataI::getNewObjects().

◆ createMix()

std::vector< RPCObGasMix::Item > RPCFw::createMix ( long long  since,
long long  till 
)

Definition at line 1618 of file RPCFw.cc.

1618  {
1619  tMIN = UTtoT(since);
1620  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
1621  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
1622 
1623  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
1624  session->transaction().start(true);
1625  coral::ISchema& schema = session->nominalSchema();
1626  std::cout << ">> creating UXC object..." << std::endl;
1627 
1628  coral::IQuery* queryMix = schema.newQuery();
1629  queryMix->addToTableList("RPCGASPARAMETERS");
1630  queryMix->addToTableList("DP_NAME2ID");
1631  queryMix->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1632  queryMix->addToOutputList("DP_NAME2ID.ID", "ID");
1633  queryMix->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1634  queryMix->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1635  queryMix->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1636 
1637  coral::IQuery* queryMix2 = schema.newQuery();
1638  queryMix2->addToTableList("RPCGASPARAMETERS");
1639  queryMix2->addToTableList("DP_NAME2ID");
1640  queryMix2->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1641  queryMix2->addToOutputList("DP_NAME2ID.ID", "ID");
1642  queryMix2->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1643  queryMix2->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1644  queryMix2->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1645 
1646  coral::IQuery* queryMix3 = schema.newQuery();
1647  queryMix3->addToTableList("RPCGASPARAMETERS");
1648  queryMix3->addToTableList("DP_NAME2ID");
1649  queryMix3->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1650  queryMix3->addToOutputList("DP_NAME2ID.ID", "ID");
1651  queryMix3->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1652  queryMix3->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1653  queryMix3->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1654 
1655  RPCObGasMix::Item Mtemp;
1656  std::vector<RPCObGasMix::Item> marray;
1657  coral::TimeStamp tlast = tMIN;
1658  if (till > since) {
1659  tMAX = UTtoT(till);
1660  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
1661  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
1662  std::cout << "Processing UXC..." << std::endl;
1663  coral::AttributeList conditionData;
1664  conditionData.extend<coral::TimeStamp>("tmin");
1665  conditionData.extend<coral::TimeStamp>("tmax");
1666  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1667  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1668  std::string conditionM1 =
1669  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1670  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%IC4H10Ratio%')";
1671  queryMix->setCondition(conditionM1, conditionData);
1672  coral::ICursor& cursorMix = queryMix->execute();
1673  while (cursorMix.next()) {
1674  Mtemp.gas1 = 0;
1675  Mtemp.gas2 = 0;
1676  Mtemp.gas3 = 0;
1677  const coral::AttributeList& row = cursorMix.currentRow();
1678  float value = row["VALUE"].data<float>();
1679  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1680  unsigned long long ut_time = TtoUT(ts);
1681  Mtemp.gas1 = value;
1682  Mtemp.unixtime = ut_time;
1683  marray.push_back(Mtemp);
1684  }
1685  std::string conditionM2 =
1686  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1687  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%C2H2F4Ratio%')";
1688  queryMix2->setCondition(conditionM2, conditionData);
1689  coral::ICursor& cursorMix2 = queryMix2->execute();
1690  while (cursorMix2.next()) {
1691  Mtemp.gas1 = 0;
1692  Mtemp.gas2 = 0;
1693  Mtemp.gas3 = 0;
1694  const coral::AttributeList& row = cursorMix2.currentRow();
1695  float value = row["VALUE"].data<float>();
1696  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1697  unsigned long long ut_time = TtoUT(ts);
1698  Mtemp.gas2 = value;
1699  Mtemp.unixtime = ut_time;
1700  marray.push_back(Mtemp);
1701  }
1702  std::string conditionM3 =
1703  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1704  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%SF6Ratio%')";
1705  queryMix3->setCondition(conditionM3, conditionData);
1706  coral::ICursor& cursorMix3 = queryMix3->execute();
1707  while (cursorMix3.next()) {
1708  Mtemp.gas1 = 0;
1709  Mtemp.gas2 = 0;
1710  Mtemp.gas3 = 0;
1711  const coral::AttributeList& row = cursorMix3.currentRow();
1712  float value = row["VALUE"].data<float>();
1713  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1714  unsigned long long ut_time = TtoUT(ts);
1715  Mtemp.gas3 = value;
1716  Mtemp.unixtime = ut_time;
1717  marray.push_back(Mtemp);
1718  }
1719  } else {
1720  std::cout << "This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1721  }
1722 
1723  std::cout << ">> GasMix array --> size: " << marray.size() << " >> done." << std::endl;
1724  delete queryMix;
1725  session->transaction().commit();
1726  delete session;
1727  return marray;
1728 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObGasMix::Item::gas1, RPCObGasMix::Item::gas2, RPCObGasMix::Item::gas3, m_connectionString, m_password, m_userName, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::till, tMAX, tMIN, TtoUT(), RPCObGasMix::Item::unixtime, UTtoT(), and relativeConstraints::value.

Referenced by popcon::RpcDataGasMix::getNewObjects().

◆ createSTATUS()

std::vector< RPCObStatus::S_Item > RPCFw::createSTATUS ( long long  since,
long long  till 
)

Definition at line 205 of file RPCFw.cc.

205  {
206  tMIN = UTtoT(since);
207  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
208  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
209 
210  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
211  session->transaction().start(true);
212  coral::ISchema& schema = session->nominalSchema();
213  int nRows = 0;
214  std::cout << ">> creating STATUS object..." << std::endl;
215  coral::IQuery* queryS = schema.newQuery();
216  queryS->addToTableList("FWCAENCHANNEL");
217  queryS->addToOutputList("FWCAENCHANNEL.DPID", "DPID");
218  queryS->addToOutputList("FWCAENCHANNEL.CHANGE_DATE", "TSTAMP");
219  queryS->addToOutputList("FWCAENCHANNEL.ACTUAL_STATUS", "STATUS");
220  RPCObStatus::S_Item Stemp;
221  std::vector<RPCObStatus::S_Item> statusarray;
222  coral::TimeStamp tlast = tMIN;
223  if (till > since) {
224  tMAX = UTtoT(till);
225  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
226  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
227  std::cout << ">> creating STATUS object..." << std::endl;
228  coral::AttributeList conditionData;
229  conditionData.extend<coral::TimeStamp>("tmin");
230  conditionData.extend<coral::TimeStamp>("tmax");
231  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
232  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
233  std::string condition =
234  " NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE "
235  "<:tmax";
236  queryS->setCondition(condition, conditionData);
237  coral::ICursor& cursorS = queryS->execute();
238  while (cursorS.next()) {
239  const coral::AttributeList& row = cursorS.currentRow();
240  float idoub = row["DPID"].data<float>();
241  int id = static_cast<int>(idoub);
242  float val = row["STATUS"].data<float>();
243  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
244  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
245  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
246  Stemp.dpid = id;
247  Stemp.value = val;
248  Stemp.day = ndate;
249  Stemp.time = ntime;
250  statusarray.push_back(Stemp);
251  ++nRows;
252  }
253  } else {
254  std::cout << ">> creating STATUS object..." << std::endl;
255  coral::AttributeList conditionData;
256  conditionData.extend<coral::TimeStamp>("tmin");
257  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
258  std::string condition = " NOT FWCAENCHANNEL.ACTUAL_STATUS IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
259  queryS->setCondition(condition, conditionData);
260  coral::ICursor& cursorS = queryS->execute();
261  while (cursorS.next()) {
262  const coral::AttributeList& row = cursorS.currentRow();
263  float idoub = row["DPID"].data<float>();
264  int id = static_cast<int>(idoub);
265  float val = row["STATUS"].data<float>();
266  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
267  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
268  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
269  Stemp.dpid = id;
270  Stemp.value = val;
271  Stemp.day = ndate;
272  Stemp.time = ntime;
273  statusarray.push_back(Stemp);
274  ++nRows;
275  }
276  }
277  std::cout << ">> Staus array --> size: " << statusarray.size() << " >> done." << std::endl << std::endl << std::endl;
278 
279  delete queryS;
280  session->transaction().commit();
281  delete session;
282 
283  return statusarray;
284 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObStatus::S_Item::day, RPCObStatus::S_Item::dpid, triggerObjects_cff::id, m_connectionString, m_password, m_userName, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::till, RPCObStatus::S_Item::time, tMAX, tMIN, UTtoT(), heppy_batch::val, and RPCObStatus::S_Item::value.

Referenced by popcon::RpcDataS::getNewObjects().

◆ createT()

std::vector< RPCObTemp::T_Item > RPCFw::createT ( long long  since,
long long  till 
)

Definition at line 455 of file RPCFw.cc.

455  {
456  tMIN = UTtoT(since);
457  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
458  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
459 
460  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
461  session->transaction().start(true);
462  coral::ISchema& schema = session->nominalSchema();
463  int nRows = 0;
464  coral::IQuery* queryS = schema.newQuery();
465  queryS->addToTableList("FWCAENCHANNELADC");
466  queryS->addToOutputList("FWCAENCHANNELADC.DPID", "DPID");
467  queryS->addToOutputList("FWCAENCHANNELADC.CHANGE_DATE", "TSTAMP");
468  queryS->addToOutputList("FWCAENCHANNELADC.ACTUAL_TEMPERATURE", "TEMPERATURE");
469  RPCObTemp::T_Item Ttemp;
470  std::vector<RPCObTemp::T_Item> temparray;
471  coral::TimeStamp tlast = tMIN;
472  if (till > since) {
473  tMAX = UTtoT(till);
474  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
475  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
476  std::cout << ">> creating TEMPERATURE object..." << std::endl;
477  coral::AttributeList conditionData;
478  conditionData.extend<coral::TimeStamp>("tmin");
479  conditionData.extend<coral::TimeStamp>("tmax");
480  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
481  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
482  std::string condition =
483  "FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin AND CHANGE_DATE <:tmax";
484  queryS->setCondition(condition, conditionData);
485  coral::ICursor& cursorS = queryS->execute();
486  while (cursorS.next()) {
487  const coral::AttributeList& row = cursorS.currentRow();
488  float idoub = row["DPID"].data<float>();
489  int id = static_cast<int>(idoub);
490  float val = row["TEMPERATURE"].data<float>();
491  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
492  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
493  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
494 
495  Ttemp.dpid = id;
496  Ttemp.value = val;
497  Ttemp.day = ndate;
498  Ttemp.time = ntime;
499  temparray.push_back(Ttemp);
500 
501  ++nRows;
502  }
503  } else {
504  std::cout << ">> creating TEMPERATURE object..." << std::endl;
505  coral::AttributeList conditionData;
506  conditionData.extend<coral::TimeStamp>("tmin");
507  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
508  std::string condition = "FWCAENCHANNELADC.ACTUAL_TEMPERATURE IS NOT NULL AND CHANGE_DATE >:tmin";
509  queryS->setCondition(condition, conditionData);
510  coral::ICursor& cursorS = queryS->execute();
511  while (cursorS.next()) {
512  const coral::AttributeList& row = cursorS.currentRow();
513  float idoub = row["DPID"].data<float>();
514  int id = static_cast<int>(idoub);
515  float val = row["TEMPERATURE"].data<float>();
516  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
517  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
518  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
519 
520  Ttemp.dpid = id;
521  Ttemp.value = val;
522  Ttemp.day = ndate;
523  Ttemp.time = ntime;
524  temparray.push_back(Ttemp);
525 
526  ++nRows;
527  }
528  }
529  N_IOV = TtoUT(tlast);
530  if (till > since)
531  N_IOV = till;
532  std::cout << ">> Temperature array --> size: " << temparray.size() << " >> done." << std::endl
533  << std::endl
534  << std::endl;
535 
536  delete queryS;
537  session->transaction().commit();
538  delete session;
539 
540  return temparray;
541 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObTemp::T_Item::day, RPCObTemp::T_Item::dpid, triggerObjects_cff::id, m_connectionString, m_password, m_userName, N_IOV, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::till, RPCObTemp::T_Item::time, tMAX, tMIN, TtoUT(), UTtoT(), heppy_batch::val, and RPCObTemp::T_Item::value.

Referenced by popcon::RpcDataT::getNewObjects().

◆ createUXC()

std::vector< RPCObUXC::Item > RPCFw::createUXC ( long long  since,
long long  till 
)

Definition at line 1504 of file RPCFw.cc.

1504  {
1505  tMIN = UTtoT(since);
1506  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
1507  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
1508 
1509  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
1510  session->transaction().start(true);
1511  coral::ISchema& schema = session->nominalSchema();
1512  std::cout << ">> creating UXC object..." << std::endl;
1513 
1514  // UXCT
1515  coral::IQuery* queryUXCP = schema.newQuery();
1516  queryUXCP->addToTableList("RPCGASPARAMETERS");
1517  queryUXCP->addToTableList("DP_NAME2ID");
1518  queryUXCP->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1519  queryUXCP->addToOutputList("DP_NAME2ID.ID", "ID");
1520  queryUXCP->addToOutputList("RPCGASPARAMETERS.DPID", "DPID");
1521  queryUXCP->addToOutputList("RPCGASPARAMETERS.CHANGE_DATE", "TSTAMP");
1522  queryUXCP->addToOutputList("RPCGASPARAMETERS.VALUE", "VALUE");
1523  coral::IQuery* queryUXCT = schema.newQuery();
1524  queryUXCT->addToTableList("RPCCOOLING");
1525  queryUXCT->addToTableList("DP_NAME2ID");
1526  queryUXCT->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1527  queryUXCT->addToOutputList("DP_NAME2ID.ID", "ID");
1528  queryUXCT->addToOutputList("RPCCOOLING.DPID", "DPID");
1529  queryUXCT->addToOutputList("RPCCOOLING.CHANGE_DATE", "TSTAMP");
1530  queryUXCT->addToOutputList("RPCCOOLING.VALUE", "VALUE");
1531  coral::IQuery* queryUXCH = schema.newQuery();
1532  queryUXCH->addToTableList("RPCCOOLING");
1533  queryUXCH->addToTableList("DP_NAME2ID");
1534  queryUXCH->addToOutputList("DP_NAME2ID.DPNAME", "DPNAME");
1535  queryUXCH->addToOutputList("DP_NAME2ID.ID", "ID");
1536  queryUXCH->addToOutputList("RPCCOOLING.DPID", "DPID");
1537  queryUXCH->addToOutputList("RPCCOOLING.CHANGE_DATE", "TSTAMP");
1538  queryUXCH->addToOutputList("RPCCOOLING.VALUE", "VALUE");
1539 
1540  RPCObUXC::Item Itemp;
1541  std::vector<RPCObUXC::Item> uxcarray;
1542  coral::TimeStamp tlast = tMIN;
1543  if (till > since) {
1544  tMAX = UTtoT(till);
1545  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
1546  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
1547  std::cout << "Processing UXC..." << std::endl;
1548  coral::AttributeList conditionData;
1549  conditionData.extend<coral::TimeStamp>("tmin");
1550  conditionData.extend<coral::TimeStamp>("tmax");
1551  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
1552  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
1553  std::string conditionUXCP =
1554  "RPCGASPARAMETERS.DPID = DP_NAME2ID.ID AND RPCGASPARAMETERS.CHANGE_DATE >:tmin AND "
1555  "RPCGASPARAMETERS.CHANGE_DATE <:tmax AND (DP_NAME2ID.DPNAME like '%UXCPressure%')";
1556  queryUXCP->setCondition(conditionUXCP, conditionData);
1557  coral::ICursor& cursorUXCP = queryUXCP->execute();
1558  while (cursorUXCP.next()) {
1559  Itemp.temperature = 0;
1560  Itemp.pressure = 0;
1561  Itemp.dewpoint = 0;
1562  const coral::AttributeList& row = cursorUXCP.currentRow();
1563  float value = row["VALUE"].data<float>();
1564  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1565  unsigned long long ut_time = TtoUT(ts);
1566  Itemp.pressure = value;
1567  Itemp.unixtime = ut_time;
1568  uxcarray.push_back(Itemp);
1569  }
1570  std::string conditionUXCT =
1571  "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND "
1572  "(DP_NAME2ID.DPNAME like '%TempUXC%')";
1573  queryUXCT->setCondition(conditionUXCT, conditionData);
1574  coral::ICursor& cursorUXCT = queryUXCT->execute();
1575  while (cursorUXCT.next()) {
1576  Itemp.temperature = 0;
1577  Itemp.pressure = 0;
1578  Itemp.dewpoint = 0;
1579  const coral::AttributeList& row = cursorUXCT.currentRow();
1580  float value = row["VALUE"].data<float>();
1581  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1582  unsigned long long ut_time = TtoUT(ts);
1583  Itemp.temperature = value;
1584  Itemp.unixtime = ut_time;
1585  uxcarray.push_back(Itemp);
1586  }
1587  std::string conditionUXCH =
1588  "RPCCOOLING.DPID = DP_NAME2ID.ID AND RPCCOOLING.CHANGE_DATE >:tmin AND RPCCOOLING.CHANGE_DATE <:tmax AND "
1589  "(DP_NAME2ID.DPNAME like '%DewpointUXC%')";
1590  queryUXCH->setCondition(conditionUXCH, conditionData);
1591  coral::ICursor& cursorUXCH = queryUXCH->execute();
1592  while (cursorUXCH.next()) {
1593  Itemp.temperature = 0;
1594  Itemp.pressure = 0;
1595  Itemp.dewpoint = 0;
1596  const coral::AttributeList& row = cursorUXCH.currentRow();
1597  float value = row["VALUE"].data<float>();
1598  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
1599  unsigned long long ut_time = TtoUT(ts);
1600  Itemp.dewpoint = value;
1601  Itemp.unixtime = ut_time;
1602  uxcarray.push_back(Itemp);
1603  }
1604  } else {
1605  std::cout << "This objects cannot be copied in this mode. Use RANGE mode!" << std::endl;
1606  }
1607 
1608  std::cout << ">> UXC array --> size: " << uxcarray.size() << " >> done." << std::endl;
1609  delete queryUXCT;
1610  delete queryUXCP;
1611  delete queryUXCH;
1612  session->transaction().commit();
1613  delete session;
1614  return uxcarray;
1615 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObUXC::Item::dewpoint, m_connectionString, m_password, m_userName, RPCObUXC::Item::pressure, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, RPCObUXC::Item::temperature, ntuplemaker::till, tMAX, tMIN, TtoUT(), RPCObUXC::Item::unixtime, UTtoT(), and relativeConstraints::value.

Referenced by popcon::RpcDataUXC::getNewObjects().

◆ createVMON()

std::vector< RPCObVmon::V_Item > RPCFw::createVMON ( long long  from,
long long  till 
)

Definition at line 121 of file RPCFw.cc.

121  {
122  tMIN = UTtoT(since);
123  std::cout << ">> Processing since: " << tMIN.day() << "/" << tMIN.month() << "/" << tMIN.year() << " " << tMIN.hour()
124  << ":" << tMIN.minute() << "." << tMIN.second() << std::endl;
125 
126  coral::ISession* session = this->connect(m_connectionString, m_userName, m_password);
127  session->transaction().start(true);
128  coral::ISchema& schema = session->nominalSchema();
129  int nRows = 0;
130  coral::IQuery* queryV = schema.newQuery();
131  queryV->addToTableList("FWCAENCHANNEL");
132  queryV->addToOutputList("FWCAENCHANNEL.DPID", "DPID");
133  queryV->addToOutputList("FWCAENCHANNEL.CHANGE_DATE", "TSTAMP");
134  queryV->addToOutputList("FWCAENCHANNEL.ACTUAL_VMON", "VMON");
135  RPCObVmon::V_Item Vtemp;
136  std::vector<RPCObVmon::V_Item> vmonarray;
137  coral::TimeStamp tlast = tMIN;
138  if (till > since) {
139  tMAX = UTtoT(till);
140  std::cout << ">> Processing till: " << tMAX.day() << "/" << tMAX.month() << "/" << tMAX.year() << " " << tMAX.hour()
141  << ":" << tMAX.minute() << "." << tMAX.second() << std::endl;
142  std::cout << ">> creating VMON object..." << std::endl;
143  coral::AttributeList conditionData;
144  conditionData.extend<coral::TimeStamp>("tmin");
145  conditionData.extend<coral::TimeStamp>("tmax");
146  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
147  conditionData["tmax"].data<coral::TimeStamp>() = tMAX;
148  std::string condition =
149  " NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin AND FWCAENCHANNEL.CHANGE_DATE "
150  "<:tmax";
151  queryV->setCondition(condition, conditionData);
152  coral::ICursor& cursorV = queryV->execute();
153  while (cursorV.next()) {
154  const coral::AttributeList& row = cursorV.currentRow();
155  float idoub = row["DPID"].data<float>();
156  int id = static_cast<int>(idoub);
157  float val = row["VMON"].data<float>();
158  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
159  if (isMajor(ts, tlast))
160  tlast = ts;
161  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
162  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
163  Vtemp.dpid = id;
164  Vtemp.value = val;
165  Vtemp.day = ndate;
166  Vtemp.time = ntime;
167  vmonarray.push_back(Vtemp);
168  ++nRows;
169  }
170  } else {
171  std::cout << ">> creating VMON object..." << std::endl;
172  coral::AttributeList conditionData;
173  conditionData.extend<coral::TimeStamp>("tmin");
174  conditionData["tmin"].data<coral::TimeStamp>() = tMIN;
175  std::string condition = " NOT FWCAENCHANNEL.ACTUAL_VMON IS NULL AND FWCAENCHANNEL.CHANGE_DATE >:tmin";
176  queryV->setCondition(condition, conditionData);
177  coral::ICursor& cursorV = queryV->execute();
178  while (cursorV.next()) {
179  const coral::AttributeList& row = cursorV.currentRow();
180  float idoub = row["DPID"].data<float>();
181  int id = static_cast<int>(idoub);
182  float val = row["VMON"].data<float>();
183  coral::TimeStamp ts = row["TSTAMP"].data<coral::TimeStamp>();
184  if (isMajor(ts, tlast))
185  tlast = ts;
186  int ndate = (ts.day() * 10000) + (ts.month() * 100) + (ts.year() - 2000);
187  int ntime = (ts.hour() * 10000) + (ts.minute() * 100) + ts.second();
188  Vtemp.dpid = id;
189  Vtemp.value = val;
190  Vtemp.day = ndate;
191  Vtemp.time = ntime;
192  vmonarray.push_back(Vtemp);
193  ++nRows;
194  }
195  }
196 
197  std::cout << ">> Vmon array --> size: " << vmonarray.size() << " >> done." << std::endl;
198  delete queryV;
199  session->transaction().commit();
200  delete session;
201  return vmonarray;
202 }

References RPCDBCom::connect(), gather_cfg::cout, RPCObVmon::V_Item::day, RPCObVmon::V_Item::dpid, triggerObjects_cff::id, isMajor(), m_connectionString, m_password, m_userName, writeEcalDQMStatus::since, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::till, RPCObVmon::V_Item::time, tMAX, tMIN, UTtoT(), heppy_batch::val, and RPCObVmon::V_Item::value.

Referenced by popcon::RpcDataV::getNewObjects().

◆ isMajor()

bool RPCFw::isMajor ( const coral::TimeStamp &  fir,
const coral::TimeStamp &  sec 
)

Definition at line 1891 of file RPCFw.cc.

1891  {
1892  double first =
1893  fir.year() * 1e10 + fir.month() + 1e8 + fir.day() * 1e6 + fir.hour() * 1e4 + fir.minute() * 1e2 + fir.second();
1894  double second =
1895  sec.year() * 1e10 + sec.month() + 1e8 + sec.day() * 1e6 + sec.hour() * 1e4 + sec.minute() * 1e2 + sec.second();
1896 
1897  if (first > second)
1898  return true;
1899 
1900  return false;
1901 }

References vertexPlots::e4, first, fileinputsource_cfi::sec, and edm::second().

Referenced by createIMON(), and createVMON().

◆ run()

void RPCFw::run ( )
overridevirtual

Implements RPCDBCom.

Definition at line 35 of file RPCFw.cc.

35 {}

Referenced by Types.EventID::cppID(), and Types.LuminosityBlockID::cppID().

◆ TtoUT()

unsigned long long RPCFw::TtoUT ( const coral::TimeStamp &  time)

Definition at line 1862 of file RPCFw.cc.

1862  {
1863  long long utime = (time.year() - 1970) * 31536000 + static_cast<int>(trunc((time.year() - 1972) / 4)) * 86400 +
1864  (((time.month() - 1) * 31) * 86400) + ((time.day() - 1) * 86400) + time.hour() * 3600 +
1865  time.minute() * 60 + time.second();
1866 
1867  if (time.month() == 3)
1868  utime = utime - 3 * 86400;
1869  if (time.month() == 4)
1870  utime = utime - 3 * 86400;
1871  if (time.month() == 5)
1872  utime = utime - 4 * 86400;
1873  if (time.month() == 6)
1874  utime = utime - 4 * 86400;
1875  if (time.month() == 7)
1876  utime = utime - 5 * 86400;
1877  if (time.month() == 8)
1878  utime = utime - 5 * 86400;
1879  if (time.month() == 9)
1880  utime = utime - 5 * 86400;
1881  if (time.month() == 10)
1882  utime = utime - 6 * 86400;
1883  if (time.month() == 11)
1884  utime = utime - 6 * 86400;
1885  if (time.month() == 12)
1886  utime = utime - 7 * 86400;
1887 
1888  return utime;
1889 }

References protons_cff::time, and pileupReCalc_HLTpaths::trunc.

Referenced by createGAS(), createIMON(), createMix(), createT(), and createUXC().

◆ UTtoT()

coral::TimeStamp RPCFw::UTtoT ( long long  utime)

Definition at line 1731 of file RPCFw.cc.

1731  {
1732  int yea = static_cast<int>(trunc(utime / 31536000) + 1970);
1733  int yes = (yea - 1970) * 31536000;
1734  int cony = ((yea - 1972) % 4) + 1;
1735  if (cony == 0)
1736  yes = yes + (yea - 1972) / 4 * 86400;
1737  else
1738  yes = yes + static_cast<int>(trunc((yea - 1972) / 4)) * 86400;
1739  int day = static_cast<int>(trunc((utime - yes) / 86400));
1740  int rest = static_cast<int>(utime - yes - day * 86400);
1741  int mon = 0;
1742  // BISESTILE YEAR
1743  if (cony == 0) {
1744  day = day + 1;
1745  if (day < 32) {
1746  mon = 1;
1747  day = day - 0;
1748  }
1749  if (day >= 32 && day < 61) {
1750  mon = 2;
1751  day = day - 31;
1752  }
1753  if (day >= 61 && day < 92) {
1754  mon = 3;
1755  day = day - 60;
1756  }
1757  if (day >= 92 && day < 122) {
1758  mon = 4;
1759  day = day - 91;
1760  }
1761  if (day >= 122 && day < 153) {
1762  mon = 5;
1763  day = day - 121;
1764  }
1765  if (day >= 153 && day < 183) {
1766  mon = 6;
1767  day = day - 152;
1768  }
1769  if (day >= 183 && day < 214) {
1770  mon = 7;
1771  day = day - 182;
1772  }
1773  if (day >= 214 && day < 245) {
1774  mon = 8;
1775  day = day - 213;
1776  }
1777  if (day >= 245 && day < 275) {
1778  mon = 9;
1779  day = day - 244;
1780  }
1781  if (day >= 275 && day < 306) {
1782  mon = 10;
1783  day = day - 274;
1784  }
1785  if (day >= 306 && day < 336) {
1786  mon = 11;
1787  day = day - 305;
1788  }
1789  if (day >= 336) {
1790  mon = 12;
1791  day = day - 335;
1792  }
1793  }
1794  // NOT BISESTILE YEAR
1795  else {
1796  if (day < 32) {
1797  mon = 1;
1798  day = day - 0;
1799  }
1800  if (day >= 32 && day < 60) {
1801  mon = 2;
1802  day = day - 31;
1803  }
1804  if (day >= 60 && day < 91) {
1805  mon = 3;
1806  day = day - 59;
1807  }
1808  if (day >= 91 && day < 121) {
1809  mon = 4;
1810  day = day - 90;
1811  }
1812  if (day >= 121 && day < 152) {
1813  mon = 5;
1814  day = day - 120;
1815  }
1816  if (day >= 152 && day < 182) {
1817  mon = 6;
1818  day = day - 151;
1819  }
1820  if (day >= 182 && day < 213) {
1821  mon = 7;
1822  day = day - 181;
1823  }
1824  if (day >= 213 && day < 244) {
1825  mon = 8;
1826  day = day - 212;
1827  }
1828  if (day >= 244 && day < 274) {
1829  mon = 9;
1830  day = day - 243;
1831  }
1832  if (day >= 274 && day < 305) {
1833  mon = 10;
1834  day = day - 273;
1835  }
1836  if (day >= 305 && day < 335) {
1837  mon = 11;
1838  day = day - 304;
1839  }
1840  if (day >= 335) {
1841  mon = 12;
1842  day = day - 334;
1843  }
1844  }
1845 
1846  int hou = static_cast<int>(trunc(rest / 3600));
1847  rest = rest - hou * 3600;
1848  int min = static_cast<int>(trunc(rest / 60));
1849  rest = rest - min * 60;
1850  int sec = rest;
1851  int nan = 0;
1852 
1853  // std::cout <<">> Processing since: "<<day<<"/"<<mon<<"/"<<yea<<" "<<hou<<":"<<min<<"."<<sec<< std::endl;
1854 
1855  coral::TimeStamp Tthr;
1856 
1857  Tthr = coral::TimeStamp(yea, mon, day, hou, min, sec, nan);
1858  return Tthr;
1859 }

References util.getRunInfo::day(), min(), LaserDQM_cfi::mon, dqmiodatasetharvest::nan, mergeAndRegister::rest, fileinputsource_cfi::sec, and pileupReCalc_HLTpaths::trunc.

Referenced by createFEB(), createGAS(), createIMON(), createMix(), createSTATUS(), createT(), createUXC(), and createVMON().

Member Data Documentation

◆ m_connectionString

std::string RPCFw::m_connectionString
private

◆ m_password

std::string RPCFw::m_password
private

◆ m_userName

std::string RPCFw::m_userName
private

◆ N_IOV

unsigned long long RPCFw::N_IOV

Definition at line 40 of file RPCFw.h.

Referenced by createGAS(), createIMON(), and createT().

◆ tMAX

coral::TimeStamp RPCFw::tMAX

◆ tMIN

coral::TimeStamp RPCFw::tMIN
RPCFw::tMIN
coral::TimeStamp tMIN
Definition: RPCFw.h:38
RPCObUXC::Item::dewpoint
float dewpoint
Definition: RPCObUXC.h:20
RPCObGas::Item::day
int day
Definition: RPCObGas.h:21
RPCObGasMix::Item
Definition: RPCObGasMix.h:17
RPCObImon::I_Item
Definition: RPCObCond.h:17
RPCFw::m_connectionString
std::string m_connectionString
Definition: RPCFw.h:54
RPCObPVSSmap::Item::region
int region
Definition: RPCObPVSSmap.h:21
RPCFw::m_userName
std::string m_userName
Definition: RPCFw.h:55
min
T min(T a, T b)
Definition: MathUtil.h:58
RPCObUXC::Item
Definition: RPCObUXC.h:17
RPCObPVSSmap::Item::dpid
int dpid
Definition: RPCObPVSSmap.h:20
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RPCObStatus::S_Item::day
int day
Definition: RPCObCond.h:54
RPCFw::TtoUT
unsigned long long TtoUT(const coral::TimeStamp &time)
Definition: RPCFw.cc:1862
RPCObFebmap::Feb_Item::vmon3
float vmon3
Definition: RPCObFebmap.h:25
RPCObFebmap::Feb_Item::vmon4
float vmon4
Definition: RPCObFebmap.h:26
dqmiodatasetharvest.nan
nan
Definition: dqmiodatasetharvest.py:39
protons_cff.time
time
Definition: protons_cff.py:39
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
RPCObFebmap::Feb_Item::day
int day
Definition: RPCObFebmap.h:29
RPCFw::N_IOV
unsigned long long N_IOV
Definition: RPCFw.h:40
RPCObStatus::S_Item::time
int time
Definition: RPCObCond.h:55
RPCFw::isMajor
bool isMajor(const coral::TimeStamp &fir, const coral::TimeStamp &sec)
Definition: RPCFw.cc:1891
RPCObFebmap::Feb_Item::dpid
int dpid
Definition: RPCObFebmap.h:18
RPCObVmon::V_Item::time
int time
Definition: RPCObCond.h:38
RPCDBCom::connect
coral::ISession * connect(const std::string &connectionString, const std::string &userName, const std::string &password)
Definition: RPCDBCom.cc:22
EcalCondDBWriter_cfi.userName
userName
Definition: EcalCondDBWriter_cfi.py:61
RPCObImon::I_Item::value
float value
Definition: RPCObCond.h:19
RPCObVmon::V_Item::value
float value
Definition: RPCObCond.h:36
RPCObFebmap::Feb_Item::noise3
int noise3
Definition: RPCObFebmap.h:33
RPCObVmon::V_Item::dpid
int dpid
Definition: RPCObCond.h:35
EcalCondDBWriter_cfi.password
password
Definition: EcalCondDBWriter_cfi.py:62
RPCObFebmap::Feb_Item::temp2
float temp2
Definition: RPCObFebmap.h:28
RPCFw::tMAX
coral::TimeStamp tMAX
Definition: RPCFw.h:39
RPCObStatus::S_Item
Definition: RPCObCond.h:51
RPCObGasMix::Item::gas3
float gas3
Definition: RPCObGasMix.h:21
RPCObGasMix::Item::gas1
float gas1
Definition: RPCObGasMix.h:19
RPCFw::UTtoT
coral::TimeStamp UTtoT(long long utime)
Definition: RPCFw.cc:1731
RPCObVmon::V_Item::day
int day
Definition: RPCObCond.h:37
writeEcalDQMStatus.since
since
Definition: writeEcalDQMStatus.py:53
RPCObUXC::Item::temperature
float temperature
Definition: RPCObUXC.h:18
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ntuplemaker.till
till
Definition: ntuplemaker.py:198
RPCObFebmap::Feb_Item::noise4
int noise4
Definition: RPCObFebmap.h:34
RPCObPVSSmap::Item
Definition: RPCObPVSSmap.h:18
RPCObPVSSmap::Item::subsector
int subsector
Definition: RPCObPVSSmap.h:26
RPCObGas::Item::flowin
float flowin
Definition: RPCObGas.h:19
RPCObGas::Item::flowout
float flowout
Definition: RPCObGas.h:20
RPCObTemp::T_Item::time
int time
Definition: RPCObCond.h:72
RPCObFebmap::Feb_Item::vmon1
float vmon1
Definition: RPCObFebmap.h:23
RPCFw::m_password
std::string m_password
Definition: RPCFw.h:56
RPCObGas::Item::time
int time
Definition: RPCObGas.h:22
RPCObStatus::S_Item::value
float value
Definition: RPCObCond.h:53
RPCObFebmap::Feb_Item::thr1
float thr1
Definition: RPCObFebmap.h:19
RPCObPVSSmap::Item::station
int station
Definition: RPCObPVSSmap.h:23
RPCObPVSSmap::Item::sector
int sector
Definition: RPCObPVSSmap.h:24
value
Definition: value.py:1
RPCObTemp::T_Item::value
float value
Definition: RPCObCond.h:70
RPCObTemp::T_Item::day
int day
Definition: RPCObCond.h:71
RPCObFebmap::Feb_Item::thr3
float thr3
Definition: RPCObFebmap.h:21
RPCObTemp::T_Item::dpid
int dpid
Definition: RPCObCond.h:69
RPCObFebmap::Feb_Item::noise1
int noise1
Definition: RPCObFebmap.h:31
RPCObFebmap::Feb_Item::temp1
float temp1
Definition: RPCObFebmap.h:27
util.getRunInfo.day
def day(string)
Definition: getRunInfo.py:11
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
RPCObImon::I_Item::time
int time
Definition: RPCObCond.h:21
RPCObImon::I_Item::dpid
int dpid
Definition: RPCObCond.h:18
RPCObGasMix::Item::gas2
float gas2
Definition: RPCObGasMix.h:20
RPCObVmon::V_Item
Definition: RPCObCond.h:34
heppy_batch.val
val
Definition: heppy_batch.py:351
mergeAndRegister.rest
rest
Definition: mergeAndRegister.py:121
indexGen.date
date
Definition: indexGen.py:99
RPCObFebmap::Feb_Item
Definition: RPCObFebmap.h:17
RPCObFebmap::Feb_Item::time
int time
Definition: RPCObFebmap.h:30
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
relativeConstraints.value
value
Definition: relativeConstraints.py:53
RPCObFebmap::Feb_Item::thr4
float thr4
Definition: RPCObFebmap.h:22
RPCObUXC::Item::pressure
float pressure
Definition: RPCObUXC.h:19
RPCObPVSSmap::Item::suptype
int suptype
Definition: RPCObPVSSmap.h:27
RPCObGas::Item
Definition: RPCObGas.h:17
RPCObGas::Item::dpid
int dpid
Definition: RPCObGas.h:18
RPCObStatus::S_Item::dpid
int dpid
Definition: RPCObCond.h:52
RPCObFebmap::Feb_Item::noise2
int noise2
Definition: RPCObFebmap.h:32
RPCObFebmap::Feb_Item::vmon2
float vmon2
Definition: RPCObFebmap.h:24
RPCObPVSSmap::Item::since
int since
Definition: RPCObPVSSmap.h:19
RPCObUXC::Item::unixtime
int unixtime
Definition: RPCObUXC.h:21
RPCObPVSSmap::Item::ring
int ring
Definition: RPCObPVSSmap.h:22
RPCObFebmap::Feb_Item::thr2
float thr2
Definition: RPCObFebmap.h:20
l1RCTOmdsFedVectorProducer_cfi.connectionString
connectionString
Definition: l1RCTOmdsFedVectorProducer_cfi.py:4
RPCObGasMix::Item::unixtime
int unixtime
Definition: RPCObGasMix.h:18
pileupReCalc_HLTpaths.trunc
trunc
Definition: pileupReCalc_HLTpaths.py:144
RPCDBCom::RPCDBCom
RPCDBCom()
Definition: RPCDBCom.cc:8
RPCObImon::I_Item::day
int day
Definition: RPCObCond.h:20
vertexPlots.e4
e4
Definition: vertexPlots.py:64
RPCObTemp::T_Item
Definition: RPCObCond.h:68
RPCObPVSSmap::Item::layer
int layer
Definition: RPCObPVSSmap.h:25