Public Member Functions | |
void | afterAlignment (const edm::EventSetup &iSetup) |
Called after updating AlignableTracker and AlignableMuon (by "endOfLoop()"): may be reimplemented. | |
AlignmentMonitorTracksFromTrajectories (const edm::ParameterSet &cfg) | |
void | book () |
Book or retrieve histograms; MUST be reimplemented. | |
void | event (const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) |
~AlignmentMonitorTracksFromTrajectories () | |
Private Attributes | |
TH1F * | m_chi2_100 |
TH1F * | m_chi2_10000 |
TH1F * | m_chi2_1000000 |
TH1F * | m_chi2_improvement |
TH1F * | m_chi2_log |
TH1F * | m_chi2DOF_100 |
TH1F * | m_chi2DOF_1000 |
TH1F * | m_chi2DOF_5 |
TH1F * | m_chi2DOF_improvement |
TH1F * | m_chi2DOF_log |
TH1F * | m_diMuon_Jpsi |
TH1F * | m_diMuon_log |
TH1F * | m_diMuon_Ups |
TH1F * | m_diMuon_Z |
TH1F * | m_diMuon_Zbackward |
TH1F * | m_diMuon_Zbarrel |
TH1F * | m_diMuon_Zforward |
TH1F * | m_pt [36] |
bool | m_vertexConstraint |
double | m_vX |
double | m_vY |
double | m_vZ |
MuonServiceProxy * | theMuonServiceProxy |
MuonUpdatorAtVertex * | theMuonUpdatorAtVertex |
Definition at line 34 of file AlignmentMonitorTracksFromTrajectories.cc.
AlignmentMonitorTracksFromTrajectories::AlignmentMonitorTracksFromTrajectories | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 98 of file AlignmentMonitorTracksFromTrajectories.cc.
References lat::endl(), Exception, edm::ParameterSet::getParameter(), m_vertexConstraint, m_vX, m_vY, m_vZ, MuonServiceProxy_cff::MuonServiceProxy, MuonUpdatorAtVertex_cff::MuonUpdatorAtVertex, theMuonServiceProxy, and theMuonUpdatorAtVertex.
00099 : AlignmentMonitorBase(cfg, "AlignmentMonitorTracksFromTrajectories") 00100 , m_vertexConstraint(cfg.getParameter<bool>("vertexConstraint")) 00101 { 00102 std::vector<double> vertex(cfg.getParameter<std::vector<double> >("fakeBeamSpot")); 00103 if (vertex.size() != 3) { 00104 throw cms::Exception("BadConfig") 00105 << "fakeBeamSpot must be a 3-tuple: cms.vdouble(##, ##, ##)" << std::endl; 00106 } 00107 m_vX = vertex[0]; 00108 m_vY = vertex[1]; 00109 m_vZ = vertex[2]; 00110 00111 if (m_vertexConstraint) { 00112 throw cms::Exception("NotImplemented") 00113 << "Sorry; AlignmentMonitorTracksFromTrajectories can't constrain " 00114 << "to the vertex because that now requires a beamspot, which requires " 00115 << "the whole Event record (something AlignmentMonitor modules don't get)." << std::endl; 00116 } 00117 theMuonServiceProxy = new MuonServiceProxy(cfg.getParameter<edm::ParameterSet>("ServiceParameters")); 00118 theMuonUpdatorAtVertex = new MuonUpdatorAtVertex(cfg.getParameter<edm::ParameterSet>("MuonUpdatorAtVertexParameters"), theMuonServiceProxy); 00119 }
AlignmentMonitorTracksFromTrajectories::~AlignmentMonitorTracksFromTrajectories | ( | ) | [inline] |
void AlignmentMonitorTracksFromTrajectories::afterAlignment | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
Called after updating AlignableTracker and AlignableMuon (by "endOfLoop()"): may be reimplemented.
Reimplemented from AlignmentMonitorBase.
Definition at line 273 of file AlignmentMonitorTracksFromTrajectories.cc.
void AlignmentMonitorTracksFromTrajectories::book | ( | ) | [virtual] |
Book or retrieve histograms; MUST be reimplemented.
Implements AlignmentMonitorBase.
Definition at line 129 of file AlignmentMonitorTracksFromTrajectories.cc.
References AlignmentMonitorBase::book1D(), i, m_chi2_100, m_chi2_10000, m_chi2_1000000, m_chi2_improvement, m_chi2_log, m_chi2DOF_100, m_chi2DOF_1000, m_chi2DOF_5, m_chi2DOF_improvement, m_chi2DOF_log, m_diMuon_Jpsi, m_diMuon_log, m_diMuon_Ups, m_diMuon_Z, m_diMuon_Zbackward, m_diMuon_Zbarrel, m_diMuon_Zforward, m_pt, name, and indexGen::title.
00129 { 00130 m_diMuon_Z = book1D("/iterN/", "diMuon_Z", "Di-muon mass (GeV)", 200, 90. - 50., 90. + 50.); 00131 m_diMuon_Zforward = book1D("/iterN/", "diMuon_Zforward", "Di-muon mass (GeV) eta > 1.4", 200, 90. - 50., 90. + 50.); 00132 m_diMuon_Zbarrel = book1D("/iterN/", "diMuon_Zbarrel", "Di-muon mass (GeV) -1.4 < eta < 1.4", 200, 90. - 50., 90. + 50.); 00133 m_diMuon_Zbackward = book1D("/iterN/", "diMuon_Zbackward", "Di-muon mass (GeV) eta < -1.4", 200, 90. - 50., 90. + 50.); 00134 m_diMuon_Ups = book1D("/iterN/", "diMuon_Ups", "Di-muon mass (GeV)", 200, 9. - 3., 9. + 3.); 00135 m_diMuon_Jpsi = book1D("/iterN/", "diMuon_Jpsi", "Di-muon mass (GeV)", 200, 3. - 1., 3. + 1.); 00136 m_diMuon_log = book1D("/iterN/", "diMuon_log", "Di-muon mass (log GeV)", 300, 0, 3); 00137 m_chi2_100 = book1D("/iterN/", "m_chi2_100", "Track chi^2", 100, 0, 100); 00138 m_chi2_10000 = book1D("/iterN/", "m_chi2_10000", "Track chi^2", 100, 0, 10000); 00139 m_chi2_1000000 = book1D("/iterN/", "m_chi2_1000000", "Track chi^2", 100, 1, 1000000); 00140 m_chi2_log = book1D("/iterN/", "m_chi2_log", "Log track chi^2", 100, -3, 7); 00141 m_chi2DOF_5 = book1D("/iterN/", "m_chi2DOF_5", "Track chi^2/nDOF", 100, 0, 5); 00142 m_chi2DOF_100 = book1D("/iterN/", "m_chi2DOF_100", "Track chi^2/nDOF", 100, 0, 100); 00143 m_chi2DOF_1000 = book1D("/iterN/", "m_chi2DOF_1000", "Track chi^2/nDOF", 100, 0, 1000); 00144 m_chi2DOF_log = book1D("/iterN/", "m_chi2DOF_log", "Log track chi^2/nDOF", 100, -3, 7); 00145 m_chi2_improvement = book1D("/iterN/", "m_chi2_improvement", "Track-by-track chi^2/original chi^2", 100, 0., 10.); 00146 m_chi2DOF_improvement = book1D("/iterN/", "m_chi2DOF_improvement", "Track-by-track (chi^2/DOF)/(original chi^2/original DOF)", 100, 0., 10.); 00147 for (int i = 0; i < 36; i++) { 00148 char name[100], title[100]; 00149 sprintf(name, "m_pt_phi%d", i); 00150 sprintf(title, "Track pt (GeV) in phi bin %d/36", i); 00151 m_pt[i] = book1D("/iterN/", name, title, 100, 0, 100); 00152 } 00153 }
void AlignmentMonitorTracksFromTrajectories::event | ( | const edm::EventSetup & | iSetup, | |
const ConstTrajTrackPairCollection & | iTrajTracks | |||
) |
Definition at line 159 of file AlignmentMonitorTracksFromTrajectories.cc.
References TrajectoryMeasurement::backwardPredictedState(), reco::TrackBase::chi2(), Trajectory::chiSquared(), TrackingRecHit::dimension(), e1, e2, relval_parameters_module::energy, eta, PV3DBase< T, PVType, FrameType >::eta(), i, it, m_chi2_100, m_chi2_10000, m_chi2_1000000, m_chi2_improvement, m_chi2_log, m_chi2DOF_100, m_chi2DOF_1000, m_chi2DOF_5, m_chi2DOF_improvement, m_chi2DOF_log, m_diMuon_Jpsi, m_diMuon_log, m_diMuon_Ups, m_diMuon_Z, m_diMuon_Zbackward, m_diMuon_Zbarrel, m_diMuon_Zforward, m_pt, m_vX, m_vY, m_vZ, PV3DBase< T, PVType, FrameType >::mag(), PV3DBase< T, PVType, FrameType >::mag2(), Trajectory::measurements(), reco::TrackBase::normalizedChi2(), p1, p2, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, MuonUpdatorAtVertex::propagate(), TrajectoryMeasurement::recHit(), funct::sqrt(), state, TrajectoryStateOnSurface::surface(), theMuonServiceProxy, theMuonUpdatorAtVertex, Surface::toGlobal(), and track.
00159 { 00160 theMuonServiceProxy->update(iSetup); 00161 00162 GlobalVector p1, p2; 00163 double e1 = 0.; 00164 double e2 = 0.; 00165 00166 for (ConstTrajTrackPairCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it) { 00167 const Trajectory *traj = it->first; 00168 const reco::Track *track = it->second; 00169 00170 int nDOF = 0; 00171 TrajectoryStateOnSurface closestTSOS; 00172 double closest = 10000.; 00173 00174 std::vector<TrajectoryMeasurement> measurements = traj->measurements(); 00175 for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) { 00176 const TrajectoryMeasurement meas = *im; 00177 const TransientTrackingRecHit* hit = &(*meas.recHit()); 00178 // const DetId id = hit->geographicalId(); 00179 00180 nDOF += hit->dimension(); 00181 00182 TrajectoryStateOnSurface TSOS = meas.backwardPredictedState(); 00183 GlobalPoint where = TSOS.surface().toGlobal(LocalPoint(0,0,0)); 00184 00185 if (where.mag() < closest) { 00186 closest = where.mag(); 00187 closestTSOS = TSOS; 00188 } 00189 00190 } // end loop over measurements 00191 nDOF -= 5; 00192 00193 if (closest != 10000.) { 00194 std::pair<bool, FreeTrajectoryState> state; 00195 00196 // if (m_vertexConstraint) { 00197 // state = theMuonUpdatorAtVertex->propagateWithUpdate(closestTSOS, iEvent???); 00198 // // add in chi^2 contribution from vertex contratint? 00199 // } 00200 // else { 00201 state = theMuonUpdatorAtVertex->propagate(closestTSOS, GlobalPoint(m_vX, m_vY, m_vZ)); 00202 // } 00203 00204 if (state.first) { 00205 double chi2 = traj->chiSquared(); 00206 double chi2DOF = chi2 / double(nDOF); 00207 00208 m_chi2_100->Fill(chi2); 00209 m_chi2_10000->Fill(chi2); 00210 m_chi2_1000000->Fill(chi2); 00211 m_chi2_log->Fill(log10(chi2)); 00212 00213 m_chi2DOF_5->Fill(chi2DOF); 00214 m_chi2DOF_100->Fill(chi2DOF); 00215 m_chi2DOF_1000->Fill(chi2DOF); 00216 m_chi2DOF_log->Fill(log10(chi2DOF)); 00217 m_chi2_improvement->Fill(chi2 / track->chi2()); 00218 m_chi2DOF_improvement->Fill(chi2DOF / track->normalizedChi2()); 00219 00220 GlobalVector momentum = state.second.momentum(); 00221 double energy = momentum.mag(); 00222 00223 if (energy > e1) { 00224 e2 = e1; 00225 e1 = energy; 00226 p2 = p1; 00227 p1 = momentum; 00228 } 00229 else if (energy > e2) { 00230 e2 = energy; 00231 p2 = momentum; 00232 } 00233 00234 double pt = momentum.perp(); 00235 double phi = momentum.phi(); 00236 while (phi < -M_PI) phi += 2.* M_PI; 00237 while (phi > M_PI) phi -= 2.* M_PI; 00238 00239 double phibin = (phi + M_PI) / (2. * M_PI) * 36.; 00240 00241 for (int i = 0; i < 36; i++) { 00242 if (phibin < i+1) { 00243 m_pt[i]->Fill(pt); 00244 break; 00245 } 00246 } 00247 00248 } // end if propagate was successful 00249 } // end if we have a closest TSOS 00250 } // end loop over tracks 00251 00252 if (e1 > 0. && e2 > 0.) { 00253 double energy_tot = e1 + e2; 00254 GlobalVector momentum_tot = p1 + p2; 00255 double mass = sqrt(energy_tot*energy_tot - momentum_tot.mag2()); 00256 double eta = momentum_tot.eta(); 00257 00258 m_diMuon_Z->Fill(mass); 00259 if (eta > 1.4) m_diMuon_Zforward->Fill(mass); 00260 else if (eta > -1.4) m_diMuon_Zbarrel->Fill(mass); 00261 else m_diMuon_Zbackward->Fill(mass); 00262 00263 m_diMuon_Ups->Fill(mass); 00264 m_diMuon_Jpsi->Fill(mass); 00265 m_diMuon_log->Fill(log10(mass)); 00266 } // end if we have two tracks 00267 }
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2_100 [private] |
Definition at line 56 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2_10000 [private] |
Definition at line 57 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2_1000000 [private] |
Definition at line 58 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2_improvement [private] |
Definition at line 64 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2_log [private] |
Definition at line 59 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2DOF_100 [private] |
Definition at line 61 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2DOF_1000 [private] |
Definition at line 62 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2DOF_5 [private] |
Definition at line 60 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2DOF_improvement [private] |
Definition at line 65 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_chi2DOF_log [private] |
Definition at line 63 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_Jpsi [private] |
Definition at line 54 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_log [private] |
Definition at line 55 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_Ups [private] |
Definition at line 53 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_Z [private] |
Definition at line 49 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_Zbackward [private] |
Definition at line 52 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_Zbarrel [private] |
Definition at line 51 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_diMuon_Zforward [private] |
Definition at line 50 of file AlignmentMonitorTracksFromTrajectories.cc.
TH1F* AlignmentMonitorTracksFromTrajectories::m_pt[36] [private] |
Definition at line 66 of file AlignmentMonitorTracksFromTrajectories.cc.
Definition at line 46 of file AlignmentMonitorTracksFromTrajectories.cc.
Referenced by AlignmentMonitorTracksFromTrajectories().
double AlignmentMonitorTracksFromTrajectories::m_vX [private] |
Definition at line 47 of file AlignmentMonitorTracksFromTrajectories.cc.
Referenced by AlignmentMonitorTracksFromTrajectories(), and event().
double AlignmentMonitorTracksFromTrajectories::m_vY [private] |
Definition at line 47 of file AlignmentMonitorTracksFromTrajectories.cc.
Referenced by AlignmentMonitorTracksFromTrajectories(), and event().
double AlignmentMonitorTracksFromTrajectories::m_vZ [private] |
Definition at line 47 of file AlignmentMonitorTracksFromTrajectories.cc.
Referenced by AlignmentMonitorTracksFromTrajectories(), and event().
MuonServiceProxy* AlignmentMonitorTracksFromTrajectories::theMuonServiceProxy [private] |
Definition at line 44 of file AlignmentMonitorTracksFromTrajectories.cc.
Referenced by AlignmentMonitorTracksFromTrajectories(), and event().
Definition at line 45 of file AlignmentMonitorTracksFromTrajectories.cc.
Referenced by AlignmentMonitorTracksFromTrajectories(), and event().