CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

CSCRecHit2D Class Reference

#include <CSCRecHit2D.h>

Inheritance diagram for CSCRecHit2D:
RecHit2DLocalPos TrackingRecHit

List of all members.

Public Types

typedef edm::RangeMap< int,
std::vector< float > > 
ADCContainer
typedef std::vector< int > ChannelContainer
enum  SharedInputType {
  all = TrackingRecHit::all, some = TrackingRecHit::some, allWires, someWires,
  allStrips, someStrips
}
 

definition of equality via shared input

More...

Public Member Functions

const ADCContaineradcs () const
 L1A.
short int badStrip () const
 flags for involvement of 'bad' channels
short int badWireGroup () const
const ChannelContainerchannels () const
 Extracting strip channel numbers comprising the rechit.
const ChannelContainerchannelsl1a () const
 const ChannelContainer& channels() const { return theStrips; }
const ChannelContainerchannelsTotal () const
 L1A.
CSCRecHit2Dclone () const
 RecHit2DLocalPos base class interface.
CSCDetId cscDetId () const
 CSCRecHit2D (const CSCDetId &id, const LocalPoint &pos, const LocalError &err, const ChannelContainer &channels, const ADCContainer &adcs, const ChannelContainer &wgroups, float tpeak, float posInStrip, float errInStrip, int quality, short int badStrip=0, short int badWireGroup=0, int scaledWireTime=0)
 CSCRecHit2D ()
float errorWithinStrip () const
 The uncertainty of the estimated position within the strip.
LocalPoint localPosition () const
LocalError localPositionError () const
float positionWithinStrip () const
 The estimated position within the strip.
void print () const
 Print the content of the RecHit2D including L1A (for debugging)
int quality () const
 quality flag of the reconstruction
bool sharesInput (const TrackingRecHit *other, CSCRecHit2D::SharedInputType what) const
 Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.
virtual bool sharesInput (const TrackingRecHit *other, TrackingRecHit::SharedInputType what) const
 Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.
bool sharesInput (const CSCRecHit2D *otherRecHit, CSCRecHit2D::SharedInputType what) const
 Returns true if the two CSCRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.
float tpeak () const
 Fitted peaking time.
ChannelContainer wgroups () const
 Container of wire groups comprising the rechit.
ChannelContainer wgroupsBX () const
 The BX number.
ChannelContainer wgroupsBXandWire () const
 The BX + wire group number.
float wireTime () const
 ~CSCRecHit2D ()

Private Attributes

ADCContainer theADCs
short int theBadStrip
short int theBadWireGroup
float theErrorWithinStrip
LocalError theLocalError
LocalPoint theLocalPosition
float thePositionWithinStrip
int theQuality
int theScaledWireTime
ChannelContainer theStrips
ChannelContainer theStripsHighBits
 L1A.
ChannelContainer theStripsLowBits
float theTpeak
ChannelContainer theWgroupsHighBits
 L1A.
ChannelContainer theWgroupsLowBits
 BX.
ChannelContainer theWireGroups

Detailed Description

Describes a 2-dim reconstructed hit in one layer of an Endcap Muon CSC.

Author:
Tim Cox et al.

Definition at line 18 of file CSCRecHit2D.h.


Member Typedef Documentation

typedef edm::RangeMap<int, std::vector<float> > CSCRecHit2D::ADCContainer

Definition at line 23 of file CSCRecHit2D.h.

typedef std::vector<int> CSCRecHit2D::ChannelContainer

Definition at line 22 of file CSCRecHit2D.h.


Member Enumeration Documentation

definition of equality via shared input

Enumerator:
all 
some 
allWires 
someWires 
allStrips 
someStrips 

Reimplemented from TrackingRecHit.

Definition at line 25 of file CSCRecHit2D.h.


Constructor & Destructor Documentation

CSCRecHit2D::CSCRecHit2D ( )

Extract low byte to account strip number

