Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:38

0001 #include <iostream>
0002 #include <fstream>
0003 #include <vector>
0004 #include <iostream>
0005 #include <string>
0006 
0007 using namespace std;
0008 
0009 int main()
0010 {
0011   float elem33,elem34,elem44,elem35,elem45,elem55,elem46,elem56,elem66,elem57,elem67,elem77;
0012   int index,flag,flag1;
0013   int nrlines=0;
0014 
0015   std::vector<int>   index_id;
0016   std::vector<float> Elem33;
0017   std::vector<float> Elem34;
0018   std::vector<float> Elem44;
0019   std::vector<float> Elem35;
0020   std::vector<float> Elem45;
0021   std::vector<float> Elem55;
0022   std::vector<float> Elem46;
0023   std::vector<float> Elem56;
0024   std::vector<float> Elem66;
0025   std::vector<float> Elem57;
0026   std::vector<float> Elem67;
0027   std::vector<float> Elem77;
0028 
0029   std::ifstream dbdata;
0030   dbdata.open("FileName",std::ios::in);
0031   if(!dbdata)
0032   {
0033     std::cerr <<"Error: FileName -> no such file!"<< std::endl;
0034     exit(1);
0035   }
0036 
0037   while (!dbdata.eof() )
0038   {
0039     dbdata >> index >>elem33>>elem34>>elem44>>elem35>>elem45>>elem55>>elem46>>elem56>>elem66>>elem57>>elem67>>elem77 >>flag >>flag1;
0040     index_id.push_back(index);
0041     Elem33.push_back(elem33);
0042     Elem34.push_back(elem34);
0043     Elem44.push_back(elem44);
0044     Elem35.push_back(elem35);
0045     Elem45.push_back(elem45);
0046     Elem55.push_back(elem55);
0047     Elem46.push_back(elem46);
0048     Elem56.push_back(elem56);
0049     Elem66.push_back(elem66);
0050     Elem57.push_back(elem57);
0051     Elem67.push_back(elem67);
0052     Elem77.push_back(elem77);
0053     nrlines++;
0054   }
0055   dbdata.close();
0056   std::ofstream myMatrixFile("GoodVals_FileName",std::ios::out);
0057 
0058   for(int i=0; i<nrlines-1;++i)
0059   {
0060 
0061     if (Elem33[i]<30.0 && Elem33[i]>0)
0062     {
0063       if (Elem34[i]>-5.0 && Elem34[i]<15.0)
0064       {
0065         if (Elem44[i]>0 && Elem44[i]<30.0)
0066         {
0067           if (Elem35[i]<25. && Elem35[i]>-5.0)
0068           {
0069             if (Elem45[i]<30.&& Elem45[i]>-5.0)
0070             {
0071               if (Elem55[i]<30.&& Elem55[i]>0)
0072               {
0073                 if (Elem46[i]>-5. && Elem46[i]<30.0)
0074                 {
0075                   if(Elem56[i]<25.&& Elem56[i]>-5.0)
0076                   {
0077                     if (Elem66[i]<25.&& Elem66[i]>0)
0078                     {
0079                       if (Elem57[i]>-5. && Elem57[i]<30.0)
0080                       {
0081                         if (Elem67[i]<15.0 && Elem67[i]>-5.0)
0082                         {
0083                           if (Elem77[i]<25. && Elem77[i]>0 )
0084                           {
0085                             if(Elem34[i]*Elem34[i]<Elem33[i] && Elem34[i]*Elem34[i]<Elem44[i])
0086                             {
0087                               if(Elem35[i]*Elem35[i]<Elem33[i] && Elem35[i]*Elem35[i]<Elem55[i])
0088                               {
0089                                 if(Elem45[i]*Elem45[i]<Elem44[i] && Elem45[i]*Elem45[i]<Elem55[i])
0090                                 {
0091                                   if(Elem46[i]*Elem46[i]<Elem44[i] && Elem46[i]*Elem46[i]<Elem66[i])
0092                                   {
0093                                     if(Elem56[i]*Elem56[i]<Elem55[i] && Elem56[i]*Elem56[i]<Elem66[i])
0094                                     {
0095                                       if(Elem57[i]*Elem57[i]<Elem55[i] && Elem57[i]*Elem57[i]<Elem77[i])
0096                                       {
0097                                         myMatrixFile<<index_id[i]<<"  "<<Elem33[i]<<"  "<<Elem34[i]<<"  "<<Elem44[i]<<"  "<<Elem35[i]<<"  "<<Elem45[i]<<"  "<<Elem55[i]<<"  "<<Elem46[i]<<"  "<<Elem56[i]<<"  "<<Elem66[i]<<"  "<<Elem57[i]<<"  "<<Elem67[i]<<"  "<<Elem77[i]<<std::endl;
0098                                       }
0099                                     }
0100                                   }
0101                                 }
0102                               }
0103                             }
0104                           }
0105                         }
0106                       }
0107                     }
0108                   }
0109                 }
0110               }
0111             }
0112           }
0113         }
0114       }
0115     }
0116     if (flag==1 || flag1!=1)
0117     {
0118       std::cout<<"Flag not 0: "<<index_id[i]<<" " <<flag<<"  "<<flag1<<std::endl;
0119     }
0120   }
0121 
0122   /*
0123     if(Elem34[i]*Elem34[i]<Elem33[i] && Elem34[i]*Elem34[i]<Elem44[i]){
0124     if(Elem35[i]*Elem35[i]<Elem33[i] && Elem35[i]*Elem35[i]<Elem55[i]){
0125     if(Elem45[i]*Elem45[i]<Elem44[i] && Elem45[i]*Elem45[i]<Elem55[i]){
0126     if(Elem46[i]*Elem46[i]<Elem44[i] && Elem46[i]*Elem46[i]<Elem66[i]){
0127       if(Elem56[i]*Elem56[i]<Elem55[i] && Elem56[i]*Elem56[i]<Elem66[i]){
0128       if(Elem57[i]*Elem57[i]<Elem55[i] && Elem57[i]*Elem57[i]<Elem77[i]){
0129       myMatrixFile<<index_id[i]<<"  "<<Elem33[i]<<"  "<<Elem34[i]<<"  "<<Elem44[i]<<"  "<<Elem35[i]<<"  "<<Elem45[i]<<"  "<<Elem55[i]<<"  "<<Elem46[i]<<"  "<<Elem56[i]<<"  "<<Elem66[i]<<"  "<<Elem57[i]<<"  "<<Elem67[i]<<"  "<<Elem77[i]<<std::endl;
0130       }
0131       }
0132     }
0133     }
0134     }
0135     }
0136   }
0137       */
0138 }