00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonDTLocalMillepedeAlgorithm_h 00002 #define Alignment_MuonAlignmentAlgorithms_MuonDTLocalMillepedeAlgorithm_h 00003 00004 00005 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h" 00006 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentIORoot.h" 00007 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00008 00009 #include "FWCore/ServiceRegistry/interface/Service.h" 00010 #include "PhysicsTools/UtilAlgos/interface/TFileService.h" 00011 00012 #include "TH1D.h" 00013 #include "TProfile.h" 00014 #include "TTree.h" 00015 #include "TFile.h" 00016 #include "TChain.h" 00017 #include "TMatrixD.h" 00018 00019 00020 class AlignableNavigator; 00021 class TFile; 00022 class TTree; 00023 class AlignableDet; 00024 00025 #define MAX_HIT 60 00026 #define MAX_HIT_CHAM 14 00027 #define MAX_SEGMENT 5 00028 00029 00030 class MuonDTLocalMillepedeAlgorithm : public AlignmentAlgorithmBase 00031 { 00032 00033 public: 00034 00036 MuonDTLocalMillepedeAlgorithm(const edm::ParameterSet& cfg); 00037 00039 ~MuonDTLocalMillepedeAlgorithm() {}; 00040 00042 void initialize( const edm::EventSetup& setup, 00043 AlignableTracker* tracker, AlignableMuon* muon, 00044 AlignmentParameterStore* store); 00045 00047 void terminate(void); 00048 00049 00051 void run(const edm::EventSetup& setup, const EventInfo &eventInfo); 00052 //void run( const edm::EventSetup& , const ConstTrajTrackPairCollection& ); 00053 00054 00055 00056 private: 00057 00058 // Builds the 4D segments 00059 bool build4DSegments(); 00060 00061 // Declares the tree structure and associated the variables 00062 void setBranchTrees(); 00063 00064 //Auxiliar structure for 4D segment construction 00065 typedef struct { 00066 int nhits; 00067 float xc[MAX_HIT]; float yc[MAX_HIT]; float zc[MAX_HIT]; 00068 float erx[MAX_HIT]; 00069 int wh[MAX_HIT]; int st[MAX_HIT]; int sr[MAX_HIT]; 00070 int sl[MAX_HIT]; int la[MAX_HIT]; 00071 } Info1D; 00072 00073 Info1D myTrack1D; 00074 00075 00076 //Block of variables for the tree 00077 //--------------------------------------------------------- 00078 float p, pt, eta, phi, charge; 00079 int nseg; 00080 int nphihits[MAX_SEGMENT]; 00081 int nthetahits[MAX_SEGMENT]; 00082 int nhits[MAX_SEGMENT]; 00083 float xSl[MAX_SEGMENT]; 00084 float dxdzSl[MAX_SEGMENT]; 00085 float exSl[MAX_SEGMENT]; 00086 float edxdzSl[MAX_SEGMENT]; 00087 float exdxdzSl[MAX_SEGMENT]; 00088 float ySl[MAX_SEGMENT]; 00089 float dydzSl[MAX_SEGMENT]; 00090 float eySl[MAX_SEGMENT]; 00091 float edydzSl[MAX_SEGMENT]; 00092 float eydydzSl[MAX_SEGMENT]; 00093 float xSlSL1[MAX_SEGMENT]; 00094 float dxdzSlSL1[MAX_SEGMENT]; 00095 float exSlSL1[MAX_SEGMENT]; 00096 float edxdzSlSL1[MAX_SEGMENT]; 00097 float exdxdzSlSL1[MAX_SEGMENT]; 00098 float xSL1SL3[MAX_SEGMENT]; 00099 float xSlSL3[MAX_SEGMENT]; 00100 float dxdzSlSL3[MAX_SEGMENT]; 00101 float exSlSL3[MAX_SEGMENT]; 00102 float edxdzSlSL3[MAX_SEGMENT]; 00103 float exdxdzSlSL3[MAX_SEGMENT]; 00104 float xSL3SL1[MAX_SEGMENT]; 00105 float xc[MAX_SEGMENT][MAX_HIT_CHAM]; 00106 float yc[MAX_SEGMENT][MAX_HIT_CHAM]; 00107 float zc[MAX_SEGMENT][MAX_HIT_CHAM]; 00108 float ex[MAX_SEGMENT][MAX_HIT_CHAM]; 00109 float xcp[MAX_SEGMENT][MAX_HIT_CHAM]; 00110 float ycp[MAX_SEGMENT][MAX_HIT_CHAM]; 00111 float excp[MAX_SEGMENT][MAX_HIT_CHAM]; 00112 float eycp[MAX_SEGMENT][MAX_HIT_CHAM]; 00113 int wh[MAX_SEGMENT]; int st[MAX_SEGMENT]; int sr[MAX_SEGMENT]; 00114 int sl[MAX_SEGMENT][MAX_HIT_CHAM]; 00115 int la[MAX_SEGMENT][MAX_HIT_CHAM]; 00116 //--------------------------------------------------------------- 00117 00118 00119 00120 00121 // private data members 00122 TFile *f; 00123 TTree *ttreeOutput; 00124 TChain *tali; 00125 00126 00127 AlignmentParameterStore* theAlignmentParameterStore; 00128 std::vector<Alignable*> theAlignables; 00129 AlignableNavigator* theAlignableDetAccessor; 00130 00131 //Service for histograms 00132 edm::Service<TFileService> fs; 00133 00134 edm::InputTag globalTracks; 00135 edm::InputTag consTraj; 00136 std::string ntuplePath; 00137 float ptMax; 00138 float ptMin; 00139 float nPhihits; 00140 float nThetahits; 00141 int workingmode; 00142 int numberOfRootFiles; 00143 int nMtxSection; 00144 00145 00146 //FIXME: Not clear if needed 00147 float numberOfSigmasX; 00148 float numberOfSigmasDXDZ; 00149 float numberOfSigmasY; 00150 float numberOfSigmasDYDZ; 00151 00152 float meanx[5][4][14]; 00153 float sigmax[5][4][14]; 00154 float meandxdz[5][4][14]; 00155 float sigmadxdz[5][4][14]; 00156 float meany[5][4][14]; 00157 float sigmay[5][4][14]; 00158 float meandydz[5][4][14]; 00159 float sigmadydz[5][4][14]; 00160 00161 00162 }; 00163 00164 #endif