CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ChamberSegmentUtility Class Reference

#include <ChamberSegmentUtility.h>

Public Member Functions

 ChamberSegmentUtility (const edm::Event &, const edm::EventSetup &)
 
const std::map< int,
std::vector< CSCSegment > > & 
getCSClist () const
 
std::vector< CSCRecHit2DgetCSCRHmap (CSCSegment)
 
std::vector< CSCSegmentgetCSCSegmentsInChamber (CSCDetId)
 
const std::map< int,
std::vector< DTRecSegment4D > > & 
getDTlist () const
 
std::vector< DTRecHit1DgetDTRHmap (DTRecSegment4D)
 
std::vector< DTRecSegment4DgetDTSegmentsInChamber (DTChamberId)
 

Private Attributes

edm::Handle
< DTRecSegment4DCollection
all4DSegments
 
edm::ESHandle< CSCGeometrycscGeometry
 
std::vector< CSCSegmentcscseg
 
std::map< int, std::vector
< CSCSegment > > 
cscsegMap
 
edm::Handle< CSCSegmentCollectionCSCSegments
 
edm::ESHandle< DTGeometrydtGeom
 
std::vector< DTRecSegment4Ddtseg
 
std::map< int, std::vector
< DTRecSegment4D > > 
dtsegMap
 
std::vector< DTRecHit1DphiSegRH
 
CSCDetId selectedCSC
 
DTChamberId selectedDT
 
std::vector< DTRecHit1DzSegRH
 

Detailed Description

Class: ChamberSegmentUtility

Description: utility class for the dynamical truncation algorithm

Date:
2010/06/27 17:32:41
Revision:
1.3

Authors : D. Pagano & G. Bruno - UCL Louvain

Definition at line 35 of file ChamberSegmentUtility.h.

Constructor & Destructor Documentation

ChamberSegmentUtility::ChamberSegmentUtility ( const edm::Event Event,
const edm::EventSetup Setup 
)

Definition at line 38 of file ChamberSegmentUtility.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), and getHLTprescales::index.

39 {
40 
41  Setup.get<MuonGeometryRecord>().get(cscGeometry);
42  Event.getByLabel("cscSegments", CSCSegments);
43  Setup.get<MuonGeometryRecord>().get(dtGeom);
44  Event.getByLabel("dt4DSegments", all4DSegments);
45 
46  unsigned int index = 0;
47  for ( CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
48  chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
49 
50  CSCSegmentCollection::range range = CSCSegments->get((*chamberId));
51 
52  for (CSCSegmentCollection::const_iterator segment = range.first;
53  segment!=range.second; ++segment) {
54  if ((*chamberId).station() == 1) cscsegMap[1].push_back(*segment);
55  if ((*chamberId).station() == 2) cscsegMap[2].push_back(*segment);
56  if ((*chamberId).station() == 3) cscsegMap[3].push_back(*segment);
57  if ((*chamberId).station() == 4) cscsegMap[4].push_back(*segment);
58  }
59  }
60 
62  for (chamberIdIt = all4DSegments->id_begin();
63  chamberIdIt != all4DSegments->id_end();
64  ++chamberIdIt){
65 
66  DTRecSegment4DCollection::range range = all4DSegments->get((*chamberIdIt));
67 
68  for (DTRecSegment4DCollection::const_iterator segment = range.first;
69  segment!=range.second; ++segment){
70 
71  if ((*chamberIdIt).station() == 1) dtsegMap[1].push_back(*segment);
72  if ((*chamberIdIt).station() == 2) dtsegMap[2].push_back(*segment);
73  if ((*chamberIdIt).station() == 3) dtsegMap[3].push_back(*segment);
74  if ((*chamberIdIt).station() == 4) dtsegMap[4].push_back(*segment);
75  }
76  }
77 
78 
79 }
edm::ESHandle< DTGeometry > dtGeom
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
identifier iterator
Definition: RangeMap.h:138
std::map< int, std::vector< DTRecSegment4D > > dtsegMap
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
std::map< int, std::vector< CSCSegment > > cscsegMap
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::ESHandle< CSCGeometry > cscGeometry
edm::Handle< CSCSegmentCollection > CSCSegments
const T & get() const
Definition: EventSetup.h:55
edm::Handle< DTRecSegment4DCollection > all4DSegments

