114 LogTrace(
"Calibration") <<
"--- [DTVDriftCalibration] Event analysed #Run: " <<
event.id().run()
115 <<
" #Event: " <<
event.id().event();
120 stringstream linestr;
121 int selWheel, selStation, selSector;
123 linestr >> selWheel >> selStation >> selSector;
124 chosenChamberId =
DTChamberId(selWheel, selStation, selSector);
125 LogTrace(
"Calibration") <<
"chosen chamber " << chosenChamberId;
146 DTRecSegment4DCollection::id_iterator chamberIdIt;
147 for (chamberIdIt = all4DSegments->id_begin();
148 chamberIdIt != all4DSegments->id_end();
152 const DTChamber* chamber = dtGeom->chamber(*chamberIdIt);
153 LogTrace(
"Calibration") <<
"Chamber Id: " << *chamberIdIt;
164 segment!=range.second; ++segment){
166 if( !(*segment).hasZed() && !(*segment).hasPhi() ){
167 LogError(
"Calibration") <<
"4D segment without Z and Phi segments";
171 LogTrace(
"Calibration") <<
"Segment local pos (in chamber RF): " << (*segment).localPosition()
172 <<
"\nSegment global pos: " << chamber->
toGlobal((*segment).localPosition());
174 if( !
select_(*segment, event, eventSetup) )
continue;
178 map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
179 if((*segment).hasPhi()){
184 for(vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
185 hit != phiHits.end(); ++
hit) {
188 hitsBySLMap[slId].push_back(*
hit);
194 if((*segment).hasZed()) {
197 zSeg2DPosInCham = chamber->
toLocal(sl->
toGlobal((*zSeg).localPosition()));
198 zSeg2DDirInCham = chamber->
toLocal(sl->
toGlobal((*zSeg).localDirection()));
202 LocalPoint segment4DLocalPos = (*segment).localPosition();
203 LocalVector segment4DLocalDir = (*segment).localDirection();
204 double chiSquare = ((*segment).chi2()/(*segment).degreesOfFreedom());
206 hChi2->Fill(chiSquare);
207 if((*segment).hasPhi())
208 h2DSegmRPhi->
Fill(phiSeg2DPosInCham.
x(), phiSeg2DDirInCham.
x()/phiSeg2DDirInCham.
z());
209 if((*segment).hasZed())
210 h2DSegmRZ->
Fill(zSeg2DPosInCham.
y(), zSeg2DDirInCham.
y()/zSeg2DDirInCham.
z());
212 if((*segment).hasZed() && (*segment).hasPhi())
214 segment4DLocalPos.
y(),
215 atan(segment4DLocalDir.
x()/segment4DLocalDir.
z())*180./
Geom::pi(),
216 atan(segment4DLocalDir.
y()/segment4DLocalDir.
z())*180./
Geom::pi(),
218 else if((*segment).hasPhi())
220 atan(segment4DLocalDir.
x()/segment4DLocalDir.
z())*180./
Geom::pi());
221 else if((*segment).hasZed())
222 LogWarning(
"Calibration") <<
"4d segment with only Z";
225 for(
map<
DTSuperLayerId,vector<DTRecHit1D> >::const_iterator slIdAndHits = hitsBySLMap.begin(); slIdAndHits != hitsBySLMap.end(); ++slIdAndHits) {
226 if (slIdAndHits->second.size() < 3)
continue;
233 vector<const TMax*> tMaxes = slSeg.getTMax(slId);
238 TString
name = (((((TString)
"TMax"+(
long) slId.
wheel()) +(
long) slId.
station())
240 cell =
new cellInfo(name);
247 LogWarning(
"Calibration") <<
"[DTVDriftCalibration] ###Warning: the chosen granularity is not implemented yet, only bySL available!";
std::pair< const_iterator, const_iterator > range
iterator range
TMaxGranularity theGranularity
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
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)
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Geom::Theta< T > theta() const
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the synchronization module at each event.
std::map< DTWireId, cellInfo * > theWireIdAndCellMap
int superLayer() const
Return the superlayer number.
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
DTSuperLayerId superLayerId() const
The id of the superlayer on which reside the segment.
virtual LocalPoint localPosition() const
local position in SL frame
DTSegmentSelector select_
std::string theCalibChamber
virtual LocalVector localDirection() const
the local direction in SL frame
int station() const
Return the station number.
int wheel() const
Return the wheel number.
DTTTrigBaseSync * theSync
edm::InputTag theRecHits4DLabel
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.