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 (const CSCSegment &)
 
std::vector< CSCSegmentgetCSCSegmentsInChamber (CSCDetId)
 
const std::map< int,
std::vector< DTRecSegment4D > > & 
getDTlist () const
 
std::vector< DTRecHit1DgetDTRHmap (const 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

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

Definition at line 33 of file ChamberSegmentUtility.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file ChamberSegmentUtility.cc.

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

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

References cscsegMap.

Referenced by DynamicTruncation::filteringAlgo().

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

Definition at line 130 of file ChamberSegmentUtility.cc.

References getHLTprescales::index.

Referenced by DynamicTruncation::filteringAlgo().

131 {
132 
133  vector<CSCRecHit2D> allchRH;
134 
135  // loop on segments 4D
136  unsigned int index = 0;
137  for ( CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
138  chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
139 
140  // Get the range for the corresponding ChamberId
141  CSCSegmentCollection::range range = CSCSegments->get((*chamberId));
142 
143  // Loop over the rechits of this DetUnit
144  for (CSCSegmentCollection::const_iterator segment = range.first;
145  segment!=range.second; ++segment) {
146 
147  if((*segment).parameters() == selected.parameters()) {
148  allchRH = (*segment).specificRecHits();
149  }
150  }
151  }
152  return allchRH;
153 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
edm::Handle< CSCSegmentCollection > CSCSegments
vector< CSCSegment > ChamberSegmentUtility::getCSCSegmentsInChamber ( CSCDetId  sel)

Definition at line 81 of file ChamberSegmentUtility.cc.

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

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

Definition at line 46 of file ChamberSegmentUtility.h.

References dtsegMap.

Referenced by DynamicTruncation::filteringAlgo().

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

Definition at line 156 of file ChamberSegmentUtility.cc.

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

Referenced by DynamicTruncation::filteringAlgo().

157 {
158 
159  vector<DTRecHit1D> allchRH;
160  phiSegRH.clear();
161  zSegRH.clear();
162 
163  // loop on segments 4D
164  DTRecSegment4DCollection::id_iterator chamberIdIt;
165  for (chamberIdIt = all4DSegments->id_begin();
166  chamberIdIt != all4DSegments->id_end();
167  ++chamberIdIt){
168 
169  // Get the range for the corresponding ChamberId
170  DTRecSegment4DCollection::range range = all4DSegments->get((*chamberIdIt));
171 
172  // Loop over the rechits of this DetUnit
173  for (DTRecSegment4DCollection::const_iterator segment = range.first;
174  segment!=range.second; ++segment){
175 
176  if((*segment).parameters() == selected.parameters()) {
177  if((*segment).hasPhi()){
178  const DTChamberRecSegment2D* phiSeg = (*segment).phiSegment();
179  phiSegRH = phiSeg->specificRecHits();
180  }
181  if((*segment).hasZed()){
182  const DTSLRecSegment2D* zSeg = (*segment).zSegment();
183  zSegRH = zSeg->specificRecHits();
184  }
185 
186  // RecHits will be ordered later
187  for (vector<DTRecHit1D>::const_iterator itphi = phiSegRH.begin(); itphi != phiSegRH.end(); itphi++) allchRH.push_back(*itphi);
188  for (vector<DTRecHit1D>::iterator itz = zSegRH.begin(); itz < zSegRH.end(); itz++) allchRH.push_back(*itz);
189 
190  }
191  }
192  }
193  return allchRH;
194 }
AlgebraicVector parameters() const
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
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 105 of file ChamberSegmentUtility.cc.

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

Member Data Documentation

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

Definition at line 63 of file ChamberSegmentUtility.h.

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

Definition at line 60 of file ChamberSegmentUtility.h.

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

Definition at line 66 of file ChamberSegmentUtility.h.

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

Definition at line 68 of file ChamberSegmentUtility.h.

Referenced by getCSClist().

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

Definition at line 61 of file ChamberSegmentUtility.h.

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

Definition at line 62 of file ChamberSegmentUtility.h.

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

Definition at line 65 of file ChamberSegmentUtility.h.

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

Definition at line 67 of file ChamberSegmentUtility.h.

Referenced by getDTlist().

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

Definition at line 71 of file ChamberSegmentUtility.h.

CSCDetId ChamberSegmentUtility::selectedCSC
private

Definition at line 70 of file ChamberSegmentUtility.h.

DTChamberId ChamberSegmentUtility::selectedDT
private

Definition at line 69 of file ChamberSegmentUtility.h.

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

Definition at line 72 of file ChamberSegmentUtility.h.