Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:21:59

0001 #ifndef __PHG4SVTXCLUSTERIZER_H__
0002 #define __PHG4SVTXCLUSTERIZER_H__
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <phool/PHTimeServer.h>
0006 #include <map>
0007 #include <limits.h>
0008 
0009 #include <trackbase/TrkrClusterContainer.h>
0010 #include <trackbase/TrkrDefUtil.h>
0011 
0012 class TrkrHitSetContainer;
0013 
0014 class MvtxAlign : public SubsysReco {
0015 
0016 public:
0017 
0018   struct AlignmentPar {
0019     double dx;
0020     double dy;
0021     double dz;
0022   };
0023 
0024 
0025   MvtxAlign(const std::string &name = "MvtxAlign");
0026   virtual ~MvtxAlign() {}
0027 
0028   //! module initialization
0029   int Init(PHCompositeNode *topNode) {return 0;}
0030 
0031   //! run initialization
0032   int InitRun(PHCompositeNode *topNode);
0033 
0034   //! event processing
0035   int process_event(PHCompositeNode *topNode);
0036 
0037   //! end of process
0038   int End(PHCompositeNode *topNode) {return 0;}
0039 
0040   //! put in misalignment by hand
0041   void AddAlignmentPar(TrkrDefs::hitsetkey key, double dx, double dy, double dz);
0042 
0043   //! print stored misalignments
0044   void PrintAlignmentPars(std::ostream &os = std::cout) const;
0045 
0046   //! set the directory for alignment parameter files
0047   void SetAlignmentParFileDir(const std::string fdir) { fdir_ = fdir; }
0048 
0049   //! set boolean to read from file rather than setting by hand
0050   void SetAlignmentParFromFile(const bool yn) { apff_ = yn; }
0051 
0052 private:
0053 
0054   // read the alignment parameters from file based on run number
0055   int ReadAlignmentParFile();
0056 
0057   // node tree storage pointers
0058   TrkrClusterContainer* clusters_;
0059 
0060   // storage object for misalignments
0061   std::map<TrkrDefs::hitsetkey, AlignmentPar> alignmap_;
0062 
0063   // directory for alignment parameter files
0064   std::string fdir_;
0065   int runnumber_;
0066   bool apff_; // alignment par from file
0067 
0068   PHTimeServer::timer _timer;
0069 };
0070 
0071 #endif