kalmanalignment is hosted by Hepforge, IPPP Durham
Kalman Alignment

/home/mweber/Dokumente/CMS/Alignment/kalmanalignment/trunk/simulation/Detector.h

Go to the documentation of this file.
00001 #ifndef _Detector_h
00002 #define _Detector_h
00003 
00004 // STL includes
00005 #include <vector>
00006 
00007 // C/C++ includes
00008 #include <math.h>
00009 
00010 // local includes
00011 #include "Det.h"
00012 
00019 class Detector;
00020 
00021 // defined in Detector.cc
00022 extern Detector * gDetector;
00023 
00033 class Detector
00034 {
00035  public:
00038   Detector(const char * fname);
00039   virtual ~Detector();
00040 
00042   const int    GetNLayer() const { return fNLayer; };
00044   const int    GetNRod() const { return fNRod; };
00046   const int    GetNModule() const { return fNModule; };
00048   const double GetLayerDistance() const { return fLayerDistance; };
00049 
00050   // detector size
00051   const double GetWidth() const { return fNRod*fModuleWidth; };
00052   const double GetLength() const { return fNModule*fModuleLength; };
00053   const double GetHeight() const { return fNLayer*fLayerDistance; };
00054 
00058   const double GetMisalignPosition() const { return fMisalignPosition; };
00061   const double GetMisalignRotation() const { return fMisalignRotation; };
00063   const CLHEP::HepVector & GetTrueMisalign() const { return fTrueMisalignment; }
00064 
00066   int MakeID(int layer, int rod, int module) const;
00067 
00069   const Det & GetDet(int layer, int rod, int module) const;
00071   void ResetDet(int moduleID);
00072 
00073  protected:
00074   // Detector layout
00075   int    fNLayer;
00076   int    fNRod;
00077   int    fNModule;
00078   double fLayerDistance;
00079   bool   fRandomPlacement;
00080 
00081   // Module layout
00082   double fModuleWidth;
00083   double fModuleLength;
00084   double fModuleThickness;
00085   double fModulePitchX;
00086   double fModulePitchY;
00087 
00088   // Misalignment
00089   double fMisalignPosition;
00090   double fMisalignRotation;
00091 
00093   std::vector<Det *> DetVec;
00094 
00096   CLHEP::HepVector fTrueMisalignment;
00097 
00098  private:
00099   void ReadConfiguration(const char * fname);
00101   void CreateModules();
00103   Det * CreateDetector(int ID, int layer, int rod, int module);
00105   void MisalignDetector(Det * adet);
00106 };
00107 
00108 #endif