Extract middle byte to account L1A phase

To account BX in wgroups

Definition at line 4 of file CSCRecHit2D.cc.

References i, theStrips, theStripsHighBits, theStripsLowBits, theWgroupsHighBits, theWgroupsLowBits, and theWireGroups.

Referenced by clone().

                         :
  theLocalPosition(0.,0.), 
  theLocalError(0.,0.,0.),
  theStrips( ChannelContainer() ),
  theADCs( ADCContainer() ),
  theWireGroups( ChannelContainer() ),
  theTpeak( -999. ),  
  thePositionWithinStrip(-999.),
  theErrorWithinStrip(-999.),
  theQuality( 0 ), theBadStrip( 0 ), theBadWireGroup( 0 ),
  theScaledWireTime( 0 )
{

theStripsLowBits.clear();
for(int i=0; i<(int)theStrips.size(); i++){
        theStripsLowBits.push_back(theStrips[i] & 0x000000FF);
        }
theStripsHighBits.clear();
for(int i=0; i<(int)theStrips.size(); i++){
        theStripsHighBits.push_back(theStrips[i] & 0x0000FF00);
        }

theWgroupsHighBits.clear();
for(int i=0; i<(int)theWireGroups.size(); i++)
   theWgroupsHighBits.push_back((theWireGroups[i] >> 16) & 0x0000FFFF);
theWgroupsLowBits.clear();
for(int i=0; i<(int)theWireGroups.size(); i++)
   theWgroupsLowBits.push_back(theWireGroups[i] & 0x0000FFFF);

}
CSCRecHit2D::CSCRecHit2D ( const CSCDetId id,
const LocalPoint pos,
const LocalError err,
const ChannelContainer channels,
const ADCContainer adcs,
const ChannelContainer wgroups,
float  tpeak,
float  posInStrip,
float  errInStrip,
int  quality,
short int  badStrip = 0,
short int  badWireGroup = 0,
int  scaledWireTime = 0 
)

Extract second byte to account strip number

Extract middle byte to account L1A phase

To account BX in wgroups

Definition at line 38 of file CSCRecHit2D.cc.

References i, theStrips, theStripsHighBits, theStripsLowBits, theWgroupsHighBits, theWgroupsLowBits, and theWireGroups.

                                              :
  RecHit2DLocalPos( id ), 
  theLocalPosition( pos ), 
  theLocalError( err ),
  theStrips( channels ),
  theADCs( adcs ),
  theWireGroups( wgroups ),
  theTpeak( tpeak ),
  thePositionWithinStrip( posInStrip ),
  theErrorWithinStrip( errInStrip ),
  theQuality( quality ), theBadStrip( badStrip ), theBadWireGroup( badWireGroup ),
  theScaledWireTime ( scaledWireTime )
{

theStripsLowBits.clear();
for(int i=0; i<(int)theStrips.size(); i++){
        theStripsLowBits.push_back(theStrips[i] & 0x000000FF);
        }
theStripsHighBits.clear();
for(int i=0; i<(int)theStrips.size(); i++){
        theStripsHighBits.push_back(theStrips[i] & 0x0000FF00);
        }

theWgroupsHighBits.clear();
for(int i=0; i<(int)theWireGroups.size(); i++)
   theWgroupsHighBits.push_back((theWireGroups[i] >> 16) & 0x0000FFFF);
theWgroupsLowBits.clear();
for(int i=0; i<(int)theWireGroups.size(); i++)
   theWgroupsLowBits.push_back(theWireGroups[i] & 0x0000FFFF);

}
CSCRecHit2D::~CSCRecHit2D ( )

Definition at line 83 of file CSCRecHit2D.cc.

{}

Member Function Documentation

const ADCContainer& CSCRecHit2D::adcs ( ) const [inline]

L1A.

Map of strip ADCs for strips comprising the rechit

Definition at line 60 of file CSCRecHit2D.h.

