Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:03

0001 #ifndef OMTF_OMTFinput_H
0002 #define OMTF_OMTFinput_H
0003 
0004 #include <vector>
0005 #include <ostream>
0006 #include <bitset>
0007 
0008 class XMLConfigReader;
0009 class OMTFConfiguration;
0010 
0011 class OMTFinput {
0012 public:
0013   typedef std::vector<int> vector1D;
0014   typedef std::vector<vector1D> vector2D;
0015 
0016   OMTFinput(const OMTFConfiguration *);
0017 
0018   ///Add hit to given layer.
0019   ///iInput marks input number (max 14 per layer)
0020   bool addLayerHit(unsigned int iLayer, unsigned int iInput, int iPhi, int iEta, bool allowOverwrite = true);
0021 
0022   ///Reset vectors with data.
0023   void clear();
0024 
0025   ///Read data from a XML file
0026   void readData(XMLConfigReader *aReader, unsigned int iEvent = 0, unsigned int iProcessor = 0);
0027 
0028   ///Apply shift to all data
0029   void shiftMyPhi(int phiShift);
0030 
0031   ///Merge data of two input objects.
0032   ///Method used in DiMuon studies.
0033   void mergeData(const OMTFinput *aInput);
0034 
0035   const OMTFinput::vector1D &getLayerData(unsigned int iLayer, bool giveEta = false) const;
0036 
0037   std::bitset<128> getRefHits(unsigned int iProcessor) const;
0038 
0039   friend std::ostream &operator<<(std::ostream &out, const OMTFinput &aInput);
0040 
0041   OMTFinput &operator+=(const OMTFinput &iInput) {
0042     mergeData(&iInput);
0043     return *this;
0044   }
0045 
0046 private:
0047   ///Phi measurements in logic layers
0048   ///First index: layer number
0049   ///Second index: measurement number within layer
0050   vector2D measurementsPhi;
0051 
0052   ///Eta measurements in logic layers
0053   ///First index: layer number
0054   ///Second index: measurement number within layer
0055   vector2D measurementsEta;
0056 
0057   ///RefHitsEta
0058   mutable vector1D refHitsEta;
0059 
0060   const OMTFConfiguration *myOmtfConfig;
0061 };
0062 
0063 #endif