Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_Alignment_TkLasBeam_h
0002 #define DataFormats_Alignment_TkLasBeam_h
0003 
0004 #include <vector>
0005 #include <cmath>
0006 
0007 #include "DataFormats/Alignment/interface/SiStripLaserRecHit2D.h"
0008 
0009 /// \class TkLasBeam
0010 /// a collection of tracker laser hits (SiStripLaserRecHit2D) originating from a single laser beam.
0011 /// documentation in TkLasTrackBasedInterface TWiki
0012 class TkLasBeam {
0013 public:
0014   typedef std::vector<SiStripLaserRecHit2D>::const_iterator const_iterator;
0015 
0016   TkLasBeam() {}
0017 
0018   TkLasBeam(unsigned int aBeamId) { beamId = aBeamId; }
0019 
0020   virtual ~TkLasBeam() {}  // virtual destructor to work as base class
0021 
0022   /// return the full beam identifier
0023   unsigned int getBeamId(void) const { return beamId; }
0024 
0025   /// access the collection of hits
0026   const std::vector<SiStripLaserRecHit2D>& getData(void) const { return data; }
0027 
0028   /// access iterator to the collection of hits
0029   std::vector<SiStripLaserRecHit2D>::const_iterator begin(void) const { return data.begin(); }
0030 
0031   /// access iterator to the collection of hits
0032   std::vector<SiStripLaserRecHit2D>::const_iterator end(void) const { return data.end(); }
0033 
0034   /// insert a hit in the data vector
0035   void push_back(const SiStripLaserRecHit2D& aHit) { data.push_back(aHit); }
0036 
0037   /// returns the beam number (10^1 digit of beamId)
0038   unsigned int getBeamNumber(void) const { return beamId % 100 / 10; }
0039 
0040   /// true if this is a TEC internal beam (from 10^2 digit of beamId). side parameter: -1 = ask if TEC-, 1 = TEC+, 0 = any tec, don't care
0041   bool isTecInternal(int side = 0) const;
0042 
0043   /// true if this is an AT beam (from 10^2 digit of beamId)
0044   bool isAlignmentTube(void) const { return (beamId % 1000 / 100) == 2; }
0045 
0046   /// true if this beam hits TEC R6 (last digit of beamId)
0047   bool isRing6(void) const { return (beamId % 10) == 1; }
0048 
0049 private:
0050   unsigned int beamId;
0051   std::vector<SiStripLaserRecHit2D> data;
0052 };
0053 
0054 // To get the typedef for the collection:
0055 #include "DataFormats/Alignment/interface/TkLasBeamCollectionFwd.h"
0056 
0057 #endif