References theADCs.

Referenced by MuonTruth::analyze().

{ return theADCs; }
short int CSCRecHit2D::badStrip ( ) const [inline]

flags for involvement of 'bad' channels

Definition at line 85 of file CSCRecHit2D.h.

References theBadStrip.

{ return theBadStrip; }
short int CSCRecHit2D::badWireGroup ( ) const [inline]

Definition at line 86 of file CSCRecHit2D.h.

References theBadWireGroup.

{ return theBadWireGroup; }
const ChannelContainer& CSCRecHit2D::channels ( ) const [inline]

Extracting strip channel numbers comprising the rechit.

Definition at line 50 of file CSCRecHit2D.h.

References theStripsLowBits.

Referenced by MuonTruth::analyze(), MuonTruth::associateCSCHitId(), MuonTruth::associateHitId(), operator<<(), print(), and sharesInput().

{ return theStripsLowBits; } 
const ChannelContainer& CSCRecHit2D::channelsl1a ( ) const [inline]

const ChannelContainer& channels() const { return theStrips; }

L1A Extract the L1A phase bits from the StripChannelContainer

Definition at line 54 of file CSCRecHit2D.h.

References theStripsHighBits.

Referenced by print().

{ return theStripsHighBits; } 
const ChannelContainer& CSCRecHit2D::channelsTotal ( ) const [inline]

L1A.

Container of the L1A+Channels comprising the rechit

Definition at line 57 of file CSCRecHit2D.h.

References theStrips.

Referenced by print().

{ return theStrips; } 
CSCRecHit2D* CSCRecHit2D::clone ( void  ) const [inline, virtual]

RecHit2DLocalPos base class interface.

Implements RecHit2DLocalPos.

Definition at line 44 of file CSCRecHit2D.h.

References CSCRecHit2D().

{ return new CSCRecHit2D( *this ); }
CSCDetId CSCRecHit2D::cscDetId ( ) const [inline]
float CSCRecHit2D::errorWithinStrip ( ) const [inline]

The uncertainty of the estimated position within the strip.

Definition at line 79 of file CSCRecHit2D.h.

References theErrorWithinStrip.

Referenced by operator<<().

{ return theErrorWithinStrip;} ;
LocalPoint CSCRecHit2D::localPosition ( ) const [inline, virtual]

Implements RecHit2DLocalPos.

Definition at line 45 of file CSCRecHit2D.h.

References theLocalPosition.

Referenced by CSCSegAlgoTC::areHitsCloseInGlobalPhi(), CSCSegAlgoSK::areHitsCloseInGlobalPhi(), CSCSegAlgoTC::areHitsCloseInLocalX(), CSCSegAlgoSK::areHitsCloseInLocalX(), FWCSCRecHitProxyBuilder::build(), CSCSegAlgoTC::buildSegments(), CSCSegAlgoSK::buildSegments(), CSCSegAlgoDF::buildSegments(), CSCSegAlgoST::correctTheCovX(), CSCSegAlgoDF::derivativeMatrix(), CSCSegAlgoSK::derivativeMatrix(), CSCSegAlgoShowering::derivativeMatrix(), CSCSegAlgoHitPruning::derivativeMatrix(), CSCSegAlgoTC::derivativeMatrix(), CSCSegAlgoST::derivativeMatrix(), CSCSegAlgoHitPruning::fillChiSquared(), CSCSegAlgoSK::fillChiSquared(), CSCSegAlgoTC::fillChiSquared(), CSCSegAlgoST::fillChiSquared(), CSCSegAlgoHitPruning::fitSlopes(), CSCSegAlgoST::fitSlopes(), CSCSegAlgoTC::fitSlopes(), CSCSegAlgoSK::fitSlopes(), CSCMake2DRecHit::isHitInFiducial(), CSCSegAlgoTC::isHitNearSegment(), CSCSegAlgoSK::isHitNearSegment(), CSCSegAlgoShowering::isHitNearSegment(), CSCSegAlgoDF::isHitNearSegment(), CSCValidation::ltrh::operator()(), operator<<(), CSCRecHit2DValidation::plotResolution(), GlobalRecHitsAnalyzer::plotResolution(), GlobalRecHitsProducer::plotResolution(), print(), CSCSegAlgoDF::pruneFromResidual(), CSCSegAlgoShowering::pruneFromResidual(), CSCSegAlgoShowering::showerSeg(), CSCSegAlgoTC::tryAddingHitsToSegment(), CSCSegAlgoSK::tryAddingHitsToSegment(), CSCSegAlgoSK::updateParameters(), CSCSegAlgoShowering::updateParameters(), CSCSegAlgoDF::updateParameters(), and CSCSegAlgoTC::updateParameters().

