17 inputDTRecSegment4DToken_(ic.consumes<
DTRecSegment4DCollection>(parset.getParameter<
edm::InputTag>(
"inputDTRecSegment4DCollection"))),
18 inputCSCSegmentToken_(ic.consumes<
CSCSegmentCollection>(parset.getParameter<
edm::InputTag>(
"inputCSCSegmentCollection"))),
19 inputDTRecSegment4DCollection_(parset.getParameter<
edm::InputTag>(
"inputDTRecSegment4DCollection")),
20 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();
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();
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;
111 unsigned int index_chamber = 0;
112 int n_segments_noArb = 0;
114 for(std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch = mu.
matches().begin();
115 chamberMatch != mu.
matches().end(); ++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;
131 endcap = cscdetid.
endcap();
133 ring = cscdetid.
ring();
135 chamberStr <<
", CSC chamber End:"<<endcap<<
",St:"<<station<<
",Ri:"<<ring<<
",Ch:"<<
chamber;
138 chamberStr <<
", Number of segments: "<<chamberMatch->segmentMatches.size();
140 n_segments_noArb = n_segments_noArb + chamberMatch->segmentMatches.size();
142 unsigned int index_segment = 0;
144 for(std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
145 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch, index_segment++) {
147 float segmentX = segmentMatch->x;
148 float segmentY = segmentMatch->y ;
149 float segmentdXdZ = segmentMatch->dXdZ;
150 float segmentdYdZ = segmentMatch->dYdZ;
151 float segmentXerr = segmentMatch->xErr;
152 float segmentYerr = segmentMatch->yErr;
153 float segmentdXdZerr = segmentMatch->dXdZErr;
154 float segmentdYdZerr = segmentMatch->dYdZErr;
163 if (segment_arbitrated_Ok) ARBITRATED =
" ***ARBITRATED OK*** ";
167 <<
"\n\t segment index: "<<index_segment << ARBITRATED
168 <<
"\n\t Local Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), " 169 <<
"\n\t Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
172 if (!segment_arbitrated_Ok)
continue;
174 if (segmentDT.
get() !=
nullptr) {
177 edm::LogVerbatim(
"TrackerMuonHitExtractor")<<
"\t ===> MATCHING with DT segment with index = "<<segmentDT.
key();
181 std::vector<const TrackingRecHit*> phiHits = phiSeg->
recHits();
182 for(std::vector<const TrackingRecHit*>::const_iterator ihit = phiHits.begin();
183 ihit != phiHits.end(); ++ihit) {
184 ret.push_back(*ihit);
190 std::vector<const TrackingRecHit*> zedHits = zSeg->
recHits();
191 for(std::vector<const TrackingRecHit*>::const_iterator ihit = zedHits.begin();
192 ihit != zedHits.end(); ++ihit) {
193 ret.push_back(*ihit);
196 }
else edm::LogWarning(
"TrackerMuonHitExtractor")<<
"\n***WARNING: UNMATCHED DT segment ! \n";
201 <<
"\n\t segment index: "<<index_segment << ARBITRATED
202 <<
"\n\t Local Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), " 203 <<
"\n\t Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
206 if (!segment_arbitrated_Ok)
continue;
208 if (segmentCSC.
get() !=
nullptr) {
211 edm::LogVerbatim(
"TrackerMuonHitExtractor")<<
"\t ===> MATCHING with CSC segment with index = "<<segmentCSC.
key();
213 std::vector<const TrackingRecHit*>
hits = segment->
recHits();
214 for(std::vector<const TrackingRecHit*>::const_iterator ihit = hits.begin();
215 ihit != hits.end(); ++ihit) {
216 ret.push_back(*ihit);
218 }
else edm::LogWarning(
"TrackerMuonHitExtractor")<<
"\n***WARNING: UNMATCHED CSC segment ! \n";
224 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.
int numberOfMatches(unsigned int type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
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
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.