17 : inputDTRecSegment4DToken_(
19 inputCSCSegmentToken_(
21 inputDTRecSegment4DCollection_(parset.getParameter<
edm::InputTag>(
"inputDTRecSegment4DCollection")),
22 inputCSCSegmentCollection_(parset.getParameter<
edm::InputTag>(
"inputCSCSegmentCollection")) {}
35 unsigned int index_dt_segment = 0;
38 ++segment, index_dt_segment++) {
39 LocalPoint segmentLocalPosition = segment->localPosition();
40 LocalVector segmentLocalDirection = segment->localDirection();
41 LocalError segmentLocalPositionError = segment->localPositionError();
42 LocalError segmentLocalDirectionError = segment->localDirectionError();
43 DetId geoid = segment->geographicalId();
47 int sector = dtdetid.
sector();
49 float segmentX = segmentLocalPosition.
x();
50 float segmentY = segmentLocalPosition.
y();
51 float segmentdXdZ = segmentLocalDirection.
x() / segmentLocalDirection.
z();
52 float segmentdYdZ = segmentLocalDirection.
y() / segmentLocalDirection.
z();
53 float segmentXerr =
sqrt(segmentLocalPositionError.
xx());
54 float segmentYerr =
sqrt(segmentLocalPositionError.
yy());
55 float segmentdXdZerr =
sqrt(segmentLocalDirectionError.
xx());
56 float segmentdYdZerr =
sqrt(segmentLocalDirectionError.
yy());
59 <<
"\nDT segment index :" << index_dt_segment <<
"\nchamber Wh:" << wheel <<
",St:" << station
60 <<
",Se:" << sector <<
"\nLocal Position (X,Y)=(" << segmentX <<
"," << segmentY <<
") +/- (" << segmentXerr
61 <<
"," << segmentYerr <<
"), " 62 <<
"Local Direction (dXdZ,dYdZ)=(" << segmentdXdZ <<
"," << segmentdYdZ <<
") +/- (" << segmentdXdZerr <<
"," 63 << segmentdYdZerr <<
")";
67 unsigned int index_csc_segment = 0;
70 ++segment, index_csc_segment++) {
71 LocalPoint segmentLocalPosition = segment->localPosition();
72 LocalVector segmentLocalDirection = segment->localDirection();
73 LocalError segmentLocalPositionError = segment->localPositionError();
74 LocalError segmentLocalDirectionError = segment->localDirectionError();
76 DetId geoid = segment->geographicalId();
83 float segmentX = segmentLocalPosition.
x();
84 float segmentY = segmentLocalPosition.
y();
85 float segmentdXdZ = segmentLocalDirection.
x() / segmentLocalDirection.
z();
86 float segmentdYdZ = segmentLocalDirection.
y() / segmentLocalDirection.
z();
87 float segmentXerr =
sqrt(segmentLocalPositionError.
xx());
88 float segmentYerr =
sqrt(segmentLocalPositionError.
yy());
89 float segmentdXdZerr =
sqrt(segmentLocalDirectionError.
xx());
90 float segmentdYdZerr =
sqrt(segmentLocalDirectionError.
yy());
93 <<
"\nCSC segment index :" << index_csc_segment <<
"\nchamber Endcap:" << endcap <<
",St:" << station
94 <<
",Ri:" << ring <<
",Ch:" << chamber <<
"\nLocal Position (X,Y)=(" << segmentX <<
"," << segmentY <<
") +/- (" 95 << segmentXerr <<
"," << segmentYerr <<
"), " 96 <<
"Local Direction (dXdZ,dYdZ)=(" << segmentdXdZ <<
"," << segmentdYdZ <<
") +/- (" << segmentdXdZerr <<
"," 97 << segmentdYdZerr <<
")";
101 std::vector<const TrackingRecHit *> ret;
107 <<
"Number of chambers: " << mu.
matches().size()
110 unsigned int index_chamber = 0;
111 int n_segments_noArb = 0;
113 for (std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch = mu.
matches().begin();
114 chamberMatch != mu.
matches().end();
115 ++chamberMatch, index_chamber++) {
116 std::stringstream chamberStr;
117 chamberStr <<
"\nchamber index: " << index_chamber;
119 int subdet = chamberMatch->detector();
120 DetId did = chamberMatch->id;
124 wheel = dtdetid.
wheel();
126 sector = dtdetid.
sector();
127 chamberStr <<
", DT chamber Wh:" << wheel <<
",St:" << station <<
",Se:" << sector;
130 endcap = cscdetid.
endcap();
132 ring = cscdetid.
ring();
134 chamberStr <<
", CSC chamber End:" << endcap <<
",St:" << station <<
",Ri:" << ring <<
",Ch:" <<
chamber;
137 chamberStr <<
", Number of segments: " << chamberMatch->segmentMatches.size();
139 n_segments_noArb = n_segments_noArb + chamberMatch->segmentMatches.size();
141 unsigned int index_segment = 0;
143 for (std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
144 segmentMatch != chamberMatch->segmentMatches.end();
145 ++segmentMatch, index_segment++) {
146 float segmentX = segmentMatch->x;
147 float segmentY = segmentMatch->y;
148 float segmentdXdZ = segmentMatch->dXdZ;
149 float segmentdYdZ = segmentMatch->dYdZ;
150 float segmentXerr = segmentMatch->xErr;
151 float segmentYerr = segmentMatch->yErr;
152 float segmentdXdZerr = segmentMatch->dXdZErr;
153 float segmentdYdZerr = segmentMatch->dYdZErr;
162 if (segment_arbitrated_Ok)
163 ARBITRATED =
" ***ARBITRATED OK*** ";
167 <<
"\n\t segment index: " << index_segment << ARBITRATED <<
"\n\t Local Position (X,Y)=(" << segmentX
168 <<
"," << segmentY <<
") +/- (" << segmentXerr <<
"," << segmentYerr <<
"), " 169 <<
"\n\t Local Direction (dXdZ,dYdZ)=(" << segmentdXdZ <<
"," << segmentdYdZ <<
") +/- (" << segmentdXdZerr
170 <<
"," << segmentdYdZerr <<
")";
174 if (!segment_arbitrated_Ok)
177 if (segmentDT.
get() !=
nullptr) {
181 <<
"\t ===> MATCHING with DT segment with index = " << segmentDT.
key();
185 std::vector<const TrackingRecHit *> phiHits = phiSeg->
recHits();
186 for (std::vector<const TrackingRecHit *>::const_iterator ihit = phiHits.begin(); ihit != phiHits.end();
188 ret.push_back(*ihit);
194 std::vector<const TrackingRecHit *> zedHits = zSeg->
recHits();
195 for (std::vector<const TrackingRecHit *>::const_iterator ihit = zedHits.begin(); ihit != zedHits.end();
197 ret.push_back(*ihit);
201 edm::LogWarning(
"TrackerMuonHitExtractor") <<
"\n***WARNING: UNMATCHED DT segment ! \n";
206 <<
"\n\t segment index: " << index_segment << ARBITRATED <<
"\n\t Local Position (X,Y)=(" << segmentX
207 <<
"," << segmentY <<
") +/- (" << segmentXerr <<
"," << segmentYerr <<
"), " 208 <<
"\n\t Local Direction (dXdZ,dYdZ)=(" << segmentdXdZ <<
"," << segmentdYdZ <<
") +/- (" << segmentdXdZerr
209 <<
"," << segmentdYdZerr <<
")";
213 if (!segment_arbitrated_Ok)
216 if (segmentCSC.
get() !=
nullptr) {
220 <<
"\t ===> MATCHING with CSC segment with index = " << segmentCSC.
key();
222 std::vector<const TrackingRecHit *>
hits = segment->
recHits();
223 for (std::vector<const TrackingRecHit *>::const_iterator ihit = hits.begin(); ihit != hits.end(); ++ihit) {
224 ret.push_back(*ihit);
227 edm::LogWarning(
"TrackerMuonHitExtractor") <<
"\n***WARNING: UNMATCHED CSC segment ! \n";
233 edm::LogVerbatim(
"TrackerMuonHitExtractor") <<
"\n N. matched Segments before arbitration = " << n_segments_noArb;
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
key_type key() const
Accessor for product key.
C::const_iterator const_iterator
constant access iterator type
static const unsigned int BestInChamberByDR
T const * get() const
Returns C++ pointer to the item.
bool hasPhi() const
Does it have the Phi projection?
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool hasZed() const
Does it have the Z projection?
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
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
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
int station() const
Return the station number.
int wheel() const
Return the wheel number.