{ return theLocalPosition; }
LocalError CSCRecHit2D::localPositionError ( ) const [inline, virtual]
float CSCRecHit2D::positionWithinStrip ( ) const [inline]

The estimated position within the strip.

Definition at line 76 of file CSCRecHit2D.h.

References thePositionWithinStrip.

Referenced by operator<<().

void CSCRecHit2D::print ( void  ) const

Print the content of the RecHit2D including L1A (for debugging)

Prefered to have this version of print() for debugging; will be removed soon

L1A

L1A

Definition at line 214 of file CSCRecHit2D.cc.

References channels(), channelsl1a(), channelsTotal(), gather_cfg::cout, cscDetId(), i, gen::k, localPosition(), localPositionError(), mathSSE::sqrt(), wgroups(), wgroupsBX(), wgroupsBXandWire(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

                              {
std::cout << "CSCRecHit in CSC Detector: " << cscDetId() << std::endl;
std::cout << "  local x = " << localPosition().x() << " +/- " << sqrt( localPositionError().xx() ) <<  " y = " << localPosition().y() << " +/- " << sqrt( localPositionError().yy() ) << std::endl;

std::cout << "  L1A+Channels: ";
for (int i=0; i<(int)channelsTotal().size(); i++) {std::cout 
       << std::hex << channelsTotal()[i] << " ";}
std::cout << std::endl;

std::cout << "  Channels: ";
for (int i=0; i<(int)channels().size(); i++) {std::cout << std::dec << channels()[i] << " "
     << " (" << "HEX: " << std::hex << channels()[i] << ")" << " ";
      }
  std::cout << std::endl;


std::cout << "  L1APhase: ";
  for (int i=0; i<(int)channelsl1a().size(); i++) {
       std::cout << "|";
       for (int k=0; k<8 ; k++){ 
       std::cout << ((channelsl1a()[i] >> (15-k)) & 0x1) << " ";}
       std::cout << "| ";       
       }           
  std::cout << std::endl;

std::cout << "  BX + WireGroups combined: ";
   for (int i=0; i<(int)wgroupsBXandWire().size(); i++) {std::cout //std::dec << wgroups()[i] 
        << "HEX: " << std::hex << wgroupsBXandWire()[i] << std::hex << " | ";
   }
 
std::cout << "  WireGroups: ";
for (int i=0; i<(int)wgroups().size(); i++) {std::cout << std::dec << wgroups()[i]  
       << " | ";}
std::cout << " BX#: ";
   for (int i=0; i<(int)wgroupsBX().size(); i++) {std::cout << std::dec << wgroupsBX()[i] 
       << " (" << "HEX: " << std::hex << wgroupsBX()[i] << ")" << " | ";
   }

  std::cout << std::endl;
}
int CSCRecHit2D::quality ( ) const [inline]

quality flag of the reconstruction

Definition at line 82 of file CSCRecHit2D.h.

References theQuality.

Referenced by operator<<().

{ return theQuality;}
bool CSCRecHit2D::sharesInput ( const CSCRecHit2D otherRecHit,
CSCRecHit2D::SharedInputType  what 
) const

Returns true if the two CSCRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.

Definition at line 105 of file CSCRecHit2D.cc.

References all, allStrips, allWires, CSCDetId::channel(), channels(), cscDetId(), newFWLiteAna::found, TrackingRecHit::geographicalId(), some, someStrips, someWires, theStrips, theWireGroups, and wgroups().

                                                                                                    {
  
  // Check to see if the geographical ID of the two are the same
  if (geographicalId() != otherRecHit->geographicalId()) return false;
  
  // Trivial cases
  const ChannelContainer otherStrips = otherRecHit->channels();
  const ChannelContainer otherWireGroups = otherRecHit->wgroups();
  if (theStrips.size() == 0 && otherStrips.size() == 0 && theWireGroups.size() == 0 && otherWireGroups.size() == 0) return true;
  if ((what == allWires || what == someWires) && theWireGroups.size() == 0 && otherWireGroups.size() == 0) return true;
  if ((what == allStrips || what == someStrips) && theStrips.size() == 0 && otherStrips.size() == 0) return true;
  
  // Check to see if the wire containers are the same length
  if ((what == all || what == allWires) && theWireGroups.size() != otherWireGroups.size()) return false;
  
  // Check to see if the strip containers are the same length
  if ((what == all || what == allStrips) && theStrips.size() != otherStrips.size()) return false;
  
  bool foundWire = false;
  // Check to see if the wires are the same
  if (what != allStrips && what != someStrips) {
    for (ChannelContainer::const_iterator iWire = theWireGroups.begin(); iWire != theWireGroups.end(); ++iWire) {
      bool found = false;
      for (ChannelContainer::const_iterator jWire = otherWireGroups.begin(); jWire != otherWireGroups.end(); ++jWire) {
        if (*iWire == *jWire) {
          if (what == some || what == someWires) return true;
          else {
            found = true;
            foundWire = true;
            break;
          }
        }
      }
      if ((what == all || what == allWires) && !found) return false;
    }
    if (what == someWires && !foundWire) return false;
  }
  
  // Check to see if the wires are the same
  bool foundStrip = false;
  if (what != allWires && what != someWires) {
    for (ChannelContainer::const_iterator iStrip = theStrips.begin(); iStrip != theStrips.end(); ++iStrip) {
      bool found = false;
      for (ChannelContainer::const_iterator jStrip = otherStrips.begin(); jStrip != otherStrips.end(); ++jStrip) {
        //a strip is a channel for all but ME1/1a chambers (where 3 ganged strips are a channel)
        if(cscDetId().channel(*iStrip)==otherRecHit->cscDetId().channel(*jStrip)){
          if (what == some || what == someStrips) return true;
          else {
            found = true;
            foundStrip = true;
            break;
          }
        }
      }
      if ((what == all || what == allStrips) && !found) return false;
    }
    if (what == someStrips && !foundStrip) return false;
  }
  
  // In case we were looking for "some" and found absolutely nothing.
  if (!foundWire && !foundStrip) return false;
  
  // If we made it this far, then:
  //  1) the detector IDs are the same
  //  2) the channel containers have the same number of entries
  //  3) for each entry in my channel container, I can find the same value in the other RecHit's corresponding channel container
  // I think that means we are the same.
  return true;
}
bool CSCRecHit2D::sharesInput ( const TrackingRecHit other,
TrackingRecHit::SharedInputType  what 
) const [virtual]

Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.

Reimplemented from TrackingRecHit.

Definition at line 85 of file CSCRecHit2D.cc.

Referenced by sharesInput().

                                                                                                   {
  
  // This is to satisfy the base class virtual function
  
  // @@ Cast the enum (!) But what if the TRH::SIT changes?!
  CSCRecHit2D::SharedInputType cscWhat = static_cast<CSCRecHit2D::SharedInputType>(what);
  return sharesInput(other, cscWhat);
}
bool CSCRecHit2D::sharesInput ( const TrackingRecHit other,
CSCRecHit2D::SharedInputType  what 
) const

Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.

Definition at line 94 of file CSCRecHit2D.cc.

References CSC(), TrackingRecHit::geographicalId(), sharesInput(), and DetId::subdetId().

                                                                                                {
  
  // Check to see if the TrackingRecHit is actually a CSCRecHit2D.
  if (other->geographicalId().subdetId() != MuonSubdetId::CSC) return false;
  
  // Now I can static cast, because the previous guarantees that this is a CSCRecHit2D
  const CSCRecHit2D *otherRecHit = static_cast<const CSCRecHit2D *>(other);
  
  return sharesInput(otherRecHit, what);
}
float CSCRecHit2D::tpeak ( ) const [inline]

Fitted peaking time.

Definition at line 73 of file CSCRecHit2D.h.

References theTpeak.

{ return theTpeak; }
ChannelContainer CSCRecHit2D::wgroups ( ) const [inline]

Container of wire groups comprising the rechit.

Definition at line 64 of file CSCRecHit2D.h.

References theWgroupsLowBits.

Referenced by operator<<(), print(), and sharesInput().

{ return theWgroupsLowBits; }
ChannelContainer CSCRecHit2D::wgroupsBX ( ) const [inline]

The BX number.

Definition at line 67 of file CSCRecHit2D.h.

References theWgroupsHighBits.

Referenced by print().

{ return theWgroupsHighBits; }
ChannelContainer CSCRecHit2D::wgroupsBXandWire ( ) const [inline]

The BX + wire group number.

Definition at line 70 of file CSCRecHit2D.h.

References theWireGroups.

Referenced by print().

{ return theWireGroups; }
float CSCRecHit2D::wireTime ( ) const [inline]

Definition at line 89 of file CSCRecHit2D.h.

References theScaledWireTime.

{ return (float)theScaledWireTime/100.; }

Member Data Documentation

Definition at line 108 of file CSCRecHit2D.h.

Referenced by adcs().

short int CSCRecHit2D::theBadStrip [private]

Definition at line 114 of file CSCRecHit2D.h.

Referenced by badStrip().

short int CSCRecHit2D::theBadWireGroup [private]

Definition at line 115 of file CSCRecHit2D.h.

Referenced by badWireGroup().

Definition at line 112 of file CSCRecHit2D.h.

Referenced by errorWithinStrip().

Definition at line 106 of file CSCRecHit2D.h.

Referenced by localPositionError().

Definition at line 105 of file CSCRecHit2D.h.

Referenced by localPosition().

Definition at line 111 of file CSCRecHit2D.h.

Referenced by positionWithinStrip().

int CSCRecHit2D::theQuality [private]

Definition at line 113 of file CSCRecHit2D.h.

Referenced by quality().

Definition at line 116 of file CSCRecHit2D.h.

Referenced by wireTime().

Definition at line 107 of file CSCRecHit2D.h.

Referenced by channelsTotal(), CSCRecHit2D(), and sharesInput().

L1A.

Definition at line 118 of file CSCRecHit2D.h.

Referenced by channelsl1a(), and CSCRecHit2D().

Definition at line 117 of file CSCRecHit2D.h.

Referenced by channels(), and CSCRecHit2D().

float CSCRecHit2D::theTpeak [private]

Definition at line 110 of file CSCRecHit2D.h.

Referenced by tpeak().

L1A.

Definition at line 119 of file CSCRecHit2D.h.

Referenced by CSCRecHit2D(), and wgroupsBX().

BX.

Definition at line 120 of file CSCRecHit2D.h.

Referenced by CSCRecHit2D(), and wgroups().

Definition at line 109 of file CSCRecHit2D.h.

Referenced by CSCRecHit2D(), sharesInput(), and wgroupsBXandWire().