Member Function Documentation

const std::map<int, std::vector<CSCSegment> >& ChamberSegmentUtility::getCSClist ( ) const
inline

Definition at line 51 of file ChamberSegmentUtility.h.

References cscsegMap.

Referenced by DynamicTruncation::filteringAlgo().

51 { return cscsegMap; };
std::map< int, std::vector< CSCSegment > > cscsegMap
vector< CSCRecHit2D > ChamberSegmentUtility::getCSCRHmap ( CSCSegment  selected)

Definition at line 132 of file ChamberSegmentUtility.cc.

References getHLTprescales::index, and CSCSegment::parameters().

Referenced by DynamicTruncation::filteringAlgo().

133 {
134 
135  vector<CSCRecHit2D> allchRH;
136 
137  // loop on segments 4D
138  unsigned int index = 0;
139  for ( CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
140  chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
141 
142  // Get the range for the corresponding ChamberId
143  CSCSegmentCollection::range range = CSCSegments->get((*chamberId));
144 
145  // Loop over the rechits of this DetUnit
146  for (CSCSegmentCollection::const_iterator segment = range.first;
147  segment!=range.second; ++segment) {
148 
149  if((*segment).parameters() == selected.parameters()) {
150  allchRH = (*segment).specificRecHits();
151  }
152  }
153  }
154  return allchRH;
155 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
AlgebraicVector parameters() const
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
Definition: CSCSegment.cc:57
identifier iterator
Definition: RangeMap.h:138
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
edm::Handle< CSCSegmentCollection > CSCSegments
vector< CSCSegment > ChamberSegmentUtility::getCSCSegmentsInChamber ( CSCDetId  sel)

Definition at line 83 of file ChamberSegmentUtility.cc.

References CSCDetId::chamber(), and getHLTprescales::index.

84 {
85 
86  // loop on segments 4D
87  unsigned int index = 0;
88  for ( CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
89  chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
90 
91  if ((*chamberId).chamber() != sel.chamber()) continue;
92 
93  // Get the range for the corresponding ChamberId
94  CSCSegmentCollection::range range = CSCSegments->get((*chamberId));
95 
96  // Loop over the rechits of this DetUnit
97  for (CSCSegmentCollection::const_iterator segment = range.first;
98  segment!=range.second; ++segment) {
99  cscseg.push_back(*segment);
100  }
101  }
102  return cscseg;
103 }
int chamber() const
Definition: CSCDetId.h:70
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
identifier iterator
Definition: RangeMap.h:138
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
edm::Handle< CSCSegmentCollection > CSCSegments
std::vector< CSCSegment > cscseg
const std::map<int, std::vector<DTRecSegment4D> >& ChamberSegmentUtility::getDTlist ( ) const
inline

Definition at line 48 of file ChamberSegmentUtility.h.

References dtsegMap.

Referenced by DynamicTruncation::filteringAlgo().

48 { return dtsegMap; };
std::map< int, std::vector< DTRecSegment4D > > dtsegMap
vector< DTRecHit1D > ChamberSegmentUtility::getDTRHmap ( DTRecSegment4D  selected)

Definition at line 158 of file ChamberSegmentUtility.cc.

References DTRecSegment4D::parameters(), and DTRecSegment2D::specificRecHits().

Referenced by DynamicTruncation::filteringAlgo().

159 {
160 
161  vector<DTRecHit1D> allchRH;
162  phiSegRH.clear();
163  zSegRH.clear();
164 
165  // loop on segments 4D
167  for (chamberIdIt = all4DSegments->id_begin();
168  chamberIdIt != all4DSegments->id_end();
169  ++chamberIdIt){
170 
171  // Get the range for the corresponding ChamberId
172  DTRecSegment4DCollection::range range = all4DSegments->get((*chamberIdIt));
173 
174  // Loop over the rechits of this DetUnit
175  for (DTRecSegment4DCollection::const_iterator segment = range.first;
176  segment!=range.second; ++segment){
177 
178  if((*segment).parameters() == selected.parameters()) {
179  if((*segment).hasPhi()){
180  const DTChamberRecSegment2D* phiSeg = (*segment).phiSegment();
181  phiSegRH = phiSeg->specificRecHits();
182  }
183  if((*segment).hasZed()){
184  const DTSLRecSegment2D* zSeg = (*segment).zSegment();
185  zSegRH = zSeg->specificRecHits();
186  }
187 
188  // RecHits will be ordered later
189  for (vector<DTRecHit1D>::const_iterator itphi = phiSegRH.begin(); itphi != phiSegRH.end(); itphi++) allchRH.push_back(*itphi);
190  for (vector<DTRecHit1D>::iterator itz = zSegRH.begin(); itz < zSegRH.end(); itz++) allchRH.push_back(*itz);
191 
192  }
193  }
194  }
195  return allchRH;
196 }
AlgebraicVector parameters() const
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
identifier iterator
Definition: RangeMap.h:138
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
std::vector< DTRecHit1D > phiSegRH
edm::Handle< DTRecSegment4DCollection > all4DSegments
std::vector< DTRecHit1D > zSegRH
vector< DTRecSegment4D > ChamberSegmentUtility::getDTSegmentsInChamber ( DTChamberId  sel)

Definition at line 107 of file ChamberSegmentUtility.cc.

108 {
109 
110  // loop on segments 4D
112  for (chamberIdIt = all4DSegments->id_begin();
113  chamberIdIt != all4DSegments->id_end();
114  ++chamberIdIt){
115 
116  if (*chamberIdIt != sel) continue;
117 
118  // Get the range for the corresponding ChamberId
119  DTRecSegment4DCollection::range range = all4DSegments->get((*chamberIdIt));
120 
121  // Loop over the rechits of this DetUnit
122  for (DTRecSegment4DCollection::const_iterator segment = range.first;
123  segment!=range.second; ++segment){
124  dtseg.push_back(*segment);
125  }
126  }
127  return dtseg;
128 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
identifier iterator
Definition: RangeMap.h:138
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
std::vector< DTRecSegment4D > dtseg
edm::Handle< DTRecSegment4DCollection > all4DSegments

Member Data Documentation

edm::Handle<DTRecSegment4DCollection> ChamberSegmentUtility::all4DSegments
private

Definition at line 65 of file ChamberSegmentUtility.h.

edm::ESHandle<CSCGeometry> ChamberSegmentUtility::cscGeometry
private

Definition at line 62 of file ChamberSegmentUtility.h.

std::vector<CSCSegment> ChamberSegmentUtility::cscseg
private

Definition at line 68 of file ChamberSegmentUtility.h.

std::map<int, std::vector<CSCSegment> > ChamberSegmentUtility::cscsegMap
private

Definition at line 70 of file ChamberSegmentUtility.h.

Referenced by getCSClist().

edm::Handle<CSCSegmentCollection> ChamberSegmentUtility::CSCSegments
private

Definition at line 63 of file ChamberSegmentUtility.h.

edm::ESHandle<DTGeometry> ChamberSegmentUtility::dtGeom
private

Definition at line 64 of file ChamberSegmentUtility.h.

std::vector<DTRecSegment4D> ChamberSegmentUtility::dtseg
private

Definition at line 67 of file ChamberSegmentUtility.h.

std::map<int, std::vector<DTRecSegment4D> > ChamberSegmentUtility::dtsegMap
private

Definition at line 69 of file ChamberSegmentUtility.h.

Referenced by getDTlist().

std::vector<DTRecHit1D> ChamberSegmentUtility::phiSegRH
private

Definition at line 73 of file ChamberSegmentUtility.h.

CSCDetId ChamberSegmentUtility::selectedCSC
private

Definition at line 72 of file ChamberSegmentUtility.h.

DTChamberId ChamberSegmentUtility::selectedDT
private

Definition at line 71 of file ChamberSegmentUtility.h.

std::vector<DTRecHit1D> ChamberSegmentUtility::zSegRH
private

Definition at line 74 of file ChamberSegmentUtility.h.