Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:35:08

0001 #ifndef PixelToLNKAssociateFromAscii_H
0002 #define PixelToLNKAssociateFromAscii_H
0003 
0004 /** \class PixelToLNKAssociateFromAscii
0005  *  Check to which FED pixel module belongs to.
0006  *  The associacions are read from the datafile
0007  */
0008 
0009 #include <vector>
0010 #include <string>
0011 #include <map>
0012 
0013 #include "CalibTracker/SiPixelConnectivity/interface/TRange.h"
0014 #include "CalibTracker/SiPixelConnectivity/interface/PixelToFEDAssociate.h"
0015 
0016 class PixelBarrelName;
0017 class PixelEndcapName;
0018 class PixelModuleName;
0019 
0020 class PixelToLNKAssociateFromAscii : public PixelToFEDAssociate {
0021 public:
0022   typedef PixelToFEDAssociate::CablingRocId CablingRocId;
0023   typedef PixelToFEDAssociate::DetectorRocId DetectorRocId;
0024 
0025   PixelToLNKAssociateFromAscii(const std::string& fileName, const bool phase1 = false);
0026 
0027   const CablingRocId* operator()(const DetectorRocId& roc) const override;
0028 
0029   /// version
0030   std::string version() const override;
0031 
0032 private:
0033   typedef TRange<int> Range;
0034 
0035   /// initialisatin (read file)
0036   void init(const std::string& fileName);
0037   void addConnections(int fedId, int linkId, std::string module, Range rocDetIds);
0038   std::string theVersion;
0039   std::vector<std::pair<DetectorRocId, CablingRocId> > theConnection;
0040   Range readRange(const std::string&) const;
0041   bool phase1_;  // signals phase1 detector
0042 };
0043 #endif