CMS 3D CMS Logo

HIPAlignmentAlgorithm.h

Go to the documentation of this file.
00001 #ifndef Alignment_HIPAlignmentAlgorithm_HIPAlignmentAlgorithm_h
00002 #define Alignment_HIPAlignmentAlgorithm_HIPAlignmentAlgorithm_h
00003 
00004 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
00005 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentIORoot.h"
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 
00008 class AlignableNavigator;
00009 class TFile;
00010 class TTree;
00011 
00012 class HIPAlignmentAlgorithm : public AlignmentAlgorithmBase
00013 {
00014 
00015  public:
00016   
00018   HIPAlignmentAlgorithm(const edm::ParameterSet& cfg);
00019 
00021   ~HIPAlignmentAlgorithm() {};
00022 
00024   void initialize( const edm::EventSetup& setup, 
00025                    AlignableTracker* tracker, AlignableMuon* muon, 
00026                    AlignmentParameterStore* store);
00027 
00029   void terminate(void);
00030 
00032   void startNewLoop(void);
00033 
00035   void run( const edm::EventSetup& setup, const ConstTrajTrackPairCollection& tracks );
00036 
00037  private:
00038 
00039   // private member functions
00040 
00041   int readIterationFile(std::string filename);
00042   void writeIterationFile(std::string filename,int iter);
00043   void setAlignmentPositionError(void);
00044   double calcAPE(double* par, int iter, double function);
00045   void bookRoot(void);
00046   void fillRoot(void);
00047   bool calcParameters(Alignable* ali);
00048   void collector(void);
00049 
00050   // private data members
00051 
00052   AlignmentParameterStore* theAlignmentParameterStore;
00053   std::vector<Alignable*> theAlignables;
00054   AlignableNavigator* theAlignableDetAccessor;
00055 
00056   AlignmentIORoot    theIO;
00057   int ioerr;
00058   int theIteration;
00059 
00060   // steering parameters
00061 
00062   // verbosity flag
00063   bool verbose;
00064   // names of IO root files
00065   std::string outfile,outfile2,outpath,suvarfile,sparameterfile;
00066   std::string struefile,smisalignedfile,salignedfile,siterationfile;
00067   // alignment position error parameters
00068   bool theApplyAPE;
00069   std::vector<edm::ParameterSet> theAPEParameterSet;
00070   std::vector<std::pair<std::vector<Alignable*>, std::vector<double> > > theAPEParameters;
00071   // max allowed pull (residual / uncertainty) on a hit used in alignment
00072   double theMaxAllowedHitPull;
00073   // min number of hits on alignable to calc parameters
00074   int theMinimumNumberOfHits;
00075   // max allowed rel error on parameter (else not used)
00076   double theMaxRelParameterError;
00077   // collector mode (parallel processing)
00078   bool isCollector;
00079   int theCollectorNJobs;
00080   std::string theCollectorPath;
00081   int theEventPrescale,theCurrentPrescale;
00082 
00083   std::vector<align::StructureType> theLevels; // for survey residuals
00084 
00085   // root tree variables
00086   TFile* theFile;
00087   TTree* theTree; // event-wise tree
00088   TFile* theFile2;
00089   TTree* theTree2; // alignable-wise tree
00090 
00091   // variables for event-wise tree
00092   static const int MAXREC = 99;
00093   //int m_Run,m_Event;
00094   int m_Ntracks,m_Nhits[MAXREC];
00095   float m_Pt[MAXREC],m_Eta[MAXREC],m_Phi[MAXREC],m_Chi2n[MAXREC];
00096 
00097   // variables for alignable-wise tree
00098   //static const int MAXITER = 99;
00099   //static const int MAXPAR = 6;
00100   int m2_Nhit,m2_Type,m2_Layer;
00101   float m2_Xpos, m2_Ypos, m2_Zpos, m2_Eta, m2_Phi; 
00102   align::ID m2_Id;
00103   align::StructureType m2_ObjId;
00104 
00105 };
00106 
00107 #endif

Generated on Tue Jun 9 17:24:02 2009 for CMSSW by  doxygen 1.5.4