Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:26

0001 /****************************************************************************
0002  *
0003  * 
0004  * Authors: 
0005  *  F.Ferro ferro@ge.infn.it
0006  *
0007  ****************************************************************************/
0008 
0009 #include "CondFormats/PPSObjects/interface/CTPPSPixelFramePosition.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 #include <iomanip>
0012 
0013 using namespace std;
0014 
0015 //----------------------------------------------------------------------------------------------------
0016 
0017 std::ostream &operator<<(std::ostream &s, const CTPPSPixelFramePosition &fp) {
0018   return s << fp.getFEDId() << ":" << fp.getFMCId() << ":" << fp.getChannelIdx() << ":" << fp.getROC();
0019 }
0020 
0021 //----------------------------------------------------------------------------------------------------
0022 
0023 void CTPPSPixelFramePosition::printXML() {
0024   edm::LogInfo("printXML") << "\" FEDId=\"" << getFEDId() << "\" FMCId=\"" << getFMCId() << "\" ChannelIdx=\""
0025                            << getChannelIdx() << "\" ROC=\"" << getROC() << "\"";
0026 }
0027 
0028 //----------------------------------------------------------------------------------------------------
0029 
0030 unsigned char CTPPSPixelFramePosition::setXMLAttribute(const std::string &attribute,
0031                                                        const std::string &value,
0032                                                        unsigned char &flag) {
0033   unsigned int v = atoi(value.c_str());
0034 
0035   if (attribute == "FEDId") {
0036     setFEDId(v);
0037     flag |= 0x8;
0038     return 0;
0039   }
0040 
0041   if (attribute == "FMC") {
0042     setFMCId(v);
0043     flag |= 0x4;
0044     return 0;
0045   }
0046 
0047   if (attribute == "FEDChannel") {
0048     setChannelIdx(v);
0049     flag |= 0x2;
0050     return 0;
0051   }
0052 
0053   if (attribute == "ROCinChannel") {
0054     setROC(v);
0055     flag |= 0x1;
0056     return 0;
0057   }
0058 
0059   return 1;
0060 }