CMS 3D CMS Logo

Public Member Functions | Private Attributes

ChamberSegmentUtility Class Reference

#include <ChamberSegmentUtility.h>

List of all members.

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

Date:
2013/05/28 15:46:29
Revision:
1.4

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.

{

  Setup.get<MuonGeometryRecord>().get(cscGeometry);
  Event.getByLabel("cscSegments", CSCSegments);
  Setup.get<MuonGeometryRecord>().get(dtGeom);
  Event.getByLabel("dt4DSegments", all4DSegments);

  unsigned int index = 0;
  for (  CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
         chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
    
    CSCSegmentCollection::range  range = CSCSegments->get((*chamberId));
    
    for (CSCSegmentCollection::const_iterator segment = range.first;
         segment!=range.second; ++segment) {
      if ((*chamberId).station() == 1) cscsegMap[1].push_back(*segment);
      if ((*chamberId).station() == 2) cscsegMap[2].push_back(*segment);
      if ((*chamberId).station() == 3) cscsegMap[3].push_back(*segment);
      if ((*chamberId).station() == 4) cscsegMap[4].push_back(*segment);
    }
  }
  
  DTRecSegment4DCollection::id_iterator chamberIdIt;
  for (chamberIdIt = all4DSegments->id_begin();
       chamberIdIt != all4DSegments->id_end();
       ++chamberIdIt){
    
    DTRecSegment4DCollection::range  range = all4DSegments->get((*chamberIdIt));

    for (DTRecSegment4DCollection::const_iterator segment = range.first;
         segment!=range.second; ++segment){
      
      if ((*chamberIdIt).station() == 1) dtsegMap[1].push_back(*segment);
      if ((*chamberIdIt).station() == 2) dtsegMap[2].push_back(*segment);
      if ((*chamberIdIt).station() == 3) dtsegMap[3].push_back(*segment);
      if ((*chamberIdIt).station() == 4) dtsegMap[4].push_back(*segment);
    }
  }


}

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().

{ return cscsegMap; };
vector< CSCRecHit2D > ChamberSegmentUtility::getCSCRHmap ( const CSCSegment selected)

Definition at line 132 of file ChamberSegmentUtility.cc.

References getHLTprescales::index.

Referenced by DynamicTruncation::filteringAlgo().

{

  vector<CSCRecHit2D> allchRH;
  
  // loop on segments 4D                                                       
  unsigned int index = 0;
  for (  CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
         chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
    
    // Get the range for the corresponding ChamberId                    
    CSCSegmentCollection::range  range = CSCSegments->get((*chamberId));
    
    // Loop over the rechits of this DetUnit                        
    for (CSCSegmentCollection::const_iterator segment = range.first;
         segment!=range.second; ++segment) {
      
      if((*segment).parameters() == selected.parameters()) {
        allchRH = (*segment).specificRecHits();
      }
    }  
  }
  return allchRH;
}
vector< CSCSegment > ChamberSegmentUtility::getCSCSegmentsInChamber ( CSCDetId  sel)

Definition at line 83 of file ChamberSegmentUtility.cc.

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

{
  
  // loop on segments 4D   
  unsigned int index = 0;
  for (  CSCSegmentCollection::id_iterator chamberId = CSCSegments->id_begin();
         chamberId != CSCSegments->id_end(); ++chamberId, ++index ) {
    
    if ((*chamberId).chamber() != sel.chamber()) continue;
    
    // Get the range for the corresponding ChamberId                                                                                                                     
    CSCSegmentCollection::range  range = CSCSegments->get((*chamberId));
    
    // Loop over the rechits of this DetUnit                                                                                                                            
    for (CSCSegmentCollection::const_iterator segment = range.first;
         segment!=range.second; ++segment) {
      cscseg.push_back(*segment);
    }
  }
  return 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().

{ return dtsegMap; };
vector< DTRecHit1D > ChamberSegmentUtility::getDTRHmap ( const DTRecSegment4D selected)

Definition at line 158 of file ChamberSegmentUtility.cc.

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

Referenced by DynamicTruncation::filteringAlgo().

{
  
  vector<DTRecHit1D> allchRH;
  phiSegRH.clear();
  zSegRH.clear();
  
  // loop on segments 4D                                                                                                                                                      
  DTRecSegment4DCollection::id_iterator chamberIdIt;
  for (chamberIdIt = all4DSegments->id_begin();
       chamberIdIt != all4DSegments->id_end();
       ++chamberIdIt){
    
    // Get the range for the corresponding ChamberId              
    DTRecSegment4DCollection::range  range = all4DSegments->get((*chamberIdIt));
    
    // Loop over the rechits of this DetUnit         
    for (DTRecSegment4DCollection::const_iterator segment = range.first;
         segment!=range.second; ++segment){
      
      if((*segment).parameters() == selected.parameters()) {
        if((*segment).hasPhi()){
          const DTChamberRecSegment2D* phiSeg = (*segment).phiSegment();
          phiSegRH = phiSeg->specificRecHits();
        }
        if((*segment).hasZed()){
          const DTSLRecSegment2D* zSeg = (*segment).zSegment();
          zSegRH = zSeg->specificRecHits();
        }

        // RecHits will be ordered later
        for (vector<DTRecHit1D>::const_iterator itphi = phiSegRH.begin(); itphi != phiSegRH.end(); itphi++) allchRH.push_back(*itphi);
        for (vector<DTRecHit1D>::iterator itz = zSegRH.begin(); itz < zSegRH.end(); itz++) allchRH.push_back(*itz);
        
      }
    }
  }
  return allchRH;
}
vector< DTRecSegment4D > ChamberSegmentUtility::getDTSegmentsInChamber ( DTChamberId  sel)

Definition at line 107 of file ChamberSegmentUtility.cc.

{

  // loop on segments 4D                                                                                                                                                      
  DTRecSegment4DCollection::id_iterator chamberIdIt;
  for (chamberIdIt = all4DSegments->id_begin();
       chamberIdIt != all4DSegments->id_end();
       ++chamberIdIt){
    
    if (*chamberIdIt != sel) continue;
    
    // Get the range for the corresponding ChamberId              
    DTRecSegment4DCollection::range  range = all4DSegments->get((*chamberIdIt));
    
    // Loop over the rechits of this DetUnit         
    for (DTRecSegment4DCollection::const_iterator segment = range.first;
         segment!=range.second; ++segment){
      dtseg.push_back(*segment);
    }
  }
  return dtseg;
}

Member Data Documentation

Definition at line 65 of file ChamberSegmentUtility.h.

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().

Definition at line 63 of file ChamberSegmentUtility.h.

Definition at line 64 of file ChamberSegmentUtility.h.

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().

Definition at line 73 of file ChamberSegmentUtility.h.

Definition at line 72 of file ChamberSegmentUtility.h.

Definition at line 71 of file ChamberSegmentUtility.h.

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

Definition at line 74 of file ChamberSegmentUtility.h.