19 inputDTRecSegment4DCollection_(parset.getParameter<edm::
InputTag>(
"inputDTRecSegment4DCollection")),
20 inputCSCSegmentCollection_(parset.getParameter<edm::
InputTag>(
"inputCSCSegmentCollection"))
25 inputDTRecSegment4DCollection_(parset.getParameter<edm::
InputTag>(
"inputDTRecSegment4DCollection")),
26 inputCSCSegmentCollection_(parset.getParameter<edm::
InputTag>(
"inputCSCSegmentCollection"))
39 unsigned int index_dt_segment = 0;
42 LocalPoint segmentLocalPosition = segment->localPosition();
43 LocalVector segmentLocalDirection = segment->localDirection();
44 LocalError segmentLocalPositionError = segment->localPositionError();
45 LocalError segmentLocalDirectionError = segment->localDirectionError();
46 DetId geoid = segment->geographicalId();
48 int wheel = dtdetid.
wheel();
50 int sector = dtdetid.
sector();
52 float segmentX = segmentLocalPosition.
x();
53 float segmentY = segmentLocalPosition.
y();
54 float segmentdXdZ = segmentLocalDirection.
x()/segmentLocalDirection.
z();
55 float segmentdYdZ = segmentLocalDirection.
y()/segmentLocalDirection.
z();
56 float segmentXerr =
sqrt(segmentLocalPositionError.
xx());
57 float segmentYerr =
sqrt(segmentLocalPositionError.
yy());
58 float segmentdXdZerr =
sqrt(segmentLocalDirectionError.
xx());
59 float segmentdYdZerr =
sqrt(segmentLocalDirectionError.
yy());
62 <<
"\nDT segment index :"<<index_dt_segment
63 <<
"\nchamber Wh:"<<wheel<<
",St:"<<station<<
",Se:"<<sector
64 <<
"\nLocal Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
65 <<
"Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
69 unsigned int index_csc_segment = 0;
72 LocalPoint segmentLocalPosition = segment->localPosition();
73 LocalVector segmentLocalDirection = segment->localDirection();
74 LocalError segmentLocalPositionError = segment->localPositionError();
75 LocalError segmentLocalDirectionError = segment->localDirectionError();
77 DetId geoid = segment->geographicalId();
82 int chamber = cscdetid.
chamber();
84 float segmentX = segmentLocalPosition.
x();
85 float segmentY = segmentLocalPosition.
y();
86 float segmentdXdZ = segmentLocalDirection.
x()/segmentLocalDirection.
z();
87 float segmentdYdZ = segmentLocalDirection.
y()/segmentLocalDirection.
z();
88 float segmentXerr =
sqrt(segmentLocalPositionError.
xx());
89 float segmentYerr =
sqrt(segmentLocalPositionError.
yy());
90 float segmentdXdZerr =
sqrt(segmentLocalDirectionError.
xx());
91 float segmentdYdZerr =
sqrt(segmentLocalDirectionError.
yy());
94 <<
"\nCSC segment index :"<<index_csc_segment
95 <<
"\nchamber Endcap:"<<endcap<<
",St:"<<station<<
",Ri:"<<ring<<
",Ch:"<<chamber
96 <<
"\nLocal Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
97 <<
"Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
101 std::vector<const TrackingRecHit *>
103 std::vector<const TrackingRecHit *>
ret;
110 unsigned int index_chamber = 0;
112 for(std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch = mu.
matches().begin();
113 chamberMatch != mu.
matches().end(); ++chamberMatch, index_chamber++) {
114 std::stringstream chamberStr;
115 chamberStr <<
"\nchamber index: "<<index_chamber;
117 int subdet = chamberMatch->detector();
118 DetId did = chamberMatch->id;
122 wheel = dtdetid.
wheel();
124 sector = dtdetid.
sector();
125 chamberStr <<
", DT chamber Wh:"<<wheel<<
",St:"<<station<<
",Se:"<<sector;
129 endcap = cscdetid.
endcap();
131 ring = cscdetid.
ring();
133 chamberStr <<
", CSC chamber End:"<<endcap<<
",St:"<<station<<
",Ri:"<<ring<<
",Ch:"<<chamber;
136 chamberStr <<
", Number of segments: "<<chamberMatch->segmentMatches.size();
139 unsigned int index_segment = 0;
141 for(std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
142 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch, index_segment++) {
144 float segmentX = segmentMatch->x;
145 float segmentY = segmentMatch->y ;
146 float segmentdXdZ = segmentMatch->dXdZ;
147 float segmentdYdZ = segmentMatch->dYdZ;
148 float segmentXerr = segmentMatch->xErr;
149 float segmentYerr = segmentMatch->yErr;
150 float segmentdXdZerr = segmentMatch->dXdZErr;
151 float segmentdYdZerr = segmentMatch->dYdZErr;
160 if (segment_arbitrated_Ok) ARBITRATED =
" ***ARBITRATED OK*** ";
164 <<
"\n\t segment index: "<<index_segment << ARBITRATED
165 <<
"\n\t Local Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
166 <<
"\n\t Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
168 if (!segment_arbitrated_Ok)
continue;
170 if (segmentDT.
get() != 0) {
173 edm::LogVerbatim(
"TrackerMuonHitExtractor")<<
"\t ===> MATCHING with DT segment with index = "<<segmentDT.
key();
177 std::vector<const TrackingRecHit*> phiHits = phiSeg->
recHits();
178 for(std::vector<const TrackingRecHit*>::const_iterator ihit = phiHits.begin();
179 ihit != phiHits.end(); ++ihit) {
180 ret.push_back(*ihit);
186 std::vector<const TrackingRecHit*> zedHits = zSeg->
recHits();
187 for(std::vector<const TrackingRecHit*>::const_iterator ihit = zedHits.begin();
188 ihit != zedHits.end(); ++ihit) {
189 ret.push_back(*ihit);
192 }
else edm::LogWarning(
"TrackerMuonHitExtractor")<<
"\n***WARNING: UNMATCHED DT segment ! \n";
197 <<
"\n\t segment index: "<<index_segment << ARBITRATED
198 <<
"\n\t Local Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
199 <<
"\n\t Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
201 if (!segment_arbitrated_Ok)
continue;
203 if (segmentCSC.
get() != 0) {
206 edm::LogVerbatim(
"TrackerMuonHitExtractor")<<
"\t ===> MATCHING with CSC segment with index = "<<segmentCSC.
key();
208 std::vector<const TrackingRecHit*> hits = segment->
recHits();
209 for(std::vector<const TrackingRecHit*>::const_iterator ihit = hits.begin();
210 ihit != hits.end(); ++ihit) {
211 ret.push_back(*ihit);
213 }
else edm::LogWarning(
"TrackerMuonHitExtractor")<<
"\n***WARNING: UNMATCHED CSC segment ! \n";
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
key_type key() const
Accessor for product key.
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
static const unsigned int BestInChamberByDR
T const * get() const
Returns C++ pointer to the item.
bool hasPhi() const
Does it have the Phi projection?
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool hasZed() const
Does it have the Z projection?
std::vector< MuonChamberMatch > & matches()
get muon matching information
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
static const unsigned int BelongsToTrackByDR
int station() const
Return the station number.
int wheel() const
Return the wheel number.