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
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
00051
00052 AlignmentParameterStore* theAlignmentParameterStore;
00053 std::vector<Alignable*> theAlignables;
00054 AlignableNavigator* theAlignableDetAccessor;
00055
00056 AlignmentIORoot theIO;
00057 int ioerr;
00058 int theIteration;
00059
00060
00061
00062
00063 bool verbose;
00064
00065 std::string outfile,outfile2,outpath,suvarfile,sparameterfile;
00066 std::string struefile,smisalignedfile,salignedfile,siterationfile;
00067
00068 bool theApplyAPE;
00069 std::vector<edm::ParameterSet> theAPEParameterSet;
00070 std::vector<std::pair<std::vector<Alignable*>, std::vector<double> > > theAPEParameters;
00071
00072 double theMaxAllowedHitPull;
00073
00074 int theMinimumNumberOfHits;
00075
00076 double theMaxRelParameterError;
00077
00078 bool isCollector;
00079 int theCollectorNJobs;
00080 std::string theCollectorPath;
00081 int theEventPrescale,theCurrentPrescale;
00082
00083 std::vector<align::StructureType> theLevels;
00084
00085
00086 TFile* theFile;
00087 TTree* theTree;
00088 TFile* theFile2;
00089 TTree* theTree2;
00090
00091
00092 static const int MAXREC = 99;
00093
00094 int m_Ntracks,m_Nhits[MAXREC];
00095 float m_Pt[MAXREC],m_Eta[MAXREC],m_Phi[MAXREC],m_Chi2n[MAXREC];
00096
00097
00098
00099
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