Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CASTORTEXT2DETIDCONVERTER_H
0002 #define CASTORTEXT2DETIDCONVERTER_H
0003 
0004 /** \class CastorText2DetIdConverter
0005 
0006    Converts any flavour of HcalDetId to/from ascii strings
0007 
0008 */
0009 #include <string>
0010 #include "DataFormats/DetId/interface/DetId.h"
0011 
0012 class CastorText2DetIdConverter {
0013 public:
0014   CastorText2DetIdConverter(const std::string& fFlavor = "NA",
0015                             const std::string& fField1 = "0",
0016                             const std::string& fField2 = "0",
0017                             const std::string& fField3 = "0");
0018 
0019   CastorText2DetIdConverter(DetId fId);
0020 
0021   //  bool isHcalDetId () const;
0022   bool isHcalCastorDetId() const;
0023 
0024   const std::string& getFlavor() const { return flavorName; }
0025   const std::string& getField1() const { return field1; }
0026   const std::string& getField2() const { return field2; }
0027   const std::string& getField3() const { return field3; }
0028   DetId getId() const { return mId; }
0029   int getField(int i) const;
0030   std::string toString() const;
0031 
0032 private:
0033   bool init(const std::string& fFlavor,
0034             const std::string& fField1,
0035             const std::string& fField2,
0036             const std::string& fField3);
0037   bool init(DetId fId);
0038   void setField(int i, int fValue);
0039   std::string flavorName;
0040   std::string field1;
0041   std::string field2;
0042   std::string field3;
0043   DetId mId;
0044 };
0045 
0046 #endif