116 LogTrace(
"Calibration") <<
"--- [DTVDriftCalibration] Event analysed #Run: " <<
event.id().run()
117 <<
" #Event: " <<
event.id().event();
122 stringstream linestr;
123 int selWheel, selStation, selSector;
125 linestr >> selWheel >> selStation >> selSector;
126 chosenChamberId =
DTChamberId(selWheel, selStation, selSector);
127 LogTrace(
"Calibration") <<
"chosen chamber " << chosenChamberId;
142 for (chamberIdIt = all4DSegments->id_begin(); chamberIdIt != all4DSegments->id_end(); ++chamberIdIt) {
145 LogTrace(
"Calibration") <<
"Chamber Id: " << *chamberIdIt;
156 if (!(*segment).hasZed() && !(*segment).hasPhi()) {
157 LogError(
"Calibration") <<
"4D segment without Z and Phi segments";
161 LogTrace(
"Calibration") <<
"Segment local pos (in chamber RF): " << (*segment).localPosition()
162 <<
"\nSegment global pos: " << chamber->
toGlobal((*segment).localPosition());
164 if (!((*
select_)(*segment, event, eventSetup)))
169 map<DTSuperLayerId, vector<DTRecHit1D> > hitsBySLMap;
170 if ((*segment).hasPhi()) {
175 for (vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
hit != phiHits.end(); ++
hit) {
178 hitsBySLMap[slId].push_back(*
hit);
184 if ((*segment).hasZed()) {
187 zSeg2DPosInCham = chamber->
toLocal(sl->
toGlobal((*zSeg).localPosition()));
188 zSeg2DDirInCham = chamber->
toLocal(sl->
toGlobal((*zSeg).localDirection()));
192 LocalPoint segment4DLocalPos = (*segment).localPosition();
193 LocalVector segment4DLocalDir = (*segment).localDirection();
194 double chiSquare = ((*segment).chi2() / (*segment).degreesOfFreedom());
196 hChi2->Fill(chiSquare);
197 if ((*segment).hasPhi())
198 h2DSegmRPhi->
Fill(phiSeg2DPosInCham.
x(), phiSeg2DDirInCham.
x() / phiSeg2DDirInCham.
z());
199 if ((*segment).hasZed())
200 h2DSegmRZ->
Fill(zSeg2DPosInCham.
y(), zSeg2DDirInCham.
y() / zSeg2DDirInCham.
z());
202 if ((*segment).hasZed() && (*segment).hasPhi())
204 segment4DLocalPos.
y(),
205 atan(segment4DLocalDir.
x() / segment4DLocalDir.
z()) * 180. /
Geom::pi(),
206 atan(segment4DLocalDir.
y() / segment4DLocalDir.
z()) * 180. /
Geom::pi(),
208 else if ((*segment).hasPhi())
210 atan(segment4DLocalDir.
x() / segment4DLocalDir.
z()) * 180. /
Geom::pi());
211 else if ((*segment).hasZed())
212 LogWarning(
"Calibration") <<
"4d segment with only Z";
215 for (map<
DTSuperLayerId, vector<DTRecHit1D> >::const_iterator slIdAndHits = hitsBySLMap.begin();
216 slIdAndHits != hitsBySLMap.end();
218 if (slIdAndHits->second.size() < 3)
223 DTTMax slSeg(slIdAndHits->second,
225 chamber->
toGlobal((*segment).localDirection()),
226 chamber->
toGlobal((*segment).localPosition()),
231 vector<const TMax*> tMaxes = slSeg.getTMax(slId);
235 if (cell ==
nullptr) {
236 TString
name = (((((TString)
"TMax" + (
long)slId.
wheel()) + (
long)slId.
station()) + (
long)slId.
sector()) +
238 cell =
new cellInfo(name);
244 LogWarning(
"Calibration") <<
"[DTVDriftCalibration] ###Warning: the chosen granularity is not implemented "
245 "yet, only bySL available!";
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > theDTGeomToken
std::pair< const_iterator, const_iterator > range
iterator range
LocalPoint localPosition() const override
local position in SL frame
LocalVector localDirection() const override
the local direction in SL frame
TMaxGranularity theGranularity
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
std::unique_ptr< DTTTrigBaseSync > theSync
void Fill(float x, float y, float phi, float theta, float impact)
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
void Fill(float pos, float localAngle)
Log< level::Error, false > LogError
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
const uint16_t range(const Frame &aFrame)
Geom::Theta< T > theta() const
bool getData(T &iHolder) const
C::const_iterator const_iterator
constant access iterator type
std::map< DTWireId, cellInfo * > theWireIdAndCellMap
int superLayer() const
Return the superlayer number.
edm::EDGetTokenT< DTRecSegment4DCollection > theRecHits4DToken
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
DTSuperLayerId superLayerId() const
The id of the superlayer on which reside the segment.
dtcalibration::Histograms histograms_
std::unique_ptr< DTSegmentSelector > select_
std::string theCalibChamber
Log< level::Warning, false > LogWarning
int station() const
Return the station number.
int wheel() const
Return the wheel number.