Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:17

0001 //
0002 // Test program that will read and write out
0003 // DAC settings, trim bitsa and maskbits for a
0004 // readout link object.
0005 //
0006 //
0007 //
0008 //
0009 //
0010 
0011 #include "CalibFormats/SiPixelObjects/interface/PixelCalibConfiguration.h"
0012 #include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h"
0013 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0014 #include "CalibFormats/SiPixelObjects/interface/PixelPortcardMap.h"
0015 #include "CalibFormats/SiPixelObjects/interface/PixelFECConfig.h"
0016 #include "CalibFormats/SiPixelObjects/interface/PixelTKFECConfig.h"
0017 #include "PixelUtilities/PixelTestStandUtilities/include/PixelTimer.h"
0018 
0019 using namespace pos;
0020 using namespace std;
0021 
0022 int main() {
0023   //First lets do some tests of the PixelROCName class
0024 
0025   //std::string path(std::getenv("XDAQ_ROOT"));
0026   //path+="/pixel/PixelFEDInterface/test/";
0027   //PixelFEDCard card(path+"params_fed.dat");
0028 
0029   //PixelCalibConfiguration calib("calib.dat_orig");
0030 
0031   //calib.writeASCII("");
0032 
0033   //return 0;
0034 
0035   cout << "Will open translation.dat" << endl;
0036 
0037   PixelTimer t, t2, t3, t4;
0038 
0039   t2.start();
0040 
0041   PixelNameTranslation nametranslation("translation.dat");
0042 
0043   t2.stop();
0044   cout << "Time to read name translations:" << t2.tottime() << endl;
0045 
0046   t3.start();
0047 
0048   PixelCalibConfiguration calib("calib.dat");
0049 
0050   t3.stop();
0051   cout << "Time to read calib.dat:" << t3.tottime() << endl;
0052 
0053   t4.start();
0054 
0055   PixelDetectorConfig detconfig("detectconfig.dat");
0056 
0057   t4.stop();
0058   cout << "Time to read detectconfig:" << t4.tottime() << endl;
0059 
0060   PixelPortcardMap portcardmap("portcardmap.dat");
0061 
0062   PixelFECConfig fecconfig("fecconfig.dat");
0063 
0064   PixelTKFECConfig tkfecconfig("tkfecconfig.dat");
0065 
0066   const std::set<std::string>& portcards = portcardmap.portcards(&detconfig);
0067 
0068   cout << "Will start to build ROC list" << endl;
0069 
0070   t.start();
0071 
0072   calib.buildROCAndModuleLists(&nametranslation, &detconfig);
0073 
0074   t.stop();
0075 
0076   cout << "Done with building ROC list" << endl;
0077 
0078   cout << "Size of ROC list:" << calib.rocList().size() << endl;
0079 
0080   cout << "Time to build ROC list:" << t.tottime() << endl;
0081 
0082   /*
0083   
0084   
0085   for(unsigned int fednumber=1; fednumber<2; fednumber++){
0086     for (unsigned int channel=1; channel<7; ++channel) {
0087       std::cout << "Will check fednumber="<<fednumber<<" and channel="<<channel<<std::endl;
0088       std::vector<PixelROCName> rocs=nametranslation.getROCsFromFEDChannel(fednumber, channel);
0089       for (unsigned int iroc=0; iroc<rocs.size(); ++iroc) {
0090         std::cout<<"ROC Name under FED ID "<<fednumber<<" channel="<<channel<<" ROC Name="<<rocs[iroc]<<std::endl;
0091       }
0092     }
0093   }
0094   */
0095 
0096   return 0;
0097 }