Implements edm::EDAnalyzer.
Definition at line 109 of file DTVDriftCalibration.cc.
110 LogTrace(
"Calibration") <<
"--- [DTVDriftCalibration] Event analysed #Run: " <<
event.id().run()
111 <<
" #Event: " <<
event.id().event();
116 stringstream linestr;
117 int selWheel, selStation, selSector;
119 linestr >> selWheel >> selStation >> selSector;
120 chosenChamberId =
DTChamberId(selWheel, selStation, selSector);
121 LogTrace(
"Calibration") <<
"chosen chamber " << chosenChamberId;
143 for (chamberIdIt = all4DSegments->id_begin(); chamberIdIt != all4DSegments->id_end(); ++chamberIdIt) {
146 LogTrace(
"Calibration") <<
"Chamber Id: " << *chamberIdIt;
157 if (!(*segment).hasZed() && !(*segment).hasPhi()) {
158 LogError(
"Calibration") <<
"4D segment without Z and Phi segments";
162 LogTrace(
"Calibration") <<
"Segment local pos (in chamber RF): " << (*segment).localPosition()
163 <<
"\nSegment global pos: " <<
chamber->toGlobal((*segment).localPosition());
170 map<DTSuperLayerId, vector<DTRecHit1D> > hitsBySLMap;
171 if ((*segment).hasPhi()) {
176 for (vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
hit != phiHits.end(); ++
hit) {
179 hitsBySLMap[slId].push_back(*
hit);
185 if ((*segment).hasZed()) {
188 zSeg2DPosInCham =
chamber->toLocal(sl->
toGlobal((*zSeg).localPosition()));
189 zSeg2DDirInCham =
chamber->toLocal(sl->
toGlobal((*zSeg).localDirection()));
193 LocalPoint segment4DLocalPos = (*segment).localPosition();
194 LocalVector segment4DLocalDir = (*segment).localDirection();
195 double chiSquare = ((*segment).chi2() / (*segment).degreesOfFreedom());
198 if ((*segment).hasPhi())
199 h2DSegmRPhi->
Fill(phiSeg2DPosInCham.
x(), phiSeg2DDirInCham.
x() / phiSeg2DDirInCham.
z());
200 if ((*segment).hasZed())
201 h2DSegmRZ->
Fill(zSeg2DPosInCham.
y(), zSeg2DDirInCham.
y() / zSeg2DDirInCham.
z());
203 if ((*segment).hasZed() && (*segment).hasPhi())
205 segment4DLocalPos.
y(),
206 atan(segment4DLocalDir.
x() / segment4DLocalDir.
z()) * 180. /
Geom::pi(),
207 atan(segment4DLocalDir.
y() / segment4DLocalDir.
z()) * 180. /
Geom::pi(),
209 else if ((*segment).hasPhi())
211 atan(segment4DLocalDir.
x() / segment4DLocalDir.
z()) * 180. /
Geom::pi());
212 else if ((*segment).hasZed())
213 LogWarning(
"Calibration") <<
"4d segment with only Z";
216 for (
map<
DTSuperLayerId, vector<DTRecHit1D> >::const_iterator slIdAndHits = hitsBySLMap.begin();
217 slIdAndHits != hitsBySLMap.end();
219 if (slIdAndHits->second.size() < 3)
224 DTTMax slSeg(slIdAndHits->second,
225 *(
chamber->superLayer(slIdAndHits->first)),
226 chamber->toGlobal((*segment).localDirection()),
227 chamber->toGlobal((*segment).localPosition()),
232 vector<const TMax*> tMaxes = slSeg.getTMax(slId);
236 if (cell ==
nullptr) {
237 TString
name = (((((TString)
"TMax" + (
long)slId.
wheel()) + (
long)slId.
station()) + (
long)slId.
sector()) +
239 cell =
new cellInfo(
name);
245 LogWarning(
"Calibration") <<
"[DTVDriftCalibration] ###Warning: the chosen granularity is not implemented "
246 "yet, only bySL available!";
References DTVDriftCalibration::cellInfo::add(), bySL, relativeConstraints::chamber, DTGeometry::chamber(), simKBmtfDigis_cfi::chiSquare, h4DSegm::Fill(), h2DSegm::Fill(), edm::EventSetup::get(), get, DTTMax::getTMax(), h2DSegmRPhi, h2DSegmRZ, h4DSegmAllCh, hChi2, histograms_, DTRecSegment2D::localDirection(), DTRecSegment2D::localPosition(), LogTrace, genParticles_cff::map, Skims_PA_cff::name, Geom::pi(), FastTimerService_cff::range, DTChamberId::sector(), select_, DTRecSegment2D::specificRecHits(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTSLRecSegment2D::superLayerId(), DTLayerId::superlayerId(), theCalibChamber, theFile, theGranularity, theRecHits4DToken, theSync, PV3DBase< T, PVType, FrameType >::theta(), theWireIdAndCellMap, GeomDet::toGlobal(), DTVDriftCalibration::cellInfo::update(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().