53 sigmaResAngle = pset.
getParameter<
double>(
"sigmaResAngle");
72 if (
debug ) dbe_->showDirStructure();
76 h2DHitSuperPhi =
new HRes2DHit (
"SuperPhi",dbe_,doall,local);
77 if(doall) h2DHitEff_SuperPhi =
new HEff2DHit (
"SuperPhi",dbe_);
96 if(doall) h2DHitEff_SuperPhi->ComputeEfficiency();
113 event.getByLabel(simHitLabel, simHits);
116 map<DTChamberId, PSimHitContainer > simHitsPerCh;
117 for(PSimHitContainer::const_iterator simHit = simHits->begin();
118 simHit != simHits->end(); simHit++){
120 DTChamberId chamberId = (((
DTWireId(simHit->detUnitId())).layerId()).superlayerId()).chamberId();
122 simHitsPerCh[chamberId].push_back(*simHit);
127 event.getByLabel(segment4DLabel, segment4Ds);
130 if(
debug)
cout <<
"[DTSegment2DSLPhiQuality]**Warning: no 4D Segments with label: " << segment4DLabel
131 <<
" in this event, skipping!" << endl;
136 DTRecSegment4DCollection::id_iterator chamberId;
137 for (chamberId = segment4Ds->id_begin();
138 chamberId != segment4Ds->id_end();
148 int nMuSimHit = muSimHitPerWire.size();
149 if(nMuSimHit == 0 || nMuSimHit == 1) {
150 if(
debug && nMuSimHit == 1)
151 cout <<
"[DTSegment2DSLPhiQuality] Only " << nMuSimHit <<
" mu SimHit in this chamber, skipping!" << endl;
155 cout <<
"=== Chamber " << (*chamberId) <<
" has " << nMuSimHit <<
" SimHits" << endl;
162 (*chamberId),&(*dtGeom));
164 LocalVector simSegmLocalDir = dirAndPosSimSegm.first;
165 LocalPoint simSegmLocalPos = dirAndPosSimSegm.second;
166 const DTChamber* chamber = dtGeom->chamber(*chamberId);
171 float posSimSeg = simSegmLocalPos.
x();
173 float etaSimSeg = simSegmGlobalPos.
eta();
174 float phiSimSeg = simSegmGlobalPos.
phi();
177 cout<<
" Simulated segment: local direction "<<simSegmLocalDir<<endl
178 <<
" local position "<<simSegmLocalPos<<endl
179 <<
" angle "<<angleSimSeg<<endl;
183 bool recHitFound =
false;
185 int nsegm = distance(range.first, range.second);
187 cout <<
" Chamber: " << *chamberId <<
" has " << nsegm
188 <<
" 4D segments" << endl;
197 bool bestRecHitFound =
false;
198 double deltaAlpha = 99999;
202 segment4D!=range.second;
205 if((*segment4D).dimension() != 4) {
206 if(
debug)
cout <<
"[DTSegment2DSLPhiQuality]***Error: This is not 4D segment!!!" << endl;
212 if((*phiSegment2D).dimension() != 2) {
213 if(
debug)
cout <<
"[DTSegment2DQuality]***Error: This is not 2D segment!!!" << endl;
218 LocalVector recSegDirection = (*phiSegment2D).localDirection();
222 cout <<
" RecSegment direction: " << recSegDirection << endl
223 <<
" position : " << (*phiSegment2D).localPosition() << endl
224 <<
" alpha : " << recSegAlpha << endl;
226 if(fabs(recSegAlpha - angleSimSeg) < deltaAlpha) {
227 deltaAlpha = fabs(recSegAlpha - angleSimSeg);
228 bestRecHit = &(*phiSegment2D);
229 bestRecHitFound =
true;
233 if(bestRecHitFound) {
242 if(fabs(angleBestRHit - angleSimSeg) < 5*sigmaResAngle &&
243 fabs(bestRecHitLocalPos.
x() - posSimSeg) < 5*sigmaResPos) {
248 h2DHitSuperPhi->Fill(angleSimSeg,
251 bestRecHitLocalPos.
x(),
254 sqrt(bestRecHitLocalPosErr.
xx()),
255 sqrt(bestRecHitLocalDirErr.
xx())
261 if(doall) {h2DHitEff_SuperPhi->Fill(etaSimSeg,
T getParameter(std::string const &) const
virtual LocalError localPositionError() const
local position error in SL frame
DTSegment2DSLPhiQuality(const edm::ParameterSet &pset)
Constructor.
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Perform the real analysis.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
virtual LocalError localDirectionError() const
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
static std::map< DTWireId, const PSimHit * > mapMuSimHitsPerWire(const std::map< DTWireId, edm::PSimHitContainer > &simHitWireMap)
Create a map between the Mu SimHits and corresponding MuBarWireId ;.
static std::pair< const PSimHit *, const PSimHit * > findMuSimSegment(const std::map< DTWireId, const PSimHit * > &mapWireAndMuSimHit)
Find Innermost and outermost SimHit from Mu in a SL (they identify a simulated segment) ...
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static std::pair< double, double > findSegmentAlphaAndBeta(const LocalVector &direction)
Find the angles from a segment direction:
virtual LocalPoint localPosition() const
local position in SL frame
static std::pair< LocalVector, LocalPoint > findMuSimSegmentDirAndPos(const std::pair< const PSimHit *, const PSimHit * > &inAndOutSimHit, const DetId detId, const DTGeometry *muonGeom)
Find direction and position of a segment (in local RF) from outer and inner mu SimHit in the RF of ob...
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
virtual LocalVector localDirection() const
the local direction in SL frame
std::vector< PSimHit > PSimHitContainer
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
virtual ~DTSegment2DSLPhiQuality()
Destructor.