16 inputDTRecSegment4DCollection_(parset.getParameter<edm::InputTag>(
"inputDTRecSegment4DCollection")),
17 inputCSCSegmentCollection_(parset.getParameter<edm::InputTag>(
"inputCSCSegmentCollection"))
30 unsigned int index_dt_segment = 0;
33 LocalPoint segmentLocalPosition = segment->localPosition();
34 LocalVector segmentLocalDirection = segment->localDirection();
35 LocalError segmentLocalPositionError = segment->localPositionError();
36 LocalError segmentLocalDirectionError = segment->localDirectionError();
37 DetId geoid = segment->geographicalId();
39 int wheel = dtdetid.
wheel();
41 int sector = dtdetid.
sector();
43 float segmentX = segmentLocalPosition.
x();
44 float segmentY = segmentLocalPosition.
y();
45 float segmentdXdZ = segmentLocalDirection.
x()/segmentLocalDirection.
z();
46 float segmentdYdZ = segmentLocalDirection.
y()/segmentLocalDirection.
z();
47 float segmentXerr =
sqrt(segmentLocalPositionError.
xx());
48 float segmentYerr =
sqrt(segmentLocalPositionError.
yy());
49 float segmentdXdZerr =
sqrt(segmentLocalDirectionError.
xx());
50 float segmentdYdZerr =
sqrt(segmentLocalDirectionError.
yy());
53 <<
"\nDT segment index :"<<index_dt_segment
54 <<
"\nchamber Wh:"<<wheel<<
",St:"<<station<<
",Se:"<<sector
55 <<
"\nLocal Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
56 <<
"Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
60 unsigned int index_csc_segment = 0;
63 LocalPoint segmentLocalPosition = segment->localPosition();
64 LocalVector segmentLocalDirection = segment->localDirection();
65 LocalError segmentLocalPositionError = segment->localPositionError();
66 LocalError segmentLocalDirectionError = segment->localDirectionError();
68 DetId geoid = segment->geographicalId();
73 int chamber = cscdetid.
chamber();
75 float segmentX = segmentLocalPosition.
x();
76 float segmentY = segmentLocalPosition.
y();
77 float segmentdXdZ = segmentLocalDirection.
x()/segmentLocalDirection.
z();
78 float segmentdYdZ = segmentLocalDirection.
y()/segmentLocalDirection.
z();
79 float segmentXerr =
sqrt(segmentLocalPositionError.
xx());
80 float segmentYerr =
sqrt(segmentLocalPositionError.
yy());
81 float segmentdXdZerr =
sqrt(segmentLocalDirectionError.
xx());
82 float segmentdYdZerr =
sqrt(segmentLocalDirectionError.
yy());
85 <<
"\nCSC segment index :"<<index_csc_segment
86 <<
"\nchamber Endcap:"<<endcap<<
",St:"<<station<<
",Ri:"<<ring<<
",Ch:"<<chamber
87 <<
"\nLocal Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
88 <<
"Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
92 std::vector<const TrackingRecHit *>
94 std::vector<const TrackingRecHit *>
ret;
101 unsigned int index_chamber = 0;
103 for(std::vector<reco::MuonChamberMatch>::const_iterator chamberMatch = mu.
matches().begin();
104 chamberMatch != mu.
matches().end(); ++chamberMatch, index_chamber++) {
105 std::stringstream chamberStr;
106 chamberStr <<
"\nchamber index: "<<index_chamber;
108 int subdet = chamberMatch->detector();
109 DetId did = chamberMatch->id;
113 wheel = dtdetid.
wheel();
115 sector = dtdetid.
sector();
116 chamberStr <<
", DT chamber Wh:"<<wheel<<
",St:"<<station<<
",Se:"<<sector;
120 endcap = cscdetid.
endcap();
122 ring = cscdetid.
ring();
124 chamberStr <<
", CSC chamber End:"<<endcap<<
",St:"<<station<<
",Ri:"<<ring<<
",Ch:"<<chamber;
127 chamberStr <<
", Number of segments: "<<chamberMatch->segmentMatches.size();
130 unsigned int index_segment = 0;
132 for(std::vector<reco::MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
133 segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch, index_segment++) {
135 float segmentX = segmentMatch->x;
136 float segmentY = segmentMatch->y ;
137 float segmentdXdZ = segmentMatch->dXdZ;
138 float segmentdYdZ = segmentMatch->dYdZ;
139 float segmentXerr = segmentMatch->xErr;
140 float segmentYerr = segmentMatch->yErr;
141 float segmentdXdZerr = segmentMatch->dXdZErr;
142 float segmentdYdZerr = segmentMatch->dYdZErr;
150 std::string ARBITRATED(
" ***Arbitrated Off*** ");
151 if (segment_arbitrated_Ok) ARBITRATED =
" ***ARBITRATED OK*** ";
155 <<
"\n\t segment index: "<<index_segment << ARBITRATED
156 <<
"\n\t Local Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
157 <<
"\n\t Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
159 if (!segment_arbitrated_Ok)
continue;
161 if (segmentDT.
get() != 0) {
164 edm::LogVerbatim(
"TrackerMuonHitExtractor")<<
"\t ===> MATCHING with DT segment with index = "<<segmentDT.
key();
168 std::vector<const TrackingRecHit*> phiHits = phiSeg->
recHits();
169 for(std::vector<const TrackingRecHit*>::const_iterator ihit = phiHits.begin();
170 ihit != phiHits.end(); ++ihit) {
171 ret.push_back(*ihit);
177 std::vector<const TrackingRecHit*> zedHits = zSeg->
recHits();
178 for(std::vector<const TrackingRecHit*>::const_iterator ihit = zedHits.begin();
179 ihit != zedHits.end(); ++ihit) {
180 ret.push_back(*ihit);
183 }
else edm::LogWarning(
"TrackerMuonHitExtractor")<<
"\n***WARNING: UNMATCHED DT segment ! \n";
188 <<
"\n\t segment index: "<<index_segment << ARBITRATED
189 <<
"\n\t Local Position (X,Y)=("<<segmentX<<
","<<segmentY<<
") +/- ("<<segmentXerr<<
","<<segmentYerr<<
"), "
190 <<
"\n\t Local Direction (dXdZ,dYdZ)=("<<segmentdXdZ<<
","<<segmentdYdZ<<
") +/- ("<<segmentdXdZerr<<
","<<segmentdYdZerr<<
")";
192 if (!segment_arbitrated_Ok)
continue;
194 if (segmentCSC.
get() != 0) {
197 edm::LogVerbatim(
"TrackerMuonHitExtractor")<<
"\t ===> MATCHING with CSC segment with index = "<<segmentCSC.
key();
199 std::vector<const TrackingRecHit*> hits = segment->
recHits();
200 for(std::vector<const TrackingRecHit*>::const_iterator ihit = hits.begin();
201 ihit != hits.end(); ++ihit) {
202 ret.push_back(*ihit);
204 }
else edm::LogWarning(
"TrackerMuonHitExtractor")<<
"\n***WARNING: UNMATCHED CSC segment ! \n";
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
C::const_iterator const_iterator
constant access iterator type
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
static const unsigned int BestInChamberByDR
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
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
bool hasZed() const
Does it have the Z projection?
key_type key() const
Accessor for product key.
std::vector< MuonChamberMatch > & matches()
get muon matching information
static const unsigned int BelongsToTrackByDR
int station() const
Return the station number.
T const * get() const
Returns C++ pointer to the item.
int wheel() const
Return the wheel number.