CMS 3D CMS Logo

CSCOverlapsAlignmentAlgorithm.cc
Go to the documentation of this file.
2 
4  : AlignmentAlgorithmBase(iConfig)
5  , m_minHitsPerChamber(iConfig.getParameter<int>("minHitsPerChamber"))
6  , m_maxdrdz(iConfig.getParameter<double>("maxdrdz"))
7  , m_fiducial(iConfig.getParameter<bool>("fiducial"))
8  , m_useHitWeights(iConfig.getParameter<bool>("useHitWeights"))
9  , m_slopeFromTrackRefit(iConfig.getParameter<bool>("slopeFromTrackRefit"))
10  , m_minStationsInTrackRefits(iConfig.getParameter<int>("minStationsInTrackRefits"))
11  , m_truncateSlopeResid(iConfig.getParameter<double>("truncateSlopeResid"))
12  , m_truncateOffsetResid(iConfig.getParameter<double>("truncateOffsetResid"))
13  , m_combineME11(iConfig.getParameter<bool>("combineME11"))
14  , m_useTrackWeights(iConfig.getParameter<bool>("useTrackWeights"))
15  , m_errorFromRMS(iConfig.getParameter<bool>("errorFromRMS"))
16  , m_minTracksPerOverlap(iConfig.getParameter<int>("minTracksPerOverlap"))
17  , m_makeHistograms(iConfig.getParameter<bool>("makeHistograms"))
18  , m_mode_string(iConfig.getParameter<std::string>("mode"))
19  , m_reportFileName(iConfig.getParameter<std::string>("reportFileName"))
20  , m_minP(iConfig.getParameter<double>("minP"))
21  , m_maxRedChi2(iConfig.getParameter<double>("maxRedChi2"))
22  , m_writeTemporaryFile(iConfig.getParameter<std::string>("writeTemporaryFile"))
23  , m_readTemporaryFiles(iConfig.getParameter<std::vector<std::string> >("readTemporaryFiles"))
24  , m_doAlignment(iConfig.getParameter<bool>("doAlignment"))
25 {
30  else throw cms::Exception("BadConfig") << "mode must be one of \"phiy\", \"phipos\", \"phiz\", \"radius\"" << std::endl;
31 
32  std::vector<edm::ParameterSet> fitters = iConfig.getParameter<std::vector<edm::ParameterSet> >("fitters");
33  for (std::vector<edm::ParameterSet>::const_iterator fitter = fitters.begin(); fitter != fitters.end(); ++fitter) {
35  }
36 
37  for (std::vector<CSCPairResidualsConstraint*>::const_iterator residualsConstraint = m_residualsConstraints.begin(); residualsConstraint != m_residualsConstraints.end(); ++residualsConstraint) {
38  (*residualsConstraint)->configure(this);
39  m_quickChamberLookup[std::pair<CSCDetId,CSCDetId>((*residualsConstraint)->id_i(), (*residualsConstraint)->id_j())] = *residualsConstraint;
40  }
41 
43  m_trackTransformer = new TrackTransformer(iConfig.getParameter<edm::ParameterSet>("TrackTransformer"));
44  m_propagatorName = iConfig.getParameter<edm::ParameterSet>("TrackTransformer").getParameter<std::string>("Propagator");
45  }
46  else {
47  m_trackTransformer = nullptr;
49  }
50 
51  m_propagatorPointer = nullptr;
52 
53  if (m_makeHistograms) {
54  edm::Service<TFileService> tFileService;
55  m_histP10 = tFileService->make<TH1F>("P10", "", 100, 0, 10);
56  m_histP100 = tFileService->make<TH1F>("P100", "", 100, 0, 100);
57  m_histP1000 = tFileService->make<TH1F>("P1000", "", 100, 0, 1000);
58 
59  m_hitsPerChamber = tFileService->make<TH1F>("hitsPerChamber", "", 10, -0.5, 9.5);
60 
61  m_fiducial_ME11 = tFileService->make<TProfile>("fiducial_ME11", "", 100, 0.075, 0.100);
62  m_fiducial_ME12 = tFileService->make<TProfile>("fiducial_ME12", "", 100, 0.080, 0.105);
63  m_fiducial_MEx1 = tFileService->make<TProfile>("fiducial_MEx1", "", 100, 0.160, 0.210);
64  m_fiducial_MEx2 = tFileService->make<TProfile>("fiducial_MEx2", "", 100, 0.080, 0.105);
65 
66  m_slope = tFileService->make<TH1F>("slope", "", 100, -0.5, 0.5);
67  m_slope_MEp4 = tFileService->make<TH1F>("slope_MEp4", "", 100, -0.5, 0.5);
68  m_slope_MEp3 = tFileService->make<TH1F>("slope_MEp3", "", 100, -0.5, 0.5);
69  m_slope_MEp2 = tFileService->make<TH1F>("slope_MEp2", "", 100, -0.5, 0.5);
70  m_slope_MEp1 = tFileService->make<TH1F>("slope_MEp1", "", 100, -0.5, 0.5);
71  m_slope_MEm1 = tFileService->make<TH1F>("slope_MEm1", "", 100, -0.5, 0.5);
72  m_slope_MEm2 = tFileService->make<TH1F>("slope_MEm2", "", 100, -0.5, 0.5);
73  m_slope_MEm3 = tFileService->make<TH1F>("slope_MEm3", "", 100, -0.5, 0.5);
74  m_slope_MEm4 = tFileService->make<TH1F>("slope_MEm4", "", 100, -0.5, 0.5);
75 
76  m_slopeResiduals = tFileService->make<TH1F>("slopeResiduals", "mrad", 300, -30., 30.);
77  m_slopeResiduals_weighted = tFileService->make<TH1F>("slopeResiduals_weighted", "mrad", 300, -30., 30.);
78  m_slopeResiduals_normalized = tFileService->make<TH1F>("slopeResiduals_normalized", "", 200, -20., 20.);
79  m_offsetResiduals = tFileService->make<TH1F>("offsetResiduals", "mm", 300, -30., 30.);
80  m_offsetResiduals_weighted = tFileService->make<TH1F>("offsetResiduals_weighted", "mm", 300, -30., 30.);
81  m_offsetResiduals_normalized = tFileService->make<TH1F>("offsetResiduals_normalized", "", 200, -20., 20.);
82 
83  m_drdz = tFileService->make<TH1F>("drdz", "", 100, -0.5, 0.5);
84 
85  m_occupancy = tFileService->make<TH2F>("occupancy", "", 36, 1, 37, 20, 1, 21);
86  for (int i = 1; i <= 36; i++) {
87  std::stringstream pairname;
88  pairname << i << "-";
89  if (i+1 == 37) pairname << 1;
90  else pairname << (i+1);
91  m_occupancy->GetXaxis()->SetBinLabel(i, pairname.str().c_str());
92  }
93  m_occupancy->GetYaxis()->SetBinLabel(1, "ME-4/2");
94  m_occupancy->GetYaxis()->SetBinLabel(2, "ME-4/1");
95  m_occupancy->GetYaxis()->SetBinLabel(3, "ME-3/2");
96  m_occupancy->GetYaxis()->SetBinLabel(4, "ME-3/1");
97  m_occupancy->GetYaxis()->SetBinLabel(5, "ME-2/2");
98  m_occupancy->GetYaxis()->SetBinLabel(6, "ME-2/1");
99  m_occupancy->GetYaxis()->SetBinLabel(7, "ME-1/3");
100  m_occupancy->GetYaxis()->SetBinLabel(8, "ME-1/2");
101  if (!m_combineME11) {
102  m_occupancy->GetYaxis()->SetBinLabel(9, "ME-1/1b");
103  m_occupancy->GetYaxis()->SetBinLabel(10, "ME-1/1a");
104  m_occupancy->GetYaxis()->SetBinLabel(11, "ME+1/1a");
105  m_occupancy->GetYaxis()->SetBinLabel(12, "ME+1/1b");
106  }
107  else {
108  m_occupancy->GetYaxis()->SetBinLabel(9, "ME-1/1");
109  m_occupancy->GetYaxis()->SetBinLabel(10, "");
110  m_occupancy->GetYaxis()->SetBinLabel(11, "");
111  m_occupancy->GetYaxis()->SetBinLabel(12, "ME+1/1");
112  }
113  m_occupancy->GetYaxis()->SetBinLabel(13, "ME+1/2");
114  m_occupancy->GetYaxis()->SetBinLabel(14, "ME+1/3");
115  m_occupancy->GetYaxis()->SetBinLabel(15, "ME+2/1");
116  m_occupancy->GetYaxis()->SetBinLabel(16, "ME+2/2");
117  m_occupancy->GetYaxis()->SetBinLabel(17, "ME+3/1");
118  m_occupancy->GetYaxis()->SetBinLabel(18, "ME+3/2");
119  m_occupancy->GetYaxis()->SetBinLabel(19, "ME+4/1");
120  m_occupancy->GetYaxis()->SetBinLabel(20, "ME+4/2");
121 
122  m_XYpos_mep1 = tFileService->make<TH2F>("XYpos_mep1", "Positions: ME+1", 140, -700., 700., 140, -700., 700.);
123  m_XYpos_mep2 = tFileService->make<TH2F>("XYpos_mep2", "Positions: ME+2", 140, -700., 700., 140, -700., 700.);
124  m_XYpos_mep3 = tFileService->make<TH2F>("XYpos_mep3", "Positions: ME+3", 140, -700., 700., 140, -700., 700.);
125  m_XYpos_mep4 = tFileService->make<TH2F>("XYpos_mep4", "Positions: ME+4", 140, -700., 700., 140, -700., 700.);
126  m_XYpos_mem1 = tFileService->make<TH2F>("XYpos_mem1", "Positions: ME-1", 140, -700., 700., 140, -700., 700.);
127  m_XYpos_mem2 = tFileService->make<TH2F>("XYpos_mem2", "Positions: ME-2", 140, -700., 700., 140, -700., 700.);
128  m_XYpos_mem3 = tFileService->make<TH2F>("XYpos_mem3", "Positions: ME-3", 140, -700., 700., 140, -700., 700.);
129  m_XYpos_mem4 = tFileService->make<TH2F>("XYpos_mem4", "Positions: ME-4", 140, -700., 700., 140, -700., 700.);
130  m_RPhipos_mep1 = tFileService->make<TH2F>("RPhipos_mep1", "Positions: ME+1", 144, -M_PI, M_PI, 21, 0., 700.);
131  m_RPhipos_mep2 = tFileService->make<TH2F>("RPhipos_mep2", "Positions: ME+2", 144, -M_PI, M_PI, 21, 0., 700.);
132  m_RPhipos_mep3 = tFileService->make<TH2F>("RPhipos_mep3", "Positions: ME+3", 144, -M_PI, M_PI, 21, 0., 700.);
133  m_RPhipos_mep4 = tFileService->make<TH2F>("RPhipos_mep4", "Positions: ME+4", 144, -M_PI, M_PI, 21, 0., 700.);
134  m_RPhipos_mem1 = tFileService->make<TH2F>("RPhipos_mem1", "Positions: ME-1", 144, -M_PI, M_PI, 21, 0., 700.);
135  m_RPhipos_mem2 = tFileService->make<TH2F>("RPhipos_mem2", "Positions: ME-2", 144, -M_PI, M_PI, 21, 0., 700.);
136  m_RPhipos_mem3 = tFileService->make<TH2F>("RPhipos_mem3", "Positions: ME-3", 144, -M_PI, M_PI, 21, 0., 700.);
137  m_RPhipos_mem4 = tFileService->make<TH2F>("RPhipos_mem4", "Positions: ME-4", 144, -M_PI, M_PI, 21, 0., 700.);
138  }
139  else {
140  m_histP10 = nullptr;
141  m_histP100 = nullptr;
142  m_histP1000 = nullptr;
143  m_hitsPerChamber = nullptr;
144  m_fiducial_ME11 = nullptr;
145  m_fiducial_ME12 = nullptr;
146  m_fiducial_MEx1 = nullptr;
147  m_fiducial_MEx2 = nullptr;
148  m_slope = nullptr;
149  m_slope_MEp4 = nullptr;
150  m_slope_MEp3 = nullptr;
151  m_slope_MEp2 = nullptr;
152  m_slope_MEp1 = nullptr;
153  m_slope_MEm1 = nullptr;
154  m_slope_MEm2 = nullptr;
155  m_slope_MEm3 = nullptr;
156  m_slope_MEm4 = nullptr;
157  m_slopeResiduals = nullptr;
158  m_slopeResiduals_weighted = nullptr;
159  m_slopeResiduals_normalized = nullptr;
160  m_offsetResiduals = nullptr;
161  m_offsetResiduals_weighted = nullptr;
163  m_drdz = nullptr;
164  m_occupancy = nullptr;
165  m_XYpos_mep1 = nullptr;
166  m_XYpos_mep2 = nullptr;
167  m_XYpos_mep3 = nullptr;
168  m_XYpos_mep4 = nullptr;
169  m_XYpos_mem1 = nullptr;
170  m_XYpos_mem2 = nullptr;
171  m_XYpos_mem3 = nullptr;
172  m_XYpos_mem4 = nullptr;
173  m_RPhipos_mep1 = nullptr;
174  m_RPhipos_mep2 = nullptr;
175  m_RPhipos_mep3 = nullptr;
176  m_RPhipos_mep4 = nullptr;
177  m_RPhipos_mem1 = nullptr;
178  m_RPhipos_mem2 = nullptr;
179  m_RPhipos_mem3 = nullptr;
180  m_RPhipos_mem4 = nullptr;
181  }
182 }
183 
185 
186 void CSCOverlapsAlignmentAlgorithm::initialize(const edm::EventSetup& iSetup, AlignableTracker* alignableTracker, AlignableMuon* alignableMuon, AlignableExtras* alignableExtras, AlignmentParameterStore* alignmentParameterStore) {
187  m_alignmentParameterStore = alignmentParameterStore;
189 
190  if (alignableTracker == nullptr) m_alignableNavigator = new AlignableNavigator(alignableMuon);
191  else m_alignableNavigator = new AlignableNavigator(alignableTracker, alignableMuon);
192 
193  for (const auto& alignable: m_alignables) {
194  DetId id = alignable->geomDetId();
195  if (id.det() != DetId::Muon || id.subdetId() != MuonSubdetId::CSC || CSCDetId(id.rawId()).layer() != 0) {
196  throw cms::Exception("BadConfig") << "Only CSC chambers may be alignable" << std::endl;
197  }
198 
199  std::vector<bool> selector = alignable->alignmentParameters()->selector();
200  for (std::vector<bool>::const_iterator i = selector.begin(); i != selector.end(); ++i) {
201  if (!(*i)) throw cms::Exception("BadConfig") << "All selector strings should be \"111111\"" << std::endl;
202  }
203  }
204 
205  edm::ESHandle<CSCGeometry> cscGeometry;
206  iSetup.get<MuonGeometryRecord>().get(cscGeometry);
207 
208  for (std::vector<CSCPairResidualsConstraint*>::const_iterator residualsConstraint = m_residualsConstraints.begin(); residualsConstraint != m_residualsConstraints.end(); ++residualsConstraint) {
209  (*residualsConstraint)->setZplane(&*cscGeometry);
210  }
211 
212  if (!m_readTemporaryFiles.empty()) {
213  std::vector<std::ifstream*> input;
214  for (std::vector<std::string>::const_iterator fileName = m_readTemporaryFiles.begin(); fileName != m_readTemporaryFiles.end(); ++fileName) {
215  input.push_back(new std::ifstream(fileName->c_str()));
216  }
217 
218  for (std::vector<CSCPairResidualsConstraint*>::const_iterator residualsConstraint = m_residualsConstraints.begin(); residualsConstraint != m_residualsConstraints.end(); ++residualsConstraint) {
219  (*residualsConstraint)->read(input, m_readTemporaryFiles);
220  }
221 
222  for (std::vector<std::ifstream*>::const_iterator file = input.begin(); file != input.end(); ++file) {
223  delete (*file);
224  }
225  }
226 }
227 
230  if (m_slopeFromTrackRefit) {
231  iSetup.get<TrackingComponentsRecord>().get(m_propagatorName, propagator);
232  if (m_propagatorPointer != &*propagator) {
234 
235  for (std::vector<CSCPairResidualsConstraint*>::const_iterator residualsConstraint = m_residualsConstraints.begin(); residualsConstraint != m_residualsConstraints.end(); ++residualsConstraint) {
236  (*residualsConstraint)->setPropagator(m_propagatorPointer);
237  }
238  }
239  }
240 
241  edm::ESHandle<TransientTrackBuilder> transientTrackBuilder;
242  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", transientTrackBuilder);
243 
244  if (m_trackTransformer != nullptr) m_trackTransformer->setServices(iSetup);
245 
246  const ConstTrajTrackPairCollection &trajtracks = eventInfo.trajTrackPairs();
247  for (ConstTrajTrackPairCollection::const_iterator trajtrack = trajtracks.begin(); trajtrack != trajtracks.end(); ++trajtrack) {
248  const Trajectory* traj = (*trajtrack).first;
249  const reco::Track* track = (*trajtrack).second;
250 
251  if (m_makeHistograms) {
252  m_histP10->Fill(track->p());
253  m_histP100->Fill(track->p());
254  m_histP1000->Fill(track->p());
255  }
256  if (track->p() >= m_minP) {
257  std::vector<TrajectoryMeasurement> measurements = traj->measurements();
258  reco::TransientTrack transientTrack = transientTrackBuilder->build(track);
259 
260  std::map<int,std::map<CSCDetId,bool> > stationsToChambers;
261  for (std::vector<TrajectoryMeasurement>::const_iterator measurement = measurements.begin(); measurement != measurements.end(); ++measurement) {
262  DetId id = measurement->recHit()->geographicalId();
263  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
264  CSCDetId cscid(id.rawId());
265  CSCDetId chamberId(cscid.endcap(), cscid.station(), cscid.ring(), cscid.chamber(), 0);
266  if (m_combineME11 && cscid.station() == 1 && cscid.ring() == 4) chamberId = CSCDetId(cscid.endcap(), 1, 1, cscid.chamber(), 0);
267  int station = (cscid.endcap() == 1 ? 1 : -1)*cscid.station();
268 
269  if (stationsToChambers.find(station) == stationsToChambers.end()) stationsToChambers[station] = std::map<CSCDetId,bool>();
270  stationsToChambers[station][chamberId] = true;
271 
272  if (m_makeHistograms) {
273  GlobalPoint pos = measurement->recHit()->globalPosition();
274  if (cscid.endcap() == 1 && cscid.station() == 1) { m_XYpos_mep1->Fill(pos.x(), pos.y()); m_RPhipos_mep1->Fill(pos.phi(), pos.perp()); }
275  if (cscid.endcap() == 1 && cscid.station() == 2) { m_XYpos_mep2->Fill(pos.x(), pos.y()); m_RPhipos_mep2->Fill(pos.phi(), pos.perp()); }
276  if (cscid.endcap() == 1 && cscid.station() == 3) { m_XYpos_mep3->Fill(pos.x(), pos.y()); m_RPhipos_mep3->Fill(pos.phi(), pos.perp()); }
277  if (cscid.endcap() == 1 && cscid.station() == 4) { m_XYpos_mep4->Fill(pos.x(), pos.y()); m_RPhipos_mep4->Fill(pos.phi(), pos.perp()); }
278  if (cscid.endcap() == 2 && cscid.station() == 1) { m_XYpos_mem1->Fill(pos.x(), pos.y()); m_RPhipos_mem1->Fill(pos.phi(), pos.perp()); }
279  if (cscid.endcap() == 2 && cscid.station() == 2) { m_XYpos_mem2->Fill(pos.x(), pos.y()); m_RPhipos_mem2->Fill(pos.phi(), pos.perp()); }
280  if (cscid.endcap() == 2 && cscid.station() == 3) { m_XYpos_mem3->Fill(pos.x(), pos.y()); m_RPhipos_mem3->Fill(pos.phi(), pos.perp()); }
281  if (cscid.endcap() == 2 && cscid.station() == 4) { m_XYpos_mem4->Fill(pos.x(), pos.y()); m_RPhipos_mem4->Fill(pos.phi(), pos.perp()); }
282  }
283  }
284  }
285 
286  std::map<CSCPairResidualsConstraint*,bool> residualsConstraints;
287  for (std::map<int,std::map<CSCDetId,bool> >::const_iterator iter = stationsToChambers.begin(); iter != stationsToChambers.end(); ++iter) {
288  for (std::map<CSCDetId,bool>::const_iterator one = iter->second.begin(); one != iter->second.end(); ++one) {
289  for (std::map<CSCDetId,bool>::const_iterator two = one; two != iter->second.end(); ++two) {
290  if (one != two) {
291  std::map<std::pair<CSCDetId,CSCDetId>,CSCPairResidualsConstraint*>::const_iterator quick;
292 
293  quick = m_quickChamberLookup.find(std::pair<CSCDetId,CSCDetId>(one->first, two->first));
294  if (quick != m_quickChamberLookup.end()) residualsConstraints[quick->second] = true;
295 
296  quick = m_quickChamberLookup.find(std::pair<CSCDetId,CSCDetId>(two->first, one->first));
297  if (quick != m_quickChamberLookup.end()) residualsConstraints[quick->second] = true;
298  }
299  }
300  }
301  }
302 
303  for (std::map<CSCPairResidualsConstraint*,bool>::const_iterator residualsConstraint = residualsConstraints.begin(); residualsConstraint != residualsConstraints.end(); ++residualsConstraint) {
304  residualsConstraint->first->addTrack(measurements, transientTrack, m_trackTransformer);
305  }
306  }
307  }
308 }
309 
311  // write residuals partial fits to temporary files for collection
312  if (m_writeTemporaryFile != std::string("")) {
313  std::ofstream output(m_writeTemporaryFile.c_str());
314  for (std::vector<CSCPairResidualsConstraint*>::const_iterator residualsConstraint = m_residualsConstraints.begin(); residualsConstraint != m_residualsConstraints.end(); ++residualsConstraint) {
315  (*residualsConstraint)->write(output);
316  }
317  }
318 
319  // write report for alignment results
320  if (m_doAlignment) {
321  std::ofstream report;
322  bool writeReport = (m_reportFileName != std::string(""));
323  if (writeReport) {
324  report.open(m_reportFileName.c_str());
325  report << "cscReports = []" << std::endl << std::endl
326  << "class CSCChamberCorrection:" << std::endl
327  << " def __init__(self, name, detid, value):" << std::endl
328  << " self.name, self.detid, self.value = name, detid, value" << std::endl << std::endl
329  << "class CSCErrorMode:" << std::endl
330  << " def __init__(self, error):" << std::endl
331  << " self.error = error" << std::endl
332  << " self.terms = {}" << std::endl
333  << " self.detids = {}" << std::endl
334  << " def addTerm(self, name, detid, coefficient):" << std::endl
335  << " self.terms[name] = coefficient" << std::endl
336  << " self.detids[name] = detid" << std::endl << std::endl
337  << "class CSCConstraintResidual:" << std::endl
338  << " def __init__(self, i, j, before, uncert, residual, pull):" << std::endl
339  << " self.i, self.j, self.before, self.error, self.residual, self.pull = i, j, before, uncert, residual, pull" << std::endl << std::endl
340  << "class CSCFitterReport:" << std::endl
341  << " def __init__(self, name, oldchi2, newchi2):" << std::endl
342  << " self.name, self.oldchi2, self.newchi2 = name, oldchi2, newchi2" << std::endl
343  << " self.chamberCorrections = []" << std::endl
344  << " self.errorModes = []" << std::endl
345  << " self.constraintResiduals = []" << std::endl << std::endl
346  << " def addChamberCorrection(self, name, detid, value):" << std::endl
347  << " self.chamberCorrections.append(CSCChamberCorrection(name, detid, value))" << std::endl << std::endl
348  << " def addErrorMode(self, error):" << std::endl
349  << " self.errorModes.append(CSCErrorMode(error))" << std::endl << std::endl
350  << " def addErrorModeTerm(self, name, detid, coefficient):" << std::endl
351  << " self.errorModes[-1].addTerm(name, detid, coefficient)" << std::endl << std::endl
352  << " def addCSCConstraintResidual(self, i, j, before, uncert, residual, pull):" << std::endl
353  << " self.constraintResiduals.append(CSCConstraintResidual(i, j, before, uncert, residual, pull))" << std::endl << std::endl
354  << "import re" << std::endl
355  << "def nameToKey(name):" << std::endl
356  << " match = re.match(\"ME([\\+\\-])([1-4])/([1-4])/([0-9]{2})\", name)" << std::endl
357  << " if match is None: return None" << std::endl
358  << " endcap, station, ring, chamber = match.groups()" << std::endl
359  << " if endcap == \"+\": endcap = 1" << std::endl
360  << " else: endcap = 2" << std::endl
361  << " station = int(station)" << std::endl
362  << " ring = int(ring)" << std::endl
363  << " chamber = int(chamber)" << std::endl
364  << " return endcap, station, ring, chamber" << std::endl << std::endl;
365  }
366 
367  for (std::vector<CSCChamberFitter>::const_iterator fitter = m_fitters.begin(); fitter != m_fitters.end(); ++fitter) {
370 
371 
372 
373  }
374  else {
375  std::vector<CSCAlignmentCorrections*> corrections;
376  fitter->fit(corrections);
377 
378  // corrections only exist if the fit was successful
379  for (std::vector<CSCAlignmentCorrections*>::iterator correction = corrections.begin(); correction != corrections.end(); ++correction) {
380 
381  (*correction)->applyAlignment(m_alignableNavigator, m_alignmentParameterStore, m_mode, m_combineME11);
382  if (m_makeHistograms) (*correction)->plot();
383  if (writeReport) (*correction)->report(report);
384  }
385  }
386  }
387  }
388 }
389 
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
int chamber() const
Definition: CSCDetId.h:68
T getParameter(std::string const &) const
std::vector< CSCChamberFitter > m_fitters
T perp() const
Definition: PV3DBase.h:72
void setServices(const edm::EventSetup &) override
set the services needed by the TrackTransformer
CSCOverlapsAlignmentAlgorithm(const edm::ParameterSet &iConfig)
std::vector< std::string > m_readTemporaryFiles
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
reco::TransientTrack build(const reco::Track *p) const
T y() const
Definition: PV3DBase.h:63
void run(const edm::EventSetup &iSetup, const EventInfo &eventInfo) override
Run the algorithm (must be implemented in derived class)
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
AlignmentParameterStore * m_alignmentParameterStore
const ConstTrajTrackPairCollection & trajTrackPairs() const
define event information passed to algorithms
static std::string const input
Definition: EdmProvDump.cc:44
int endcap() const
Definition: CSCDetId.h:93
void initialize(const edm::EventSetup &iSetup, AlignableTracker *alignableTracker, AlignableMuon *alignableMuon, AlignableExtras *alignableExtras, AlignmentParameterStore *alignmentParameterStore) override
Call at beginning of job (must be implemented in derived class)
DataContainer const & measurements() const
Definition: Trajectory.h:196
static const int CSC
Definition: MuonSubdetId.h:13
std::vector< CSCPairResidualsConstraint * > m_residualsConstraints
#define M_PI
int ring() const
Definition: CSCDetId.h:75
Definition: DetId.h:18
virtual void terminate()
Called at end of job (must be implemented in derived class)
T get() const
Definition: EventSetup.h:63
int station() const
Definition: CSCDetId.h:86
#define DEFINE_EDM_PLUGIN(factory, type, name)
eventInfo
add run, event number and lumi section
std::map< std::pair< CSCDetId, CSCDetId >, CSCPairResidualsConstraint * > m_quickChamberLookup
Constructor of the full muon geometry.
Definition: AlignableMuon.h:37
T x() const
Definition: PV3DBase.h:62
const align::Alignables & alignables(void) const
get all alignables
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection